16 #include "TGeoManager.h" 42 double xyzLocal[3] = {0.,0.,localz};
50 if (TGeoSphere
const* sphere =
asSphere(); sphere) {
51 return sphere->GetRmax();
53 else if (TGeoTube
const* tube =
asTube(); tube) {
54 return tube->GetRmax();
57 throw std::bad_cast{};
65 TGeoBBox
const* pBox =
asBox();
66 return pBox? pBox->GetDZ(): 0.0;
73 TGeoBBox
const* pBox =
asBox();
74 return pBox? pBox->GetDX(): 0.0;
81 TGeoBBox
const* pBox =
asBox();
82 return pBox? pBox->GetDY(): 0.0;
89 if (TGeoSphere
const* sphere =
asSphere(); sphere) {
90 return sphere->GetRmin();
92 else if (TGeoTube
const* tube =
asTube(); tube) {
93 return tube->GetRmin();
96 throw std::bad_cast{};
126 {
return DistanceToPoint(geo::vect::makeFromCoords<geo::Point_t>(xyz)); }
132 std::ostringstream sstr;
140 return local.Z() / local.R();
end
while True: pbar.update(maxval-len(onlies[E][S])) #print iS, "/", len(onlies[E][S]) found = False for...
TGeoSphere const * asSphere() const
Returns the geometry object as TGeoSphere, nullptr if not a sphere.
Utilities to extend the interface of geometry vectors.
double CosThetaFromNormal(geo::Point_t const &point) const
Get cos(angle) to normal of this detector - used for solid angle calcs.
const TGeoNode * fOpDetNode
Pointer to theopdet node.
TGeoBBox const * asBox() const
Returns the geometry object as TGeoBBox, nullptr if not box-derived.
OpDetGeo(TGeoNode const &node, geo::TransformationMatrix &&trans)
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.
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.
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
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].
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 ( )
static constexpr double degree
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.
LArSoft geometry interface.
geo::OpDetID fID
Identifier of this optical detector.
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.
ROOT::Math::Transform3D TransformationMatrix
Type of transformation matrix used in geometry.