Hall C ROOT/C++ Analyzer (hcana)
Loading...
Searching...
No Matches
THcTrigRawHit.cxx
Go to the documentation of this file.
1
129// TODO: Check if signal matches plane.
130
131#include "THcTrigRawHit.h"
132
133#include <iostream>
134#include <string>
135#include <stdexcept>
136
137#include "TObject.h"
138#include "TString.h"
139
140
142 Int_t plane, Int_t counter
143) : THcRawHit(plane, counter), fAdcHits(), fTdcHits() {}
144
145
147 // Call base class assignment operator.
149
150 if (this != &right) {
151 for (Int_t iAdcSig=0; iAdcSig<fNAdcSignals; ++iAdcSig) {
152 fAdcHits[iAdcSig] = right.fAdcHits[iAdcSig];
153 }
154 for (Int_t iTdcSig=0; iTdcSig<fNTdcSignals; ++iTdcSig) {
155 fTdcHits[iTdcSig] = right.fTdcHits[iTdcSig];
156 }
157 }
158
159 return *this;
160}
161
162
164
165
167 THcRawHit::Clear(opt);
168
169 for (Int_t iAdcSig=0; iAdcSig<fNAdcSignals; ++iAdcSig) {
170 fAdcHits[iAdcSig].Clear();
171 }
172 for (Int_t iTdcSig=0; iTdcSig<fNTdcSignals; ++iTdcSig) {
173 fTdcHits[iTdcSig].Clear();
174 }
175}
176
177
179 if (0 <= signal && signal < fNAdcSignals) {
180 fAdcHits[signal].SetData(data);
181 }
182 else if (fNAdcSignals <= signal && signal < fNAdcSignals+fNTdcSignals) {
184 }
185 else {
186 throw std::out_of_range(
187 "`THcTrigRawHit::SetData`: only signals `0` and `1` available!"
188 );
189 }
190}
191
192
194 if (0 <= signal && signal < fNAdcSignals) {
195 fAdcHits[signal].SetSample(data);
196 }
197 else {
198 throw std::out_of_range(
199 "`THcTrigRawHit::SetSample`: only signal `0` available!"
200 );
201 }
202}
203
204
206 Int_t signal, Int_t data, Int_t time, Int_t pedestal, Int_t peak
207) {
208 if (0 <= signal && signal < fNAdcSignals) {
210 }
211 else {
212 throw std::out_of_range(
213 "`THcTrigRawHit::SetDataTimePedestalPeak`: only signal `0` available!"
214 );
215 }
216}
217
218
219void THcTrigRawHit::SetReference(Int_t signal, Int_t reference) {
220 if (signal < fNAdcSignals) {
221 fAdcHits[signal].SetRefTime(reference);
222 } else if (signal < fNAdcSignals+fNTdcSignals) {
223 fTdcHits[signal-fNAdcSignals].SetRefTime(reference);
224 } else {
225 throw std::out_of_range(
226 "`THcTrigRawHit::SetReference`: only signals `2` and `3` available!"
227 );
228 }
229}
230
231
233 if (0 <= signal && signal < fNAdcSignals) {
234 return fAdcHits[signal].GetPulseInt();
235 }
236 else if (fNAdcSignals <= signal && signal < fNAdcSignals+fNTdcSignals) {
237 return fTdcHits[signal-fNAdcSignals].GetTime();
238 }
239 else {
240 throw std::out_of_range(
241 "`THcTrigRawHit::GetData`: only signals `0` and `1` available!"
242 );
243 }
244}
245
246
248 if (0 <= signal && signal < fNAdcSignals) {
249 return fAdcHits[signal].GetPulseIntRaw();
250 }
251 else if (fNAdcSignals <= signal && signal < fNAdcSignals+fNTdcSignals) {
252 return fTdcHits[signal-fNAdcSignals].GetTimeRaw();
253 }
254 else {
255 throw std::out_of_range(
256 "`THcTrigRawHit::GetRawData`: only signals `0` and `1` available!"
257 );
258 }
259}
260
261
263 if (fNAdcSignals <= signal && signal < fNAdcSignals+fNTdcSignals) {
264 return fTdcHits[signal-fNAdcSignals].GetRefTime();
265 }
266 else {
267 throw std::out_of_range(
268 "`THcTrigRawHit::GetReference`: only signal `1` available!"
269 );
270 }
271}
272
273
275 if (0 <= signal && signal < fNAdcSignals) {
276 return kADC;
277 }
278 else if (fNAdcSignals <= signal && signal < fNAdcSignals+fNTdcSignals) {
279 return kTDC;
280 }
281 else {
282 throw std::out_of_range(
283 "`THcTrigRawHit::GetSignalType`: only signals `0` and `1` available!"
284 );
285 }
286}
287
288
292
293
295 if (fNAdcSignals <= signal && signal < fNAdcSignals+fNTdcSignals) {
296 return fTdcHits[signal-fNAdcSignals].HasRefTime();
297 }
298 else {
299 throw std::out_of_range(
300 "`THcTrigRawHit::HasReference`: only signal `1` available!"
301 );
302 }
303}
304
305
309
310
314
315
317 for (Int_t iAdcSig=0; iAdcSig<fNAdcSignals; ++iAdcSig) {
318 fAdcHits[iAdcSig].SetF250Params(NSA, NSB, NPED);
319 }
320}
321
322
int Int_t
uint32_t NSB
std::vector< uint32_t > peak
uint32_t NSA
uint32_t pedestal
uint32_t time
bool Bool_t
const char Option_t
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
ClassImp(VDC::AnalyticTTDConv) using namespace std
Class representing a single raw ADC hit.
Definition THcRawAdcHit.h:7
void SetData(Int_t data)
Sets raw ADC value.
void SetDataTimePedestalPeak(Int_t data, Int_t time, Int_t pedestal, Int_t peak)
Sets various bits of ADC data.
Int_t GetPulseIntRaw(UInt_t iPulse=0) const
Gets raw pulse integral. In channels.
void SetSample(Int_t data)
Sets raw signal sample.
virtual void Clear(Option_t *opt="")
Clears variables before next event.
void SetF250Params(Int_t NSA, Int_t NSB, Int_t NPED)
Sets F250 parameters used for pedestal subtraction.
void SetRefTime(Int_t refTime)
Sets reference time. In channels.
Double_t GetPulseInt(UInt_t iPulse=0) const
Gets pedestal subtracted pulse integral. In channels.
Base class detector specific raw hit that go into hit lists.
Definition THcRawHit.h:11
THcRawHit & operator=(const THcRawHit &rhs)=default
Class representing a single raw TDC hit.
Definition THcRawTdcHit.h:7
Int_t GetRefTime() const
Gets reference time. In channels.
Int_t GetTimeRaw(UInt_t iHit=0) const
Gets raw TDC time. In channels.
void SetRefTime(Int_t refTime)
Sets reference time. In channels.
Int_t GetTime(UInt_t iHit=0) const
Gets TDC time. In channels.
Bool_t HasRefTime() const
Queries whether reference time has been set.
void SetTime(Int_t time)
Sets raw TDC time from the modules. In channels.
virtual void Clear(Option_t *opt="")
Clears variables before next event.
Class representing a single raw hit for the THcTrigDet.
Int_t GetReference(Int_t signal)
Returns reference time.
THcRawAdcHit fAdcHits[fNAdcSignals]
THcTrigRawHit(Int_t plane=0, Int_t counter=0)
A constructor.
static const Int_t fNTdcSignals
THcRawAdcHit & GetRawAdcHit()
Gets reference to THcRawAdcHit.
virtual void Clear(Option_t *opt="")
Clears variables before next event.
ESignalType GetSignalType(Int_t signal)
Returns the signal type.
Int_t GetData(Int_t signal)
Gets data for first hit of signal.
THcRawTdcHit & GetRawTdcHit()
Gets reference to THcRawTdcHit.
Int_t GetRawData(Int_t signal)
Gets raw data for first hit of signal.
void SetData(Int_t signal, Int_t data)
Sets next data value.
Int_t GetNSignals()
Returns number of signal handled by this class, i.e., 2.
THcRawTdcHit fTdcHits[fNTdcSignals]
void SetF250Params(Int_t NSA, Int_t NSB, Int_t NPED)
See THcRawAdcHit::SetF250Params.
void SetSample(Int_t signal, Int_t data)
Sets next waveform sample value.
void SetDataTimePedestalPeak(Int_t signal, Int_t data, Int_t time, Int_t pedestal, Int_t peak)
Sets multiple bits of data from flash 250 ADC modules.
THcTrigRawHit & operator=(const THcTrigRawHit &right)
Assignment operator.
Bool_t HasReference(Int_t signal)
Checks if reference time is available.
void SetReference(Int_t signal, Int_t reference)
Sets reference time.
virtual ~THcTrigRawHit()
A destructor.
static const Int_t fNAdcSignals
virtual void Clear(Option_t *="")