14#ifdef HAS_RNTUPLE_SUPPORT
15#include "ROOT/RNTupleModel.hxx"
16#include "ROOT/RField.hxx"
20#ifdef __USE_DATABASE__
73 fTriumf_ADC.InitializeChannel(subsystem,
"QwIntegrationPMT", name, datatosave);
91 fTriumf_ADC.InitializeChannel(subsystem,module, name, datatosave);
123 fTriumf_ADC.SetExternalRandomVariable(random_variable);
135 fTriumf_ADC.SetRandomEventDriftParameters(amplitude, phase, frequency);
147 fTriumf_ADC.AddRandomEventDriftParameters(amplitude, phase, frequency);
291 Bool_t eventokay=kTRUE;
294 eventokay=(deviceerror & 0x0);
325 fTriumf_ADC.SetSingleEventCuts(errorflag,LL,UL,stability,burplevel);
333 fTriumf_ADC.SetDefaultSampleSize((
size_t)sample_size);
339 fTriumf_ADC.SetMollerADCSaturationLimt(saturation_volt);
381 Bool_t burpstatus = kFALSE;
383 if(
typeid(*ev_error)==
typeid(*
this)) {
390 TString loc=
"Standard exception from QwIntegrationPMT::CheckForBurpFail :"+
393 throw std::invalid_argument(loc.Data());
395 }
catch (std::exception& e) {
396 std::cerr<< e.what()<<std::endl;
408 if(
typeid(*ev_error)==
typeid(*
this)) {
414 TString loc=
"Standard exception from QwIntegrationPMT::UpdateErrorFlag :"+
417 throw std::invalid_argument(loc.Data());
419 }
catch (std::exception& e) {
420 std::cerr<< e.what()<<std::endl;
433 fTriumf_ADC.ProcessEvBuffer(buffer,word_position_in_buffer);
435 return word_position_in_buffer;
527 std::cout<<
"QwMollerADC_Channel Info " <<std::endl;
529 std::cout<<
"Blindability is " << (
fIsBlindable?
"TRUE":
"FALSE")
536 <<
" C_e=" <<
fCoeff_e << std::endl;
575 fTriumf_ADC.ConstructBranchAndVector(tree, prefix,values);
595 devicename.ToLower();
599 if (modulelist.
HasValue(devicename)){
618#ifdef HAS_RNTUPLE_SUPPORT
619void QwIntegrationPMT::ConstructNTupleAndVector(std::unique_ptr<ROOT::RNTupleModel>& model, TString& prefix, std::vector<Double_t>& values, std::vector<std::shared_ptr<Double_t>>& fieldPtrs)
625 fTriumf_ADC.ConstructNTupleAndVector(model, prefix, values, fieldPtrs);
629void QwIntegrationPMT::FillNTupleVector(std::vector<Double_t>& values)
const
665#ifdef __USE_DATABASE__
668 std::vector <QwDBInterface> row_list;
677 std::vector <QwErrDBInterface> row_list;
#define QwMessage
Predefined log drain for regular messages.
class QwMollerADC_Channel QwBeamCharge
class QwMollerADC_Channel QwBeamEnergy
static const UInt_t kPMTErrorFlag
class QwMollerADC_Channel QwBeamAngle
class QwMollerADC_Channel QwBeamPosition
Database interface for QwIntegrationPMT and subsystems.
Integration PMT detector for charge and asymmetry measurements.
const TString QwBPMStripline< T >::subelement[4]
static std::ostream & endl(std::ostream &)
End of the line.
Concrete hardware channel for Moller ADC modules (6x32-bit words)
static const Double_t kTimePerSample
void AssignScaledValue(const QwMollerADC_Channel &value, Double_t scale)
Configuration file parser with flexible tokenization and search capabilities.
Bool_t HasValue(TString &vname)
A helper class to manage a vector of branch entries for ROOT trees.
VQwDataElement()
Default constructor.
virtual const TString & GetElementName() const
Get the name of this element.
void AddEntriesToList(std::vector< QwDBInterface > &row_list)
Data blinding utilities for parity violation analysis.
QwIntegrationPMT & operator-=(const QwIntegrationPMT &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 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.
void SetHardwareSum(Double_t hwsum, UInt_t sequencenumber=0)
Set the hardware-level sum measurement for a sequence.
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.
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)
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.
void SetRandomEventAsymmetry(Double_t asymmetry)
Set an asymmetry parameter applied to helicity states.
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.
QwMollerADC_Channel fTriumf_ADC
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 Ratio(QwIntegrationPMT &numer, QwIntegrationPMT &denom)
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.