RawBeamline.cxx
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////////
2 /// \file RawBeamline.cxx
3 /// \brief Raw data definitions for beamline data used in NOvA
4 /// test beam experiment.
5 /// \author Mike Wallbank (University of Cincinnati) <wallbank@fnal.gov>
6 /// \date October 2018
7 ////////////////////////////////////////////////////////////////////////////
8 
9 #include "RawData/RawBeamline.h"
10 
11 // -----------------------------------------------------------------------
12 // RawBeamlineTrigger
13 // -----------------------------------------------------------------------
15 }
16 
17 // -----------------------------------------------------------------------
19  fBeamlineRun = run;
20  return;
21 }
22 
23 // -----------------------------------------------------------------------
25  fBField = b_field;
26  return;
27 }
28 
29 // -----------------------------------------------------------------------
31  return fBeamlineRun;
32 }
33 
34 // -----------------------------------------------------------------------
36  return fBField;
37 }
38 
39 // -----------------------------------------------------------------------
40 // RawBeamlineTrigger
41 // -----------------------------------------------------------------------
43 }
44 
45 // -----------------------------------------------------------------------
47  unsigned int number) {
48  fDetectorID = detector;
49  fNumber = number;
50 }
51 
52 // -----------------------------------------------------------------------
54  fDetectorID = detector;
55 }
56 
57 // -----------------------------------------------------------------------
59  fTimestamp = timestamp;
60  return;
61 }
62 
63 // -----------------------------------------------------------------------
65  fPattern = pattern;
66  return;
67 }
68 
69 // -----------------------------------------------------------------------
71  fTDUTime = tduTime;
72  return;
73 }
74 
75 // -----------------------------------------------------------------------
77  fTriggerCondition = trig_condition;
78  return;
79 }
80 
81 // -----------------------------------------------------------------------
83  return fNumber;
84 }
85 
86 // -----------------------------------------------------------------------
88  return fDetectorID;
89 }
90 
91 // -----------------------------------------------------------------------
93  return fTimestamp;
94 }
95 
96 // -----------------------------------------------------------------------
98  return fPattern;
99 }
100 
101 // -----------------------------------------------------------------------
103  return fTDUTime;
104 }
105 
106 // -----------------------------------------------------------------------
108  return fTriggerCondition;
109 }
110 
111 // -----------------------------------------------------------------------
112 // RawBeamlineDigit
113 // -----------------------------------------------------------------------
115 }
116 
117 // -----------------------------------------------------------------------
119  fChannelID = channel;
120 }
121 
122 // -----------------------------------------------------------------------
124  return fChannelID;
125 }
126 
127 // -----------------------------------------------------------------------
129  return fTimestamp;
130 }
131 
132 // -----------------------------------------------------------------------
133 unsigned int rawdata::RawBeamlineDigit::NADC() const {
134  return fADCs.size();
135 }
136 
137 // -----------------------------------------------------------------------
138 uint16_t rawdata::RawBeamlineDigit::ADC(unsigned int sample) const {
139  if (sample >= this->NADC()) {
140  std::cout << "Sample index " << sample << " out of range (ADCs.size() == " << this->NADC() << "). "
141  << "Aborting..." << std::endl;
142  abort();
143  }
144  return fADCs.at(sample);
145 }
146 
147 // -----------------------------------------------------------------------
148 std::vector<uint16_t> rawdata::RawBeamlineDigit::ADCs() const {
149  return fADCs;
150 }
151 
152 // -----------------------------------------------------------------------
154  fChannelID = channel;
155 }
156 
157 // -----------------------------------------------------------------------
159  fTimestamp = timestamp;
160 }
161 
162 // -----------------------------------------------------------------------
163 void rawdata::RawBeamlineDigit::SetWaveform(std::vector<uint16_t> waveform) {
164  fADCs = waveform;
165 }
166 
167 // -----------------------------------------------------------------------
168 // RawBeamlineWC
169 // -----------------------------------------------------------------------
171 }
172 
173 // -----------------------------------------------------------------------
175  fDetectorID = detector;
176 }
177 
178 // -----------------------------------------------------------------------
180  return fDetectorID;
181 }
182 
183 // -----------------------------------------------------------------------
185  return fTimestamp;
186 }
187 
188 // -----------------------------------------------------------------------
189 std::vector<rawdata::RawBeamlineWC::WCPulse> rawdata::RawBeamlineWC::XPulses() const {
190  return fXPulses;
191 }
192 
193 // -----------------------------------------------------------------------
194 std::vector<rawdata::RawBeamlineWC::WCPulse> rawdata::RawBeamlineWC::YPulses() const {
195  return fYPulses;
196 }
197 
198 // -----------------------------------------------------------------------
200  fXPulses.push_back(pulse);
201  return;
202 }
203 
204 // -----------------------------------------------------------------------
206  fYPulses.push_back(pulse);
207  return;
208 }
209 
210 // -----------------------------------------------------------------------
212  fDetectorID = detector;
213  return;
214 }
215 
216 // -----------------------------------------------------------------------
218  fTimestamp = timestamp;
219  return;
220 }
std::vector< WCPulse > YPulses() const
beamlinegeo::DetectorID DetectorID() const
Definition: RawBeamline.cxx:87
void SetBeamlineRun(unsigned int run)
Definition: RawBeamline.cxx:18
unsigned int TriggerNumber() const
Definition: RawBeamline.cxx:82
void SetTDUTime(uint64_t tduTime)
Definition: RawBeamline.cxx:70
uint32_t Pattern() const
Definition: RawBeamline.cxx:97
uint32_t Timestamp() const
unsigned int BeamlineRun() const
Definition: RawBeamline.cxx:30
uint64_t Timestamp() const
std::vector< WCPulse > XPulses() const
std::vector< uint16_t > ADCs() const
unsigned int NADC() const
void SetWaveform(std::vector< uint16_t > waveform)
void SetChannelID(beamlinegeo::ChannelID channel)
void SetTimestamp(uint32_t timestamp)
void SetTimestamp(uint64_t timestamp)
std::string TriggerCondition() const
uint64_t Timestamp() const
Definition: RawBeamline.cxx:92
void SetBField(float b_field)
Definition: RawBeamline.cxx:24
uint64_t TDUTime() const
void SetTriggerCondition(std::string trig_condition)
Definition: RawBeamline.cxx:76
void SetDetectorID(beamlinegeo::DetectorID detector)
Definition: RawBeamline.cxx:53
Definition: run.py:1
void AddXPulse(WCPulse pulse)
OStream cout
Definition: OStream.cxx:6
void AddYPulse(WCPulse pulse)
void SetPattern(uint32_t pattern)
Definition: RawBeamline.cxx:64
beamlinegeo::ChannelID ChannelID() const
void SetDetectorID(beamlinegeo::DetectorID detector)
Raw data definitions for beamline data used in NOvA test beam experiment.
void SetTimestamp(uint64_t timestamp)
Definition: RawBeamline.cxx:58
beamlinegeo::DetectorID DetectorID() const
uint16_t ADC(unsigned int sample) const
enum BeamMode string