LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
PhotonMappingIdentityTransformations.h
Go to the documentation of this file.
1 
10 #ifndef LARSIM_PHOTONPROPAGATION_LIBRARYMAPPINGTOOLS_PHOTONMAPPINGIDENTITYTRANSFORMATIONS_H
11 #define LARSIM_PHOTONPROPAGATION_LIBRARYMAPPINGTOOLS_PHOTONMAPPINGIDENTITYTRANSFORMATIONS_H
12 
13 // LArSoft libraries
14 #include "larcore/CoreUtils/ServiceUtil.h" // lar::providerFrom()
18 
19 // framework libraries
21 
22 namespace geo {
23  class GeometryCore;
24 }
25 
26 namespace phot {
27 
43 
44  public:
45  struct Config {
46 
47  // using Name = fhicl::Name;
48  // using Comment = fhicl::Comment;
49 
50  // no configuration required
51 
52  }; // struct Config
53 
55 
58  : fGeom(lar::providerFrom<geo::Geometry>())
59  , fOpDetsToLibraryIndicesMap(makeOpDetsToLibraryIndicesMap())
60  , fLibraryIndicesToOpDetsMap(makeLibraryIndicesToOpDetsMap())
61  {}
62 
66  {}
67 
68  // --- BEGIN Geometry mapping interface ------------------------------------
71 
82  geo::Point_t detectorToLibrary(geo::Point_t const& location) const override { return location; }
83 
85  // --- END Geometry mapping interface --------------------------------------
86 
87  // --- BEGIN Optical detector mapping interface ----------------------------
90 
103  OpDetID_t opDetID) const override
104  {
105  return LibraryIndex_t{opDetID};
106  }
107 
120  LibraryIndex_t libIndex) const override
121  {
122  return OpDetID_t{libIndex};
123  }
124 
136  geo::Point_t const& location) const override
137  {
138  return fOpDetsToLibraryIndicesMap;
139  }
140 
150  std::size_t opDetMappingSize() const override { return fOpDetsToLibraryIndicesMap.size(); }
151 
164  geo::Point_t const& location) const override
165  {
166  return fLibraryIndicesToOpDetsMap;
167  }
168 
177  std::size_t libraryMappingSize(geo::Point_t const& location) const override
178  {
179  return fLibraryIndicesToOpDetsMap.size();
180  }
181 
183  // --- END Optical detector identifier mapping interface -------------------
184 
185  protected:
187  geo::GeometryCore const* fGeom = nullptr;
188 
191 
194 
196  LibraryIndexToOpDetMap makeLibraryIndicesToOpDetsMap() const;
197 
199  OpDetToLibraryIndexMap makeOpDetsToLibraryIndicesMap() const;
200 
201  }; // class PhotonMappingIdentityTransformations
202 
203 } // namespace phot
204 
205 #endif // LARSIM_PHOTONPROPAGATION_LIBRARYMAPPINGTOOLS_PHOTONMAPPINGIDENTITYTRANSFORMATIONS_H
Interface for transformation of photon visibility maps.
Utilities related to art service access.
LibraryIndexToOpDetMap const & libraryIndicesToOpDets(geo::Point_t const &location) const override
Returns a map of optical detectors identifiers, one for each library index.
T::provider_type const * providerFrom()
Returns a constant pointer to the provider of specified service.
Definition: ServiceUtil.h:75
OpDetID_t LibraryIndex_t
Type describing a library index. FIXME former LibraryOpDetID_t.
geo::Point_t detectorToLibrary(geo::Point_t const &location) const override
Returns the representation within the library of a detector location.
LibraryIndexToOpDetMap fLibraryIndicesToOpDetsMap
Complete optical detector identifier mapping library-to-world.
Collection of functions to transform photon mapping data.
Definitions of geometry vector data types.
std::size_t libraryMappingSize(geo::Point_t const &location) const override
Size of the mapping of library optical detectors.
LibraryIndex_t opDetToLibraryIndex(geo::Point_t const &location, OpDetID_t opDetID) const override
Maps an optical detector with its library index.
PhotonMappingIdentityTransformations(Config const &)
Constructor: ignores the configuration.
std::vector< OpDetID_t > LibraryIndexToOpDetMap
Type describing the mapping of optical detectors into library indices.
Description of geometry of one entire detector.
Definition: GeometryCore.h:119
PhotonMappingIdentityTransformations(Parameters const &config)
Constructor: ignores the configuration.
int OpDetID_t
Type describing a optical detector ID.
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
Definition: geo_vectors.h:180
General LArSoft Utilities.
OpDetToLibraryIndexMap const & opDetsToLibraryIndices(geo::Point_t const &location) const override
Returns a map of library indices as function of optical detectors.
LArSoft-specific namespace.
OpDetID_t libraryIndexToOpDet(geo::Point_t const &location, LibraryIndex_t libIndex) const override
Maps a library index with an optical detector.
Namespace collecting geometry-related classes utilities.
OpDetToLibraryIndexMap fOpDetsToLibraryIndicesMap
Complete optical detector identifier mapping world-to-library.
art framework interface to geometry description
std::vector< LibraryIndex_t > OpDetToLibraryIndexMap
Type describing the mapping of library indices into optical detectors.
std::size_t opDetMappingSize() const override
Expected number of mappings of optical detector into library index.