LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
OpHit.cxx
Go to the documentation of this file.
1 //
3 // \brief Definition of OpHit reconstruction object
4 //
5 // \author bjpjones@mit.edu
6 // cschiu@mit.edu
7 //
9 
11 
12 #include <ostream>
13 
14 namespace recob {
15 
16  //----------------------------------------------------------------------
18  : fOpChannel(-1)
19  , fFrame(0)
20  , fPeakTime(0)
21  , fPeakTimeAbs(0)
22  , fStartTime(DefaultTime)
23  , fRiseTime(DefaultTime)
24  , fWidth(0)
25  , fArea(0)
26  , fAmplitude(0.)
27  , fPE(0.)
28  , fFastToTotal(0.)
29  {}
30 
31  //----------------------------------------------------------------------
32  OpHit::OpHit(int opchannel,
33  double peaktime,
34  double peaktimeabs,
35  double starttime,
36  double risetime,
37  unsigned short frame,
38  double width,
39  double area,
40  double amplitude,
41  double pe,
42  double fasttototal)
43  : fOpChannel(opchannel)
44  , fFrame(frame)
45  , fPeakTime(peaktime)
46  , fPeakTimeAbs(peaktimeabs)
47  , fStartTime(starttime)
48  , fRiseTime(risetime)
49  , fWidth(width)
50  , fArea(area)
51  , fAmplitude(amplitude)
52  , fPE(pe)
53  , fFastToTotal(fasttototal)
54  {}
55 
56  //----------------------------------------------------------------------
57  OpHit::OpHit(int opchannel,
58  double peaktime,
59  double peaktimeabs,
60  unsigned short frame,
61  double width,
62  double area,
63  double amplitude,
64  double pe,
65  double fasttototal)
66  : OpHit{opchannel,
67  peaktime,
68  peaktimeabs,
71  frame,
72  width,
73  area,
74  amplitude,
75  pe,
76  fasttototal}
77  {}
78 
79  //----------------------------------------------------------------------
80  bool operator<(const OpHit& a, const OpHit& b)
81  {
82  return a.PE() < b.PE();
83  }
84 
85  //----------------------------------------------------------------------
86  std::ostream& operator<<(std::ostream& out, OpHit const& hit)
87  {
88  // single line output
89 
90  out << "Hit on optical channel " << hit.OpChannel();
91  if (hit.HasStartTime()) out << " starting at " << hit.StartTime();
92  out << " us, peak at " << hit.PeakTime() << " us (absolute: " << hit.PeakTimeAbs() << " us)";
93  if (hit.RiseTime() != OpHit::DefaultTime) out << "; rise time: " << hit.RiseTime() << " us";
94  out << "; width " << hit.Width() << " us, amplitude " << hit.Amplitude() << " ADC#, integral "
95  << hit.Area() << " ADC#, " << hit.PE() << " photoelectrons";
96  if (hit.FastToTotal() > 0.0) out << "; fast fraction: " << hit.FastToTotal();
97 
98  return out;
99  }
100 
101  //----------------------------------------------------------------------
102 }
double FastToTotal() const
Definition: OpHit.h:126
Reconstruction base classes.
double fAmplitude
Definition: OpHit.h:34
double fFastToTotal
Definition: OpHit.h:36
double PeakTime() const
Definition: OpHit.h:94
double StartTime() const
Definition: OpHit.h:102
bool HasStartTime() const
Definition: OpHit.h:130
double fWidth
Definition: OpHit.h:32
unsigned short fFrame
Definition: OpHit.h:27
double fPeakTimeAbs
Definition: OpHit.h:29
double Width() const
Definition: OpHit.h:110
double Amplitude() const
Definition: OpHit.h:118
double fStartTime
Definition: OpHit.h:30
static constexpr double DefaultTime
Definition: OpHit.h:21
double PE() const
Definition: OpHit.h:122
Detector simulation of raw signals on wires.
int fOpChannel
Definition: OpHit.h:26
double fRiseTime
Definition: OpHit.h:31
friend bool operator<(const OpHit &a, const OpHit &b)
Definition: OpHit.cxx:80
double fPeakTime
Definition: OpHit.h:28
double PeakTimeAbs() const
Definition: OpHit.h:98
double Area() const
Definition: OpHit.h:114
double fPE
Definition: OpHit.h:35
int OpChannel() const
Definition: OpHit.h:86
double fArea
Definition: OpHit.h:33
std::ostream & operator<<(std::ostream &o, Cluster const &c)
Definition: Cluster.cxx:168
double RiseTime() const
Definition: OpHit.h:106