17 #include "cetlib_except/exception.h" 21 #include <TGeoManager.h> 23 #include <TGeoVolume.h> 24 #include <TGeoMatrix.h> 44 : fDetectorName(pset.get<
std::string >(
"Name"))
68 if (gdmlfile.empty()) {
69 throw cet::exception(
"AuxDetGeometryCore") <<
"No GDML Geometry file specified!\n";
72 if (rootfile.empty()) {
73 throw cet::exception(
"AuxDetGeometryCore") <<
"No ROOT Geometry file specified!\n";
83 TGeoManager::Import(rootfile.c_str());
84 gGeoManager->LockGeometry();
87 std::vector<const TGeoNode*> path(8);
88 path[0] = gGeoManager->GetTopNode();
94 mf::LogInfo(
"AuxDetGeometryCore") <<
"New detector geometry loaded from " 114 throw cet::exception(
"Geometry") <<
"Requested AuxDet index " << aid
115 <<
" is out of range: " <<
NAuxDets();
117 return AuxDets()[aid]->NSensitiveVolume();
134 <<
" does not exist\n";
148 unsigned int &ad)
const 187 std::string
const& auxDetName)
const 194 uint32_t
const& channel)
const 197 return this->
AuxDet(adIdx);
202 uint32_t
const& channel)
const 212 const char* nm = path[depth]->GetName();
213 if( (strncmp(nm,
"volAuxDet", 9) == 0) ){
219 unsigned int deeper = depth+1;
220 if(deeper >= path.size()){
221 throw cet::exception(
"AuxDetGeometryCore") <<
"exceeded maximum TGeoNode depth\n";
224 const TGeoVolume *v = path[depth]->GetVolume();
225 int nd = v->GetNdaughters();
226 for(
int i = 0; i < nd; ++i){
227 path[deeper] = v->GetNode(i);
~AuxDetGeometryCore()
Destructor.
void LoadGeometryFile(std::string gdmlfile, std::string rootfile)
Loads the geometry information from the specified files.
AuxDetGeo const & AuxDet(unsigned int const ad=0) const
Returns the specified auxiliary detector.
Encapsulate the geometry of the sensitive portion of an auxiliary detector.
AuxDetGeometryData_t fGeoData
The detector description data.
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
AuxDetSensitiveGeo const & SensitiveVolume(size_t sv) const
void FindAuxDetSensitiveAtPosition(double const worldLoc[3], size_t &adg, size_t &sv) const
Fills the indices of the sensitive auxiliary detector at location.
std::string fDetectorName
Name of the detector.
uint32_t PositionToAuxDetChannel(double const worldLoc[3], size_t &ad, size_t &sv) const
const AuxDetGeo & ChannelToAuxDet(std::string const &auxDetName, uint32_t const &channel) const
unsigned int NAuxDetSensitive(size_t const &aid) const
Returns the number of sensitive components of auxiliary detector.
Access the description of auxiliary detector geometry.
std::shared_ptr< const geo::AuxDetChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
unsigned int NAuxDets() const
Returns the number of auxiliary detectors.
const AuxDetSensitiveGeo & ChannelToAuxDetSensitive(std::string const &auxDetName, uint32_t const &channel) const
AuxDetList_t & AuxDets()
Return the internal auxiliary detectors list.
std::vector< evd::details::RawDigitInfo_t >::const_iterator begin(RawDigitCacheDataClass const &cache)
void MakeAuxDet(std::vector< const TGeoNode * > &path, int depth)
void ApplyChannelMap(std::shared_ptr< geo::AuxDetChannelMapAlg > pChannelMap)
Initializes the geometry to work with this channel map.
Encapsulate the geometry of an auxiliary detector.
AuxDetGeo const & PositionToAuxDet(double const worldLoc[3], unsigned int &ad) const
Returns the auxiliary detector at specified location.
std::string fROOTfile
path to geometry file for geometry in GeometryCore
AuxDetGeometryCore(fhicl::ParameterSet const &pset)
Initialize geometry from a given configuration.
void ClearGeometry()
Deletes the detector geometry structures.
std::string fGDMLfile
path to geometry file used for Geant4 simulation
std::vector< evd::details::RawDigitInfo_t >::const_iterator end(RawDigitCacheDataClass const &cache)
Namespace collecting geometry-related classes utilities.
const AuxDetSensitiveGeo & PositionToAuxDetSensitive(double const worldLoc[3], size_t &ad, size_t &sv) const
Returns the auxiliary detector at specified location.
unsigned int FindAuxDetAtPosition(double const worldLoc[3]) const
Returns the index of the auxiliary detector at specified location.
TVector3 AuxDetChannelToPosition(uint32_t const &channel, std::string const &auxDetName) const
cet::coded_exception< error, detail::translate > exception
void FindAuxDet(std::vector< const TGeoNode * > &path, unsigned int depth)