13 #include "cetlib/container_algorithms.h" 14 #include "cetlib_except/exception.h" 19 #include "TGeoMatrix.h" 34 auto const [axis,
sign] = driftAxis;
48 std::size_t hash_value,
51 double const driftDistance)
60 TGeoVolume* vc = tpc_node->GetVolume();
63 <<
"cannot find detector outline volume - bail ungracefully\n";
77 <<
"\ndetector active volume is " <<
fActiveVolume->GetName();
80 auto const* active_volume_box =
static_cast<TGeoBBox const*
>(
fActiveVolume->GetShape());
85 auto const* total_volume_box =
static_cast<TGeoBBox const*
>(
fTotalVolume->GetShape());
88 fLength = 2.0 * total_volume_box->GetDZ();
96 double Rxx, Rxy, Rxz, Ryx, Ryy, Ryz, Rzx, Rzy, Rzz;
97 fTrans.
Matrix().Rotation().GetComponents(Rxx, Rxy, Rxz, Ryx, Ryy, Ryz, Rzx, Rzy, Rzz);
125 fLength = 2. * total_volume_box->GetDX();
130 fLength = 2. * total_volume_box->GetDY();
161 return cathodeCenter;
173 std::ostringstream sstr;
203 return {activeBox.CenterX(), activeBox.CenterY(), activeBox.MinZ()};
215 for (
int i = 0, nd = tpc->GetNdaughters(); i < nd; ++i) {
216 auto daughter = tpc->GetDaughter(i);
217 if (daughter && strncmp(daughter->GetName(),
"volTPCActive", 12) == 0)
return daughter;
void InitTPCBoundaries()
Recomputes the TPC boundary.
Point_t GetCathodeCenter() const
Returns the expected drift direction based on geometry.
void PrintTPCInfo(Stream &&out, std::string indent="", unsigned int verbosity=1) const
Prints information about this TPC.
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Vector_t
Type for representation of momenta in 3D space.
double fLength
Length of total volume.
double ActiveHalfHeight() const
Half height (associated with y coordinate) of active TPC volume [cm].
double fActiveHalfWidth
Half width of active volume.
constexpr Vector Yaxis()
Returns a y axis vector of the specified type.
BoxBoundedGeo fActiveBox
Box of the active volume.
constexpr auto abs(T v)
Returns the absolute value of the argument.
double HalfLength() const
Length is associated with z coordinate [cm].
DriftAxis DriftAxisWithSign() const
Returns the expected drift direction based on geometry.
Class for approximate comparisons.
Point_t toWorldCoords(LocalPoint_t const &local) const
Transform point from local TPC frame to world frame.
double ActiveHalfLength() const
Length (associated with z coordinate) of active TPC volume [cm].
double fHalfWidth
Half width of total volume.
BoxBoundedGeo const & ActiveBoundingBox() const
Returns the box of the active volume of this TPC.
double fActiveLength
Length of active volume.
TPCGeo(TGeoNode const *tpc_node, std::size_t hash_value, TransformationMatrix &&trans, DriftAxis driftAxis, double driftDistance)
double ActiveHalfWidth() const
Half width (associated with x coordinate) of active TPC volume [cm].
std::string indent(std::size_t const i)
Utilities to extend the interface of geometry vectors.This library provides facilities that can be us...
constexpr int to_int(Coordinate const coord) noexcept
Enumerate the possible plane projections.
constexpr Vector Xaxis()
Returns a x axis vector of the specified type.
decltype(auto) makeTransformationMatrix(Trans &&trans)
Converts a transformation matrix into a geo::TransformationMatrix.
TGeoVolume * fTotalVolume
Total volume of TPC, called volTPC in GDML file.
Point_t toPoint(Point const &p)
Convert the specified point into a geo::Point_t.
static TGeoNode const * NodeForActiveVolume(TGeoNode const *tpc)
void UpdateAfterSorting(TPCID tpcid)
Performs all updates after cryostat has sorted TPCs.
The data type to uniquely identify a TPC.
Point_t GetActiveVolumeCenter() const
Returns the center of the TPC active volume in world coordinates [cm].
double ActiveLength() const
Length (associated with z coordinate) of active TPC volume [cm].
double HalfHeight() const
Height is associated with y coordinate [cm].
constexpr Vector Zaxis()
Returns a z axis vector of the specified type.
std::string TPCInfo(std::string indent="", unsigned int verbosity=1) const
Returns a string with information about this TPC.
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
TGeoVolume * fActiveVolume
Active volume of LAr, called volTPCActive in GDML file.
double DriftDistance() const
Drift distance is defined as the distance between the anode and the cathode, in centimeters.
void SetBoundaries(Coord_t x_min, Coord_t x_max, Coord_t y_min, Coord_t y_max, Coord_t z_min, Coord_t z_max)
Sets the boundaries in world coordinates as specified.
Vector_t fWidthDir
Direction width refers to.
std::tuple< double, double, const reco::ClusterHit3D * > Point
Definitions used by the VoronoiDiagram algorithm.
LocalTransformation_t fTrans
TPC-to-world transformation.
Vector_t fHeightDir
Direction height refers to.
Vector_t fLengthDir
Direction length refers to.
Point_t fActiveCenter
Center of the active volume, in world coordinates [cm].
Point3DBase_t< TPCGeoCoordinatesTag > LocalPoint_t
Type of points in the local GDML TPC frame.
Point_t GetFrontFaceCenter() const
Returns the center of the active TPC volume side facing negative z.
double fHalfHeight
Half height of total volume.
double HalfWidth() const
Width is associated with x coordinate [cm].
ROOT::Math::Transform3D TransformationMatrix
Type of transformation matrix used in geometry.
cet::coded_exception< error, detail::translate > exception
Encapsulate the construction of a single detector plane .
double fActiveHalfHeight
Half height of active volume.