16 #include "TGeoManager.h"
27 : fTrans(
std::move(trans))
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{};
109 double angle = (
end.Y()-center.Y()+
end.X()-center.X()) /
111 std::acos((
end.Z() - center.Z())/
HalfL());
126 {
return DistanceToPoint(geo::vect::makeFromCoords<geo::Point_t>(xyz)); }
130 (std::string indent ,
unsigned int verbosity )
const
132 std::ostringstream sstr;
133 PrintOpDetInfo(sstr, indent, verbosity);
TGeoSphere const * asSphere() const
Returns the geometry object as TGeoSphere, nullptr if not a sphere.
double std(const std::vector< short > &wf, const double ped_mean, size_t start, size_t nsample)
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)
auto end(FixedBins< T, C > const &) noexcept
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].
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 ( )
finds tracks best matching by angle
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::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
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.