21 #include "messagefacility/MessageLogger/MessageLogger.h"
22 #include "cetlib_except/exception.h"
36 : fTotalVolume(node.GetVolume())
37 , fTrans(
std::move(trans))
38 , fSensitive(
std::move(sensitive))
42 throw cet::exception(
"AuxDetGeo") <<
"cannot find AuxDet volume\n";
44 MF_LOG_DEBUG(
"Geometry") <<
"detector total volume is " <<
fTotalVolume->GetName();
96 auto const local = sensVol.toLocalCoords(point);
98 double const HalfCenterWidth = sensVol.HalfCenterWidth();
100 double const deltaWidth
101 =
local.Z()*(HalfCenterWidth-sensVol.HalfWidth2())/sensVol.HalfLength();
103 if (
local.Z() >= - sensVol.HalfLength() &&
104 local.Z() <= sensVol.HalfLength() &&
105 local.Y() >= - sensVol.HalfHeight() &&
106 local.Y() <= sensVol.HalfHeight() &&
108 local.X() >= - HalfCenterWidth + deltaWidth &&
109 local.X() <= HalfCenterWidth - deltaWidth
114 throw cet::exception(
"AuxDetGeo")
115 <<
"Can't find AuxDetSensitive for position " << point <<
"\n";
117 return std::numeric_limits<std::size_t>::max();
129 sv = FindSensitiveVolume(point);
130 if (sv == std::numeric_limits<std::size_t>::max()) {
131 throw cet::exception(
"AuxDetGeo")
132 <<
"Can't find AuxDetSensitiveGeo for position " << point <<
"\n";
134 return SensitiveVolume(sv);
139 (
double const worldLoc[3],
size_t& sv)
const
150 (std::string indent ,
unsigned int verbosity )
const
152 std::ostringstream sstr;
153 PrintAuxDetInfo(sstr, indent, verbosity);
162 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.
std::string AuxDetInfo(std::string indent="", unsigned int verbosity=1) const
Returns a string with auxiliary detector information.
double std(const std::vector< short > &wf, const double ped_mean, size_t start, size_t nsample)
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
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
Utilities to extend the interface of geometry vectors.
geo::Vector_t GetNormalVector() const
Returns the unit normal vector to the detector.
auto norm(Vector const &v)
Return norm of the specified vector.
Encapsulate the geometry of an auxiliary detector.
AuxDetGeo(TGeoNode const &node, geo::TransformationMatrix &&trans, AuxDetSensitiveList_t &&sensitive)
std::vector< geo::AuxDetSensitiveGeo > AuxDetSensitiveList_t
Type of list of sensitive volumes.
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()).
double fHalfHeight
half height of volume
void InitShapeSize()
Extracts the size of the detector from the geometry information.
ROOT::Math::Transform3D TransformationMatrix
Type of transformation matrix used in geometry.
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
void GetCenter(double *xyz, double localz=0.0) const
Return the center position of an AuxDet.