All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
phot::PhotonMappingIdentityTransformations Class Reference

Trivial photon mapping transformation. More...

#include <PhotonMappingIdentityTransformations.h>

Inheritance diagram for phot::PhotonMappingIdentityTransformations:
phot::IPhotonMappingTransformations phot::PhotonMappingXMirrorTransformations

Classes

struct  Config
 

Public Types

using Parameters = art::ToolConfigTable< Config >
 
- Public Types inherited from phot::IPhotonMappingTransformations
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...
 
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...
 
- Public Member Functions inherited from phot::IPhotonMappingTransformations
virtual ~IPhotonMappingTransformations ()=default
 
template<typename Coll >
auto applyOpDetMapping (OpDetToLibraryIndexMap const &opDetToLibraryMap, Coll &&source, util::collection_value_t< Coll > defaultValue) const -> MappedOpDetData_t< Coll >
 
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...
 

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...
 

Additional Inherited Members

- Static Public Attributes inherited from phot::IPhotonMappingTransformations
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 = std::numeric_limits<LibraryIndex_t>::max()
 Value used for an invalid library index. More...
 

Detailed Description

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.

Note
The documentation of this class describes the details of this implementation of phot::IPhotonMappingTransformations interface. For information about how to use it, see the documentation of that interface.

Definition at line 40 of file PhotonMappingIdentityTransformations.h.

Member Typedef Documentation

Definition at line 54 of file PhotonMappingIdentityTransformations.h.

Constructor & Destructor Documentation

phot::PhotonMappingIdentityTransformations::PhotonMappingIdentityTransformations ( Config const &  )
inline

Constructor: ignores the configuration.

Definition at line 58 of file PhotonMappingIdentityTransformations.h.

59  : fGeom(lar::providerFrom<geo::Geometry>())
62  {}
OpDetToLibraryIndexMap makeOpDetsToLibraryIndicesMap() const
Return a trivial library index mapping.
LibraryIndexToOpDetMap fLibraryIndicesToOpDetsMap
Complete optical detector identifier mapping library-to-world.
geo::GeometryCore const * fGeom
Detector geometry service provider.
LibraryIndexToOpDetMap makeLibraryIndicesToOpDetsMap() const
Return a trivial global optical detector identifier mapping.
OpDetToLibraryIndexMap fOpDetsToLibraryIndicesMap
Complete optical detector identifier mapping world-to-library.
phot::PhotonMappingIdentityTransformations::PhotonMappingIdentityTransformations ( Parameters const &  config)
inline

Constructor: ignores the configuration.

Definition at line 65 of file PhotonMappingIdentityTransformations.h.

67  {}
PhotonMappingIdentityTransformations(Config const &)
Constructor: ignores the configuration.

Member Function Documentation

geo::Point_t phot::PhotonMappingIdentityTransformations::detectorToLibrary ( geo::Point_t const &  location) const
inlineoverridevirtual

Returns the representation within the library of a detector location.

Parameters
locationposition in world coordinates [cm]
Returns
a vector expressing location in the library space

The returned vector is an exact copy of location.

No exception is ever thrown.

Implements phot::IPhotonMappingTransformations.

Reimplemented in phot::PhotonMappingXMirrorTransformations.

Definition at line 85 of file PhotonMappingIdentityTransformations.h.

86  { return location; }
OpDetID_t phot::PhotonMappingIdentityTransformations::libraryIndexToOpDet ( geo::Point_t const &  location,
LibraryIndex_t  libIndex 
) const
inlineoverridevirtual

Maps a library index with an optical detector.

Parameters
locationworld reference point _(unused)_
libIndexthe library index to be mapped
Returns
optical detector ID (as used, e.g., in geo::GeometryCore::OpDetGeoFromOpDet())
See Also
opDetToLibraryIndex(), libraryIndicesToOpDets()

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 123 of file PhotonMappingIdentityTransformations.h.

124  { return OpDetID_t{ libIndex }; }
int OpDetID_t
Type describing a optical detector ID.
LibraryIndexToOpDetMap const& phot::PhotonMappingIdentityTransformations::libraryIndicesToOpDets ( geo::Point_t const &  location) const
inlineoverridevirtual

Returns a map of optical detectors identifiers, one for each library index.

Parameters
locationa world reference point _(unused)_
Returns
optical detector identifiers for all library indices
See Also
opDetsToLibraryIndices(), libraryIndexToOpDet()

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 166 of file PhotonMappingIdentityTransformations.h.

167  { return fLibraryIndicesToOpDetsMap; }
LibraryIndexToOpDetMap fLibraryIndicesToOpDetsMap
Complete optical detector identifier mapping library-to-world.
std::size_t phot::PhotonMappingIdentityTransformations::libraryMappingSize ( geo::Point_t const &  location) const
inlineoverridevirtual

Size of the mapping of library optical detectors.

