Photon library mapping for ICARUS geometry. More...
#include <ICARUSPhotonMappingTransformations.h>
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 | |
ICARUSPhotonMappingTransformations (Config const &config) | |
Constructor. More... | |
ICARUSPhotonMappingTransformations (Parameters const &config) | |
Constructor: ignores the configuration. More... | |
template<typename OutputIndex , typename InputIndex , template< typename...> typename Container> | |
auto | invertMapping (Container< OutputIndex > const &directMap, std::size_t size, InputIndex invalidIndex) -> Container< InputIndex > |
Inverts a given mapping. 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 |
Returns the library index for the specified optical detector. More... | |
virtual OpDetID_t | libraryIndexToOpDet (geo::Point_t const &location, LibraryIndex_t libIndex) const override |
Returns the optical detector ID for the specified library index. 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 identifiers of optical detectors for each library index, for the library appropriate around location More... | |
virtual std::size_t | libraryMappingSize (geo::Point_t const &location) const override |
Expected size of the mapping from library to 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 | |
geo::CryostatID | whichCryostat (geo::Point_t const &point) const |
Returns which cryostat better contain point . Never invalid so far. More... | |
OpDetToLibraryIndexMap const & | opDetsToLibraryIndicesImpl (geo::Point_t const &location) const |
LibraryIndexToOpDetMap const & | libraryIndicesToOpDetsImpl (geo::Point_t const &location) const |
void | prepareGeometryMapping () |
void | prepareLibraryMappings (LibraryIndexToOpDetMap const &libraryIndices) |
void | prepareMappings (LibraryIndexToOpDetMap const &libraryIndices) |
Extracts the necessary information for mapping from the geometry. More... | |
void | dumpMapping () const |
Writes the current mapping information into the console. Debug stuff. More... | |
Static Protected Member Functions | |
template<typename OutputIndex , typename InputIndex , template< typename...> typename Container> | |
static Container< InputIndex > | invertMapping (Container< OutputIndex > const &directMap, std::size_t size, InputIndex invalidIndex) |
Inverts a given mapping. More... | |
Protected Attributes | |
bool | fDumpMapping = false |
Whether to dump mapping on initialization. More... | |
geo::GeometryCore const * | fGeom = nullptr |
Detector geometry service provider. Not really used. More... | |
std::vector< geo::Vector_t > | fTranslations |
Translation of the point. More... | |
geo::Length_t | fSwitchPoint |
Switch coordinate on x axis [cm]. More... | |
unsigned int | fNOpDetChannels |
std::vector< int > | fChannelShifts |
Amount of channel number shifting indexed by cryostat. Not really used. More... | |
std::vector < LibraryIndexToOpDetMap > | fLibraryIndexToOpDetMaps |
Library to detector channel mappings, indexed by cryostat number. More... | |
LibraryIndexToOpDetMap | fInvalidLibraryIndexToOpDetMap |
A library-to-detector mapping for invalid points. More... | |
std::vector < OpDetToLibraryIndexMap > | fOpDetToLibraryIndexMaps |
Detector channel to library mappings, indexed by cryostat number. More... | |
OpDetToLibraryIndexMap | fInvalidOpDetToLibraryIndexMap |
A detector-to-library mapping for invalid points. 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... | |
Photon library mapping for ICARUS geometry.
This is an implementation of phot::IPhotonMappingTransformation
interface to exploit ICARUS detector symmetries.
The current implementation only exploits the fact that the two cryostats are identical, and ignores the symmetry respect to the cathode within each of the cryostats.
The required library is expected to cover the first 180 PMT channels (the ones pertaining the first cryostat, C:0
), and the full volume of the TPC.
When requested a point in the first cryostat (C:0
), the point is used directly in the visibility library to get visibility on PMT channels 0 to 179 (the lower half). The mapping then maps the remaining PMT channels (180 to 359) to be invalid and with default value of 0
.
When requested a point in the other cryostat (C:1
), the point is translated into the first one to get visibility of PMT channels 0 to 179 (the lower half). The mapping then translates those channels into the range 180 to 359, and maps the remaining PMT channels (0 to 179) to be invalid and with default value of 0
.
Note that the content of the library for channels 180 to 359 is always ignored, and it may well be absent.
Definition at line 58 of file ICARUSPhotonMappingTransformations.h.
using phot::ICARUSPhotonMappingTransformations::Parameters = art::ToolConfigTable<Config> |
Definition at line 82 of file ICARUSPhotonMappingTransformations.h.
phot::ICARUSPhotonMappingTransformations::ICARUSPhotonMappingTransformations | ( | Config const & | config | ) |
Constructor.
Definition at line 31 of file ICARUSPhotonMappingTransformations.cxx.
|
inline |
Constructor: ignores the configuration.
Definition at line 89 of file ICARUSPhotonMappingTransformations.h.
|
overridevirtual |
Returns the representation within the library of a detector location.
location | position in world coordinates [cm] |
location
in the library spaceThe returned vector is shifted as it were on the first cryostat.
No exception is ever thrown.
Implements phot::IPhotonMappingTransformations.
Definition at line 50 of file ICARUSPhotonMappingTransformations.cxx.
|
protected |
Writes the current mapping information into the console. Debug stuff.
Definition at line 315 of file ICARUSPhotonMappingTransformations.cxx.
|
staticprotected |
Inverts a given mapping.
OutputIndex | the output index of the mapping to invert |
IndexIndex | the input index of the mapping to invert |
Container | container used for the mapping (be it std::vector ) |
directMap | the mapping (input index to output index) to be inverted |
size | the total number of output indices (some may be not mapped) |
invalidIndex | input index to associate to unmapped output indices |
directMap
The resulting, "inverse" mapping has exactly size
entries. If the input mapping maps out beyond that, those indices are not mapped back.
auto phot::ICARUSPhotonMappingTransformations::invertMapping | ( | Container< OutputIndex > const & | directMap, |
std::size_t | size, | ||
InputIndex | invalidIndex | ||
) | -> Container<InputIndex> |
Inverts a given mapping.
OutputIndex | the output index of the mapping to invert |
IndexIndex | the input index of the mapping to invert |
Container | type of container used for the mapping (be it std::vector ) |
directMap | the mapping (input index to output index) to be inverted |
size | the total number of output indices (some may be not mapped) |
invalidIndex | the input index to associate to unmapped output indices |
directMap
The resulting, "inverse" mapping has exactly size
entries. If the input mapping maps out beyond that, those indices are not mapped back.
Definition at line 332 of file ICARUSPhotonMappingTransformations.h.
|
inlineoverridevirtual |
Returns the optical detector ID for the specified library index.
location | where the scintillation source is in world frame [cm] |
libIndex | library index to be mapped |
libIndex
(as used, e.g., in geo::GeometryCore::OpDetGeoFromOpDet()
), or InvalidOpDetID
std::out_of_range | if input library index can't be handled TODO not implemented this way (yet?) |
Implements phot::IPhotonMappingTransformations.
Definition at line 145 of file ICARUSPhotonMappingTransformations.h.
|
inlineoverridevirtual |
Returns a map of identifiers of optical detectors for each library index, for the library appropriate around location
location | where the scintillation source is in world frame [cm] |
We use this mapping when we have information from the visibility library appropriate for a source at the specified location
: this information is addressed via a "library index" with the reduced range (i.e. 0 to 179) and we need to know which are the optical detector channels that visibility covers.
For ICARUS, this mapping is expected to be straightforward:
location
is in the first cryostat (C:0)location
is in the other one (C:1)The specified location
is used to provide context in a similar fashion as detectorToLibrary()
does. It can be used to choose the correct mapping among the available ones.
The returned value is a mapping object (see LibraryIndexToOpDetMap
documentation for the interface). If a library index does not map to any optical detector in the library at location
(which is unusual!), the optical detector ID corresponding to it is InvalidOpDetID
.
Implements phot::IPhotonMappingTransformations.
Definition at line 199 of file ICARUSPhotonMappingTransformations.h.
|
protected |
Definition at line 69 of file ICARUSPhotonMappingTransformations.cxx.
|
inlineoverridevirtual |
Expected size of the mapping from library to optical detectors.
location | where the scintillation source is in world frame [cm] |
libraryIndicesToOpDets()
This is effectively the size of the mapping returned by libraryIndicesToOpDets()
. It represents how many library indices are provided by the library for the specified location
, that is 180
.
Implements phot::IPhotonMappingTransformations.
Definition at line 214 of file ICARUSPhotonMappingTransformations.h.
|
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 168 of file ICARUSPhotonMappingTransformations.h.
|
inlineoverridevirtual |
Returns a map of library indices as function of optical detectors.
location | where the scintillation source is in world frame [cm] |
Implements phot::IPhotonMappingTransformations.
Definition at line 156 of file ICARUSPhotonMappingTransformations.h.
|
protected |
Definition at line 59 of file ICARUSPhotonMappingTransformations.cxx.
|
inlineoverridevirtual |
Returns the library index for the specified optical detector.
location | where the scintillation source is in world frame [cm] |
opDetID | optical detector identifier (as used, e.g., in geo::GeometryCore::OpDetGeoFromOpDet() ) |
opDetID
, or InvalidLibraryIndex
std::out_of_range | if input optical detector ID can't be handled TODO not implemented this way (yet?) |
opDetFromLibrary()
The mapping reduces the optical detector ID to the corresponding one in the first cryostat.
Implements phot::IPhotonMappingTransformations.
Definition at line 132 of file ICARUSPhotonMappingTransformations.h.
|
protected |
Definition at line 78 of file ICARUSPhotonMappingTransformations.cxx.
|
protected |
Definition at line 116 of file ICARUSPhotonMappingTransformations.cxx.
|
protected |
Extracts the necessary information for mapping from the geometry.
Definition at line 260 of file ICARUSPhotonMappingTransformations.cxx.
|
inlineprotected |
Returns which cryostat better contain point
. Never invalid so far.
Definition at line 262 of file ICARUSPhotonMappingTransformations.h.
|
protected |
Amount of channel number shifting indexed by cryostat. Not really used.
Total number of optical detector channels.
Definition at line 247 of file ICARUSPhotonMappingTransformations.h.
|
protected |
Whether to dump mapping on initialization.
Definition at line 226 of file ICARUSPhotonMappingTransformations.h.
|
protected |
Detector geometry service provider. Not really used.
Definition at line 233 of file ICARUSPhotonMappingTransformations.h.
|
protected |
A library-to-detector mapping for invalid points.
Definition at line 251 of file ICARUSPhotonMappingTransformations.h.
|
protected |
A detector-to-library mapping for invalid points.
Definition at line 255 of file ICARUSPhotonMappingTransformations.h.
|
protected |
Library to detector channel mappings, indexed by cryostat number.
Definition at line 249 of file ICARUSPhotonMappingTransformations.h.
|
protected |
Definition at line 245 of file ICARUSPhotonMappingTransformations.h.
|
protected |
Detector channel to library mappings, indexed by cryostat number.
Definition at line 253 of file ICARUSPhotonMappingTransformations.h.
|
protected |
Switch coordinate on x axis [cm].
Definition at line 240 of file ICARUSPhotonMappingTransformations.h.
|
protected |
Translation of the point.
Definition at line 239 of file ICARUSPhotonMappingTransformations.h.