OpFlash.cxx
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 //
3 // \brief Definition of OpFlash reconstruction object
4 //
5 // \author bjpjones@mit.edu
6 // cschiu@mit.edu
7 //
8 ////////////////////////////////////////////////////////////////////////
9 
11 
12 #include <numeric> // std::accumulate()
13 #include <utility> // std::move()
14 
15 namespace recob{
16 
17  //----------------------------------------------------------------------
18  OpFlash::OpFlash(double time, double timewidth, double abstime, unsigned int frame,
19  std::vector<double> PEperOpDet,
20  bool InBeamFrame, int onBeamTime, double FastToTotal,
21  double xCenter, double xWidth,
22  double yCenter, double yWidth,
23  double zCenter, double zWidth,
24  std::vector<double> WireCenters,
25  std::vector<double> WireWidths)
26  : fTime { time }
27  , fTimeWidth { timewidth }
28  , fAbsTime { abstime }
29  , fFrame { frame }
30  , fPEperOpDet { std::move(PEperOpDet) }
33  , fXCenter { xCenter }
34  , fXWidth { xWidth }
35  , fYCenter { yCenter }
36  , fYWidth { yWidth }
37  , fZCenter { zCenter }
38  , fZWidth { zWidth }
41  , fOnBeamTime { onBeamTime }
42  {
43  }
44 
45  //----------------------------------------------------------------------
46  OpFlash::OpFlash(double time, double timewidth, double abstime, unsigned int frame,
47  std::vector<double> PEperOpDet,
48  bool InBeamFrame, int onBeamTime, double FastToTotal,
49  double yCenter, double yWidth,
50  double zCenter, double zWidth,
51  std::vector<double> WireCenters,
52  std::vector<double> WireWidths)
53  : OpFlash{
54  time, timewidth, abstime, frame,
55  std::move(PEperOpDet), InBeamFrame, onBeamTime, FastToTotal,
56  NoCenter, NoCenter, yCenter, yWidth, zCenter, zWidth,
57  std::move(WireCenters), std::move(WireWidths)
58  }
59  {}
60 
61  //----------------------------------------------------------------------
62  bool operator < (const OpFlash & a, const OpFlash & b)
63  {
64  return a.Time() < b.Time();
65  }
66 
67  //----------------------------------------------------------------------
68  double OpFlash::TotalPE() const
69  {
70  return std::accumulate(fPEperOpDet.begin(), fPEperOpDet.end(), 0.0);
71  }
72 
73 
74 
75 }
std::vector< double > fPEperOpDet
Number of PE on each PMT.
Definition: OpFlash.h:34
std::vector< double > const & WireCenters() const
Definition: OpFlash.h:120
double fYCenter
Geometric center in y [cm].
Definition: OpFlash.h:39
static constexpr double NoCenter
Special value used for absence of center location information.
Definition: OpFlash.h:24
Reconstruction base classes.
double FastToTotal() const
Definition: OpFlash.h:119
bool operator<(Cluster const &a, Cluster const &b)
Definition: Cluster.cxx:196
double fZCenter
Geometric center in z [cm].
Definition: OpFlash.h:41
double fXWidth
Estimated width in x [cm].
Definition: OpFlash.h:38
double fZWidth
Geometric width in z [cm].
Definition: OpFlash.h:42
double Time() const
Definition: OpFlash.h:106
double fYWidth
Geometric width in y [cm].
Definition: OpFlash.h:40
unsigned int fFrame
Frame number.
Definition: OpFlash.h:33
const double a
def move(depos, offset)
Definition: depos.py:107
double fFastToTotal
Fast to total light ratio.
Definition: OpFlash.h:43
double fAbsTime
Time by PMT readout clock.
Definition: OpFlash.h:32
double fXCenter
Estimated center in x [cm].
Definition: OpFlash.h:37
std::vector< double > const & WireWidths() const
Definition: OpFlash.h:121
std::vector< double > fWireWidths
Geometric width in each view.
Definition: OpFlash.h:36
bool fInBeamFrame
Is this in the beam frame?
Definition: OpFlash.h:44
static bool * b
Definition: config.cpp:1043
double TotalPE() const
Definition: OpFlash.cxx:68
OpFlash()=default
int fOnBeamTime
Is this in time with beam?
Definition: OpFlash.h:45
std::vector< double > fWireCenters
Geometric center in each view.
Definition: OpFlash.h:35
double fTimeWidth
Width of the flash in time [us].
Definition: OpFlash.h:31
bool InBeamFrame() const
Definition: OpFlash.h:122