All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CathodeCrossingUtils.cxx
Go to the documentation of this file.
1 /**
2  * @file icaruscode/Analysis/trigger/details/CathodeCrossingUtils.cxx
3  * @brief Algorithms dealing with a trajectory and the cathode (implementation)
4  * @author Gianluca Petrillo (petrillo@slac.stanford.edu)
5  * @date July 27, 2022
6  * @see icaruscode/Analysis/trigger/details/CathodeCrossingUtils.h
7  */
8 
9 // library header
11 
12 // LArSoft libraries
16 #include "larcorealg/Geometry/geo_vectors_utils.h" // MiddlePointAccumulator...
17 
18 
19 // -----------------------------------------------------------------------------
21  (geo::Point_t const& point, geo::GeometryCore const& geom)
22 {
23  geo::CryostatGeo const* pCryo = geom.PositionToCryostatPtr(point);
24  if (!pCryo) return {}; // all invalid, goodbye
25 
26  return {
27  findCathodeCenter(*pCryo) // center
28  , -(pCryo->TPC(0).DriftDir<geo::Vector_t>()) // normal
29  };
30 
31 } // icarus::findTPCcathode()
32 
33 
34 // -----------------------------------------------------------------------------
35 double icarus::distance(geo::Point_t const& point, CathodeDesc_t const& cathode)
36  { return (point - cathode.center).Dot(cathode.normal); }
37 
38 
39 // -----------------------------------------------------------------------------
41 
42  // cathode position: assumes one cathode plane shared by all TPC
44 
45  for (geo::TPCGeo const& TPC: cryo.IterateTPCs())
46  cathodePos.add(TPC.GetCathodeCenter<geo::Point_t>());
47 
48  return cathodePos.middlePoint();
49 
50 } // icarus::findCathodeCenter()
51 
52 
53 // -----------------------------------------------------------------------------
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Vector_t
Type for representation of momenta in 3D space.
Definition: geo_vectors.h:164
Vector DriftDir() const
Returns the direction of the drift (vector pointing toward the planes).
Definition: TPCGeo.h:773
Encapsulate the construction of a single cyostat.
Helper class to compute the middle point in a point set.
Geometry information for a single TPC.
Definition: TPCGeo.h:38
ElementIteratorBox IterateTPCs() const
Returns an object suitable for iterating through all TPCs.
Definition: CryostatGeo.h:258
CathodeDesc_t findTPCcathode(geo::Point_t const &point, geo::GeometryCore const &geom)
Returns cathode information for cryostat at the specified point.
Geometry information for a single cryostat.
Definition: CryostatGeo.h:43
Algorithms dealing with a trajectory and the cathode.
BEGIN_PROLOG TPC
geo::Point_t findCathodeCenter(geo::CryostatGeo const &cryo)
Returns the center of the cathode in the specified cryostat.
void add(Point const &p)
Accumulates a point.
Access the description of detector geometry.
Simple description for the cathode.
double distance(geo::Point_t const &point, CathodeDesc_t const &cathode)
Returns the distance of a point from the cathode.
Utilities to extend the interface of geometry vectors.
Description of geometry of one entire detector.
geo::CryostatGeo const * PositionToCryostatPtr(geo::Point_t const &point) const
Returns the cryostat at specified location.
const TPCGeo & TPC(unsigned int itpc) const
Return the itpc&#39;th TPC in the cryostat.
Definition: CryostatGeo.cxx:93
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
Definition: geo_vectors.h:184
Encapsulate the construction of a single detector plane.