LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
OpFlash.h
Go to the documentation of this file.
1 //
3 // \brief Definition of OpFlash object for LArSoft
4 //
5 // \author bjpjones@mit.edu
6 // cschiu@mit.edu
7 //
9 #ifndef OPFLASH_H
10 #define OPFLASH_H
11 
12 #include <iosfwd> // std::ostream
13 #include <limits> // std::numeric_limits<>
14 #include <vector>
15 
16 namespace recob {
17 
18  // subevents are groupings of OpDet pulse peaks. Each peak comes from an OpDet and
19  // has a certain number of PE; each subevent has a time associated with it
20  class OpFlash {
21  public:
23  static constexpr double NoCenter = std::numeric_limits<double>::max();
24 
25  OpFlash() = default;
26 
27  private:
28  double fTime{0.0};
29  double fTimeWidth;
30  double fAbsTime;
31  unsigned int fFrame;
32  std::vector<double> fPEperOpDet;
33  std::vector<double> fWireCenters;
34  std::vector<double> fWireWidths;
35  double fXCenter{NoCenter};
36  double fXWidth{NoCenter};
37  double fYCenter;
38  double fYWidth;
39  double fZCenter;
40  double fZWidth;
41  double fFastToTotal;
42  bool fInBeamFrame;
44 
45  public:
47  OpFlash(double time,
48  double timewidth,
49  double abstime,
50  unsigned int frame,
51  std::vector<double> PEperOpDet,
52  bool InBeamFrame,
53  int OnBeamTime,
54  double FastToTotal,
55  double xCenter,
56  double xWidth,
57  double yCenter,
58  double yWidth,
59  double zCenter,
60  double zWidth,
61  std::vector<double> WireCenters = std::vector<double>(0),
62  std::vector<double> WireWidths = std::vector<double>(0));
63 
65  OpFlash(double time,
66  double timewidth,
67  double abstime,
68  unsigned int frame,
69  std::vector<double> PEperOpDet,
70  bool InBeamFrame = 0,
71  int OnBeamTime = 0,
72  double FastToTotal = 1,
73  double yCenter = 0,
74  double yWidth = 0,
75  double zCenter = 0,
76  double zWidth = 0,
77  std::vector<double> WireCenters = std::vector<double>(0),
78  std::vector<double> WireWidths = std::vector<double>(0));
79 
80  // Get Methods
81  double Time() const;
82  double TimeWidth() const;
83  double AbsTime() const;
84  unsigned int Frame() const;
85  double PE(unsigned int i) const;
86 
88  std::vector<double> const& PEs() const;
89 
91  bool hasXCenter() const;
92 
94  double XCenter() const;
95  double XWidth() const;
96  double YCenter() const;
97  double YWidth() const;
98  double ZCenter() const;
99  double ZWidth() const;
100 
101  bool InBeamFrame() const;
102  int OnBeamTime() const;
103 
104  std::vector<double> const& WireCenters() const;
105  std::vector<double> const& WireWidths() const;
106 
107  double TotalPE() const;
108  double FastToTotal() const;
109  };
110 
114  std::ostream& operator<<(std::ostream& out, OpFlash const& flash);
115 
116 }
117 
118 inline double recob::OpFlash::Time() const
119 {
120  return fTime;
121 }
122 inline double recob::OpFlash::TimeWidth() const
123 {
124  return fTimeWidth;
125 }
126 inline double recob::OpFlash::AbsTime() const
127 {
128  return fAbsTime;
129 }
130 inline unsigned int recob::OpFlash::Frame() const
131 {
132  return fFrame;
133 }
134 inline double recob::OpFlash::PE(unsigned int i) const
135 {
136  return fPEperOpDet[i];
137 }
138 inline std::vector<double> const& recob::OpFlash::PEs() const
139 {
140  return fPEperOpDet;
141 }
142 inline bool recob::OpFlash::hasXCenter() const
143 {
144  return fXCenter != NoCenter;
145 }
146 inline double recob::OpFlash::XCenter() const
147 {
148  return fXCenter;
149 }
150 inline double recob::OpFlash::XWidth() const
151 {
152  return fXWidth;
153 }
154 inline double recob::OpFlash::YCenter() const
155 {
156  return fYCenter;
157 }
158 inline double recob::OpFlash::YWidth() const
159 {
160  return fYWidth;
161 }
162 inline double recob::OpFlash::ZCenter() const
163 {
164  return fZCenter;
165 }
166 inline double recob::OpFlash::ZWidth() const
167 {
168  return fZWidth;
169 }
170 inline double recob::OpFlash::FastToTotal() const
171 {
172  return fFastToTotal;
173 }
174 inline std::vector<double> const& recob::OpFlash::WireCenters() const
175 {
176  return fWireCenters;
177 }
178 inline std::vector<double> const& recob::OpFlash::WireWidths() const
179 {
180  return fWireWidths;
181 }
182 inline bool recob::OpFlash::InBeamFrame() const
183 {
184  return fInBeamFrame;
185 }
186 inline int recob::OpFlash::OnBeamTime() const
187 {
188  return fOnBeamTime;
189 }
190 
191 namespace recob {
193  bool operator()(recob::OpFlash const& i, recob::OpFlash const& j) const
194  {
195  return i.Time() < j.Time();
196  }
197  };
198 }
199 
200 #endif
std::vector< double > const & WireCenters() const
Definition: OpFlash.h:174
double XWidth() const
Definition: OpFlash.h:150
double fYCenter
Geometric center in y [cm].
Definition: OpFlash.h:37
static constexpr double NoCenter
Special value used for absence of center location information.
Definition: OpFlash.h:23
double fTime
Time on trigger time scale [us].
Definition: OpFlash.h:28
Reconstruction base classes.
double FastToTotal() const
Definition: OpFlash.h:170
double TimeWidth() const
Definition: OpFlash.h:122
double fZCenter
Geometric center in z [cm].
Definition: OpFlash.h:39
std::vector< double > fPEperOpDet
Number of PE on each PMT.
Definition: OpFlash.h:32
double PE(unsigned int i) const
Definition: OpFlash.h:134
double fXWidth
Estimated width in x [cm].
Definition: OpFlash.h:36
double fZWidth
Geometric width in z [cm].
Definition: OpFlash.h:40
bool hasXCenter() const
Returns whether the estimated center on x direction is available.
Definition: OpFlash.h:142
double ZCenter() const
Definition: OpFlash.h:162
double Time() const
Definition: OpFlash.h:118
double fYWidth
Geometric width in y [cm].
Definition: OpFlash.h:38
int OnBeamTime() const
Definition: OpFlash.h:186
unsigned int fFrame
Frame number.
Definition: OpFlash.h:31
std::vector< double > fWireCenters
Geometric center in each view.
Definition: OpFlash.h:33
unsigned int Frame() const
Definition: OpFlash.h:130
std::vector< double > fWireWidths
Geometric width in each view.
Definition: OpFlash.h:34
double fFastToTotal
Fast to total light ratio.
Definition: OpFlash.h:41
double fAbsTime
Time by PMT readout clock.
Definition: OpFlash.h:30
double fXCenter
Estimated center in x [cm].
Definition: OpFlash.h:35
std::vector< double > const & WireWidths() const
Definition: OpFlash.h:178
double YWidth() const
Definition: OpFlash.h:158
std::vector< double > const & PEs() const
Returns a vector with a number of photoelectrons per channel.
Definition: OpFlash.h:138
bool operator()(recob::OpFlash const &i, recob::OpFlash const &j) const
Definition: OpFlash.h:193
bool fInBeamFrame
Is this in the beam frame?
Definition: OpFlash.h:42
double TotalPE() const
Definition: OpFlash.cxx:94
double XCenter() const
Returns the estimated center on x direction (.
Definition: OpFlash.h:146
OpFlash()=default
double YCenter() const
Definition: OpFlash.h:154
int fOnBeamTime
Is this in time with beam?
Definition: OpFlash.h:43
double AbsTime() const
Definition: OpFlash.h:126
double fTimeWidth
Width of the flash in time [us].
Definition: OpFlash.h:29
double ZWidth() const
Definition: OpFlash.h:166
std::ostream & operator<<(std::ostream &o, Cluster const &c)
Definition: Cluster.cxx:168
bool InBeamFrame() const
Definition: OpFlash.h:182