LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
APAGeometryAlg.h
Go to the documentation of this file.
1 // \file APAGeometryAlg.h
3 // tylerdalion@gmail.com
5 #ifndef APAGeometryALG_H
6 #define APAGeometryALG_H
7 
8 #include <stdint.h>
9 #include <vector>
10 
11 #include "TVector3.h"
12 
16 
17 namespace fhicl {
18  class ParameterSet;
19 }
20 
21 namespace apa {
22 
23  // each APA has 4 separate views
24  typedef enum _apa_plane_proj {
25  kU,
26  kV,
27  kZ0,
28  kZ1,
30  } APAView_t;
31 
32  //---------------------------------------------------------------
34  public:
37 
38  void reconfigure(fhicl::ParameterSet const& p);
39 
40  void Init();
41 
42  bool APAChannelsIntersect(uint32_t chan1,
43  uint32_t chan2,
44  std::vector<geo::WireIDIntersection>& IntersectVector) const;
46 
47  bool LineSegChanIntersect(TVector3 xyzStart,
48  TVector3 xyzEnd,
49  uint32_t chan,
50  std::vector<geo::WireID>& widsCrossed,
51  bool ExtendLine) const;
53 
54  std::vector<geo::WireID> ChanSegsPerSide(uint32_t chan, unsigned int side) const;
55  std::vector<geo::WireID> ChanSegsPerSide(std::vector<geo::WireID> wids,
56  unsigned int side) const;
57 
58  std::vector<double> ThreeChanPos(uint32_t u, uint32_t v, uint32_t z) const;
60 
61  geo::WireID NearestWireIDOnChan(const double WorldLoc[3],
62  uint32_t chan,
63  unsigned int const plane,
64  unsigned int const tpc = 0,
65  unsigned int const cstat = 0) const;
66 
67  unsigned int ChannelToAPA(
68  uint32_t chan) const;
69  void ChannelToAPA(uint32_t chan, unsigned int& apa, unsigned int& cryo) const;
70  APAView_t APAView(uint32_t chan) const;
71  unsigned int ChannelsInView(geo::View_t geoview) const;
72  uint32_t FirstChannelInView(geo::View_t geoview, unsigned int apa, unsigned int cryo) const;
73  uint32_t FirstChannelInView(geo::View_t geoview, uint32_t chan) const;
74  uint32_t FirstChannelInView(uint32_t chan) const;
75  unsigned int ChannelsInAPAView(APAView_t apaview) const;
76  unsigned int ChannelsPerAPA() const { return fChannelsPerAPA; };
77 
78  private:
79  art::ServiceHandle<geo::Geometry const> fGeom; // handle to geometry service
80 
81  unsigned int fChannelsPerAPA;
82  unsigned int fAPAsPerCryo;
83 
84  // channel boundaries to avoid calling ChannelToWire repetitively
85  uint32_t fFirstU;
86  uint32_t fLastU;
87  uint32_t fFirstV;
88  uint32_t fLastV;
89  uint32_t fFirstZ0;
90  uint32_t fLastZ0;
91  uint32_t fFirstZ1;
92  uint32_t fLastZ1;
93 
94  double fChannelRange[2]; // for each induction view: U=0, V=1
95 
96  }; // class APAGeometryAlg
97 
98 } // namespace apa
99 
100 #endif // ifndef APAGeometryALG_H
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
Double_t z
Definition: plot.C:276
U view on both sides of the APA.
unsigned int fAPAsPerCryo
V view on both sides of the APA.
Z view on the larger-x side of the APA.
enum apa::_apa_plane_proj APAView_t
parameter set interface
_apa_plane_proj
unsigned int fChannelsPerAPA
All APAs have this same number of channels.
Definition of data types for geometry description.
Z view on the smaller-x side of the APA.
art::ServiceHandle< geo::Geometry const > fGeom
art framework interface to geometry description