All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
OpDetPulse.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 //
3 // Waveform for one PMT
4 //
5 // Ben Jones and Christie Chiu, June 2012
6 // bjpjones@mit.edu, cschiu@mit.edu
7 //
8 ////////////////////////////////////////////////////////////////////////
9 
10 #ifndef RAWDATA_OPDETPULSE_H
11 #define RAWDATA_OPDETPULSE_H
12 
13 #include <vector>
14 
15 ///Raw data description
16 namespace raw {
17 
18  class OpDetPulse {
19 
20  public:
21  OpDetPulse(); // Default constructor
22 
23  private:
24 
25  unsigned short fOpChannel; ///< channel in the readout
26  // for c2: fSamples is not used
27  //unsigned short fSamples; ///< number of ticks of the clock
28  unsigned int fPMTFrame; ///< frame number where pulse begins
29  unsigned int fFirstSample; ///< first sample number within pmt frame
30 
31  std::vector<short> fWaveform;
32 
33 
34  public:
35 
36  OpDetPulse(unsigned short OpChannel,
37  std::vector<short> Waveform,
38  unsigned int PMTFrame,
39  unsigned int FirstSample);
40 
41  OpDetPulse(unsigned short OpChannel);
42 
43  int Integral(unsigned short startbin=0,
44  unsigned short endbin=0);
45 
46  const std::vector<short>& Waveform() const;
47  std::vector<short>& Waveform() ;
48  unsigned short OpChannel() const;
49  unsigned short Samples() const;
50  unsigned int PMTFrame() const;
51  unsigned int FirstSample() const;
52 
53  void SetPMTFrame( unsigned int Frame );
54  void SetFirstSample( unsigned int FirstSample );
55 
56  };
57 }
58 
59 inline const std::vector<short>& raw::OpDetPulse::Waveform() const { return fWaveform; }
60 inline std::vector<short>& raw::OpDetPulse::Waveform() { return fWaveform; }
61 inline unsigned short raw::OpDetPulse::OpChannel() const { return fOpChannel; }
62 inline unsigned short raw::OpDetPulse::Samples() const { return fWaveform.size(); }
63 inline unsigned int raw::OpDetPulse::PMTFrame() const { return fPMTFrame; }
64 inline unsigned int raw::OpDetPulse::FirstSample() const { return fFirstSample; }
65 inline void raw::OpDetPulse::SetPMTFrame(unsigned int Frame) { fPMTFrame=Frame; }
66 inline void raw::OpDetPulse::SetFirstSample(unsigned int FirstSample) { fFirstSample = FirstSample; }
67 
68 
69 
70 #endif // RAWDATA_OPDETPULSE_H
71 
72 ////////////////////////////////////////////////////////////////////////
unsigned short OpChannel() const
Definition: OpDetPulse.h:61
std::vector< short > fWaveform
Definition: OpDetPulse.h:31
const std::vector< short > & Waveform() const
Definition: OpDetPulse.h:59
unsigned int fFirstSample
first sample number within pmt frame
Definition: OpDetPulse.h:29
unsigned int FirstSample() const
Definition: OpDetPulse.h:64
unsigned short Samples() const
Definition: OpDetPulse.h:62
unsigned int fPMTFrame
frame number where pulse begins
Definition: OpDetPulse.h:28
void SetPMTFrame(unsigned int Frame)
Definition: OpDetPulse.h:65
int Integral(unsigned short startbin=0, unsigned short endbin=0)
Definition: OpDetPulse.cxx:48
unsigned short fOpChannel
channel in the readout
Definition: OpDetPulse.h:25
void SetFirstSample(unsigned int FirstSample)
Definition: OpDetPulse.h:66
unsigned int PMTFrame() const
Definition: OpDetPulse.h:63