LArSoft
v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
|
Description of geometry of one set of auxiliary detectors. More...
#include "AuxDetGeometryCore.h"
Public Types | |
using | AuxDetList_t = AuxDetGeometryData_t::AuxDetList_t |
Type of list of auxiliary detectors. More... | |
Public Member Functions | |
AuxDetGeometryCore (fhicl::ParameterSet const &pset) | |
Initialize geometry from a given configuration. More... | |
AuxDetGeometryCore (AuxDetGeometryCore const &)=delete | |
AuxDetGeometryCore (AuxDetGeometryCore &&)=delete | |
AuxDetGeometryCore & | operator= (AuxDetGeometryCore const &)=delete |
AuxDetGeometryCore & | operator= (AuxDetGeometryCore &&)=delete |
std::string const & | ROOTFile () const |
Returns the full directory path to the geometry file source. More... | |
std::string const & | GDMLFile () const |
Returns the full directory path to the GDML file source. More... | |
std::string const & | DetectorName () const |
Returns a string with the name of the detector, as configured. More... | |
unsigned int | NAuxDets () const |
Returns the number of auxiliary detectors. More... | |
unsigned int | NAuxDetSensitive (size_t const &aid) const |
Returns the number of sensitive components of auxiliary detector. More... | |
std::vector< AuxDetGeo > const & | AuxDetGeoVec () const |
Returns the full list of pointer to the auxiliary detectors. More... | |
AuxDetGeo const & | AuxDet (unsigned int const ad=0) const |
Returns the specified auxiliary detector. More... | |
unsigned int | FindAuxDetAtPosition (Point_t const &worldLoc, double tolerance=0) const |
Returns the index of the auxiliary detector at specified location. More... | |
void | FindAuxDetSensitiveAtPosition (Point_t const &worldLoc, size_t &adg, size_t &sv, double tolerance=0) const |
Fills the indices of the sensitive auxiliary detector at location. More... | |
AuxDetGeo const & | PositionToAuxDet (Point_t const &worldLoc, unsigned int &ad, double tolerance=0) const |
Returns the auxiliary detector at specified location. More... | |
AuxDetSensitiveGeo const & | PositionToAuxDetSensitive (Point_t const &worldLoc, size_t &ad, size_t &sv, double tolerance=0) const |
Returns the auxiliary detector at specified location. More... | |
uint32_t | PositionToAuxDetChannel (Point_t const &worldLoc, size_t &ad, size_t &sv) const |
Point_t | AuxDetChannelToPosition (std::string const &auxDetName, uint32_t channel) const |
AuxDetGeo const & | ChannelToAuxDet (std::string const &auxDetName, uint32_t channel) const |
AuxDetSensitiveGeo const & | ChannelToAuxDetSensitive (std::string const &auxDetName, uint32_t channel) const |
Geometry initialization | |
void | LoadGeometryFile (std::string gdmlfile, std::string rootfile) |
Loads the geometry information from the specified files. More... | |
bool | hasAuxDetChannelMap () const |
Returns whether we have a channel map. More... | |
void | ApplyChannelMap (std::unique_ptr< geo::AuxDetChannelMapAlg > pChannelMap) |
Initializes the geometry to work with this channel map. More... | |
Protected Member Functions | |
geo::AuxDetChannelMapAlg const * | AuxDetChannelMap () const |
Returns the object handling the channel map. More... | |
AuxDetList_t & | AuxDets () |
Return the internal auxiliary detectors list. More... | |
AuxDetList_t const & | AuxDets () const |
Return the internal auxiliary detectors list. More... | |
Private Member Functions | |
void | ClearGeometry () |
Deletes the detector geometry structures. More... | |
Private Attributes | |
AuxDetGeometryData_t | fGeoData |
The detector description data. More... | |
std::string | fDetectorName |
Name of the detector. More... | |
std::string | fGDMLfile |
path to geometry file used for Geant4 simulation More... | |
std::string | fROOTfile |
path to geometry file for geometry in GeometryCore More... | |
fhicl::ParameterSet | fBuilderParameters |
Configuration of geometry builder. More... | |
std::unique_ptr< AuxDetChannelMapAlg const > | fChannelMapAlg |
Object containing the channel to wire mapping. More... | |
Description of geometry of one set of auxiliary detectors.
Instantiation is a multi-step procedure:
Step 3 (creation of the channel mapping algorithm object) can be performed at any time before step 4, provided that no GeometryCore instance is needed for it.
Definition at line 88 of file AuxDetGeometryCore.h.
Type of list of auxiliary detectors.
Definition at line 91 of file AuxDetGeometryCore.h.
geo::AuxDetGeometryCore::AuxDetGeometryCore | ( | fhicl::ParameterSet const & | pset | ) |
Initialize geometry from a given configuration.
pset | configuration parameters |
This constructor does not load any geometry description. The next step is to do exactly that, by GeometryCore::LoadGeometryFile().
Definition at line 40 of file AuxDetGeometryCore.cxx.
References fDetectorName.
|
delete |
|
delete |
void geo::AuxDetGeometryCore::ApplyChannelMap | ( | std::unique_ptr< geo::AuxDetChannelMapAlg > | pChannelMap | ) |
Initializes the geometry to work with this channel map.
pChannelMap | a pointer to the channel mapping algorithm to be used |
The specified channel mapping is used with this geometry. The algorithm object is asked and allowed to make the necessary modifications to the geometry description. These modifications typically involve some resorting of the objects.
The ownership of the algorithm object is shared, usually with a calling framework: we maintain it alive as long as we need it (and no other code can delete it), and we delete it only if no other code is sharing the ownership.
This method needs to be called after LoadGeometryFile() to complete the geometry initialization.
Definition at line 48 of file AuxDetGeometryCore.cxx.
References fChannelMapAlg, fGeoData, and geo::AuxDetChannelMapAlg::Initialize().
Referenced by geo::AuxDetGeometry::InitializeChannelMap().
const AuxDetGeo & geo::AuxDetGeometryCore::AuxDet | ( | unsigned int const | ad = 0 | ) | const |
Returns the specified auxiliary detector.
ad | the auxiliary detector index |
what happens if it does not exist?
remove the default parameter?
Definition at line 121 of file AuxDetGeometryCore.cxx.
References AuxDets(), and NAuxDets().
Referenced by ChannelToAuxDet(), ChannelToAuxDetSensitive(), PositionToAuxDet(), and PositionToAuxDetSensitive().
|
inlineprotected |
Returns the object handling the channel map.
Definition at line 289 of file AuxDetGeometryCore.h.
Point_t geo::AuxDetGeometryCore::AuxDetChannelToPosition | ( | std::string const & | auxDetName, |
uint32_t | channel | ||
) | const |
Definition at line 176 of file AuxDetGeometryCore.cxx.
References AuxDets(), and fChannelMapAlg.
|
inline |
Returns the full list of pointer to the auxiliary detectors.
Definition at line 162 of file AuxDetGeometryCore.h.
|
inlineprotected |
Return the internal auxiliary detectors list.
Definition at line 293 of file AuxDetGeometryCore.h.
Referenced by AuxDet(), AuxDetChannelToPosition(), ChannelToAuxDet(), ChannelToAuxDetSensitive(), ClearGeometry(), FindAuxDetAtPosition(), FindAuxDetSensitiveAtPosition(), LoadGeometryFile(), NAuxDetSensitive(), and PositionToAuxDetChannel().
|
inlineprotected |
Return the internal auxiliary detectors list.
Definition at line 294 of file AuxDetGeometryCore.h.
AuxDetGeo const & geo::AuxDetGeometryCore::ChannelToAuxDet | ( | std::string const & | auxDetName, |
uint32_t | channel | ||
) | const |
Definition at line 183 of file AuxDetGeometryCore.cxx.
References AuxDet(), AuxDets(), and fChannelMapAlg.
AuxDetSensitiveGeo const & geo::AuxDetGeometryCore::ChannelToAuxDetSensitive | ( | std::string const & | auxDetName, |
uint32_t | channel | ||
) | const |
Definition at line 191 of file AuxDetGeometryCore.cxx.
References AuxDet(), AuxDets(), fChannelMapAlg, and geo::AuxDetGeo::SensitiveVolume().
|
private |
Deletes the detector geometry structures.
Definition at line 97 of file AuxDetGeometryCore.cxx.
References AuxDets().
Referenced by LoadGeometryFile().
|
inline |
Returns a string with the name of the detector, as configured.
Definition at line 127 of file AuxDetGeometryCore.h.
unsigned int geo::AuxDetGeometryCore::FindAuxDetAtPosition | ( | Point_t const & | worldLoc, |
double | tolerance = 0 |
||
) | const |
Returns the index of the auxiliary detector at specified location.
worldLoc | 3D coordinates of the point (world reference frame) |
Definition at line 130 of file AuxDetGeometryCore.cxx.
References AuxDets(), and fChannelMapAlg.
Referenced by FindAuxDetSensitiveAtPosition(), and PositionToAuxDet().
void geo::AuxDetGeometryCore::FindAuxDetSensitiveAtPosition | ( | Point_t const & | worldLoc, |
size_t & | adg, | ||
size_t & | sv, | ||
double | tolerance = 0 |
||
) | const |
Fills the indices of the sensitive auxiliary detector at location.
worldLoc | 3D coordinates of the point (world reference frame) |
adg | (output) auxiliary detector index |
sv | (output) sensitive volume index |
tolerance | tolerance (cm) for matches. Default 0. |
Definition at line 147 of file AuxDetGeometryCore.cxx.
References AuxDets(), fChannelMapAlg, and FindAuxDetAtPosition().
Referenced by PositionToAuxDetSensitive().
|
inline |
Returns the full directory path to the GDML file source.
This is the full path of the source of the detector geometry handed to the detector simulation (GEANT).
Definition at line 124 of file AuxDetGeometryCore.h.
|
inline |
Returns whether we have a channel map.
Definition at line 264 of file AuxDetGeometryCore.h.
void geo::AuxDetGeometryCore::LoadGeometryFile | ( | std::string | gdmlfile, |
std::string | rootfile | ||
) |
Loads the geometry information from the specified files.
gdmlfile | path to file to be used for Geant4 simulation |
rootfile | path to file for internal geometry representation |
Both paths must directly resolve to an available file, as no search is performed for them.
The gdmlfile parameter does not have to necessarily be in GDML format, as long as it's something supported by Geant4. This file is not used by the geometry, but its path is provided on request by the simulation modules (see LArSoft LArG4
module). The rootfile also does not need to be a ROOT file, but just anything that TGeoManager::Import() supports. This file is parsed immediately and the internal geometry representation is built out of it.
Definition at line 55 of file AuxDetGeometryCore.cxx.
References AuxDets(), ClearGeometry(), geo::GeometryBuilder::extractAuxiliaryDetectors(), fBuilderParameters, fGDMLfile, and fROOTfile.
Referenced by geo::AuxDetGeometry::LoadNewGeometry().
|
inline |
Returns the number of auxiliary detectors.
This method returns the total number of scintillator paddles (Auxiliary Detectors aka AuxDet) outside of the cryostat
Definition at line 147 of file AuxDetGeometryCore.h.
Referenced by AuxDet(), and NAuxDetSensitive().
unsigned int geo::AuxDetGeometryCore::NAuxDetSensitive | ( | size_t const & | aid | ) | const |
Returns the number of sensitive components of auxiliary detector.
aid | ID of the auxiliary detector |
cet::exception | (category "Geometry") if aid does not exist |
Definition at line 103 of file AuxDetGeometryCore.cxx.
References AuxDets(), and NAuxDets().
|
delete |
|
delete |
const AuxDetGeo & geo::AuxDetGeometryCore::PositionToAuxDet | ( | Point_t const & | worldLoc, |
unsigned int & | ad, | ||
double | tolerance = 0 |
||
) | const |
Returns the auxiliary detector at specified location.
worldLoc | 3D coordinates of the point (world reference frame) |
ad | (output) the auxiliary detector index |
tolerance | tolerance (cm) for matches. Default 0 |
Definition at line 137 of file AuxDetGeometryCore.cxx.
References AuxDet(), and FindAuxDetAtPosition().
uint32_t geo::AuxDetGeometryCore::PositionToAuxDetChannel | ( | Point_t const & | worldLoc, |
size_t & | ad, | ||
size_t & | sv | ||
) | const |
Definition at line 168 of file AuxDetGeometryCore.cxx.
References AuxDets(), and fChannelMapAlg.
AuxDetSensitiveGeo const & geo::AuxDetGeometryCore::PositionToAuxDetSensitive | ( | Point_t const & | worldLoc, |
size_t & | ad, | ||
size_t & | sv, | ||
double | tolerance = 0 |
||
) | const |
Returns the auxiliary detector at specified location.
worldLoc | 3D coordinates of the point (world reference frame |
tolerance | tolerance (cm) for matches. Default 0. |
ad | (output) the auxiliary detector index |
sv | (output) the auxiliary detector sensitive volume index |
Definition at line 157 of file AuxDetGeometryCore.cxx.
References AuxDet(), FindAuxDetSensitiveAtPosition(), and geo::AuxDetGeo::SensitiveVolume().
|
inline |
Returns the full directory path to the geometry file source.
This is the full path of the source of the detector geometry GeometryCore relies on.
Definition at line 115 of file AuxDetGeometryCore.h.
|
private |
Configuration of geometry builder.
Definition at line 306 of file AuxDetGeometryCore.h.
Referenced by LoadGeometryFile().
|
private |
Object containing the channel to wire mapping.
Definition at line 308 of file AuxDetGeometryCore.h.
Referenced by ApplyChannelMap(), AuxDetChannelToPosition(), ChannelToAuxDet(), ChannelToAuxDetSensitive(), FindAuxDetAtPosition(), FindAuxDetSensitiveAtPosition(), and PositionToAuxDetChannel().
|
private |
Name of the detector.
Definition at line 303 of file AuxDetGeometryCore.h.
Referenced by AuxDetGeometryCore().
|
private |
path to geometry file used for Geant4 simulation
Definition at line 304 of file AuxDetGeometryCore.h.
Referenced by LoadGeometryFile().
|
private |
The detector description data.
Definition at line 301 of file AuxDetGeometryCore.h.
Referenced by ApplyChannelMap().
|
private |
path to geometry file for geometry in GeometryCore
Definition at line 305 of file AuxDetGeometryCore.h.
Referenced by LoadGeometryFile().