All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
OpFlash.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////////
2 //
3 // \brief Definition of OpFlash object for LArSoft
4 //
5 // \author bjpjones@mit.edu
6 // cschiu@mit.edu
7 //
8 ////////////////////////////////////////////////////////////////////////////
9 #ifndef OPFLASH_H
10 #define OPFLASH_H
11 
12 #include <vector>
13 #include <limits> // std::numeric_limits<>
14 
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:
22 
23  /// Special value used for absence of center location information.
24  static constexpr double NoCenter = std::numeric_limits<double>::max();
25 
26  OpFlash() = default;
27 
28 private:
29 
30  double fTime { 0.0 }; ///< Time on @ref DetectorClocksHardwareTrigger "trigger time scale" [us]
31  double fTimeWidth; ///< Width of the flash in time [us]
32  double fAbsTime; ///< Time by PMT readout clock
33  unsigned int fFrame; ///< Frame number
34  std::vector< double > fPEperOpDet; ///< Number of PE on each PMT
35  std::vector< double > fWireCenters; ///< Geometric center in each view
36  std::vector< double > fWireWidths; ///< Geometric width in each view
37  double fXCenter { NoCenter }; ///< Estimated center in x [cm]
38  double fXWidth { NoCenter }; ///< Estimated width in x [cm]
39  double fYCenter; ///< Geometric center in y [cm]
40  double fYWidth; ///< Geometric width in y [cm]
41  double fZCenter; ///< Geometric center in z [cm]
42  double fZWidth; ///< Geometric width in z [cm]
43  double fFastToTotal; ///< Fast to total light ratio
44  bool fInBeamFrame; ///< Is this in the beam frame?
45  int fOnBeamTime; ///< Is this in time with beam?
46 
47 
48 
49 
50  public:
51  /// Constructor: all data members directly initialized.
52  OpFlash(double time, double timewidth, double abstime, unsigned int frame,
53  std::vector< double > PEperOpDet,
54  bool InBeamFrame, int OnBeamTime, double FastToTotal,
55  double xCenter, double xWidth,
56  double yCenter, double yWidth,
57  double zCenter, double zWidth,
58  std::vector<double> WireCenters = std::vector<double>(0),
59  std::vector<double> WireWidths = std::vector<double>(0));
60 
61  /// Constructor: all data members directly initialized except x coordinate.
62  OpFlash(double time, double timewidth, double abstime, unsigned int frame,
63  std::vector< double > PEperOpDet,
64  bool InBeamFrame=0, int OnBeamTime=0, double FastToTotal=1,
65  double yCenter=0, double yWidth=0,
66  double zCenter=0, double zWidth=0,
67  std::vector<double> WireCenters = std::vector<double>(0),
68  std::vector<double> WireWidths = std::vector<double>(0));
69 
70  // Get Methods
71  double Time() const;
72  double TimeWidth() const;
73  double AbsTime() const;
74  unsigned int Frame() const;
75  double PE(unsigned int i) const;
76 
77  /// Returns a vector with a number of photoelectrons per channel.
78  std::vector<double> const& PEs() const;
79 
80  /// Returns whether the estimated center on _x_ direction is available.
81  bool hasXCenter() const;
82 
83  /// Returns the estimated center on _x_ direction (@see `hasXCenter()`).
84  double XCenter() const;
85  double XWidth() const;
86  double YCenter() const;
87  double YWidth() const;
88  double ZCenter() const;
89  double ZWidth() const;
90 
91  bool InBeamFrame() const;
92  int OnBeamTime() const;
93 
94  std::vector<double> const& WireCenters() const;
95  std::vector<double> const& WireWidths() const;
96 
97  double TotalPE() const;
98  double FastToTotal() const;
99 
100 
101  };
102 
103 }
104 
105 
106 inline double recob::OpFlash::Time() const { return fTime; }
107 inline double recob::OpFlash::TimeWidth() const { return fTimeWidth; }
108 inline double recob::OpFlash::AbsTime() const { return fAbsTime; }
109 inline unsigned int recob::OpFlash::Frame() const { return fFrame; }
110 inline double recob::OpFlash::PE(unsigned int i) const { return fPEperOpDet[i]; }
111 inline std::vector<double> const& recob::OpFlash::PEs() const { return fPEperOpDet; }
112 inline bool recob::OpFlash::hasXCenter() const { return fXCenter != NoCenter; }
113 inline double recob::OpFlash::XCenter() const { return fXCenter; }
114 inline double recob::OpFlash::XWidth() const { return fXWidth; }
115 inline double recob::OpFlash::YCenter() const { return fYCenter; }
116 inline double recob::OpFlash::YWidth() const { return fYWidth; }
117 inline double recob::OpFlash::ZCenter() const { return fZCenter; }
118 inline double recob::OpFlash::ZWidth() const { return fZWidth; }
119 inline double recob::OpFlash::FastToTotal() const { return fFastToTotal; }
120 inline std::vector<double> const& recob::OpFlash::WireCenters() const { return fWireCenters; }
121 inline std::vector<double> const& recob::OpFlash::WireWidths() const { return fWireWidths; }
122 inline bool recob::OpFlash::InBeamFrame() const { return fInBeamFrame; }
123 inline int recob::OpFlash::OnBeamTime() const { return fOnBeamTime; }
124 
125 namespace recob{
127  bool operator() (recob::OpFlash const& i, recob::OpFlash const& j) const
128  { return i.Time() < j.Time(); }
129  };
130 }
131 
132 
133 #endif
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 XWidth() const
Definition: OpFlash.h:114
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
double fTime
Time on trigger time scale [us].
Definition: OpFlash.h:30
double FastToTotal() const
Definition: OpFlash.h:119
double TimeWidth() const
Definition: OpFlash.h:107
double fZCenter
Geometric center in z [cm].
Definition: OpFlash.h:41
double PE(unsigned int i) const
Definition: OpFlash.h:110
double fXWidth
Estimated width in x [cm].
Definition: OpFlash.h:38
double fZWidth
Geometric width in z [cm].
Definition: OpFlash.h:42
bool hasXCenter() const
Returns whether the estimated center on x direction is available.
Definition: OpFlash.h:112
double ZCenter() const
Definition: OpFlash.h:117
double Time() const
Definition: OpFlash.h:106
double fYWidth
Geometric width in y [cm].
Definition: OpFlash.h:40
int OnBeamTime() const
Definition: OpFlash.h:123
unsigned int fFrame
Frame number.
Definition: OpFlash.h:33
unsigned int Frame() const
Definition: OpFlash.h:109
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
double YWidth() const
Definition: OpFlash.h:116
std::vector< double > const & PEs() const
Returns a vector with a number of photoelectrons per channel.
Definition: OpFlash.h:111
bool fInBeamFrame
Is this in the beam frame?
Definition: OpFlash.h:44
double TotalPE() const
Definition: OpFlash.cxx:68
double XCenter() const
Returns the estimated center on x direction (.
Definition: OpFlash.h:113
OpFlash()=default
double YCenter() const
Definition: OpFlash.h:115
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 AbsTime() const
Definition: OpFlash.h:108
double fTimeWidth
Width of the flash in time [us].
Definition: OpFlash.h:31
double ZWidth() const
Definition: OpFlash.h:118
bool InBeamFrame() const
Definition: OpFlash.h:122