LArSoft
v06_85_00
Liquid Argon Software toolkit - http://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 () | |
Destructor. More... | |
AuxDetGeometryCore (AuxDetGeometryCore const &)=delete | |
AuxDetGeometryCore (AuxDetGeometryCore &&)=delete | |
AuxDetGeometryCore & | operator= (AuxDetGeometryCore const &)=delete |
AuxDetGeometryCore & | operator= (AuxDetGeometryCore &&)=delete |
std::string | ROOTFile () const |
Returns the full directory path to the geometry file source. More... | |
std::string | GDMLFile () const |
Returns the full directory path to the GDML file source. More... | |
std::string | 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 (double const worldLoc[3]) const |
Returns the index of the auxiliary detector at specified location. More... | |
void | FindAuxDetSensitiveAtPosition (double const worldLoc[3], size_t &adg, size_t &sv) const |
Fills the indices of the sensitive auxiliary detector at location. More... | |
AuxDetGeo const & | PositionToAuxDet (double const worldLoc[3], unsigned int &ad) const |
Returns the auxiliary detector at specified location. More... | |
const AuxDetSensitiveGeo & | PositionToAuxDetSensitive (double const worldLoc[3], size_t &ad, size_t &sv) const |
Returns the auxiliary detector at specified location. More... | |
uint32_t | PositionToAuxDetChannel (double const worldLoc[3], size_t &ad, size_t &sv) const |
TVector3 | AuxDetChannelToPosition (uint32_t const &channel, std::string const &auxDetName) const |
const AuxDetGeo & | ChannelToAuxDet (std::string const &auxDetName, uint32_t const &channel) const |
const AuxDetSensitiveGeo & | ChannelToAuxDetSensitive (std::string const &auxDetName, uint32_t const &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::shared_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 | FindAuxDet (std::vector< const TGeoNode * > &path, unsigned int depth) |
void | MakeAuxDet (std::vector< const TGeoNode * > &path, int depth) |
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... | |
std::shared_ptr< const geo::AuxDetChannelMapAlg > | 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 100 of file AuxDetGeometryCore.h.
Type of list of auxiliary detectors.
Definition at line 104 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 43 of file AuxDetGeometryCore.cxx.
References fDetectorName.
geo::AuxDetGeometryCore::~AuxDetGeometryCore | ( | ) |
Destructor.
Definition at line 51 of file AuxDetGeometryCore.cxx.
References ClearGeometry().
|
delete |
|
delete |
void geo::AuxDetGeometryCore::ApplyChannelMap | ( | std::shared_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 58 of file AuxDetGeometryCore.cxx.
References fChannelMapAlg, and fGeoData.
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 129 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 306 of file AuxDetGeometryCore.h.
TVector3 geo::AuxDetGeometryCore::AuxDetChannelToPosition | ( | uint32_t const & | channel, |
std::string const & | auxDetName | ||
) | const |
Definition at line 186 of file AuxDetGeometryCore.cxx.
References AuxDets(), and fChannelMapAlg.
|
inline |
Returns the full list of pointer to the auxiliary detectors.
Definition at line 180 of file AuxDetGeometryCore.h.
|
inlineprotected |
Return the internal auxiliary detectors list.
Definition at line 310 of file AuxDetGeometryCore.h.
Referenced by AuxDet(), AuxDetChannelToPosition(), ChannelToAuxDet(), ChannelToAuxDetSensitive(), ClearGeometry(), FindAuxDetAtPosition(), FindAuxDetSensitiveAtPosition(), MakeAuxDet(), NAuxDetSensitive(), and PositionToAuxDetChannel().
|
inlineprotected |
Return the internal auxiliary detectors list.
Definition at line 311 of file AuxDetGeometryCore.h.
const AuxDetGeo & geo::AuxDetGeometryCore::ChannelToAuxDet | ( | std::string const & | auxDetName, |
uint32_t const & | channel | ||
) | const |
Definition at line 193 of file AuxDetGeometryCore.cxx.
References AuxDet(), AuxDets(), and fChannelMapAlg.
const AuxDetSensitiveGeo & geo::AuxDetGeometryCore::ChannelToAuxDetSensitive | ( | std::string const & | auxDetName, |
uint32_t const & | channel | ||
) | const |
Definition at line 201 of file AuxDetGeometryCore.cxx.
References AuxDet(), AuxDets(), fChannelMapAlg, and geo::AuxDetGeo::SensitiveVolume().
|
private |
Deletes the detector geometry structures.
Definition at line 101 of file AuxDetGeometryCore.cxx.
References AuxDets(), evd::details::begin(), and evd::details::end().
Referenced by LoadGeometryFile(), and ~AuxDetGeometryCore().
|
inline |
Returns a string with the name of the detector, as configured.
Definition at line 145 of file AuxDetGeometryCore.h.
|
private |
Definition at line 209 of file AuxDetGeometryCore.cxx.
References MakeAuxDet().
Referenced by LoadGeometryFile().
unsigned int geo::AuxDetGeometryCore::FindAuxDetAtPosition | ( | double const | worldLoc[3] | ) | const |
Returns the index of the auxiliary detector at specified location.
worldLoc | 3D coordinates of the point (world reference frame) |
Definition at line 141 of file AuxDetGeometryCore.cxx.
References AuxDets(), and fChannelMapAlg.
Referenced by FindAuxDetSensitiveAtPosition(), and PositionToAuxDet().
void geo::AuxDetGeometryCore::FindAuxDetSensitiveAtPosition | ( | double const | worldLoc[3], |
size_t & | adg, | ||
size_t & | sv | ||
) | 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 |
Definition at line 157 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 141 of file AuxDetGeometryCore.h.
|
inline |
Returns whether we have a channel map.
Definition at line 278 of file AuxDetGeometryCore.h.
Referenced by geo::AuxDetGeometry::InitializeChannelMap().
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 65 of file AuxDetGeometryCore.cxx.
References ClearGeometry(), fGDMLfile, FindAuxDet(), and fROOTfile.
Referenced by geo::AuxDetGeometry::LoadNewGeometry().
|
private |
Definition at line 234 of file AuxDetGeometryCore.cxx.
References AuxDets().
Referenced by FindAuxDet().
|
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 165 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 111 of file AuxDetGeometryCore.cxx.
References AuxDets(), and NAuxDets().
|
delete |
|
delete |
const AuxDetGeo & geo::AuxDetGeometryCore::PositionToAuxDet | ( | double const | worldLoc[3], |
unsigned int & | ad | ||
) | const |
Returns the auxiliary detector at specified location.
worldLoc | 3D coordinates of the point (world reference frame) |
ad | (output) the auxiliary detector index |
Definition at line 147 of file AuxDetGeometryCore.cxx.
References AuxDet(), and FindAuxDetAtPosition().
uint32_t geo::AuxDetGeometryCore::PositionToAuxDetChannel | ( | double const | worldLoc[3], |
size_t & | ad, | ||
size_t & | sv | ||
) | const |
Definition at line 178 of file AuxDetGeometryCore.cxx.
References AuxDets(), and fChannelMapAlg.
const AuxDetSensitiveGeo & geo::AuxDetGeometryCore::PositionToAuxDetSensitive | ( | double const | worldLoc[3], |
size_t & | ad, | ||
size_t & | sv | ||
) | const |
Returns the auxiliary detector at specified location.
worldLoc | 3D coordinates of the point (world reference frame) |
ad | (output) the auxiliary detector index |
sv | (output) the auxiliary detector sensitive volume index |
Definition at line 168 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 132 of file AuxDetGeometryCore.h.
|
private |
Object containing the channel to wire mapping.
Definition at line 328 of file AuxDetGeometryCore.h.
Referenced by ApplyChannelMap(), AuxDetChannelToPosition(), ChannelToAuxDet(), ChannelToAuxDetSensitive(), FindAuxDetAtPosition(), FindAuxDetSensitiveAtPosition(), and PositionToAuxDetChannel().
|
private |
Name of the detector.
Definition at line 325 of file AuxDetGeometryCore.h.
Referenced by AuxDetGeometryCore().
|
private |
path to geometry file used for Geant4 simulation
Definition at line 326 of file AuxDetGeometryCore.h.
Referenced by LoadGeometryFile().
|
private |
The detector description data.
Definition at line 323 of file AuxDetGeometryCore.h.
Referenced by ApplyChannelMap().
|
private |
path to geometry file for geometry in GeometryCore
Definition at line 327 of file AuxDetGeometryCore.h.
Referenced by LoadGeometryFile().