13#include <ROOT/RNTupleModel.hxx>
44 QwBCM(TString subsystemname, TString name)
49 QwBCM(TString subsystemname, TString name, TString type, TString clock =
"")
65 void InitializeChannel(TString subsystem, TString name, TString datatosave)
override;
113 void SetSingleEventCuts(UInt_t errorflag, Double_t min = 0, Double_t max = 0, Double_t stability = 0, Double_t burplevel = 0)
override;
145 std::cerr<<
"SetBCMForCombo for QwCombinedBCM<T> not defined!!\n";
154 void Scale(Double_t factor)
override;
172#ifdef HAS_RNTUPLE_SUPPORT
173 void ConstructNTupleAndVector(std::unique_ptr<ROOT::RNTupleModel>& model, TString& prefix, std::vector<Double_t>& values, std::vector<std::shared_ptr<Double_t>>& fieldPtrs)
override;
174 void FillNTupleVector(std::vector<Double_t>& values)
const override;
Parameter file parsing and management.
Definition of the pure virtual base class of all data elements.
Virtual base class for beam current monitors.
const TString QwBPMStripline< T >::subelement[4]
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.
void SetSubsystemName(TString sysname)
Set the name of the inheriting subsystem name.
Abstract base for concrete hardware channels implementing dual-operator pattern.
Templated concrete beam current monitor implementation.
UInt_t GetEventcutErrorFlag() override
return the error flag on this channel/device
void SetExternalRandomVariable(Double_t random_variable)
Set the external random variable to drive mock data.
void ConstructBranch(TTree *tree, TString &prefix) override
Construct ROOT branches for this BCM (if enabled).
void IncrementErrorCounters() override
Increment error counters (number of failed events).
Double_t GetNormClockValue() override
void SetEventCutMode(Int_t bcuts) override
void ConstructHistograms(TDirectory *folder, TString &prefix) override
Define histograms for this BCM (delegated to underlying channel).
void SetPedestal(Double_t ped) override
Set the pedestal value for the beam current monitor.
void DeaccumulateRunningSum(VQwBCM &value, Int_t ErrorMask=0xFFFFFFF) override
Remove a single entry from the running sums using a source value.
UInt_t GetErrorCode() const
void SetRandomEventDriftParameters(Double_t amplitude, Double_t phase, Double_t frequency)
Configure deterministic drift parameters applied per event.
void Scale(Double_t factor) override
Scale the underlying channel by a constant factor.
void Ratio(const VQwBCM &numer, const VQwBCM &denom) override
Polymorphic ratio formation for BCM.
Bool_t NeedsExternalClock() override
void ApplyResolutionSmearing() override
Smear the channel by the configured resolution.
void FillRawEventData() override
Materialize the current event state as raw event data.
void SetCalibrationFactor(Double_t calib) override
Set the calibration factor for the beam current monitor.
void RandomizeEventData(int helicity=0, double time=0) override
Generate mock event data for this BCM.
void SetExternalClockName(const std::string name) override
void SetBCMForCombo(VQwBCM *bcm, Double_t weight, Double_t sumqw) override
Double_t GetValue() override
Get the current value of the beam current.
VQwBCM & operator=(const VQwBCM &value) override
Polymorphic copy-assign from VQwBCM if types match.
QwBCM(TString subsystemname, TString name)
void AddRandomEventDriftParameters(Double_t amplitude, Double_t phase, Double_t frequency) override
Add additional drift parameters to the drift model.
void PrintValue() const override
Print a compact value summary for this BCM.
Bool_t CheckForBurpFail(const VQwDataElement *ev_error) override
Check for burp failures by delegating to the underlying channel.
std::string GetExternalClockName() override
void SetExternalClockPtr(const VQwHardwareChannel *clock) override
void SetRandomEventAsymmetry(Double_t asymmetry) override
Set an asymmetry parameter applied to helicity states.
void CalculateRunningAverage() override
Update running averages for the underlying channel.
void AccumulateRunningSum(const VQwBCM &, Int_t count=0, Int_t ErrorMask=0xFFFFFFF) override
Accumulate running sums from another BCM into this one.
void EncodeEventData(std::vector< UInt_t > &buffer) override
Encode current event data into an output buffer.
Double_t GetValueWidth() override
Get the width of the beam current distribution.
VQwBCM & operator+=(const VQwBCM &value) override
Polymorphic add-assign from VQwBCM if types match.
std::vector< QwErrDBInterface > GetErrDBEntry()
void SetDefaultSampleSize(Int_t sample_size) override
Set the default sample size used by the channel.
void SetResolution(Double_t resolution)
Bool_t ApplyHWChecks()
Apply hardware checks and return whether the event is valid.
QwBCM(const QwBCM &source)
Double_t GetValueError() override
Get the statistical error on the beam current.
void ProcessEvent() override
Apply hardware checks and process the event for this BCM.
void FillHistograms() override
Fill histograms for this BCM if enabled.
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 channel.
VQwHardwareChannel * GetCharge() override
void UseExternalRandomVariable()
Use an external random variable source for mock data.
std::vector< QwDBInterface > GetDBEntry()
Bool_t ApplySingleEventCuts() override
Apply single-event cuts for this BCM and return pass/fail.
void SetRandomEventParameters(Double_t mean, Double_t sigma) override
Configure Gaussian mock data parameters.
void ClearEventData() override
Clear event-scoped data in the underlying channel.
void PrintErrorCounters() const override
Print error counters (const overload).
QwBCM(TString subsystemname, TString name, TString type, TString clock="")
void InitializeChannel(TString name, TString datatosave) override
Initialize the BCM with a name and data-saving mode.
void LoadChannelParameters(QwParameterFile ¶mfile) override
void PrintInfo() const override
Print detailed information for this BCM.
Int_t SetSingleEventCuts(Double_t mean=0, Double_t sigma=0)
Set basic single-event cut limits.
void ConstructBranchAndVector(TTree *tree, TString &prefix, QwRootTreeBranchVector &values) override
Construct ROOT branches and value vector entries.
VQwBCM & operator-=(const VQwBCM &value) override
Polymorphic subtract-assign from VQwBCM.
void FillTreeVector(QwRootTreeBranchVector &values) const override
Fill tree vector entries for this BCM.
void LoadMockDataParameters(QwParameterFile ¶mfile) override
Load mock-data configuration for the underlying channel.
Abstract base for beam current monitors (BCMs)
friend class QwCombinedBCM
VQwBCM(VQwDataElement &beamcurrent)
UInt_t UpdateErrorFlag() override
Update the error flag based on the error flags of internally contained objects Return parameter is th...