All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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) }
31  , fWireCenters { std::move(WireCenters) }
32  , fWireWidths { std::move(WireWidths) }
33  , fXCenter { xCenter }
34  , fXWidth { xWidth }
35  , fYCenter { yCenter }
36  , fYWidth { yWidth }
37  , fZCenter { zCenter }
38  , fZWidth { zWidth }
39  , fFastToTotal { FastToTotal }
40  , fInBeamFrame { InBeamFrame }
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
static constexpr double NoCenter
Special value used for absence of center location information.
Definition: OpFlash.h:24
double FastToTotal() const
Definition: OpFlash.h:119
bool operator<(Cluster const &a, Cluster const &b)
Definition: Cluster.cxx:196
process_name gaushit a
double Time() const
Definition: OpFlash.h:106
double TotalPE() const
Definition: OpFlash.cxx:68
OpFlash()=default
bool InBeamFrame() const
Definition: OpFlash.h:122