10 #include "Geometry/AuxDetGeometryCore.h" 12 #include "Geometry/AuxDetGeo.h" 13 #include "Geometry/AuxDetSensitiveGeo.h" 16 #include "cetlib_except/exception.h" 20 #include <TGeoManager.h> 22 #include <TGeoVolume.h> 23 #include <TGeoMatrix.h> 67 if (gdmlfile.empty()) {
69 <<
"No GDML Geometry file specified!\n";
72 if (rootfile.empty()) {
74 <<
"No ROOT Geometry file specified!\n";
85 gGeoManager->LockGeometry();
88 std::vector<const TGeoNode*> path(8);
89 path[0] = gGeoManager->GetTopNode();
96 <<
"New detector geometry loaded from " 117 <<
"Requested AuxDet index " 119 <<
" is out of range: " 122 return AuxDets()[aid]->NSensitiveVolume();
139 <<
" does not exist\n";
153 unsigned int &ad)
const 202 return this->
AuxDet(adIdx);
217 const char*
nm = path[depth]->GetName();
218 if( (strncmp(nm,
"volAuxDet", 9) == 0) ){
224 unsigned int deeper = depth+1;
225 if(deeper >= path.size()){
227 <<
"exceeded maximum TGeoNode depth\n";
230 const TGeoVolume *v = path[depth]->GetVolume();
231 int nd = v->GetNdaughters();
232 for(
int i = 0; i < nd; ++i){
233 path[deeper] = v->GetNode(i);
end
while True: pbar.update(maxval-len(onlies[E][S])) #print iS, "/", len(onlies[E][S]) found = False for...
void ApplyChannelMap(std::shared_ptr< geo::seg::AuxDetChannelMapAlg > pChannelMap)
Initializes the geometry to work with this channel map.
AuxDetGeometryCore(fhicl::ParameterSet const &pset)
Initialize geometry from a given configuration.
std::shared_ptr< const geo::seg::AuxDetChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
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 fGDMLfile
path to geometry file used for Geant4 simulation
const TVector3 AuxDetChannelToPosition(uint32_t const &channel, std::string const &auxDetName) const
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.
AuxDetSensitiveGeo const & SensitiveVolume(size_t sv) const
void MakeAuxDet(std::vector< const TGeoNode * > &path, int depth)
~AuxDetGeometryCore()
Destructor.
AuxDetGeo const & AuxDet(unsigned int const ad=0) const
Returns the specified auxiliary detector.
void FindAuxDet(std::vector< const TGeoNode * > &path, unsigned int depth)
unsigned int NAuxDetSensitive(size_t const &aid) const
Returns the number of sensitive components of auxiliary detector.
AuxDetGeo const & PositionToAuxDet(double const worldLoc[3], unsigned int &ad) const
Returns the auxiliary detector at specified location.
void ClearGeometry()
Deletes the detector geometry structures.
uint32_t PositionToAuxDetChannel(double const worldLoc[3], size_t &ad, size_t &sv) const
#define MF_LOG_INFO(category)
AuxDetGeometryData_t fGeoData
The detector description data.
General GArSoft Utilities.
std::string fDetectorName
Name of the detector.
void LoadGeometryFile(std::string gdmlfile, std::string rootfile)
Loads the geometry information from the specified files.
unsigned int FindAuxDetAtPosition(double const worldLoc[3]) const
Returns the index of the auxiliary detector at specified location.
decltype(auto) constexpr begin(T &&obj)
ADL-aware version of std::begin.
auto const & get(AssnsNode< L, R, D > const &r)
LArSoft geometry interface.
const AuxDetSensitiveGeo & PositionToAuxDetSensitive(double const worldLoc[3], size_t &ad, size_t &sv) const
Returns the auxiliary detector at specified location.
std::string fROOTfile
path to geometry file for geometry in GeometryCore
cet::coded_exception< error, detail::translate > exception
const AuxDetGeo & ChannelToAuxDet(std::string const &auxDetName, uint32_t const &channel) const