LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
TPCGeo.h
Go to the documentation of this file.
1 #ifndef LARCOREALG_GEOMETRY_TPCGEO_H
9 #define LARCOREALG_GEOMETRY_TPCGEO_H
10 
11 // LArSoft libraries
17 #include "larcorealg/Geometry/geo_vectors_utils.h" // geo::vect
19 
20 // ROOT libraries
21 #include "TGeoVolume.h"
22 #include "TGeoMatrix.h"
23 #include "TVector3.h"
24 
25 // C/C++ standard library
26 #include <set>
27 #include <vector>
28 
29 
30 class TGeoNode;
31 
32 namespace geo {
33 
34  //......................................................................
37  class TPCGeo: public BoxBoundedGeo {
38 
39  using DefaultVector_t = TVector3; // ... not for long
40  using DefaultPoint_t = TVector3; // ... not for long
41 
42  public:
43 
45 
47 
61  struct TPCGeoCoordinatesTag {};
63 
66 
69 
71 
74 
77 
78 
79  // Construct a representation of a single plane of the detector
80  TPCGeo(GeoNodePath_t& path, size_t depth);
81 
82 
85 
87  double ActiveHalfWidth() const { return fActiveHalfWidth; }
89  double ActiveWidth() const { return 2.0 * ActiveHalfWidth(); }
91  double ActiveHalfHeight() const { return fActiveHalfHeight; }
93  double ActiveHeight() const { return 2.0 * ActiveHalfHeight(); }
95  double ActiveLength() const { return fActiveLength; }
97  double ActiveHalfLength() const { return fActiveLength / 2.0; }
99  double HalfWidth() const { return fHalfWidth; }
101  double Width() const { return 2.0 * HalfWidth(); }
103  double HalfHeight() const { return fHalfHeight; }
105  double Height() const { return 2.0 * HalfHeight(); }
107  double Length() const { return fLength; }
109  double HalfLength() const { return fLength / 2.0; }
110  double ActiveMass() const { return fActiveVolume->Weight(); }
111  const TGeoVolume* ActiveVolume() const { return fActiveVolume; }
112  const TGeoVolume* TotalVolume() const { return fTotalVolume; }
113 
115  template <typename Vector = DefaultVector_t>
116  decltype(auto) WidthDir() const { return geo::vect::convertTo<Vector>(fWidthDir); }
117 
119  template <typename Vector = DefaultVector_t>
120  decltype(auto) HeightDir() const { return geo::vect::convertTo<Vector>(fHeightDir); }
121 
123  template <typename Vector = DefaultVector_t>
124  decltype(auto) LengthDir() const { return geo::vect::convertTo<Vector>(fLengthDir); }
125 
128 
130  template <typename Vector = DefaultVector_t>
131  Vector DriftDir() const;
132 
135  double DriftDistance() const { return ComputeDriftDistance(); }
136 
138 
139 
142 
144  unsigned int Nplanes() const { return fPlanes.size(); }
146  unsigned int NElements() const { return fPlanes.size(); }
148 
150 
155  bool HasPlane(unsigned int iplane) const { return iplane < Nplanes(); }
156  bool HasElement(unsigned int iplane) const { return HasPlane(iplane); }
158 
160 
168  bool HasPlane(geo::PlaneID const& planeid) const
169  { return HasPlane(planeid.Plane); }
170  bool HasElement(geo::PlaneID const& planeid) const
171  { return HasPlane(planeid); }
173 
175  PlaneGeo const& Plane(geo::View_t view) const;
176 
177 
180  PlaneGeo const& Plane(unsigned int iplane) const;
181 
183 
192  const PlaneGeo& Plane(PlaneID const& planeid) const
193  { return Plane(planeid.Plane); }
194  const PlaneGeo& GetElement(PlaneID const& planeid) const
195  { return Plane(planeid); }
197 
203  PlaneGeo const* PlanePtr(unsigned int iplane) const
204  { return HasPlane(iplane)? &(fPlanes[iplane]): nullptr; }
205 
207 
215  PlaneGeo const* PlanePtr(PlaneID const& planeid) const
216  { return PlanePtr(planeid.Plane); }
217  PlaneGeo const* GetElementPtr(PlaneID const& planeid) const
218  { return PlanePtr(planeid); }
220 
222  geo::PlaneGeo const& SmallestPlane() const;
223 
225  geo::PlaneGeo const& FirstPlane() const { return fPlanes[0]; }
226 
228  geo::PlaneGeo const& LastPlane() const { return fPlanes[Nplanes() - 1]; }
229 
231  unsigned int MaxWires() const;
232 
234  std::set<geo::View_t> Views() const;
235 
237 
240 
242  template <typename Point = DefaultPoint_t>
243  Point GetCenter() const;
244 
246  template <typename Point = DefaultPoint_t>
248  { return geo::vect::convertTo<Point>(fActiveCenter); }
249 
252  template <typename Point = DefaultPoint_t>
254  { return geo::vect::convertTo<Point>(GetCathodeCenterImpl()); }
255 
257  template <typename Point = geo::Point_t>
259  { return geo::vect::convertTo<Point>(GetFrontFaceCenterImpl()); }
260 
263  { return *this; }
264 
267  { return fActiveBox; }
268 
269 
271  const double* PlaneLocation(unsigned int p) const;
272  double Plane0Pitch(unsigned int p) const;
273  double PlanePitch(unsigned int p1=0,
274  unsigned int p2=1) const;
275  double WirePitch(unsigned plane = 0) const;
276 
278  geo::TPCID const& ID() const { return fID; }
279 
281 
282 
297 
299  geo::PlaneGeo const& ReferencePlane() const { return FirstPlane(); }
300 
303  { return ReferencePlane().ID(); }
304 
315  template <typename Vector = DefaultPoint_t>
316  Vector RefWidthDir() const { return ReferencePlane().WidthDir<Vector>(); }
317 
328  template <typename Vector = DefaultPoint_t>
329  Vector RefDepthDir() const { return ReferencePlane().DepthDir<Vector>(); }
330 
331 
333 
343  double DistanceFromReferencePlane(geo::Point_t const& point) const
344  { return ReferencePlane().DistanceFromPlane(point); }
345  double DistanceFromReferencePlane(TVector3 const& point) const
348 
349 
351 
360  void DriftPoint(geo::Point_t& position, double distance) const
361  { ReferencePlane().DriftPoint(position, distance); }
362  void DriftPoint(TVector3& position, double distance) const
363  { ReferencePlane().DriftPoint(position, distance); }
365 
366 
368 
385  { return ReferencePlane().DecomposePointWidthDepth(point); }
386  DecomposedVector_t DecomposePoint(TVector3 const& point) const
387  { return DecomposePoint(geo::vect::toPoint(point)); }
389 
397  template <typename Point = DefaultPoint_t>
399  { return ReferencePlane().GetCenter<Point>(); }
400 
402 
416  { return ReferencePlane().PointWidthDepthProjection(point); }
418  { return Projection(point); }
419  Projection_t PointProjection(TVector3 const& point) const
420  { return Projection(geo::vect::toPoint(point)); }
422 
424 
439  { return Projection(v); }
440  Projection_t VectorProjection(TVector3 const& v) const
441  { return Projection(geo::vect::toVector(v)); }
443 
457  template <typename Point = DefaultPoint_t>
458  Point ComposePoint(DecomposedVector_t const& decomp) const
459  { return ReferencePlane().ComposePoint<Point>(decomp); }
460 
479  template <typename Point = DefaultPoint_t>
480  Point ComposePoint(double distance, Projection_t const& proj) const
481  { return ReferencePlane().ComposePoint<Point>(distance, proj); }
482 
484 
485 
488 
490  void LocalToWorld(const double* tpc, double* world) const
491  { fTrans.LocalToWorld(tpc, world); }
492 
494  TVector3 LocalToWorld(const TVector3& local) const
495  { return fTrans.LocalToWorld<TVector3>(local); }
496 
499  { return fTrans.toWorldCoords(local); }
500 
502  void LocalToWorldVect(const double* tpc, double* world) const
503  { fTrans.LocalToWorldVect(tpc, world); }
504 
506  TVector3 LocalToWorldVect(const TVector3& local) const
507  { return fTrans.LocalToWorldVect<TVector3>(local); }
508 
511  { return fTrans.toWorldCoords(local); }
512 
514  void WorldToLocal(const double* world, double* tpc) const
515  { fTrans.WorldToLocal(world, tpc); }
516 
518  TVector3 WorldToLocal(TVector3 const& world) const
519  { return fTrans.WorldToLocal<TVector3>(world); }
520 
523  { return fTrans.toLocalCoords(world); }
524 
526  void WorldToLocalVect(const double* world, double* tpc) const
527  { fTrans.WorldToLocalVect(world, tpc); }
528 
530  TVector3 WorldToLocalVect(TVector3 const& world) const
531  { return fTrans.WorldToLocalVect<TVector3>(world); }
532 
535  { return fTrans.toLocalCoords(world); }
536 
538 
539 
557  short int DetectDriftDirection() const;
558 
559 
560 
562  void SortSubVolumes(geo::GeoObjectSorter const& sorter);
563 
565  void UpdateAfterSorting(geo::TPCID tpcid);
566 
567 
590  template <typename Stream>
591  void PrintTPCInfo
592  (Stream&& out, std::string indent = "", unsigned int verbosity = 1) const;
593 
595  static constexpr unsigned int MaxVerbosity = 6;
596 
597 
609  static bool CoordinateContained
610  (double c, double min, double max, double wiggle = 1.)
611  {
612  return (c >= (min > 0? min / wiggle: min * wiggle))
613  && (c <= (max < 0? max / wiggle: max * wiggle));
614  } // CoordinateContained()
615 
616  static bool CoordinateContained
617  (double c, double const* range, double wiggle = 1.)
618  { return CoordinateContained(c, range[0], range[1], wiggle); }
619 
620 
621  private:
622 
623  void FindPlane(GeoNodePath_t& path, size_t depth);
624  void MakePlane(GeoNodePath_t& path, size_t depth);
625 
626  private:
629 
631 
632  std::vector<PlaneGeo> fPlanes;
633  TGeoVolume* fActiveVolume;
634  TGeoVolume* fTotalVolume;
636  std::vector<double> fPlane0Pitch;
637  std::vector< std::vector<double> > fPlaneLocation;
639 
642  double fActiveLength;
643  double fHalfWidth;
644  double fHalfHeight;
645  double fLength;
646 
651 
653 
655 
657  std::vector<geo::PlaneID::PlaneID_t> fViewToPlaneNumber;
658 
660  void ResetDriftDirection();
661 
664  double ComputeDriftDistance() const;
665 
667  void UpdatePlaneViewCache();
668 
670  void InitTPCBoundaries();
671 
673  void SortPlanes(std::vector<geo::PlaneGeo>&) const;
674 
677 
678  };
679 }
680 
681 
682 //------------------------------------------------------------------------------
683 //--- template implementation
684 //---
685 //------------------------------------------------------------------------------
686 template <typename Vector /* = DefaultVector_t */>
687 Vector geo::TPCGeo::DriftDir() const
688  { return geo::vect::convertTo<Vector>(fDriftDir); }
689 
690 
691 //------------------------------------------------------------------------------
692 template <typename Point /* = DefaultPoint_t */>
694 
695  // convert the origin (default constructed TVector)
696  return geo::vect::convertTo<Point>(toWorldCoords(LocalPoint_t{ 0.0, 0.0, 0.0 }));
697 
698 } // geo::TPCGeo::GetCenter()
699 
700 
701 //------------------------------------------------------------------------------
702 template <typename Stream>
704  Stream&& out,
705  std::string indent /* = "" */,
706  unsigned int verbosity /* = 1 */
707 ) const {
708 
709  //----------------------------------------------------------------------------
710  out << "TPC " << std::string(ID());
711 
712  if (verbosity-- <= 0) return; // 0
713 
714  //----------------------------------------------------------------------------
715  out
716  << " (" << Width() << " x " << Height() << " x " << Length() << ") cm^3 at "
717  << GetCenter<geo::Point_t>();
718 
719  if (verbosity-- <= 0) return; // 1
720 
721  //----------------------------------------------------------------------------
722 
723  out << "\n" << indent
724  << "drift direction " << DriftDir<geo::Vector_t>()
725  << " from cathode around " << GetCathodeCenter<geo::Point_t>()
726  << " through " << DriftDistance() << " cm toward "
727  << Nplanes() << " wire planes"
728  ;
729 
730  if (verbosity-- <= 0) return; // 2
731 
732  //----------------------------------------------------------------------------
733  out << "\n" << indent
734  << "maximum wires on any plane: " << MaxWires();
735 
736  if (verbosity-- <= 0) return; // 3
737 
738  //----------------------------------------------------------------------------
739  out << "\n" << indent
740  << "active volume ("
741  << ActiveWidth() << " x " << ActiveHeight() << " x " << ActiveLength()
742  << ") cm^3, front face at " << GetFrontFaceCenter<geo::Point_t>()
743  << " cm;"
744  << "\n" << indent << "main directions:"
745  << " width " << WidthDir<geo::Vector_t>()
746  << " height " << HeightDir<geo::Vector_t>()
747  << " length " << LengthDir<geo::Vector_t>()
748  ;
749 
750  if (verbosity-- <= 0) return; // 4
751 
752  //----------------------------------------------------------------------------
753  // print also the containing box
754  geo::BoxBoundedGeo const& box = BoundingBox();
755  out << "\n" << indent
756  << "bounding box: " << box.Min() << " -- " << box.Max();
757 
758 // if (verbosity-- <= 0) return; // 5
759 
760  //----------------------------------------------------------------------------
761  // print also the active box
762  geo::BoxBoundedGeo const& activeBox = ActiveBoundingBox();
763  out << "\n" << indent
764  << "active volume box: " << activeBox.Min() << " -- " << activeBox.Max();
765 
766 // if (verbosity-- <= 0) return; // 6
767 
768  //----------------------------------------------------------------------------
769 } // geo::TPCGeo::PrintTPCInfo()
770 
771 #endif // LARCOREALG_GEOMETRY_TPCGEO_H
772 
geo::TPCID const & ID() const
Returns the identifier of this TPC.
Definition: TPCGeo.h:278
void InitTPCBoundaries()
Recomputes the TPC boundary.
Definition: TPCGeo.cxx:495
double DistanceFromReferencePlane(TVector3 const &point) const
Returns the plane used for reference by projection methods.
Definition: TPCGeo.h:345
geo::Point_t GetCathodeCenterImpl() const
Definition: TPCGeo.cxx:361
PlaneGeo const * PlanePtr(PlaneID const &planeid) const
Returns the plane in planeid from this TPC.
Definition: TPCGeo.h:215
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Vector_t
Type for representation of momenta in 3D space.
Definition: geo_vectors.h:167
bool HasPlane(unsigned int iplane) const
Returns whether a plane with index iplane is present in this TPC.
Definition: TPCGeo.h:155
const PlaneGeo & Plane(PlaneID const &planeid) const
Returns the plane in planeid from this TPC.
Definition: TPCGeo.h:192
void DriftPoint(TVector3 &position, double distance) const
Shifts the position of an electron drifted by a distance.
Definition: TPCGeo.h:362
Vector DriftDir() const
Returns the direction of the drift (vector pointing toward the planes).
Definition: TPCGeo.h:687
geo::BoxBoundedGeo fActiveBox
Box of the active volume.
Definition: TPCGeo.h:652
std::vector< double > fPlane0Pitch
Pitch between planes.
Definition: TPCGeo.h:636
double PlanePitch(unsigned int p1=0, unsigned int p2=1) const
Returns the center of the TPC volume in world coordinates [cm].
Definition: TPCGeo.cxx:419
WidthDepthProjection_t VectorWidthDepthProjection(geo::Vector_t const &v) const
Returns the projection of the specified vector on the plane.
Definition: PlaneGeo.h:917
void PrintTPCInfo(Stream &&out, std::string indent="", unsigned int verbosity=1) const
Prints information about this TPC.
Definition: TPCGeo.h:703
Point GetActiveVolumeCenter() const
Returns the center of the TPC active volume in world coordinates [cm].
Definition: TPCGeo.h:247
void MakePlane(GeoNodePath_t &path, size_t depth)
Definition: TPCGeo.cxx:175
Point ComposePoint(double distance, Projection_t const &proj) const
Returns the 3D point from composition of projection and distance.
Definition: TPCGeo.h:480
void FindPlane(GeoNodePath_t &path, size_t depth)
Definition: TPCGeo.cxx:149
geo::Vector_t toWorldCoords(LocalVector_t const &local) const
Transform direction vector from local to world.
Definition: TPCGeo.h:510
double DistanceFromReferencePlane(geo::Point_t const &point) const
Returns the distance of the specified point from reference plane.
Definition: TPCGeo.h:343
Projection_t VectorProjection(geo::Vector_t const &v) const
Returns the projection of the specified vector on the plane.
Definition: TPCGeo.h:438
LocalVector_t toLocalCoords(geo::Vector_t const &world) const
Transform direction vector from world to local.
Definition: TPCGeo.h:534
decltype(auto) LengthDir() const
Returns the direction Length() is measured on.
Definition: TPCGeo.h:124
double fLength
Length of total volume.
Definition: TPCGeo.h:645
TPCGeo(GeoNodePath_t &path, size_t depth)
Definition: TPCGeo.cxx:38
geo::Point3DBase_t< TPCGeoCoordinatesTag > LocalPoint_t
Type of points in the local GDML TPC frame.
Definition: TPCGeo.h:65
Point ComposePoint(DecomposedVector_t const &decomp) const
Returns the 3D vector from composition of projection and distance.
Definition: TPCGeo.h:458
double ComputeDriftDistance() const
Definition: TPCGeo.cxx:481
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
double ActiveHalfHeight() const
Half height (associated with y coordinate) of active TPC volume [cm].
Definition: TPCGeo.h:91
const TGeoVolume * TotalVolume() const
Half width (associated with x coordinate) of active TPC volume [cm].
Definition: TPCGeo.h:112
unsigned int Nplanes() const
Number of planes in this tpc.
Definition: TPCGeo.h:145
double fActiveHalfWidth
Half width of active volume.
Definition: TPCGeo.h:640
Projection_t PointProjection(TVector3 const &point) const
Returns the projection of the specified point on the plane.
Definition: TPCGeo.h:419
Point GetCathodeCenter() const
Definition: TPCGeo.h:253
geo::Point_t GetFrontFaceCenterImpl() const
Definition: TPCGeo.cxx:405
The data type to uniquely identify a Plane.
Definition: geo_types.h:250
Geometry information for a single TPC.
Definition: TPCGeo.h:37
geo::PlaneGeo const & FirstPlane() const
Returns the first wire plane (the closest to TPC center).
Definition: TPCGeo.h:225
::geo::Point_t toPoint(Point const &p)
Convert the specified point into a geo::Point_t.
LocalPoint_t toLocalCoords(GlobalPoint_t const &world) const
Transforms a point from world frame to local frame.
geo::BoxBoundedGeo const & ActiveBoundingBox() const
Returns the box of the active volume of this TPC.
Definition: TPCGeo.h:266
Point ComposePoint(WireDecomposedVector_t const &decomp) const
Returns the 3D vector from composition of projection and distance.
Definition: PlaneGeo.h:818
::geo::Vector_t toVector(Vector const &v)
Convert the specified vector into a geo::Vector_t.
std::vector< geo::PlaneID::PlaneID_t > fViewToPlaneNumber
Index of the plane for each view (InvalidID if none).
Definition: TPCGeo.h:657
WidthDepthProjection_t PointWidthDepthProjection(geo::Point_t const &point) const
Returns the projection of the specified point on the plane.
Definition: PlaneGeo.h:897
std::vector< PlaneGeo > fPlanes
List of planes in this plane.
Definition: TPCGeo.h:632
Vector RefWidthDir() const
Return the direction of reference plane width.
Definition: TPCGeo.h:316
double ActiveMass() const
Half width (associated with x coordinate) of active TPC volume [cm].
Definition: TPCGeo.h:110
geo::Vector3DBase_t< TPCGeoCoordinatesTag > LocalVector_t
Type of displacement vectors in the local GDML TPC frame.
Definition: TPCGeo.h:68
void LocalToWorld(double const *local, double *world) const
Transforms a point from local frame to world frame.
double HalfLength() const
Length is associated with z coordinate [cm].
Definition: TPCGeo.h:109
void UpdateAfterSorting(geo::TPCID tpcid)
Performs all updates after cryostat has sorted TPCs.
Definition: TPCGeo.cxx:266
void LocalToWorldVect(double const *local, double *world) const
Transforms a vector from local frame to world frame.
TVector3 WorldToLocal(TVector3 const &world) const
Transform point from world frame to local TPC frame.
Definition: TPCGeo.h:518
static bool CoordinateContained(double c, double min, double max, double wiggle=1.)
Returns whether the specified coordinate is in a range.
Definition: TPCGeo.h:610
void SortSubVolumes(geo::GeoObjectSorter const &sorter)
Apply sorting to the PlaneGeo objects.
Definition: TPCGeo.cxx:226
geo::Vector_t fHeightDir
Direction height refers to.
Definition: TPCGeo.h:648
geo::Point_t toWorldCoords(LocalPoint_t const &local) const
Transform point from local TPC frame to world frame.
Definition: TPCGeo.h:498
geo::TPCID fID
ID of this TPC.
Definition: TPCGeo.h:654
double Width() const
Width is associated with x coordinate [cm].
Definition: TPCGeo.h:101
double Height() const
Height is associated with y coordinate [cm].
Definition: TPCGeo.h:105
TVector3 LocalToWorld(const TVector3 &local) const
Transform point from local TPC frame to world frame.
Definition: TPCGeo.h:494
void DriftPoint(geo::Point_t &position, double distance) const
Shifts the position of an electron drifted by a distance.
Definition: PlaneGeo.h:579
double Length() const
Length is associated with z coordinate [cm].
Definition: TPCGeo.h:107
Interface to algorithm class for sorting geo::XXXGeo objects.
Point ProjectionReferencePoint() const
Returns the reference point used by PointProjection().
Definition: TPCGeo.h:398
Projection_t Projection(geo::Vector_t const &v) const
Returns the projection of the specified vector on the plane.
Definition: TPCGeo.h:436
ROOT::Math::DisplacementVector2D< ROOT::Math::Cartesian2D< double >, WidthDepthReferenceTag > WidthDepthProjection_t
Definition: PlaneGeo.h:142
geo::Vector_t fWidthDir
Direction width refers to.
Definition: TPCGeo.h:647
Int_t max
Definition: plot.C:27
double ActiveHalfLength() const
Length (associated with z coordinate) of active TPC volume [cm].
Definition: TPCGeo.h:97
double fHalfWidth
Half width of total volume.
Definition: TPCGeo.h:643
Vector RefDepthDir() const
Return the direction of reference plane depth.
Definition: TPCGeo.h:329
WidthDepthDecomposer_t::DecomposedVector_t WDDecomposedVector_t
Definition: PlaneGeo.h:154
geo::PlaneGeo const & SmallestPlane() const
Returns the wire plane with the smallest surface.
Definition: TPCGeo.cxx:312
enum geo::driftdir DriftDirection_t
Drift direction: positive or negative.
Local-to-world transformations with LArSoft geometry vectors.
double fActiveLength
Length of active volume.
Definition: TPCGeo.h:642
std::tuple< double, double, const reco::ClusterHit3D * > Point
Definitions used by the VoronoiDiagram algorithm.
Definition: DCEL.h:34
geo::PlaneGeo::WDDecomposedVector_t DecomposedVector_t
Data structure with plane and drift projections of a 3D vector.
Definition: TPCGeo.h:76
double ActiveHalfWidth() const
Half width (associated with x coordinate) of active TPC volume [cm].
Definition: TPCGeo.h:87
void WorldToLocal(const double *world, double *tpc) const
Transform point from world frame to local TPC frame.
Definition: TPCGeo.h:514
Point GetCenter() const
Returns the centre of the wire plane in world coordinates [cm].
Definition: PlaneGeo.h:426
std::string indent(std::size_t const i)
Geometry information for a single wire plane.The plane is represented in the geometry by a solid whic...
Definition: PlaneGeo.h:78
Utilities to extend the interface of geometry vectors.
TVector3 DefaultPoint_t
Definition: TPCGeo.h:40
bool HasElement(geo::PlaneID const &planeid) const
Returns whether the plane in planeid is present in this TPC.
Definition: TPCGeo.h:170
geo::PlaneGeo::WidthDepthProjection_t Projection_t
Type of 2D vector projection on a plane.
Definition: TPCGeo.h:73
void UpdatePlaneViewCache()
Refills the plane vs. view cache of the TPC.
Definition: TPCGeo.cxx:520
bool HasPlane(geo::PlaneID const &planeid) const
Returns whether the plane in planeid is present in this TPC.
Definition: TPCGeo.h:168
bool HasElement(unsigned int iplane) const
Returns whether a plane with index iplane is present in this TPC.
Definition: TPCGeo.h:156
TGeoVolume * fTotalVolume
Total volume of TPC, called volTPC in GDML file.
Definition: TPCGeo.h:634
DriftDirection_t fDriftDirection
Direction of the electron drift in the TPC.
Definition: TPCGeo.h:635
const TGeoVolume * ActiveVolume() const
Half width (associated with x coordinate) of active TPC volume [cm].
Definition: TPCGeo.h:111
double WirePitch(unsigned plane=0) const
Returns the center of the TPC volume in world coordinates [cm].
Definition: TPCGeo.cxx:427
const PlaneGeo & GetElement(PlaneID const &planeid) const
Returns the plane in planeid from this TPC.
Definition: TPCGeo.h:194
double ActiveHeight() const
Height (associated with y coordinate) of active TPC volume [cm].
Definition: TPCGeo.h:93
geo::Point_t Min() const
Returns the corner point with the smallest coordinates.
The data type to uniquely identify a TPC.
Definition: geo_types.h:195
PlaneID_t Plane
Index of the plane within its TPC.
Definition: geo_types.h:258
TVector3 WorldToLocalVect(TVector3 const &world) const
Transform direction vector from world to local.
Definition: TPCGeo.h:530
unsigned int MaxWires() const
Returns the largest number of wires among the planes in this TPC.
Definition: TPCGeo.cxx:333
Definition of data types for geometry description.
double Plane0Pitch(unsigned int p) const
Returns the center of the TPC volume in world coordinates [cm].
Definition: TPCGeo.cxx:355
DriftDirection_t DriftDirection() const
Returns an enumerator value describing the drift direction.
Definition: TPCGeo.h:127
void SortPlanes(std::vector< geo::PlaneGeo > &) const
Sorts (in place) the specified PlaneGeo objects by drift distance.
Definition: TPCGeo.cxx:536
double ActiveLength() const
Length (associated with z coordinate) of active TPC volume [cm].
Definition: TPCGeo.h:95
Provides a base class aware of world box coordinates.
Projection_t Projection(geo::Point_t const &point) const
Returns the projection of the specified point on the plane.
Definition: TPCGeo.h:415
std::vector< std::vector< double > > fPlaneLocation
xyz locations of planes in the TPC.
Definition: TPCGeo.h:637
Encapsulate the geometry of a wire.
Tag for vectors in the "local" GDML coordinate frame of the TPC.
Definition: TPCGeo.h:62
geo::PlaneGeo const & ReferencePlane() const
Returns the plane used for reference by projection methods.
Definition: TPCGeo.h:299
double HalfHeight() const
Height is associated with y coordinate [cm].
Definition: TPCGeo.h:103
Vector DepthDir() const
Return the direction of plane depth.
Definition: PlaneGeo.h:219
DecomposedVector_t DecomposePoint(TVector3 const &point) const
Decomposes a 3D point in two components.
Definition: TPCGeo.h:386
Projection_t VectorProjection(TVector3 const &v) const
Returns the projection of the specified vector on the plane.
Definition: TPCGeo.h:440
void LocalToWorldVect(const double *tpc, double *world) const
Transform direction vector from local to world.
Definition: TPCGeo.h:502
TGeoVolume * fActiveVolume
Active volume of LAr, called volTPCActive in GDML file.
Definition: TPCGeo.h:633
double DriftDistance() const
Definition: TPCGeo.h:135
void WorldToLocal(double const *world, double *local) const
Transforms a point from world frame to local frame.
decltype(auto) HeightDir() const
Returns the direction Height() is measured on.
Definition: TPCGeo.h:120
A base class aware of world box coordinatesAn object describing a simple shape can inherit from this ...
Definition: BoxBoundedGeo.h:35
std::vector< TGeoNode const * > GeoNodePath_t
Definition: WireGeo.h:68
Encapsulate the construction of a single detector plane.
double DistanceFromPlane(geo::Point_t const &point) const
Returns the distance of the specified point from the wire plane.
Definition: PlaneGeo.h:557
PlaneGeo const * PlanePtr(unsigned int iplane) const
Returns the plane number iplane from this TPC.
Definition: TPCGeo.h:203
PlaneGeo const * GetElementPtr(PlaneID const &planeid) const
Returns the plane in planeid from this TPC.
Definition: TPCGeo.h:217
short int DetectDriftDirection() const
Returns the expected drift direction based on geometry.
Definition: TPCGeo.cxx:182
Int_t min
Definition: plot.C:26
Point GetFrontFaceCenter() const
Returns the center of the active TPC volume side facing negative z.
Definition: TPCGeo.h:258
double ActiveWidth() const
Width (associated with x coordinate) of active TPC volume [cm].
Definition: TPCGeo.h:89
geo::PlaneID const & ID() const
Returns the identifier of this plane.
Definition: PlaneGeo.h:190
geo::PlaneGeo const & LastPlane() const
Returns the last wire plane (the farther from TPC center).
Definition: TPCGeo.h:228
geo::Vector_t fLengthDir
Direction length refers to.
Definition: TPCGeo.h:649
Float_t proj
Definition: plot.C:34
geo::BoxBoundedGeo const & BoundingBox() const
Returns the bounding box of this TPC.
Definition: TPCGeo.h:262
unsigned int NElements() const
Number of planes in this tpc.
Definition: TPCGeo.h:146
LocalTransformation_t fTrans
TPC-to-world transformation.
Definition: TPCGeo.h:630
geo::WireGeo::GeoNodePath_t GeoNodePath_t
Definition: TPCGeo.h:44
void ResetDriftDirection()
Recomputes the drift direction; needs planes to have been initialised.
Definition: TPCGeo.cxx:433
DecomposedVector_t DecomposePoint(geo::Point_t const &point) const
Decomposes a 3D point in two components.
Definition: TPCGeo.h:384
void WorldToLocalVect(const double *world, double *tpc) const
Transform direction vector from world to local.
Definition: TPCGeo.h:526
Vector WidthDir() const
Return the direction of plane width.
Definition: PlaneGeo.h:207
WDDecomposedVector_t DecomposePointWidthDepth(geo::Point_t const &point) const
Decomposes a 3D point in two components.
Definition: PlaneGeo.h:878
geo::Vector_t fDriftDir
Direction electrons drift along.
Definition: TPCGeo.h:650
GenPoint3DBase_t< double, C > Point3DBase_t
Type of 3D point with representation in double precision.
Definition: geo_vectors.h:95
GenVector3DBase_t< double, C > Vector3DBase_t
Definition: geo_vectors.h:90
std::set< geo::View_t > Views() const
Returns a set of all views covered in this TPC.
Definition: TPCGeo.cxx:344
geo::PlaneID const & ReferencePlaneID() const
Returns the ID of the plane used for reference by projection methods.
Definition: TPCGeo.h:302
PlaneGeo const & Plane(geo::View_t view) const
Return the plane in the tpc with View_t view.
Definition: TPCGeo.cxx:299
GlobalPoint_t toWorldCoords(LocalPoint_t const &local) const
Transforms a point from local frame to world frame.
TVector3 DefaultVector_t
Definition: TPCGeo.h:39
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:187
static constexpr unsigned int MaxVerbosity
Maximum verbosity supported by PrintTPCInfo().
Definition: TPCGeo.h:595
Namespace collecting geometry-related classes utilities.
Projection_t PointProjection(geo::Point_t const &point) const
Returns the projection of the specified point on the plane.
Definition: TPCGeo.h:417
TVector3 LocalToWorldVect(const TVector3 &local) const
Transform direction vector from local to world.
Definition: TPCGeo.h:506
geo::Point_t fActiveCenter
Center of the active volume, in world coordinates [cm].
Definition: TPCGeo.h:638
void WorldToLocalVect(const double *world, double *local) const
Transforms a vector from world frame to local frame.
geo::Point_t Max() const
Returns the corner point with the largest coordinates.
void LocalToWorld(const double *tpc, double *world) const
Transform point from local TPC frame to world frame.
Definition: TPCGeo.h:490
LocalPoint_t toLocalCoords(geo::Point_t const &world) const
Transform point from world frame to local TPC frame.
Definition: TPCGeo.h:522
const double * PlaneLocation(unsigned int p) const
Returns the coordinates of the center of the specified plane [cm].
Definition: TPCGeo.cxx:413
double fHalfHeight
Half height of total volume.
Definition: TPCGeo.h:644
double HalfWidth() const
Width is associated with x coordinate [cm].
Definition: TPCGeo.h:99
decltype(auto) WidthDir() const
Returns the direction Width() is measured on.
Definition: TPCGeo.h:116
double fActiveHalfHeight
Half height of active volume.
Definition: TPCGeo.h:641
Point GetCenter() const
Returns the center of the TPC volume in world coordinates [cm].
Definition: TPCGeo.h:693
void DriftPoint(geo::Point_t &position, double distance) const
Shifts the position of an electron drifted by a distance.
Definition: TPCGeo.h:360