20 #include "cetlib_except/exception.h" 35 : fTotalVolume(node->GetVolume()), fTrans(
std::move(trans)), fSensitive(
std::move(sensitive))
67 for (std::size_t a = 0; a <
fSensitive.size(); ++a) {
70 auto const local = sensVol.toLocalCoords(point);
72 double const HalfCenterWidth = sensVol.HalfCenterWidth();
74 double const deltaWidth =
75 local.Z() * (HalfCenterWidth - sensVol.HalfWidth2()) / sensVol.HalfLength();
77 if (local.Z() >= -sensVol.HalfLength() && local.Z() <= sensVol.HalfLength() &&
78 local.Y() >= -sensVol.HalfHeight() && local.Y() <= sensVol.HalfHeight() &&
80 local.X() >= -HalfCenterWidth + deltaWidth && local.X() <= HalfCenterWidth - deltaWidth)
86 <<
"Can't find AuxDetSensitive for position " << point <<
"\n";
94 if (sv == std::numeric_limits<std::size_t>::max()) {
96 <<
"Can't find AuxDetSensitiveGeo for position " << point <<
"\n";
109 unsigned int verbosity )
const 111 std::ostringstream sstr;
121 if (volName.find(
"Trap") != std::string::npos) {
Point3DBase_t< AuxDetGeoCoordinatesTag > LocalPoint_t
Type of points in the local GDML auxiliary detector frame.
std::string AuxDetInfo(std::string indent="", unsigned int verbosity=1) const
Returns a string with auxiliary detector information.
AuxDetGeo(TGeoNode const *node, TransformationMatrix &&trans, AuxDetSensitiveList_t &&sensitive)
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Vector_t
Type for representation of momenta in 3D space.
AuxDetSensitiveGeo const & SensitiveVolume(size_t sv) const
double fHalfWidth2
2nd half width (width1==width2 for boxes), at +z/2
LocalTransformation_t fTrans
Auxiliary detector-to-world transformation.
std::vector< AuxDetSensitiveGeo > AuxDetSensitiveList_t
Type of list of sensitive volumes.
AuxDetSensitiveGeo const & PositionToSensitiveVolume(Point_t const &point, size_t &sv) const
double fHalfWidth1
1st half width of volume, at -z/2 in local coordinates
Point_t GetCenter(double localz=0.0) const
Returns the geometric center of the sensitive volume.
double fLength
length of volume, along z direction in local
TGeoVolume const * fTotalVolume
Total volume of AuxDet, called vol*.
std::string indent(std::size_t const i)
Utilities to extend the interface of geometry vectors.This library provides facilities that can be us...
Vector_t GetNormalVector() const
Returns the unit normal vector to the detector.
Point_t toWorldCoords(LocalPoint_t const &local) const
Transform point from local auxiliary detector frame to world frame.
Encapsulate the geometry of an auxiliary detector.
std::size_t FindSensitiveVolume(Point_t const &point) const
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
void SortSubVolumes(AuxDetGeoObjectSorter &sorter)
double fHalfHeight
half height of volume
void sort(std::vector< AuxDetGeo > &ads) const
void InitShapeSize()
Extracts the size of the detector from the geometry information.
void PrintAuxDetInfo(Stream &&out, std::string indent="", unsigned int verbosity=1) const
Prints information about this auxiliary detector.
ROOT::Math::Transform3D TransformationMatrix
Type of transformation matrix used in geometry.
cet::coded_exception< error, detail::translate > exception
std::vector< AuxDetSensitiveGeo > fSensitive
sensitive volumes in the detector