18#ifdef HAS_RNTUPLE_SUPPORT
19#include "ROOT/RNTupleModel.hxx"
29#ifdef __USE_DATABASE__
120 void InitializeChannel(TString subsystem, TString instrumenttype, TString name, TString datatosave)
override;
146 void SetEventData(Double_t* block, UInt_t sequencenumber = 0);
152 Int_t
ProcessEvBuffer(UInt_t* buffer, UInt_t num_words_left, UInt_t index = 0)
override;
184 void Scale(Double_t Offset)
override;
196 if (tmp_ptr != NULL) {
199 throw std::invalid_argument(
"Standard exception from QwVQWK_Channel::AccumulateRunningSum: incompatible hardware channel type");
245#ifdef HAS_RNTUPLE_SUPPORT
247 void ConstructNTupleAndVector(std::unique_ptr<ROOT::RNTupleModel>& model, TString &prefix, std::vector<Double_t>& values, std::vector<std::shared_ptr<Double_t>> &fieldPtrs)
override;
248 void FillNTupleVector(std::vector<Double_t>& values)
const override;
291#ifdef __USE_DATABASE__
virtual void LoadMockDataParameters(QwParameterFile ¶mfile)
Load the mock data parameters from the current line in the param file.
Configuration file parser with flexible tokenization and search capabilities.
A helper class to manage a vector of branch entries for ROOT trees.
Concrete hardware channel for VQWK ADC modules (6x32-bit words)
Int_t fADC_Same_NumEvt
Keep track of how many events with same ADC value returned.
void SubtractValueFrom(const VQwHardwareChannel *valueptr) override
Double_t GetValueError() const
Double_t fBlockError[4]
Uncertainty on the sub-block.
QwVQWK_Channel & operator=(const QwVQWK_Channel &value)
void InitializeChannel(TString name, TString datatosave) override
Initialize the fields in this object.
Double_t GetValueError(size_t element) const override
void SetCalibrationToVolts()
void SetVQWKSaturationLimt(Double_t sat_volts=8.5)
Double_t GetHardwareSumM2() const
~QwVQWK_Channel() override
void Sum(const QwVQWK_Channel &value1, const QwVQWK_Channel &value2)
void SetRawEventData() override
Double_t GetValueM2() const
Bool_t MatchNumberOfSamples(size_t numsamp)
Double_t GetVQWKSaturationLimt()
UInt_t fNumberOfSamples
Number of samples read through the module.
Int_t GetRawBlockValue(size_t blocknum) const
Int_t GetRawSoftwareSum() const
static void PrintErrorCounterTail()
Int_t fSequenceNo_Prev
Keep the sequence number of the last event.
void MultiplyBy(const VQwHardwareChannel *valueptr) override
void SetHardwareSum(Double_t hwsum, UInt_t sequencenumber=0)
Bool_t MatchSequenceNumber(size_t seqnum)
VQwHardwareChannel * Clone(VQwDataElement::EDataToSave datatosave) const override
void ScaledAdd(Double_t scale, const VQwHardwareChannel *value) override
UInt_t fSequenceNumber
Event sequence number for this channel.
Double_t fSaturationABSLimit
absolute value of the VQWK saturation volt
static const Bool_t kDEBUG
Bool_t bDevice_Error_Code
VQwHardwareChannel & operator/=(const VQwHardwareChannel &input) override
void ConstructHistograms(TDirectory *folder, TString &prefix) override
Construct the histograms for this data element.
void DeaccumulateRunningSum(const QwVQWK_Channel &value, Int_t ErrorMask=0xFFFFFFF)
Double_t GetHardwareSumWidth() const
void SetDefaultSampleSize(size_t num_samples_map)
void ClearEventData() override
Clear the event data in this element.
void CalculateRunningAverage() override
QwVQWK_Channel & operator*=(const QwVQWK_Channel &value)
const QwVQWK_Channel operator-(const QwVQWK_Channel &value) const
void LoadChannelParameters(QwParameterFile ¶mfile) override
Int_t fHardwareBlockSum_raw
Module-based sum of the four sub-blocks as read from the module.
void ConstructBranchAndVector(TTree *tree, TString &prefix, QwRootTreeBranchVector &values) override
void AddChannelOffset(Double_t Offset)
void PrintErrorCounters() const override
report number of events failed due to HW and event cut failure
void FillHistograms() override
Fill the histograms for this data element.
void ForceMapfileSampleSize()
Int_t ProcessEvBuffer(UInt_t *buffer, UInt_t num_words_left, UInt_t index=0) override
Decode the event data from a CODA buffer.
void AccumulateRunningSum(const QwVQWK_Channel &value, Int_t count=0, Int_t ErrorMask=0xFFFFFFF)
void ConstructBranch(TTree *tree, TString &prefix) override
Int_t fSoftwareBlockSum_raw
Sum of the data in the four sub-blocks raw.
Double_t GetHardwareSumError() const
Double_t GetValue(size_t element) const override
static Int_t GetBufferOffset(Int_t moduleindex, Int_t channelindex)
Int_t fErrorCount_ZeroHW
check to see ADC returning zero
Int_t fErrorCount_sample
for sample size check
QwVQWK_Channel & operator+=(const QwVQWK_Channel &value)
void RandomizeEventData(int helicity=0.0, double time=0.0) override
Internally generate random event data.
static const Bool_t bDEBUG
debugging display purposes
Double_t GetBlockErrorValue(size_t blocknum) const
Double_t GetHardwareSum() const
UInt_t fPreviousSequenceNumber
Previous event sequence number for this channel.
size_t GetSequenceNumber() const
Double_t fHardwareBlockSumError
Uncertainty on the hardware sum.
void ProcessEvent() override
Process the event data according to pedestal and calibration factor.
void SmearByResolution(double resolution) override
QwVQWK_Channel(TString name, TString datatosave="raw")
static const Int_t kWordsPerChannel
Int_t fErrorCount_Sequence
sequence number check
void FillTreeVector(QwRootTreeBranchVector &values) const override
void AssignValueFrom(const VQwDataElement *valueptr) override
UInt_t fNumberOfSamples_map
Number of samples in the expected to read through the module. This value is set in the QwBeamline map...
QwVQWK_Channel & operator-=(const QwVQWK_Channel &value)
void Ratio(const QwVQWK_Channel &numer, const QwVQWK_Channel &denom)
void Difference(const QwVQWK_Channel &value1, const QwVQWK_Channel &value2)
void AddValueFrom(const VQwHardwareChannel *valueptr) override
const QwVQWK_Channel operator+(const QwVQWK_Channel &value) const
void PrintValue() const override
Print single line of value and error of this data element.
Int_t ApplyHWChecks() override
Double_t fPrev_HardwareBlockSum
Previous Module-based sum of the four sub-blocks.
void PrintInfo() const override
Print multiple lines of information about this data element.
Double_t GetAverageVolts() const
void Blind(const QwBlinder *blinder)
Blind this channel as an asymmetry.
static const Double_t kTimePerSample
static const Double_t kVQWK_VoltsPerBit
void CopyFrom(const QwVQWK_Channel &value)
QwVQWK_Channel(const QwVQWK_Channel &value, VQwDataElement::EDataToSave datatosave)
void DivideBy(const VQwHardwareChannel *valueptr) override
void Product(const QwVQWK_Channel &value1, const QwVQWK_Channel &value2)
Int_t fErrorCount_SameHW
check to see ADC returning same HW value
Double_t fBlock[4]
Array of the sub-block data.
Double_t GetValueWidth() const
void SetEventData(Double_t *block, UInt_t sequencenumber=0)
static const Int_t kMaxChannels
Bool_t ApplySingleEventCuts() override
void AccumulateRunningSum(const VQwHardwareChannel *value, Int_t count=0, Int_t ErrorMask=0xFFFFFFF) override
const QwVQWK_Channel operator*(const QwVQWK_Channel &value) const
void AssignScaledValue(const QwVQWK_Channel &value, Double_t scale)
friend std::ostream & operator<<(std::ostream &stream, const QwVQWK_Channel &channel)
Double_t fBlockM2[4]
Second moment of the sub-block.
Double_t GetValue() const
void IncrementErrorCounters() override
Int_t fBlock_raw[4]
Array of the sub-block data as read from the module.
Double_t GetValueM2(size_t element) const override
void Scale(Double_t Offset) override
Double_t fHardwareBlockSum
Module-based sum of the four sub-blocks.
void EncodeEventData(std::vector< UInt_t > &buffer) override
Encode the event data into a CODA buffer.
void ArcTan(const QwVQWK_Channel &value)
Int_t fErrorCount_HWSat
check to see ADC channel is saturated
Double_t GetBlockValue(size_t blocknum) const
Int_t fErrorCount_SW_HW
HW_sum==SW_sum check.
Int_t GetRawValue() const
Int_t fSequenceNo_Counter
Internal counter to keep track of the sequence number.
Int_t GetRawHardwareSum() const
Double_t fHardwareBlockSumM2
Second moment of the hardware sum.
Int_t GetRawValue(size_t element) const override
size_t GetNumberOfSamples() const
static void PrintErrorCounterHead()
Int_t fNumEvtsWithEventCutsRejected
Counts the Event cut rejected events.
QwVQWK_Channel(const QwVQWK_Channel &value)
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
Int_t GetRawValue() 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.