ChannelGeo.h
Go to the documentation of this file.
1 // ChannelGeo.h
2 //
3 // David Adams
4 // August 2018
5 //
6 // Return geometry info for a channel using the current
7 // geometry service.
8 
9 #ifndef ChannelGeo_H
10 #define ChannelGeo_H
11 
12 #include <utility>
13 #include <vector>
14 #include "TVector3.h"
15 
16 namespace geo {
17  class GeometryCore;
18 }
19 
20 class ChannelGeo {
21 
22 public:
23 
24  using Index = unsigned int;
25  using Point = TVector3;
26  using EndPoints = std::pair<Point, Point>;
27  using EndPointsVector = std::vector<EndPoints>;
28 
29  // Ctor from channel number and geometry service.
30  ChannelGeo(Index icha, const geo::GeometryCore* pgeo);
31 
32  // Ctor from channel number using the current geometry service.
33  ChannelGeo(Index icha);
34 
35  // Return the channel number.
36  Index channel() const { return m_icha; }
37 
38  // Is this a valid channel?
39  bool isValid() const { return m_valid; }
40 
41  // Return the number of wires (wire segments).
42  Index nWires() const { return m_ends.size(); }
43 
44  // Return the wire endpoints for this channel.
45  const EndPointsVector& wires() const { return m_ends; }
46 
47  // Return the top or bottom endpoint for this channel.
48  const Point& top() const { return m_top; }
49  const Point& bottom() const { return m_bot; }
50 
51 private:
52 
54  bool m_valid;
58 
59 };
60 
61 #endif
Index channel() const
Definition: ChannelGeo.h:36
Index m_icha
Definition: ChannelGeo.h:53
const EndPointsVector & wires() const
Definition: ChannelGeo.h:45
std::pair< Point, Point > EndPoints
Definition: ChannelGeo.h:26
EndPointsVector m_ends
Definition: ChannelGeo.h:55
const Point & bottom() const
Definition: ChannelGeo.h:49
Point m_bot
Definition: ChannelGeo.h:57
std::vector< EndPoints > EndPointsVector
Definition: ChannelGeo.h:27
Index nWires() const
Definition: ChannelGeo.h:42
Description of geometry of one entire detector.
Point m_top
Definition: ChannelGeo.h:56
bool m_valid
Definition: ChannelGeo.h:54
bool isValid() const
Definition: ChannelGeo.h:39
LArSoft geometry interface.
Definition: ChannelGeo.h:16
const Point & top() const
Definition: ChannelGeo.h:48
unsigned int Index
Definition: ChannelGeo.h:24