21 #include "cetlib_except/exception.h" 35 : fTotalVolume(node.GetVolume()), fTrans(
std::move(trans)), fSensitive(
std::move(sensitive))
68 for (std::size_t a = 0; a <
fSensitive.size(); ++a) {
71 auto const local = sensVol.toLocalCoords(point);
73 double const HalfCenterWidth = sensVol.HalfCenterWidth();
75 double const deltaWidth =
76 local.Z() * (HalfCenterWidth - sensVol.HalfWidth2()) / sensVol.HalfLength();
78 if (local.Z() >= -sensVol.HalfLength() && local.Z() <= sensVol.HalfLength() &&
79 local.Y() >= -sensVol.HalfHeight() && local.Y() <= sensVol.HalfHeight() &&
81 local.X() >= -HalfCenterWidth + deltaWidth && local.X() <= HalfCenterWidth - deltaWidth)
87 <<
"Can't find AuxDetSensitive for position " << point <<
"\n";
95 if (sv == std::numeric_limits<std::size_t>::max()) {
97 <<
"Can't find AuxDetSensitiveGeo for position " << point <<
"\n";
110 unsigned int verbosity )
const 112 std::ostringstream sstr;
122 if (volName.find(
"Trap") != std::string::npos) {
std::string AuxDetInfo(std::string indent="", unsigned int verbosity=1) const
Returns a string with auxiliary detector information.
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.
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
Interface to algorithm class for sorting geo::XXXGeo objects.
const TGeoVolume * fTotalVolume
Total volume of AuxDet, called vol*.
std::size_t FindSensitiveVolume(geo::Point_t const &point) const
virtual void SortAuxDetSensitive(std::vector< geo::AuxDetSensitiveGeo > &adsgeo) const =0
std::string indent(std::size_t const i)
Utilities to extend the interface of geometry vectors.
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.
AuxDetGeo(TGeoNode const &node, geo::TransformationMatrix &&trans, AuxDetSensitiveList_t &&sensitive)
geo::Point_t GetCenter(double localz=0.0) const
Returns the geometric center of the sensitive volume.
std::vector< geo::AuxDetSensitiveGeo > AuxDetSensitiveList_t
Type of list of sensitive volumes.
Namespace collecting geometry-related classes utilities.
double fHalfHeight
half height of volume
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
geo::Point_t toWorldCoords(LocalPoint_t const &local) const
Transform point from local auxiliary detector frame to world frame.
std::vector< AuxDetSensitiveGeo > fSensitive
sensitive volumes in the detector