22 #include "cetlib_except/exception.h" 36 : fTotalVolume(node.GetVolume())
38 , fSensitive(
std::
move(sensitive))
42 throw cet::exception(
"AuxDetGeo") <<
"cannot find AuxDet volume\n";
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
115 <<
"Can't find AuxDetSensitive for position " << point <<
"\n";
132 <<
"Can't find AuxDetSensitiveGeo for position " << point <<
"\n";
139 (
double const worldLoc[3],
size_t& sv)
const 152 std::ostringstream sstr;
162 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.
Utilities to extend the interface of geometry vectors.
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)
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Vector_t
Type for representation of momenta in 3D space.
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
GENVECTOR_CONSTEXPR::geo::Point_t makePointFromCoords(Coords &&coords)
Creates a geo::Point_t from its coordinates (see makeFromCoords()).
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
Encapsulate the geometry of an auxiliary detector.
geo::Vector_t GetNormalVector() const
Returns the unit normal vector to the detector.
static int max(int a, int b)
auto norm(Vector const &v)
Return norm of the specified vector.
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
double Length_t
Type used for coordinates and distances. They are measured in centimeters.
AuxDetGeo(TGeoNode const &node, geo::TransformationMatrix &&trans, AuxDetSensitiveList_t &&sensitive)
std::vector< geo::AuxDetSensitiveGeo > AuxDetSensitiveList_t
Type of list of sensitive volumes.
LArSoft geometry interface.
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
void GetCenter(double *xyz, double localz=0.0) const
Return the center position of an AuxDet.