JAPAn
Just Another Parity Analyzer
Loading...
Searching...
No Matches
QwMollerADC_Channel.h
Go to the documentation of this file.
1
2/*!
3 * \file QwMollerADC_Channel.h
4 * \brief Decoding and management for Moller ADC channels (6x32-bit datawords)
5 * \author Kevin Ward (Original code by P.M. King)
6 * \date 20021-05-25
7 */
8
9#pragma once
10
11// System headers
12#include <vector>
13
14// ROOT headers
15#include "TTree.h"
16
17// Qweak headers
18#include "VQwHardwareChannel.h"
19#include "MQwMockable.h"
20#include "QwRootFile.h"
21
22// Forward declarations
23class QwBlinder;
24class QwParameterFile;
25#ifdef __USE_DATABASE__
27#endif
28
29///
30/// \ingroup QwAnalysis_ADC
31///
32/// \ingroup QwAnalysis_BL
33/**
34 * \class QwMollerADC_Channel
35 * \ingroup QwAnalysis_ADC
36 * \brief Concrete hardware channel for Moller ADC modules (6x32-bit words)
37 *
38 * Decodes and processes the data for a single Moller ADC channel and exposes
39 * block-level values, sums, and statistical moments. Supports single-event
40 * cuts, error propagation, blinding, and running statistics. Follows the
41 * dual-operator pattern to provide both type-specific operators and
42 * polymorphic operator overrides via VQwHardwareChannel.
43 */
45/****************************************************************//**
46 * Class: QwMollerADC_Channel
47 * Base class containing decoding functions for the MollerADC_Channel
48 * 6 32-bit datawords.
49 * The functions in this class will decode a single channel
50 * worth of MollerADC_Channel data and provide the components
51 * through member functions.
52 ******************************************************************/
53 public:
54 static Int_t GetBufferOffset(Int_t moduleindex, Int_t channelindex);
55 static void SetDecodeMode(UInt_t input);
56 static void PrintErrorCounterHead();
57 static void PrintErrorCounterTail();
58
59 static const Double_t kTimePerSample;
60
62
68
71
72 public:
74 InitializeChannel("","");
75 SetMollerADCSaturationLimt(8.5);//set the default saturation limit
76 };
77 QwMollerADC_Channel(TString name, TString datatosave = "raw"): MQwMockable() {
78 InitializeChannel(name, datatosave);
79 SetMollerADCSaturationLimt(8.5);//set the default saturation limit
80 };
97 ~QwMollerADC_Channel() override { };
98
106
107
109
111 return new QwMollerADC_Channel(*this,datatosave);
112 };
113
114 /// \brief Initialize the fields in this object
115 void InitializeChannel(TString name, TString datatosave) override;
116
117 /// \brief Initialize the fields in this object
118 void InitializeChannel(TString subsystem, TString instrumenttype, TString name, TString datatosave) override;
119
120 void LoadChannelParameters(QwParameterFile &paramfile) override;
121
122 // Will update the default sample size for the module.
123 void SetDefaultSampleSize(size_t num_samples_map) {
124 // This will be checked against the no.of samples read by the module
125 fNumberOfSamples_map = num_samples_map;
126 };
127 void ClearEventData() override;
128
129 /// Internally generate random event data
130 void RandomizeEventData(int helicity = 0.0, double time = 0.0) override;
131
132 /// Forces the event "number of samples" variable to be what was expected from the mapfile.
133 /// NOTE: this should only be used in mock data generation!
135
136//------------------------------------------------------------------------------------------
137 void SmearByResolution(double resolution) override;
138//------------------------------------------------------------------------------------------
139
140 /// TODO: SetHardwareSum should be removed, and SetEventData
141 /// should be made protected.
142 void SetHardwareSum(Double_t hwsum, UInt_t sequencenumber = 0);
143 void SetEventData(Double_t* block, UInt_t sequencenumber = 0);
144 void SetRawEventData() override;
145
146 // added this
147 void SetMollerADCHeaderData(UInt_t region_number,
148 ULong64_t region_timestamp,
149 UInt_t header_num_words,
150 UInt_t header_block_number,
151 ULong64_t header_packet_count,
152 ULong64_t header_tsamples)
153{
154 fRegionNumber = region_number;
155 fRegionTimestamp = region_timestamp;
156 fHeaderNumWords = header_num_words;
157 fHeaderBlockNumber = header_block_number;
158 fHeaderPacketCount = header_packet_count;
159 fHeaderTSamples = header_tsamples;
160}
161
162 void SetRegionNumber(UInt_t x) { fRegionNumber = x; }
166void SetHeaderNumWords(UInt_t x) { fHeaderNumWords = x; }
168
169UInt_t GetRegionNumber() const { return fRegionNumber; }
172UInt_t GetHeaderBlockNumber() const { return fHeaderBlockNumber; }
173UInt_t GetHeaderNumWords() const { return fHeaderNumWords; }
175
176 /// Encode the event data into a CODA buffer
177 void EncodeEventData(std::vector<UInt_t> &buffer) override;
178 /// Decode the event data from a CODA buffer
179 Int_t ProcessEvBuffer(UInt_t* buffer, UInt_t num_words_left, UInt_t index = 0) override;
180 Int_t ProcessEvBuffer_oldmock(UInt_t* buffer, UInt_t num_words_left, UInt_t index = 0);
181 Int_t ProcessEvBuffer_newreshuffled(UInt_t* buffer, UInt_t num_words_left, UInt_t index = 0); //{return 0;};
182 /// Process the event data according to pedestal and calibration factor
183 void ProcessEvent() override;
184
185
187 void AssignScaledValue(const QwMollerADC_Channel &value, Double_t scale);
188 void AssignValueFrom(const VQwDataElement* valueptr) override;
189 void AddValueFrom(const VQwHardwareChannel* valueptr) override;
190 void SubtractValueFrom(const VQwHardwareChannel* valueptr) override;
191 void MultiplyBy(const VQwHardwareChannel* valueptr) override;
192 void DivideBy(const VQwHardwareChannel* valueptr) override;
193 void ArcTan(const QwMollerADC_Channel &value);
194
198
199 VQwHardwareChannel& operator+=(const VQwHardwareChannel& input) override;
200 VQwHardwareChannel& operator-=(const VQwHardwareChannel& input) override;
201 VQwHardwareChannel& operator*=(const VQwHardwareChannel& input) override;
202 VQwHardwareChannel& operator/=(const VQwHardwareChannel& input) override;
203
204 const QwMollerADC_Channel operator+ (const QwMollerADC_Channel &value) const;
205 const QwMollerADC_Channel operator- (const QwMollerADC_Channel &value) const;
206 const QwMollerADC_Channel operator* (const QwMollerADC_Channel &value) const;
207 void Sum(const QwMollerADC_Channel &value1, const QwMollerADC_Channel &value2);
208 void Difference(const QwMollerADC_Channel &value1, const QwMollerADC_Channel &value2);
209 void Ratio(const QwMollerADC_Channel &numer, const QwMollerADC_Channel &denom);
210 void Product(const QwMollerADC_Channel &value1, const QwMollerADC_Channel &value2);
211 void DivideBy(const QwMollerADC_Channel& denom);
212 void AddChannelOffset(Double_t Offset);
213 void Scale(Double_t Offset) override;
214
215
216 /**
217 * Accumulate event values into the running sum with optional scaling.
218 * @param value Source channel to accumulate from.
219 * @param count Event count scaling (0 means use value.fGoodEventCount).
220 * @param ErrorMask Bit mask of error flags to exclude when accumulating.
221 */
222 void AccumulateRunningSum(const QwMollerADC_Channel& value, Int_t count=0, Int_t ErrorMask=0xFFFFFFF);
223 void AccumulateRunningSum(const VQwHardwareChannel *value, Int_t count=0, Int_t ErrorMask=0xFFFFFFF) override{
224 const QwMollerADC_Channel *tmp_ptr = dynamic_cast<const QwMollerADC_Channel*>(value);
225 if (tmp_ptr != NULL) {
226 AccumulateRunningSum(*tmp_ptr, count, ErrorMask);
227 } else {
228 throw std::invalid_argument("Standard exception from QwMollerADC_Channel::AccumulateRunningSum: incompatible hardware channel type");
229 }
230 };
231 ////deaccumulate one value from the running sum
232 inline void DeaccumulateRunningSum(const QwMollerADC_Channel& value, Int_t ErrorMask=0xFFFFFFF){
233 AccumulateRunningSum(value, -1, ErrorMask);
234 };
235 /*
236 void DeaccumulateRunningSum(VQwHardwareChannel *value){
237 const QwMollerADC_Channel *tmp_ptr = dynamic_cast<const QwMollerADC_Channel*>(value);
238 if (tmp_ptr != NULL) {
239 DeaccumulateRunningSum(*tmp_ptr);
240 } else {
241 throw std::invalid_argument("Standard exception from QwMollerADC_Channel::DeaccumulateRunningSum: incompatible hardware channel type");
242 }
243 };
244 */
245
246 void CalculateRunningAverage() override;
247
248 Bool_t MatchSequenceNumber(size_t seqnum);
249 Bool_t MatchNumberOfSamples(size_t numsamp);
250
251 /*Event cut related routines*/
252 Bool_t ApplySingleEventCuts(Double_t LL,Double_t UL);//check values read from modules are at desired level
253 Bool_t ApplySingleEventCuts() override;//check values read from modules are at desired level by comparing upper and lower limits (fULimit and fLLimit) set on this channel
254 void PrintErrorCounters() const override;// report number of events failed due to HW and event cut failure
255
256 void SetMollerADCSaturationLimt(Double_t sat_volts=8.5){//Set the absolute staturation limit in volts.
257 fSaturationABSLimit=sat_volts;
258 }
259
260 Double_t GetMollerADCSaturationLimt(){//Get the absolute staturation limit in volts.
261 return fSaturationABSLimit;
262 }
263
264
265 Int_t ApplyHWChecks() override; //Check for hardware errors in the devices. This will return the device error code.
266
267 void IncrementErrorCounters() override;//update the error counters based on the internal fErrorFlag
268
269 /*End*/
270
271 void ConstructHistograms(TDirectory *folder, TString &prefix) override;
272 void FillHistograms() override;
273
274 void ConstructBranchAndVector(TTree *tree, TString &prefix, QwRootTreeBranchVector &values) override;
275 void ConstructBranch(TTree *tree, TString &prefix) override;
276 void FillTreeVector(QwRootTreeBranchVector &values) const override;
277#ifdef HAS_RNTUPLE_SUPPORT
278 void ConstructNTupleAndVector(std::unique_ptr<ROOT::RNTupleModel>& model, TString& prefix, std::vector<Double_t>& values, std::vector<std::shared_ptr<Double_t>>& fieldPtrs) override;
279 void FillNTupleVector(std::vector<Double_t>& values) const override;
280#endif // HAS_RNTUPLE_SUPPORT
281
282 void CopyParameters(const VQwHardwareChannel* valueptr) override;
283
284 Int_t GetRawValue(size_t element) const override {
285 RangeCheck(element);
286 if (element==0) return fHardwareBlockSum_raw;
287 return fBlock_raw[element-1];
288 }
289 Double_t GetValue(size_t element) const override {
290 RangeCheck(element);
291 if (element==0) return fHardwareBlockSum;
292 return fBlock[element-1];
293 }
294 Double_t GetValueM2(size_t element) const override {
295 RangeCheck(element);
296 if (element==0) return fHardwareBlockSumM2;
297 return fBlockM2[element-1];
298 }
299 Double_t GetValueError(size_t element) const override {
300 RangeCheck(element);
301 if (element==0) return fHardwareBlockSumError;
302 return fBlockError[element-1];
303 }
304
305
306 Double_t GetAverageVolts() const;
307
308 size_t GetSequenceNumber() const {return (fSequenceNumber);};
309 size_t GetNumberOfSamples() const {return (fNumberOfSamples);};
310
312
313 friend std::ostream& operator<< (std::ostream& stream, const QwMollerADC_Channel& channel);
314 void PrintValue() const override;
315 void PrintInfo() const override;
316
317 /// \brief Blind this channel as an asymmetry
318 void Blind(const QwBlinder *blinder);
319 /// \brief Blind this channel as a difference
320 void Blind(const QwBlinder *blinder, const QwMollerADC_Channel& yield);
321
322 void ScaledAdd(Double_t scale, const VQwHardwareChannel *value) override;
323
324#ifdef __USE_DATABASE__
325 // Error Counters exist in QwMollerADC_Channel, not in VQwHardwareChannel
326 //
327 void AddErrEntriesToList(std::vector<QwErrDBInterface> &row_list) override;
328#endif
329
330 protected:
332
333private:
334 // The following specific access methods should only be used internally,
335 // if at all.
336 Double_t GetBlockValue(size_t blocknum) const { return GetValue(blocknum+1);};
337 Double_t GetBlockErrorValue(size_t blocknum) const { return GetValueError(blocknum+1);};
338
339 Double_t GetHardwareSum() const { return GetValue(0);};
340 Double_t GetHardwareSumM2() const { return GetValueM2(0); };
341 Double_t GetHardwareSumWidth() const { return GetValueWidth(0); };
342 Double_t GetHardwareSumError() const { return GetValueError(0); };
343 // Double_t GetSoftwareSum() const {return fSoftwareBlockSum;};
344
345 Int_t GetRawBlockValue(size_t blocknum) const {return GetRawValue(blocknum+1);};
346 Int_t GetRawHardwareSum() const { return GetRawValue(0);};
348
349 private:
350 static const Bool_t kDEBUG;
351
352 static const Int_t kMaxChannels; //no.of channels per module
353 static const Int_t kModuleHeaderWords; //no.of words per header
354 static constexpr Int_t kMaxBlock=15; // maximum no.of blocks
357 static constexpr Int_t kOldMockChannelsPerModule = 8;
358 static constexpr Int_t kNewReshuffledChannelsPerModule = 16;
359 static constexpr Int_t kOldMockDefaultBlocks = 4;
360 static constexpr Int_t kNewReshuffledDefaultBlocks = kMaxBlock;
361 static constexpr Int_t kOldMockWordsPerChannel = 30;
362 static constexpr Int_t kNewReshuffledWordsPerChannel = 14;
364 static Int_t GetWordsPerChannel();
365 static Int_t GetChannelsPerModule();
366 static Int_t GetModuleHeaderWords();
367 static Int_t GetDefaultBlocksPerEvent();
368
369 /*! \name ADC Calibration */
370 // @{
371 static const Double_t kMollerADC_VoltsPerBit;
372 //@}
373
374
375 /*! \name Channel information data members */
376
377 /*! \name Channel configuration data members */
378 // @{
379
380 //UInt_t fBlocksPerEvent;
382 // @}
383
384
385 /*! \name Event data members---Raw values */
386 // @{
387 Long64_t fBlock_raw[kMaxBlock]; ///< Array of the sub-block data as read from the module
388 Long64_t fHardwareBlockSum_raw; ///< Module-based sum of the four sub-blocks as read from the module
389 Long64_t fSoftwareBlockSum_raw; ///< Sum of the data in the four sub-blocks raw
394 UInt_t fBlockSample[kMaxBlock+1]; // number of samples in each block
395 // @}
396
397 /*! \name Event data members---Potentially calibrated values*/
398 // @{
399 // The following values potentially have pedestal removed and calibration applied
400 Double_t fBlock[kMaxBlock]; ///< Array of the sub-block data
401 Double_t fHardwareBlockSum; ///< Module-based sum of the four sub-blocks
402 // @}
403
404
405 /// \name Calculation of the statistical moments
406 // @{
407 // Moments of the separate blocks
408 Double_t fBlockM2[kMaxBlock]; ///< Second moment of the sub-block
409 Double_t fBlockError[kMaxBlock]; ///< Uncertainty on the sub-block
410 // Moments of the hardware sum
411 Double_t fHardwareBlockSumM2; ///< Second moment of the hardware sum
412 Double_t fHardwareBlockSumError; ///< Uncertainty on the hardware sum
413
414 Double_t fHardwareBlockSumRMS; // RMS of the hardware sum
415 Double_t fBlockRMS[kMaxBlock+1]; // RMS of the sub-blocks
416
417 Double_t GetHardwareSumRMS() const { return fHardwareBlockSumRMS; } // RMS of the hardware sum
418 Double_t GetBlockRMS(Int_t i) const { return fBlockRMS[i]; } // RMS of the sub-blocks
419
420 // @}
421
422
423 UInt_t fSequenceNumber; ///< Event sequence number for this channel
424 UInt_t fPreviousSequenceNumber; ///< Previous event sequence number for this channel
425 UInt_t fNumberOfSamples; ///< Number of samples read through the module
432 UInt_t fNumberOfSamples_map; ///< Number of samples in the expected to read through the module. This value is set in the QwBeamline map file
433 // Set of error counters for each HW test.
434 Int_t fErrorCount_HWSat; ///< check to see ADC channel is saturated
435 Int_t fErrorCount_sample; ///< for sample size check
436 Int_t fErrorCount_SW_HW; ///< HW_sum==SW_sum check
437 Int_t fErrorCount_Sequence; ///< sequence number check
438 Int_t fErrorCount_SameHW; ///< check to see ADC returning same HW value
439 Int_t fErrorCount_ZeroHW; ///< check to see ADC returning zero
440
441 Int_t fNumEvtsWithEventCutsRejected; ///< Counts the Event cut rejected events
442
443
444
445
446
447
448 Int_t fADC_Same_NumEvt; ///< Keep track of how many events with same ADC value returned
449 Int_t fSequenceNo_Prev; ///< Keep the sequence number of the last event
450 Int_t fSequenceNo_Counter; ///< Internal counter to keep track of the sequence number
451 Double_t fPrev_HardwareBlockSum; ///< Previous Module-based sum of the four sub-blocks
452
453
454
455 Double_t fSaturationABSLimit;///<absolute value of the MollerADC saturation volt
456
457
458 const static Bool_t bDEBUG=kFALSE;///<debugging display purposes
459
460 ///<For MollerADC data element trimming uses
461 Bool_t bHw_sum;
463 Bool_t bBlock;
468
469private:
470
471
472
473
474
475
476};
ROOT file and tree management wrapper classes.
unsigned long long ULong64_t
Definition QwBlinder.h:41
virtual void LoadMockDataParameters(QwParameterFile &paramfile)
Load the mock data parameters from the current line in the param file.
Concrete hardware channel for Moller ADC modules (6x32-bit words)
Short_t fBlock_numSamples[kMaxBlock+1]
Int_t GetRawSoftwareSum() const
static EDecodeMode fDecodeMode
Int_t ProcessEvBuffer_oldmock(UInt_t *buffer, UInt_t num_words_left, UInt_t index=0)
Int_t ProcessEvBuffer(UInt_t *buffer, UInt_t num_words_left, UInt_t index=0) override
Decode the event data from a CODA buffer.
Double_t GetHardwareSumM2() const
static constexpr Int_t kOldMockWordsPerChannel
Double_t GetValueError() const
const QwMollerADC_Channel operator*(const QwMollerADC_Channel &value) const
void AssignValueFrom(const VQwDataElement *valueptr) override
Double_t GetValueError(size_t element) const override
void SetHeaderPacketCount(ULong64_t x)
Int_t fErrorCount_SW_HW
HW_sum==SW_sum check.
VQwHardwareChannel & operator/=(const VQwHardwareChannel &input) override
QwMollerADC_Channel(TString name, TString datatosave="raw")
void AddChannelOffset(Double_t Offset)
void SetHeaderBlockNumber(UInt_t x)
void SetHardwareSum(Double_t hwsum, UInt_t sequencenumber=0)
static void PrintErrorCounterHead()
void LoadChannelParameters(QwParameterFile &paramfile) override
static Int_t GetWordsPerChannel()
static Int_t GetDefaultBlocksPerEvent()
static void SetDecodeMode(UInt_t input)
Double_t GetValueM2() const
UInt_t GetHeaderBlockNumber() const
QwMollerADC_Channel & operator+=(const QwMollerADC_Channel &value)
void DeaccumulateRunningSum(const QwMollerADC_Channel &value, Int_t ErrorMask=0xFFFFFFF)
UInt_t fSequenceNumber
Event sequence number for this channel.
void RandomizeEventData(int helicity=0.0, double time=0.0) override
Internally generate random event data.
static const Bool_t kDEBUG
QwMollerADC_Channel(const QwMollerADC_Channel &value)
QwMollerADC_Channel & operator=(const QwMollerADC_Channel &value)
Double_t fPrev_HardwareBlockSum
Previous Module-based sum of the four sub-blocks.
QwMollerADC_Channel & operator*=(const QwMollerADC_Channel &value)
const QwMollerADC_Channel operator-(const QwMollerADC_Channel &value) const
static constexpr Int_t kOldMockDefaultBlocks
Double_t fBlockM2[kMaxBlock]
Second moment of the sub-block.
Bool_t ApplySingleEventCuts() override
Int_t GetRawValue(size_t element) const override
void MultiplyBy(const VQwHardwareChannel *valueptr) override
void PrintValue() const override
Print single line of value and error of this data element.
void ScaledAdd(Double_t scale, const VQwHardwareChannel *value) override
void Sum(const QwMollerADC_Channel &value1, const QwMollerADC_Channel &value2)
void ProcessEvent() override
Process the event data according to pedestal and calibration factor.
Int_t fSequenceNo_Counter
Internal counter to keep track of the sequence number.
static constexpr Int_t kNewReshuffledDefaultBlocks
Double_t fBlockError[kMaxBlock]
Uncertainty on the sub-block.
Int_t GetRawBlockValue(size_t blocknum) const
QwMollerADC_Channel & operator-=(const QwMollerADC_Channel &value)
static Int_t GetModuleHeaderWords()
void PrintErrorCounters() const override
report number of events failed due to HW and event cut failure
Bool_t MatchSequenceNumber(size_t seqnum)
Double_t fHardwareBlockSum
Module-based sum of the four sub-blocks.
void InitializeChannel(TString name, TString datatosave) override
Initialize the fields in this object.
Double_t GetBlockErrorValue(size_t blocknum) const
Int_t fErrorCount_sample
for sample size check
static const Int_t kMaxChannels
UInt_t fNumberOfSamples_map
Number of samples in the expected to read through the module. This value is set in the QwBeamline map...
void SetDefaultSampleSize(size_t num_samples_map)
void Blind(const QwBlinder *blinder)
Blind this channel as an asymmetry.
Int_t fErrorCount_ZeroHW
check to see ADC returning zero
void ArcTan(const QwMollerADC_Channel &value)
static constexpr Int_t kMaxBlock
void DivideBy(const VQwHardwareChannel *valueptr) override
Int_t fBlock_min[kMaxBlock+1]
Int_t fNumEvtsWithEventCutsRejected
Counts the Event cut rejected events.
void SetEventData(Double_t *block, UInt_t sequencenumber=0)
Int_t fBlock_max[kMaxBlock+1]
void Scale(Double_t Offset) override
Long64_t fSoftwareBlockSum_raw
Sum of the data in the four sub-blocks raw.
Double_t GetMollerADCSaturationLimt()
Int_t fErrorCount_HWSat
check to see ADC channel is saturated
QwMollerADC_Channel(const QwMollerADC_Channel &value, VQwDataElement::EDataToSave datatosave)
void Ratio(const QwMollerADC_Channel &numer, const QwMollerADC_Channel &denom)
void CopyParameters(const VQwHardwareChannel *valueptr) override
void SetRawEventData() override
Double_t fSaturationABSLimit
absolute value of the MollerADC saturation volt
Double_t GetValue(size_t element) const override
static const Double_t kTimePerSample
void EncodeEventData(std::vector< UInt_t > &buffer) override
Encode the event data into a CODA buffer.
void AddValueFrom(const VQwHardwareChannel *valueptr) override
static constexpr Int_t kNewReshuffledChannelsPerModule
Long64_t fHardwareBlockSum_raw
Module-based sum of the four sub-blocks as read from the module.
void SetHeaderTSamples(ULong64_t x)
void AccumulateRunningSum(const VQwHardwareChannel *value, Int_t count=0, Int_t ErrorMask=0xFFFFFFF) override
UInt_t GetHeaderNumWords() const
static constexpr Int_t kOldMockChannelsPerModule
static Int_t GetBufferOffset(Int_t moduleindex, Int_t channelindex)
ULong64_t GetHeaderTSamples() const
Long64_t fBlock_raw[kMaxBlock]
Array of the sub-block data as read from the module.
Double_t GetHardwareSumRMS() const
Int_t fErrorCount_SameHW
check to see ADC returning same HW value
void FillHistograms() override
Fill the histograms for this data element.
UInt_t GetRegionNumber() const
ULong64_t GetHeaderPacketCount() const
Int_t GetRawHardwareSum() const
Double_t GetValueM2(size_t element) const override
static Bool_t fDecodeModeHasBeenSet
static const Int_t kModuleHeaderWords
Int_t ApplyHWChecks() override
void SetMollerADCSaturationLimt(Double_t sat_volts=8.5)
Int_t fErrorCount_Sequence
sequence number check
static void PrintErrorCounterTail()
void SetMollerADCHeaderData(UInt_t region_number, ULong64_t region_timestamp, UInt_t header_num_words, UInt_t header_block_number, ULong64_t header_packet_count, ULong64_t header_tsamples)
void ConstructHistograms(TDirectory *folder, TString &prefix) override
Construct the histograms for this data element.
VQwHardwareChannel * Clone(VQwDataElement::EDataToSave datatosave) const override
UInt_t fPreviousSequenceNumber
Previous event sequence number for this channel.
ULong64_t GetRegionTimestamp() const
Double_t GetValueWidth() const
Double_t GetBlockRMS(Int_t i) const
void IncrementErrorCounters() override
Double_t fHardwareBlockSumError
Uncertainty on the hardware sum.
friend std::ostream & operator<<(std::ostream &stream, const QwMollerADC_Channel &channel)
void CopyFrom(const QwMollerADC_Channel &value)
UInt_t fBlockSample[kMaxBlock+1]
Double_t GetBlockValue(size_t blocknum) const
Int_t ProcessEvBuffer_newreshuffled(UInt_t *buffer, UInt_t num_words_left, UInt_t index=0)
void PrintInfo() const override
Print multiple lines of information about this data element.
void SubtractValueFrom(const VQwHardwareChannel *valueptr) override
void SetRegionNumber(UInt_t x)
void ConstructBranchAndVector(TTree *tree, TString &prefix, QwRootTreeBranchVector &values) override
void SetRegionTimestamp(ULong64_t x)
Double_t GetHardwareSum() const
void FillTreeVector(QwRootTreeBranchVector &values) const override
void SetHeaderNumWords(UInt_t x)
Double_t GetValue() const
Int_t fADC_Same_NumEvt
Keep track of how many events with same ADC value returned.
size_t GetNumberOfSamples() const
void CalculateRunningAverage() override
Long64_t fBlockSumSq_raw[kMaxBlock+1]
void AccumulateRunningSum(const QwMollerADC_Channel &value, Int_t count=0, Int_t ErrorMask=0xFFFFFFF)
const QwMollerADC_Channel operator+(const QwMollerADC_Channel &value) const
Double_t fBlockRMS[kMaxBlock+1]
static const Bool_t bDEBUG
debugging display purposes
Double_t GetHardwareSumWidth() const
Double_t GetAverageVolts() const
static constexpr Int_t kNewReshuffledWordsPerChannel
Int_t fSequenceNo_Prev
Keep the sequence number of the last event.
void Product(const QwMollerADC_Channel &value1, const QwMollerADC_Channel &value2)
void AssignScaledValue(const QwMollerADC_Channel &value, Double_t scale)
void SmearByResolution(double resolution) override
Double_t fHardwareBlockSumM2
Second moment of the hardware sum.
static const Double_t kMollerADC_VoltsPerBit
void ClearEventData() override
Clear the event data in this element.
void Difference(const QwMollerADC_Channel &value1, const QwMollerADC_Channel &value2)
size_t GetSequenceNumber() const
UInt_t fNumberOfSamples
Number of samples read through the module.
Bool_t MatchNumberOfSamples(size_t numsamp)
static Int_t GetChannelsPerModule()
Double_t GetHardwareSumError() const
void ConstructBranch(TTree *tree, TString &prefix) override
Double_t fBlock[kMaxBlock]
Array of the sub-block data.
Configuration file parser with flexible tokenization and search capabilities.
A helper class to manage a vector of branch entries for ROOT trees.
Definition QwRootFile.h:55
The pure virtual base class of all data elements.
Abstract base for concrete hardware channels implementing dual-operator pattern.
Double_t GetValueError() const
Double_t GetValueM2() const
void SetCalibrationFactor(Double_t factor)
void CopyFrom(const VQwHardwareChannel &value)
virtual VQwHardwareChannel * Clone() const
virtual void AddErrEntriesToList(std::vector< QwErrDBInterface > &)
Double_t GetValueWidth() const
void RangeCheck(size_t element) const
Checks that the requested element is in range, to be used in accesses to subelements similar to std::...
Double_t GetValue() const
virtual void DeaccumulateRunningSum(const VQwHardwareChannel *value, Int_t ErrorMask=0xFFFFFFF)
virtual void AccumulateRunningSum(const VQwHardwareChannel *value, Int_t count=0, Int_t ErrorMask=0xFFFFFFF)
Data blinding utilities for parity violation analysis.
Definition QwBlinder.h:57