13#ifdef HAS_RNTUPLE_SUPPORT
14#include "ROOT/RNTupleModel.hxx"
15#include "ROOT/RField.hxx"
75 void InitializeChannel(TString subsystem, TString module, TString name, TString datatosave);
95 void SetEventData(Double_t* block, UInt_t sequencenumber);
115 void SetSingleEventCuts(UInt_t errorflag, Double_t LL, Double_t UL, Double_t stability, Double_t burplevel);
154 void Scale(Double_t factor);
181#ifdef HAS_RNTUPLE_SUPPORT
183 void ConstructNTupleAndVector(std::unique_ptr<ROOT::RNTupleModel>& model, TString& prefix, std::vector<Double_t>& values, std::vector<std::shared_ptr<Double_t>>& fieldPtrs);
184 void FillNTupleVector(std::vector<Double_t>& values)
const;
Parameter file parsing and management.
Decoding and management for Moller ADC channels (6x32-bit datawords)
class QwMollerADC_Channel QwBeamCharge
class QwMollerADC_Channel QwBeamEnergy
class QwMollerADC_Channel QwBeamAngle
class QwMollerADC_Channel QwBeamPosition
const TString QwBPMStripline< T >::subelement[4]
Concrete hardware channel for Moller ADC modules (6x32-bit words)
Configuration file parser with flexible tokenization and search capabilities.
A helper class to manage a vector of branch entries for ROOT trees.
The pure virtual base class of all data elements.
VQwDataElement()
Default constructor.
void SetSubsystemName(TString sysname)
Set the name of the inheriting subsystem name.
TString fElementName
Name of this data element.
Data blinding utilities for parity violation analysis.
Integration PMT providing yield/diff/asym readout from Moller ADC.
QwIntegrationPMT(TString subsystemname, TString name)
QwIntegrationPMT & operator-=(const QwIntegrationPMT &value)
void SetAsymmetry(Double_t value)
Int_t ProcessEvBuffer(UInt_t *buffer, UInt_t word_position_in_buffer, UInt_t subelement=0) override
Process the raw event buffer and decode into the ADC channel.
void FillHistograms() override
Fill the histograms for this data element.
void SetCalibrationFactor(Double_t calib)
Set the calibration factor and propagate to the underlying ADC channel.
void RandomizeMollerEvent(int helicity, const QwBeamCharge &charge, const QwBeamPosition &xpos, const QwBeamPosition &ypos, const QwBeamAngle &xprime, const QwBeamAngle &yprime, const QwBeamEnergy &energy)
Generate a mock MOLLER detector event using beam parameters.
void LoadChannelParameters(QwParameterFile ¶mfile) override
void ConstructBranchAndVector(TTree *tree, TString &prefix, QwRootTreeBranchVector &values)
Bool_t ApplyHWChecks()
Apply hardware checks and return whether the event is valid.
void PrintInfo() const override
Print multiple lines of information about this data element.
void RandomizeEventData(int helicity=0, double time=0.0)
Generate mock data for a single event.
const QwMollerADC_Channel * GetChannel(const TString name) const
void SetHardwareSum(Double_t hwsum, UInt_t sequencenumber=0)
Set the hardware-level sum measurement for a sequence.
void SetCoefficientCx(Double_t value)
void SetCoefficientCy(Double_t value)
void SetSaturationLimit(Double_t saturation_volt)
Set the saturation voltage limit for the ADC front-end.
Bool_t CheckForBurpFail(const VQwDataElement *ev_error)
Check for burp failures by comparing against a reference PMT.
QwIntegrationPMT & operator=(const QwIntegrationPMT &value)
Copy-assign from another PMT (event-scoped data).
void Difference(const QwIntegrationPMT &value1, const QwIntegrationPMT &value2)
void PrintErrorCounters()
Print accumulated error counters for this PMT.
void DeaccumulateRunningSum(QwIntegrationPMT &value, Int_t ErrorMask=0xFFFFFFF)
void InitializeChannel(TString name, TString datatosave)
Initialize the PMT channel with a name and data-saving mode.
~QwIntegrationPMT() override
void UseExternalRandomVariable()
Use an external random variable source for mock data.
void Sum(const QwIntegrationPMT &value1, const QwIntegrationPMT &value2)
void FillTreeVector(QwRootTreeBranchVector &values) const
void AddRandomEventDriftParameters(Double_t amplitude, Double_t phase, Double_t frequency)
Add additional drift parameters to the existing drift model.
void SetBlindability(Bool_t isblindable)
void SetDefaultSampleSize(Int_t sample_size)
Set the default sample size used by the ADC channel.
void SetElementName(const TString &name)
void ConstructBranch(TTree *tree, TString &prefix)
UInt_t GetEventcutErrorFlag() override
return the error flag on this channel/device
void Scale(Double_t factor)
UInt_t UpdateErrorFlag() override
Update the error flag based on the error flags of internally contained objects Return parameter is th...
void CalculateRunningAverage()
void SetExternalRandomVariable(Double_t random_variable)
Set the external random variable to drive mock data.
QwIntegrationPMT(TString name)
void IncrementErrorCounters()
void SetRandomEventAsymmetry(Double_t asymmetry)
Set an asymmetry parameter applied to helicity states.
static const Bool_t bDEBUG
QwIntegrationPMT(const QwIntegrationPMT &source)
std::vector< QwErrDBInterface > GetErrDBEntry()
void AccumulateRunningSum(const QwIntegrationPMT &value, Int_t count=0, Int_t ErrorMask=0xFFFFFFF)
void SetEventData(Double_t *block, UInt_t sequencenumber)
Set the block data for the current event sequence.
void ConstructHistograms(TDirectory *folder, TString &prefix) override
Construct the histograms for this data element.
QwIntegrationPMT & operator+=(const QwIntegrationPMT &value)
Add-assign from another PMT (sum raw channels).
void SetNormalizability(Bool_t isnormalizable)
Double_t GetValue()
Get the integrated value over the current event window.
void SetCoefficientCxp(Double_t value)
QwMollerADC_Channel fTriumf_ADC
void SetVoltPerHz(Double_t value)
void SetCoefficientCyp(Double_t value)
void SetRandomEventDriftParameters(Double_t amplitude, Double_t phase, Double_t frequency)
Configure deterministic drift parameters applied per event.
void EncodeEventData(std::vector< UInt_t > &buffer)
Encode current event data into an output buffer.
Bool_t ApplySingleEventCuts()
Apply single-event cuts for this PMT and return pass/fail.
void ClearEventData() override
Clear event-scoped data in the underlying ADC channel.
void SetPedestal(Double_t ped)
Set the pedestal value and propagate to the underlying ADC channel.
void SetEventCutMode(Int_t bcuts)
void SetCoefficientCe(Double_t value)
void Ratio(QwIntegrationPMT &numer, QwIntegrationPMT &denom)
void SetNormRate(Double_t value)
void ProcessEvent()
Apply hardware checks and process the event for this PMT.
void PrintValue() const override
Print single line of value and error of this data element.
std::vector< QwDBInterface > GetDBEntry()
void SetRandomEventParameters(Double_t mean, Double_t sigma)
Configure Gaussian mock data parameters.
void Blind(const QwBlinder *blinder)
Blind the asymmetry.
void Normalize(VQwDataElement *denom)
Int_t SetSingleEventCuts(Double_t, Double_t)
Set basic single-event cut limits.