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
virtual 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
virtual LibraryIndex_t opDetToLibraryIndex (geo::Point_t const &location, OpDetID_t opDetID) const override
 Maps an optical detector with its library index. More...
 
virtual OpDetID_t libraryIndexToOpDet (geo::Point_t const &location, LibraryIndex_t libIndex) const override
 Maps a library index with an optical detector. More...
 
virtual OpDetToLibraryIndexMap const & opDetsToLibraryIndices (geo::Point_t const &location) const override
 Returns a map of library indices as function of optical detectors. More...
 
virtual std::size_t opDetMappingSize () const override
 Expected number of mappings of optical detector into library index. More...
 
virtual LibraryIndexToOpDetMap const & libraryIndicesToOpDets (geo::Point_t const &location) const override
 Returns a map of optical detectors identifiers, one for each library index. More...
 
virtual 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

virtual LibraryIndexToOpDetMap makeLibraryIndicesToOpDetsMap () const
 Return a trivial global optical detector identifier mapping. More...
 
virtual 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 39 of file PhotonMappingIdentityTransformations.h.

Member Typedef Documentation

Definition at line 53 of file PhotonMappingIdentityTransformations.h.

Constructor & Destructor Documentation

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

Constructor: ignores the configuration.

Definition at line 57 of file PhotonMappingIdentityTransformations.h.

58  : fGeom(lar::providerFrom<geo::Geometry>())
61  {}
virtual 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.
virtual 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 64 of file PhotonMappingIdentityTransformations.h.

66  {}
static Config * config
Definition: config.cpp:1054
PhotonMappingIdentityTransformations(Config const &)
Constructor: ignores the configuration.

Member Function Documentation

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

85  { return location; }
virtual 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 122 of file PhotonMappingIdentityTransformations.h.

123  { return OpDetID_t{ libIndex }; }
int OpDetID_t
Type describing a optical detector ID.
virtual 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 165 of file PhotonMappingIdentityTransformations.h.

166  { return fLibraryIndicesToOpDetsMap; }
LibraryIndexToOpDetMap fLibraryIndicesToOpDetsMap
Complete optical detector identifier mapping library-to-world.
virtual 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 177 of file PhotonMappingIdentityTransformations.h.

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

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
protectedvirtual

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

150  { return fOpDetsToLibraryIndicesMap.size(); }
OpDetToLibraryIndexMap fOpDetsToLibraryIndicesMap
Complete optical detector identifier mapping world-to-library.
virtual 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 137 of file PhotonMappingIdentityTransformations.h.

138  { return fOpDetsToLibraryIndicesMap; }
OpDetToLibraryIndexMap fOpDetsToLibraryIndicesMap
Complete optical detector identifier mapping world-to-library.
virtual 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 107 of file PhotonMappingIdentityTransformations.h.

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

LibraryIndexToOpDetMap phot::PhotonMappingIdentityTransformations::fLibraryIndicesToOpDetsMap
protected

Complete optical detector identifier mapping library-to-world.

Definition at line 194 of file PhotonMappingIdentityTransformations.h.

OpDetToLibraryIndexMap phot::PhotonMappingIdentityTransformations::fOpDetsToLibraryIndicesMap
protected

Complete optical detector identifier mapping world-to-library.

Definition at line 191 of file PhotonMappingIdentityTransformations.h.


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