Parameters
locationa world reference point _(unused)_
Returns
the expected size of the mapping of library optical detectors
See Also
opDetsFromLibrary()

This is also the number of optical detectors.

Implements phot::IPhotonMappingTransformations.

Definition at line 178 of file PhotonMappingIdentityTransformations.h.

179  { return fLibraryIndicesToOpDetsMap.size(); }
LibraryIndexToOpDetMap fLibraryIndicesToOpDetsMap
Complete optical detector identifier mapping library-to-world.
phot::IPhotonMappingTransformations::LibraryIndexToOpDetMap phot::PhotonMappingIdentityTransformations::makeLibraryIndicesToOpDetsMap ( ) const
protected

Return a trivial global optical detector identifier mapping.

Definition at line 21 of file PhotonMappingIdentityTransformations.cxx.

22 {
23 
24  auto const nOpDets = fGeom->NOpDets();
25 
26  LibraryIndexToOpDetMap map(nOpDets);
27  std::iota(map.begin(), map.end(), 0);
28 
29  return map;
30 } // phot::PhotonMappingIdentityTransformations::makeLibraryIndicesToOpDetsMap()
geo::GeometryCore const * fGeom
Detector geometry service provider.
std::vector< OpDetID_t > LibraryIndexToOpDetMap
Type describing the mapping of optical detectors into library indices.
unsigned int NOpDets() const
Number of OpDets in the whole detector.
phot::IPhotonMappingTransformations::OpDetToLibraryIndexMap phot::PhotonMappingIdentityTransformations::makeOpDetsToLibraryIndicesMap ( ) const
protected

Return a trivial library index mapping.

Definition at line 36 of file PhotonMappingIdentityTransformations.cxx.

37 {
38 
39  auto const nOpDets = fGeom->NOpDets();
40 
41  OpDetToLibraryIndexMap map(nOpDets);
42  std::iota(map.begin(), map.end(), 0);
43 
44  return map;
45 } // phot::PhotonMappingIdentityTransformations::makeOpDetsToLibraryIndicesMap()
geo::GeometryCore const * fGeom
Detector geometry service provider.
unsigned int NOpDets() const
Number of OpDets in the whole detector.
std::vector< LibraryIndex_t > OpDetToLibraryIndexMap
Type describing the mapping of library indices into optical detectors.
std::size_t phot::PhotonMappingIdentityTransformations::opDetMappingSize ( ) const
inlineoverridevirtual

Expected number of mappings of optical detector into library index.

Returns
the expected size of the mapping of optical detectors
See Also
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.

151  { return fOpDetsToLibraryIndicesMap.size(); }
OpDetToLibraryIndexMap fOpDetsToLibraryIndicesMap
Complete optical detector identifier mapping world-to-library.
OpDetToLibraryIndexMap const& phot::PhotonMappingIdentityTransformations::opDetsToLibraryIndices ( geo::Point_t const &  location) const
inlineoverridevirtual

Returns a map of library indices as function of optical detectors.

Parameters
locationworld reference point _(unused)_
Returns
library indices for all optical detectors
See Also
opDetToLibraryIndex(), opDetsToLibraryIndices()

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 138 of file PhotonMappingIdentityTransformations.h.

139  { return fOpDetsToLibraryIndicesMap; }
OpDetToLibraryIndexMap fOpDetsToLibraryIndicesMap
Complete optical detector identifier mapping world-to-library.
LibraryIndex_t phot::PhotonMappingIdentityTransformations::opDetToLibraryIndex ( geo::Point_t const &  location,
OpDetID_t  opDetID 
) const
inlineoverridevirtual

Maps an optical detector with its library index.

Parameters
location_(unused)_ world reference point
opDetIDID of the optical detector to be mapped (as used, e.g., in geo::GeometryCore::OpDetGeoFromOpDet())
Returns
library index corresponding to the specified optical detector
See Also
libraryIndexToOpDet(), opDetsToLibraryIndices()

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 108 of file PhotonMappingIdentityTransformations.h.

109  { return LibraryIndex_t{ opDetID }; }
OpDetID_t LibraryIndex_t
Type describing a library index. FIXME former LibraryOpDetID_t.

Member Data Documentation

geo::GeometryCore const* phot::PhotonMappingIdentityTransformations::fGeom = nullptr
protected

Detector geometry service provider.

Definition at line 189 of file PhotonMappingIdentityTransformations.h.

LibraryIndexToOpDetMap phot::PhotonMappingIdentityTransformations::fLibraryIndicesToOpDetsMap
protected

Complete optical detector identifier mapping library-to-world.

Definition at line 195 of file PhotonMappingIdentityTransformations.h.

OpDetToLibraryIndexMap phot::PhotonMappingIdentityTransformations::fOpDetsToLibraryIndicesMap
protected

Complete optical detector identifier mapping world-to-library.

Definition at line 192 of file PhotonMappingIdentityTransformations.h.


The documentation for this class was generated from the following files: