16 #include "TGeoManager.h" 27 : fTrans(
std::move(trans))
37 if (TGeoSphere
const* sphere =
asSphere(); sphere) {
return sphere->GetRmax(); }
38 if (TGeoTube
const* tube =
asTube(); tube) {
return tube->GetRmax(); }
39 throw std::bad_cast{};
46 TGeoBBox
const* pBox =
asBox();
47 return pBox ? pBox->GetDZ() : 0.0;
54 TGeoBBox
const* pBox =
asBox();
55 return pBox ? pBox->GetDX() : 0.0;
62 TGeoBBox
const* pBox =
asBox();
63 return pBox ? pBox->GetDY() : 0.0;
70 if (TGeoSphere
const* sphere =
asSphere(); sphere) {
return sphere->GetRmin(); }
71 if (TGeoTube
const* tube =
asTube(); tube) {
return tube->GetRmin(); }
72 throw std::bad_cast{};
84 double angle = (
end.Y() - center.Y() +
end.X() - center.X()) /
86 std::acos((
end.Z() - center.Z()) /
HalfL());
105 unsigned int verbosity )
const 107 std::ostringstream sstr;
116 return local.Z() / local.R();
TGeoSphere const * asSphere() const
Returns the geometry object as TGeoSphere, nullptr if not a sphere.
double CosThetaFromNormal(geo::Point_t const &point) const
Get cos(angle) to normal of this detector - used for solid angle calcs.
constexpr auto abs(T v)
Returns the absolute value of the argument.
const TGeoNode * fOpDetNode
Pointer to theopdet node.
decltype(auto) constexpr end(T &&obj)
ADL-aware version of std::end.
TGeoBBox const * asBox() const
Returns the geometry object as TGeoBBox, nullptr if not box-derived.
OpDetGeo(TGeoNode const &node, geo::TransformationMatrix &&trans)
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.
geo::Point_t fCenter
Stored geometric center of the optical detector.
Utilities to extend the interface of geometry vectors.
geo::Point_t toWorldCoords(LocalPoint_t const &local) const
Transform point from local optical detector frame to world frame.
void UpdateAfterSorting(geo::OpDetID opdetid)
Performs all updates after cryostat has sorted the optical detectors.
Encapsulate the geometry of an optical detector.
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].
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
geo::OpticalPoint_t LocalPoint_t
Type of points in the local GDML TPC frame.
TGeoTube const * asTube() const
Returns the geometry object as TGeoTube, nullptr if not a tube.
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.
Namespace collecting geometry-related classes utilities.
geo::OpDetID fID
Identifier of this optical detector.
LocalPoint_t toLocalCoords(geo::Point_t const &world) const
Transform point from world frame to local optical detector frame.
ROOT::Math::Transform3D TransformationMatrix
Type of transformation matrix used in geometry.