9 #ifndef LARCOREALG_GEOMETRY_OPDETGEO_H 10 #define LARCOREALG_GEOMETRY_OPDETGEO_H 17 #include "TGeoMatrix.h" 62 OpDetGeo(std::vector<const TGeoNode*>& path,
65 void GetCenter(
double* xyz,
double localz=0.0)
const;
76 double ThetaZ(
bool degrees)
const;
140 TGeoShape
const*
Shape()
const {
return Node()->GetVolume()->GetShape(); }
167 template <
typename Stream>
169 (Stream&& out, std::string
indent =
"",
unsigned int verbosity = 0)
const;
184 {
return dynamic_cast<TGeoTube const*
>(
Shape()); }
188 {
return dynamic_cast<TGeoBBox const*
>(
Shape()); }
198 template <
typename Stream>
202 unsigned int verbosity
206 out <<
"centered at " <<
GetCenter() <<
" cm";
208 if (verbosity-- <= 0)
return;
212 out <<
", radius: " <<
RMax() <<
" cm";
213 if (
RMin() != 0.0) out <<
" (inner: " <<
RMin() <<
" cm)";
214 out <<
", length: " <<
Length() <<
" cm";
220 else out <<
", shape: '" <<
Shape()->IsA()->GetName() <<
"'";
222 if (verbosity-- <= 0)
return;
225 out <<
", theta(z): " <<
ThetaZ() <<
" rad";
234 #endif // LARCOREALG_GEOMETRY_OPDETGEO_H const TGeoNode * Node() const
Returns the ROOT object describing the detector geometry.
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Vector_t
Type for representation of momenta in 3D space.
Tag for vectors in the "local" GDML coordinate frame of the TPC.
double CosThetaFromNormal(geo::Point_t const &point) const
Get cos(angle) to normal of this detector - used for solid angle calcs.
bool isTube() const
Returns whether the detector shape is a cilynder (TGeoTube).
bool isBar() const
Returns whether the detector shape is a bar (TGeoBBox).
OpDetGeo(std::vector< const TGeoNode * > &path, int depth)
const TGeoNode * fOpDetNode
Pointer to theopdet node.
LocalVector_t toLocalCoords(geo::Vector_t const &world) const
Transform direction vector from world to local.
geo::Vector_t toWorldCoords(LocalVector_t const &local) const
Transform direction vector from local to world.
Definitions of geometry vector data types.
TGeoBBox const * asBox() const
Returns the geometry object as TGeoBBox, nullptr if not a tube.
std::string indent(std::size_t const i)
void WorldToLocal(const double *world, double *opdet) const
Transform point from world frame to local optical detector frame.
void PrintOpDetInfo(Stream &&out, std::string indent="", unsigned int verbosity=0) const
Prints information about this optical detector.
geo::Point_t fCenter
Stored geometric center of the optical detector.
void LocalToWorldVect(const double *opdet, double *world) const
Transform direction vector from local to world.
geo::Vector3DBase_t< OpDetGeoCoordinatesTag > LocalVector_t
Type of displacement vectors in the local GDML TPC frame.
geo::Point_t toWorldCoords(LocalPoint_t const &local) const
Transform point from local optical detector frame to world frame.
geo::Point_t const & GetCenter() const
double DistanceToPoint(geo::Point_t const &point) const
Returns the distance of the specified point from detector center [cm].
TGeoTube const * asTube() const
Returns the geometry object as TGeoTube, nullptr if not a tube.
static constexpr unsigned int MaxVerbosity
Maximum verbosity supported by PrintOpDetInfo().
GenPoint3DBase_t< double, C > Point3DBase_t
Type of 3D point with representation in double precision.
GenVector3DBase_t< double, C > Vector3DBase_t
LocalTransformation_t fTrans
Optical-detector-to-world transformation.
geo::Point3DBase_t< OpDetGeoCoordinatesTag > LocalPoint_t
Type of points in the local GDML TPC frame.
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
Namespace collecting geometry-related classes utilities.
void WorldToLocalVect(const double *world, double *opdet) const
Transform direction vector from world to local.
TGeoShape const * Shape() const
Returns the geometry object as TGeoShape.
void LocalToWorld(const double *opdet, double *world) const
Transform point from local optical detector frame to world frame.
LocalPoint_t toLocalCoords(geo::Point_t const &world) const
Transform point from world frame to local optical detector frame.