LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
APAGeometryAlg.h
Go to the documentation of this file.
1 // \fileAPAGeometryAlg.h
3 // tylerdalion@gmail.com
5 #ifndef APAGeometryALG_H
6 #define APAGeometryALG_H
7 #include <vector>
8 #include <cmath>
9 #include <iostream>
10 #include <stdint.h>
11 
13 #include "fhiclcpp/ParameterSet.h"
16 
21 
22 #include "TMatrixD.h"
23 #include "TVectorD.h"
24 #include "TVector3.h"
25 
26 
27 
28 namespace apa{
29 
30  // each APA has 4 separate views
31  typedef enum _apa_plane_proj {
32  kU,
33  kV,
34  kZ0,
35  kZ1,
37  } APAView_t;
38 
39 
40  //---------------------------------------------------------------
42  public:
43 
44 
47  virtual ~APAGeometryAlg();
48 
49  void reconfigure(fhicl::ParameterSet const& p);
50 
51  void Init();
52 
53  bool APAChannelsIntersect( uint32_t chan1,
54  uint32_t chan2,
55  std::vector< geo::WireIDIntersection > & IntersectVector);
57 
58  bool LineSegChanIntersect( TVector3 xyzStart,
59  TVector3 xyzEnd,
60  uint32_t chan,
61  std::vector< geo::WireID >& widsCrossed,
62  bool ExtendLine );
64 
65  std::vector<geo::WireID> ChanSegsPerSide(uint32_t chan, unsigned int side);
66  std::vector<geo::WireID> ChanSegsPerSide(std::vector<geo::WireID> wids, unsigned int side);
67 
68  std::vector<double> ThreeChanPos( uint32_t u, uint32_t v, uint32_t z );
70 
71  geo::WireID NearestWireIDOnChan( const double WorldLoc[3],
72  uint32_t chan,
73  unsigned int const plane,
74  unsigned int const tpc=0,
75  unsigned int const cstat=0);
76 
77  unsigned int ChannelToAPA(uint32_t chan);
78  void ChannelToAPA( uint32_t chan,
79  unsigned int & apa,
80  unsigned int & cryo);
81  APAView_t APAView(uint32_t chan);
82  unsigned int ChannelsInView( geo::View_t geoview );
83  uint32_t FirstChannelInView( geo::View_t geoview,
84  unsigned int apa,
85  unsigned int cryo );
86  uint32_t FirstChannelInView( geo::View_t geoview,
87  uint32_t chan );
88  uint32_t FirstChannelInView( uint32_t chan );
89  unsigned int ChannelsInAPAView( APAView_t apaview );
90  unsigned int ChannelsPerAPA(){ return fChannelsPerAPA; };
91 
92 
93  private:
94 
95  art::ServiceHandle<geo::Geometry> fGeom; // handle to geometry service
96 
97  unsigned int fChannelsPerAPA;
98  unsigned int fAPAsPerCryo;
99 
100  // channel boundaries to avoid calling ChannelToWire repetitively
101  uint32_t fFirstU;
102  uint32_t fLastU;
103  uint32_t fFirstV;
104  uint32_t fLastV;
105  uint32_t fFirstZ0;
106  uint32_t fLastZ0;
107  uint32_t fFirstZ1;
108  uint32_t fLastZ1;
109 
110  double fChannelRange[2]; // for each induction view: U=0, V=1
111 
112  }; // class APAGeometryAlg
113 
114 } // namespace apa
115 
116 #endif // ifndef APAGeometryALG_H
bool APAChannelsIntersect(uint32_t chan1, uint32_t chan2, std::vector< geo::WireIDIntersection > &IntersectVector)
If the channels intersect, get all intersections.
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
void Init()
Initialize some chanel numbers to speed up other methods.
unsigned int ChannelToAPA(uint32_t chan)
Get number of the APA containing the given channel.
Declaration of signal hit object.
Double_t z
Definition: plot.C:279
art::ServiceHandle< geo::Geometry > fGeom
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
bool LineSegChanIntersect(TVector3 xyzStart, TVector3 xyzEnd, uint32_t chan, std::vector< geo::WireID > &widsCrossed, bool ExtendLine)
If a line given by start/end points intersects a channel.
uint32_t FirstChannelInView(geo::View_t geoview, unsigned int apa, unsigned int cryo)
_apa_plane_proj
APAView_t APAView(uint32_t chan)
Get which of the 4 APA views the channel is in.
std::vector< double > ThreeChanPos(uint32_t u, uint32_t v, uint32_t z)
Find the center of the 3 intersections, choose best if multiple.
std::vector< geo::WireID > ChanSegsPerSide(uint32_t chan, unsigned int side)
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.
unsigned int ChannelsInAPAView(APAView_t apaview)
unsigned int ChannelsInView(geo::View_t geoview)
unsigned int ChannelsPerAPA()
Declaration of basic channel signal object.
void reconfigure(fhicl::ParameterSet const &p)
art framework interface to geometry description
geo::WireID NearestWireIDOnChan(const double WorldLoc[3], uint32_t chan, unsigned int const plane, unsigned int const tpc=0, unsigned int const cstat=0)