LArSoft  v10_04_05
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 
14 
15 namespace apa {
16 
17  // each APA has 4 separate views
18  enum APAView_t {
19  kU,
20  kV,
21  kZ0,
22  kZ1,
24  };
25 
26  //---------------------------------------------------------------
28  public:
30 
31  bool APAChannelsIntersect(uint32_t chan1,
32  uint32_t chan2,
33  std::vector<geo::WireIDIntersection>& IntersectVector) const;
35 
36  bool LineSegChanIntersect(geo::Point_t const& xyzStart,
37  geo::Point_t const& xyzEnd,
38  uint32_t chan,
39  std::vector<geo::WireID>& widsCrossed,
40  bool ExtendLine) const;
42 
43  std::vector<geo::WireID> ChanSegsPerSide(uint32_t chan, unsigned int side) const;
44  std::vector<geo::WireID> ChanSegsPerSide(std::vector<geo::WireID> wids,
45  unsigned int side) const;
46 
47  std::vector<double> ThreeChanPos(uint32_t u, uint32_t v, uint32_t z) const;
49 
51  uint32_t chan,
52  geo::PlaneID const& planeID) const;
53 
54  unsigned int ChannelToAPA(
55  uint32_t chan) const;
56  void ChannelToAPA(uint32_t chan, unsigned int& apa, unsigned int& cryo) const;
57  APAView_t APAView(uint32_t chan) const;
58  unsigned int ChannelsInView(geo::View_t geoview) const;
59  uint32_t FirstChannelInView(geo::View_t geoview, unsigned int apa, unsigned int cryo) const;
60  uint32_t FirstChannelInView(geo::View_t geoview, uint32_t chan) const;
61  uint32_t FirstChannelInView(uint32_t chan) const;
62  unsigned int ChannelsInAPAView(APAView_t apaview) const;
63  unsigned int ChannelsPerAPA() const { return fChannelsPerAPA; }
64 
65  private:
66  art::ServiceHandle<geo::Geometry const> fGeom; // handle to geometry service
68 
69  unsigned int fChannelsPerAPA;
70  unsigned int fAPAsPerCryo;
71 
72  // channel boundaries to avoid calling ChannelToWire repetitively
73  uint32_t fFirstU;
74  uint32_t fLastU;
75  uint32_t fFirstV;
76  uint32_t fLastV;
77  uint32_t fFirstZ0;
78  uint32_t fLastZ0;
79  uint32_t fFirstZ1;
80  uint32_t fLastZ1;
81 
82  double fChannelRange[2]; // for each induction view: U=0, V=1
83 
84  }; // class APAGeometryAlg
85 
86 } // namespace apa
87 
88 #endif // ifndef APAGeometryALG_H
Z view on the larger-x side of the APA.
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
Double_t z
Definition: plot.C:276
Z view on the smaller-x side of the APA.
The data type to uniquely identify a Plane.
Definition: geo_types.h:364
unsigned int ChannelsInAPAView(APAView_t apaview) const
uint32_t FirstChannelInView(geo::View_t geoview, unsigned int apa, unsigned int cryo) const
unsigned int fAPAsPerCryo
bool APAChannelsIntersect(uint32_t chan1, uint32_t chan2, std::vector< geo::WireIDIntersection > &IntersectVector) const
If the channels intersect, get all intersections.
APAView_t APAView(uint32_t chan) const
Get which of the 4 APA views the channel is in.
unsigned int ChannelToAPA(uint32_t chan) const
Get number of the APA containing the given channel.
unsigned int ChannelsPerAPA() const
bool LineSegChanIntersect(geo::Point_t const &xyzStart, geo::Point_t const &xyzEnd, uint32_t chan, std::vector< geo::WireID > &widsCrossed, bool ExtendLine) const
If a line given by start/end points intersects a channel.
Interface for a class providing readout channel mapping to geometry.
unsigned int ChannelsInView(geo::View_t geoview) const
U view on both sides of the APA.
unsigned int fChannelsPerAPA
All APAs have this same number of channels.
Definition of data types for geometry description.
V view on both sides of the APA.
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:180
art::ServiceHandle< geo::Geometry const > fGeom
geo::WireID NearestWireIDOnChan(geo::Point_t const &WorldLoc, uint32_t chan, geo::PlaneID const &planeID) const
std::vector< geo::WireID > ChanSegsPerSide(uint32_t chan, unsigned int side) const
geo::WireReadoutGeom const * fWireReadoutGeom
std::vector< double > ThreeChanPos(uint32_t u, uint32_t v, uint32_t z) const
Find the center of the 3 intersections, choose best if multiple.
art framework interface to geometry description