15 #include "TGeoManager.h" 33 if (TGeoSphere
const* sphere =
asSphere(); sphere) {
return sphere->GetRmax(); }
34 if (TGeoTube
const* tube =
asTube(); tube) {
return tube->GetRmax(); }
35 throw std::bad_cast{};
42 TGeoBBox
const* pBox =
asBox();
43 return pBox ? pBox->GetDZ() : 0.0;
50 TGeoBBox
const* pBox =
asBox();
51 return pBox ? pBox->GetDX() : 0.0;
58 TGeoBBox
const* pBox =
asBox();
59 return pBox ? pBox->GetDY() : 0.0;
66 if (TGeoSphere
const* sphere =
asSphere(); sphere) {
return sphere->GetRmin(); }
67 if (TGeoTube
const* tube =
asTube(); tube) {
return tube->GetRmin(); }
68 throw std::bad_cast{};
80 double angle = (
end.Y() - center.Y() +
end.X() - center.X()) /
82 std::acos((
end.Z() - center.Z()) /
HalfL());
101 unsigned int verbosity )
const 103 std::ostringstream sstr;
112 return local.Z() / local.R();
TGeoSphere const * asSphere() const
Returns the geometry object as TGeoSphere, nullptr if not a sphere.
OpDetGeo(TGeoNode const *node, TransformationMatrix &&trans)
Point_t toWorldCoords(LocalPoint_t const &local) const
Transform point from local optical detector frame to world frame.
Point_t const & GetCenter() const
constexpr auto abs(T v)
Returns the absolute value of the argument.
Point_t fCenter
Stored geometric center of the optical detector.
OpDetID fID
Identifier of this optical detector.
decltype(auto) constexpr end(T &&obj)
ADL-aware version of std::end.
double DistanceToPoint(Point_t const &point) const
Returns the distance of the specified point from detector center [cm].
TGeoBBox const * asBox() const
Returns the geometry object as TGeoBBox, nullptr if not box-derived.
void UpdateAfterSorting(OpDetID opdetid)
Performs all updates after cryostat has sorted the optical detectors.
std::string indent(std::size_t const i)
void PrintOpDetInfo(Stream &&out, std::string indent="", unsigned int verbosity=0) const
Prints information about this optical detector.
Utilities to extend the interface of geometry vectors.This library provides facilities that can be us...
OpticalPoint_t LocalPoint_t
Type of points in the local GDML TPC frame.
Encapsulate the geometry of an optical detector.
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
double CosThetaFromNormal(Point_t const &point) const
Get cos(angle) to normal of this detector - used for solid angle calcs.
TGeoTube const * asTube() const
Returns the geometry object as TGeoTube, nullptr if not a tube.
LocalPoint_t toLocalCoords(Point_t const &world) const
Transform point from world frame to local optical detector frame.
constexpr T pi()
Returns the constant pi (up to 35 decimal digits of precision)
constexpr T RadiansToDegrees(T angle)
Converts the argument angle from radians into degrees ( )
Collection of Physical constants used in LArSoft.
std::string OpDetInfo(std::string indent="", unsigned int verbosity=0) const
Returns a string with optical detector information.
The data type to uniquely identify a optical detector.
ROOT::Math::Transform3D TransformationMatrix
Type of transformation matrix used in geometry.