LArSoft
v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
|
Trivial photon mapping transformation. More...
#include "PhotonMappingIdentityTransformations.h"
Classes | |
struct | Config |
Public Types | |
using | Parameters = art::ToolConfigTable< Config > |
using | OpDetID_t = int |
Type describing a optical detector ID. More... | |
using | LibraryIndex_t = OpDetID_t |
Type describing a library index. FIXME former LibraryOpDetID_t. More... | |
using | LibraryIndexToOpDetMap = std::vector< OpDetID_t > |
Type describing the mapping of optical detectors into library indices. More... | |
using | OpDetToLibraryIndexMap = std::vector< LibraryIndex_t > |
Type describing the mapping of library indices into optical detectors. More... | |
template<typename LibDataColl > | |
using | MappedOpDetData_t = phot::OpDetVisibilityData< util::collection_reference_t< LibDataColl >, util::collection_reference_t< OpDetToLibraryIndexMap const >> |
Type of optical detector data collection. More... | |
Public Member Functions | |
PhotonMappingIdentityTransformations (Config const &) | |
Constructor: ignores the configuration. More... | |
PhotonMappingIdentityTransformations (Parameters const &config) | |
Constructor: ignores the configuration. More... | |
template<typename Coll > | |
auto | applyOpDetMapping (OpDetToLibraryIndexMap const &opDetToLibraryMap, Coll &&source, util::collection_value_t< Coll > defaultValue) const -> MappedOpDetData_t< Coll > |
Geometry mapping interface | |
geo::Point_t | detectorToLibrary (geo::Point_t const &location) const override |
Returns the representation within the library of a detector location. More... | |
Optical detector mapping interface | |
LibraryIndex_t | opDetToLibraryIndex (geo::Point_t const &location, OpDetID_t opDetID) const override |
Maps an optical detector with its library index. More... | |
OpDetID_t | libraryIndexToOpDet (geo::Point_t const &location, LibraryIndex_t libIndex) const override |
Maps a library index with an optical detector. More... | |
OpDetToLibraryIndexMap const & | opDetsToLibraryIndices (geo::Point_t const &location) const override |
Returns a map of library indices as function of optical detectors. More... | |
std::size_t | opDetMappingSize () const override |
Expected number of mappings of optical detector into library index. More... | |
LibraryIndexToOpDetMap const & | libraryIndicesToOpDets (geo::Point_t const &location) const override |
Returns a map of optical detectors identifiers, one for each library index. More... | |
std::size_t | libraryMappingSize (geo::Point_t const &location) const override |
Size of the mapping of library optical detectors. More... | |
Utility methods | |
template<typename Coll > | |
MappedOpDetData_t< Coll > | applyOpDetMapping (OpDetToLibraryIndexMap const &opDetToLibraryMap, Coll &&source, util::collection_value_t< Coll > defaultValue={}) const |
Remaps a collection indexed by library index into one indexed by optical detector IDs. More... | |
template<typename Coll > | |
auto | applyOpDetMapping (geo::Point_t const &location, Coll &&source, util::collection_value_t< Coll > defaultValue={}) const |
Remaps a collection indexed by library index into one indexed by optical detector IDs according to the mapping at location . More... | |
Static Public Attributes | |
static constexpr OpDetID_t | InvalidOpDetID = std::numeric_limits<OpDetID_t>::max() |
Value used to identify an invalid optical detector. More... | |
static constexpr LibraryIndex_t | InvalidLibraryIndex |
Value used for an invalid library index. More... | |
Protected Member Functions | |
LibraryIndexToOpDetMap | makeLibraryIndicesToOpDetsMap () const |
Return a trivial global optical detector identifier mapping. More... | |
OpDetToLibraryIndexMap | makeOpDetsToLibraryIndicesMap () const |
Return a trivial library index mapping. More... | |
Protected Attributes | |
geo::GeometryCore const * | fGeom = nullptr |
Detector geometry service provider. More... | |
OpDetToLibraryIndexMap | fOpDetsToLibraryIndicesMap |
Complete optical detector identifier mapping world-to-library. More... | |
LibraryIndexToOpDetMap | fLibraryIndicesToOpDetsMap |
Complete optical detector identifier mapping library-to-world. More... | |
Trivial photon mapping transformation.
This implementation of phot::IPhotonMappingTransformations
interface uses the identity mapping to have the library space matching the world one.
This is the most generic case when there are no symmetries to be exploited: neither locations nor the optical detectors are changed by the mapping.
phot::IPhotonMappingTransformations
interface. For information about how to use it, see the documentation of that interface. Definition at line 42 of file PhotonMappingIdentityTransformations.h.
|
inherited |
Type describing a library index. FIXME former LibraryOpDetID_t.
Definition at line 124 of file IPhotonMappingTransformations.h.
|
inherited |
Type describing the mapping of optical detectors into library indices.
This type of mapping allows querying data values by optical detector ID, fetching them from library data source.
This type guarantees:
operator[](OpDetID_t)
to fetch the library index associated to the specified optical detectorsize()
to report how many optical detectors are supported Definition at line 139 of file IPhotonMappingTransformations.h.
|
inherited |
Type of optical detector data collection.
LibDataColl | type of the original library data container |
This type behaves like a random access collection with as index the optical detector ID and as value the data corresponding to that optical detector.
Definition at line 170 of file IPhotonMappingTransformations.h.
|
inherited |
Type describing a optical detector ID.
Definition at line 121 of file IPhotonMappingTransformations.h.
|
inherited |
Type describing the mapping of library indices into optical detectors.
This type of mapping allows querying data values by library index, fetching them from an optical-detector-based data source.
This type guarantees:
operator[](LibraryIndex_t)
to access the optical detector ID of the specified library indexsize()
to report how many library optical detectors are supportedbool
, response to empty()
or to std::size()
to determine if the contained data is valid (actually, just response to phot::isValidLibraryData()
) Definition at line 157 of file IPhotonMappingTransformations.h.
Definition at line 54 of file PhotonMappingIdentityTransformations.h.
|
inline |
Constructor: ignores the configuration.
Definition at line 57 of file PhotonMappingIdentityTransformations.h.
|
inline |
Constructor: ignores the configuration.
Definition at line 64 of file PhotonMappingIdentityTransformations.h.
|
inherited |
Remaps a collection indexed by library index into one indexed by optical detector IDs.
Coll | type of collection of data from the library, to be mapped |
opDetToLibraryMap | the mapping to be applied |
source | collection of library data to be mapped |
defaultValue | value returned for unmapped optical detector IDs |
This method returns a collection proxy that dynamically applies the specified mapping. The original data is not copied.
The format of the map (opDetMap
) is an object with a indexing operator where the index is the one in the destination collection (i.e. the optical detector ID) and the mapped value is the index in the source collection (the libary index). Each valid optical detector ID must be mapped. If the library index mapped to an optical detector is InvalidLibraryIndex
, that optical detector is not mapped anywhere and its entry in the mapped collection is assigned the value defaultValue
. Otherwise, the library index must be valid (which means, up to the result of libraryMappingSize()
applied to the location where opDetMap
is valid).
Referenced by phot::IPhotonMappingTransformations::applyOpDetMapping().
|
inlineinherited |
Remaps a collection indexed by library index into one indexed by optical detector IDs according to the mapping at location
.
Coll | type of collection of data from the library, to be mapped |
location | a world reference point to provide global context |
source | collection of library data to be mapped |
defaultValue | value returned for unmapped optical detector IDs |
applyOpDetMapping()
This method applies a mapping (see applyOpDetMapping(OpDetToLibraryIndexMap const&, Coll&&, util::collection_value_t<Coll>)
) that is obtained via libraryIndicesToOpDets()
.
Definition at line 391 of file IPhotonMappingTransformations.h.
References phot::IPhotonMappingTransformations::applyOpDetMapping(), and phot::IPhotonMappingTransformations::opDetsToLibraryIndices().
|
inherited |
Definition at line 410 of file IPhotonMappingTransformations.h.
References util::make_collection_reference(), n, and util::size().
|
inlineoverridevirtual |
Returns the representation within the library of a detector location.
location | position in world coordinates [cm] |
location
in the library spaceThe returned vector is an exact copy of location
.
No exception is ever thrown.
Implements phot::IPhotonMappingTransformations.
Reimplemented in phot::PhotonMappingXMirrorTransformations.
Definition at line 82 of file PhotonMappingIdentityTransformations.h.
|
inlineoverridevirtual |
Maps a library index with an optical detector.
location | world reference point _(unused)_ |
libIndex | the library index to be mapped |
geo::GeometryCore::OpDetGeoFromOpDet()
) The mapping is trivial: each library index has the same value as the ID of the optical detector it corresponds to.
Implements phot::IPhotonMappingTransformations.
Definition at line 119 of file PhotonMappingIdentityTransformations.h.
|
inlineoverridevirtual |
Returns a map of optical detectors identifiers, one for each library index.
location | a world reference point _(unused)_ |
The mapping is trivial, as each library index has the same value as the ID of the optical detector it corresponds to. This mapping is global and does not depend on any location.
Implements phot::IPhotonMappingTransformations.
Definition at line 163 of file PhotonMappingIdentityTransformations.h.
|
inlineoverridevirtual |
Size of the mapping of library optical detectors.
location | a world reference point _(unused)_ |
opDetsFromLibrary()
This is also the number of optical detectors.
Implements phot::IPhotonMappingTransformations.
Definition at line 177 of file PhotonMappingIdentityTransformations.h.
|
protected |
Return a trivial global optical detector identifier mapping.
Definition at line 18 of file PhotonMappingIdentityTransformations.cxx.
References fGeom, and geo::GeometryCore::NOpDets().
|
protected |
Return a trivial library index mapping.
Definition at line 31 of file PhotonMappingIdentityTransformations.cxx.
References fGeom, and geo::GeometryCore::NOpDets().
|
inlineoverridevirtual |
Expected number of mappings of optical detector into library index.
opDetsToLibraryIndices()
This is effectively the number of available optical detectors, as well as the size of the mapping as returned by opDetsToLibraryIndices()
.
Implements phot::IPhotonMappingTransformations.
Definition at line 150 of file PhotonMappingIdentityTransformations.h.
|
inlineoverridevirtual |
Returns a map of library indices as function of optical detectors.
location | world reference point _(unused)_ |
The mapping is trivial, as each library index has the same value as the ID of the optical detector it corresponds to. This mapping is global and does not depend on any location.
Implements phot::IPhotonMappingTransformations.
Definition at line 135 of file PhotonMappingIdentityTransformations.h.
|
inlineoverridevirtual |
Maps an optical detector with its library index.
location | _(unused)_ world reference point |
opDetID | ID of the optical detector to be mapped (as used, e.g., in geo::GeometryCore::OpDetGeoFromOpDet() ) |
The mapping is trivial: each library index has the same value as the ID of the optical detector it corresponds to.
Implements phot::IPhotonMappingTransformations.
Definition at line 102 of file PhotonMappingIdentityTransformations.h.
|
protected |
Detector geometry service provider.
Definition at line 187 of file PhotonMappingIdentityTransformations.h.
Referenced by makeLibraryIndicesToOpDetsMap(), and makeOpDetsToLibraryIndicesMap().
|
protected |
Complete optical detector identifier mapping library-to-world.
Definition at line 193 of file PhotonMappingIdentityTransformations.h.
|
protected |
Complete optical detector identifier mapping world-to-library.
Definition at line 190 of file PhotonMappingIdentityTransformations.h.
|
staticinherited |
Value used for an invalid library index.
It may be used as value of the detector-to-library mapping.
Definition at line 186 of file IPhotonMappingTransformations.h.
|
staticinherited |
Value used to identify an invalid optical detector.
It may be used as value of the library-to-detector mapping.
Definition at line 179 of file IPhotonMappingTransformations.h.