20 #include "cetlib_except/exception.h" 29 : fTotalVolume(nullptr)
33 TGeoVolume *vc = path[depth]->GetVolume();
37 throw cet::exception(
"AuxDetGeo") <<
"cannot find AuxDet volume\n";
57 for (
auto const* sdet:
fSensitive)
delete sdet;
67 std::string pathName(path[depth]->GetName());
68 if( pathName.find(
"Sensitive") != std::string::npos){
74 unsigned int deeper = depth+1;
75 if (deeper>=path.size()) {
76 throw cet::exception(
"ExceededMaxDepth") <<
"Exceeded maximum depth\n";
78 const TGeoVolume* v = path[depth]->GetVolume();
79 int nd = v->GetNdaughters();
80 for (
int i=0; i<nd; ++i) {
81 path[deeper] = v->GetNode(i);
115 xyzDir[0] =
norm.X();
116 xyzDir[1] =
norm.Y();
117 xyzDir[2] =
norm.Z();
128 for(std::size_t a = 0; a <
fSensitive.size(); ++a) {
131 auto const local = sensVol.toLocalCoords(point);
133 double const HalfCenterWidth = sensVol.HalfCenterWidth();
135 double const deltaWidth
136 = local.Z()*(HalfCenterWidth-sensVol.HalfWidth2())/sensVol.HalfLength();
138 if (local.Z() >= - sensVol.HalfLength() &&
139 local.Z() <= sensVol.HalfLength() &&
140 local.Y() >= - sensVol.HalfHeight() &&
141 local.Y() <= sensVol.HalfHeight() &&
143 local.X() >= - HalfCenterWidth + deltaWidth &&
144 local.X() <= HalfCenterWidth - deltaWidth
150 <<
"Can't find AuxDetSensitive for position " << point <<
"\n";
167 <<
"Can't find AuxDetSensitiveGeo for position " << point <<
"\n";
174 (
double const worldLoc[3],
size_t& sv)
const 189 if( volName.find(
"Trap") != std::string::npos ) {
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Vector_t
Type for representation of momenta in 3D space.
void FindAuxDetSensitive(std::vector< const TGeoNode * > &path, unsigned int depth)
double Length_t
Type used for coordinates and distances. They are measured in centimeters.
AuxDetSensitiveGeo const & SensitiveVolume(size_t sv) const
double fHalfWidth2
2nd half width (width1==width2 for boxes), at +z/2
geo::Length_t DistanceToPoint(geo::Point_t const &point) const
Returns the distance of point from the center of the detector.
LocalTransformation_t fTrans
Auxiliary detector-to-world transformation.
double fHalfWidth1
1st half width of volume, at -z/2 in local coordinates
void SortSubVolumes(geo::GeoObjectSorter const &sorter)
geo::Point3DBase_t< AuxDetGeoCoordinatesTag > LocalPoint_t
Type of points in the local GDML auxiliary detector frame.
double fLength
length of volume, along z direction in local
AuxDetSensitiveGeo const & PositionToSensitiveVolume(geo::Point_t const &point, size_t &sv) const
std::vector< AuxDetSensitiveGeo * > fSensitive
sensitive volumes in the detector
const TGeoVolume * fTotalVolume
Total volume of AuxDet, called vol*.
void MakeAuxDetSensitive(std::vector< const TGeoNode * > &path, int depth)
std::size_t FindSensitiveVolume(geo::Point_t const &point) const
Utilities to extend the interface of geometry vectors.
virtual void SortAuxDetSensitive(std::vector< geo::AuxDetSensitiveGeo * > &adsgeo) const =0
AuxDetGeo(std::vector< const TGeoNode * > &path, int depth)
geo::Vector_t GetNormalVector() const
Returns the unit normal vector to the detector.
Encapsulate the geometry of an auxiliary detector.
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
GENVECTOR_CONSTEXPR::geo::Point_t makePointFromCoords(Coords &&coords)
Creates a geo::Point_t from its coordinates (see makeFromCoords()).
Namespace collecting geometry-related classes utilities.
double fHalfHeight
half height of volume
void InitShapeSize()
Extracts the size of the detector from the geometry information.
cet::coded_exception< error, detail::translate > exception
geo::Point_t toWorldCoords(LocalPoint_t const &local) const
Transform point from local auxiliary detector frame to world frame.
void GetCenter(double *xyz, double localz=0.0) const
Return the center position of an AuxDet.