10 #include "Geometry/AuxDetGeo.h" 11 #include "Geometry/AuxDetGeoObjectSorter.h" 13 #include "TGeoManager.h" 17 #include "TGeoMatrix.h" 24 #include "cetlib_except/exception.h" 35 TGeoVolume *vc = path[depth]->GetVolume();
39 throw cet::exception(
"AuxDetGeo") <<
"cannot find AuxDet volume\n";
48 fGeoMatrix =
new TGeoHMatrix(*path[0]->GetMatrix());
49 for(
int i = 1; i <= depth; ++i){
62 if( volName.find(
"Trap") != std::string::npos ) {
99 if( pathName.find(
"Sensitive") != std::string::npos){
105 unsigned int deeper = depth+1;
106 if (deeper>=path.size()) {
107 throw cet::exception(
"ExceededMaxDepth") <<
"Exceeded maximum depth\n";
109 const TGeoVolume* v = path[depth]->GetVolume();
110 int nd = v->GetNdaughters();
111 for (
int i=0; i<nd; ++i) {
112 path[deeper] = v->GetNode(i);
166 double xyzLocal[3] = {0.,0.,localz};
174 double normal[3]={0.,0.,1.};
185 return std::sqrt((Center[0]-xyz[0])*(Center[0]-xyz[0]) +
186 (Center[1]-xyz[1])*(Center[1]-xyz[1]) +
187 (Center[2]-xyz[2])*(Center[2]-xyz[2]));
193 double local[3] = {0.};
210 throw cet::exception(
"Geometry") <<
"Can't find AuxDetSensitive for position (" 211 << worldPos[0] <<
"," 212 << worldPos[1] <<
"," 213 << worldPos[2] <<
")\n";
double HalfWidth1() const
const TGeoVolume * fTotalVolume
Total volume of AuxDet, called vol*.
double fHalfWidth1
1st half width of volume, at -z/2 in local coordinates
std::vector< AuxDetSensitiveGeo * > fSensitive
sensitive volumes in the detector
AuxDetSensitiveGeo const & SensitiveVolume(size_t sv) const
double fHalfHeight
half height of volume
void LocalToWorldVect(const double *local, double *world) const
void WorldToLocal(const double *world, double *local) const
void GetNormalVector(double *xyzDir) const
TGeoHMatrix * fGeoMatrix
Transformation matrix to world frame.
double HalfWidth2() const
double DistanceToPoint(double *xyz) const
size_t FindSensitiveVolume(double const worldLoc[3]) const
void LocalToWorld(const double *local, double *world) const
void FindAuxDetSensitive(std::vector< const TGeoNode * > &path, unsigned int depth)
virtual void SortAuxDetSensitive(std::vector< geo::AuxDetSensitiveGeo * > &adsgeo) const =0
General GArSoft Utilities.
void SortSubVolumes(geo::AuxDetGeoObjectSorter const &sorter)
void WorldToLocalVect(const double *world, double *local) const
void WorldToLocal(const double *world, double *local) const
AuxDetSensitiveGeo const & PositionToSensitiveVolume(double const worldLoc[3], size_t &sv) const
double HalfHeight() const
AuxDetGeo(std::vector< const TGeoNode * > &path, int depth)
LArSoft geometry interface.
void MakeAuxDetSensitive(std::vector< const TGeoNode * > &path, int depth)
cet::coded_exception< error, detail::translate > exception
double fLength
length of volume, along z direction in local
double fHalfWidth2
2nd half width (width1==width2 for boxes), at +z/2
void GetCenter(double *xyz, double localz=0.0) const