JAPAn
Just Another Parity Analyzer
Loading...
Searching...
No Matches
QwBCM< T > Class Template Reference

Templated concrete beam current monitor implementation. More...

#include <QwBCM.h>

+ Inheritance diagram for QwBCM< T >:
+ Collaboration diagram for QwBCM< T >:

Public Member Functions

 QwBCM ()
 
 QwBCM (TString name)
 
 QwBCM (TString subsystemname, TString name)
 
 QwBCM (TString subsystemname, TString name, TString type, TString clock="")
 
 QwBCM (const QwBCM &source)
 
 ~QwBCM () override
 
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.
 
void InitializeChannel (TString name, TString datatosave) override
 Initialize the BCM with a name and data-saving mode.
 
void InitializeChannel (TString subsystem, TString name, TString datatosave) override
 Initialize the BCM with subsystem and name.
 
void InitializeChannel (TString subsystem, TString name, TString type, TString datatosave)
 Initialize the BCM with subsystem, module type, and name.
 
void ClearEventData () override
 Clear event-scoped data in the underlying channel.
 
void LoadChannelParameters (QwParameterFile &paramfile) override
 
void SetRandomEventDriftParameters (Double_t amplitude, Double_t phase, Double_t frequency)
 Configure deterministic drift parameters applied per event.
 
void AddRandomEventDriftParameters (Double_t amplitude, Double_t phase, Double_t frequency) override
 Add additional drift parameters to the drift model.
 
void SetRandomEventParameters (Double_t mean, Double_t sigma) override
 Configure Gaussian mock data parameters.
 
void SetRandomEventAsymmetry (Double_t asymmetry) override
 Set an asymmetry parameter applied to helicity states.
 
void SetResolution (Double_t resolution)
 
void ApplyResolutionSmearing () override
 Smear the channel by the configured resolution.
 
void FillRawEventData () override
 Materialize the current event state as raw event data.
 
void RandomizeEventData (int helicity=0, double time=0) override
 Generate mock event data for this BCM.
 
void LoadMockDataParameters (QwParameterFile &paramfile) override
 Load mock-data configuration for the underlying channel.
 
void EncodeEventData (std::vector< UInt_t > &buffer) override
 Encode current event data into an output buffer.
 
void UseExternalRandomVariable ()
 Use an external random variable source for mock data.
 
void SetExternalRandomVariable (Double_t random_variable)
 Set the external random variable to drive mock data.
 
void ProcessEvent () override
 Apply hardware checks and process the event for this BCM.
 
Bool_t ApplyHWChecks ()
 Apply hardware checks and return whether the event is valid.
 
Bool_t ApplySingleEventCuts () override
 Apply single-event cuts for this BCM and return pass/fail.
 
void IncrementErrorCounters () override
 Increment error counters (number of failed events).
 
void PrintErrorCounters () const override
 Print error counters (const overload).
 
UInt_t GetEventcutErrorFlag () override
 return the error flag on this channel/device
 
void UpdateErrorFlag (const VQwBCM *ev_error) override
 Merge error flags from a reference BCM into this instance.
 
UInt_t GetErrorCode () const
 
Int_t SetSingleEventCuts (Double_t mean=0, Double_t sigma=0)
 Set basic single-event cut limits.
 
void SetSingleEventCuts (UInt_t errorflag, Double_t min=0, Double_t max=0, Double_t stability=0, Double_t burplevel=0) override
 Inherited from VQwDataElement to set the upper and lower limits (fULimit and fLLimit), stability % and the error flag on this channel.
 
void SetDefaultSampleSize (Int_t sample_size) override
 Set the default sample size used by the channel.
 
void SetEventCutMode (Int_t bcuts) override
 
void PrintValue () const override
 Print a compact value summary for this BCM.
 
void PrintInfo () const override
 Print detailed information for this BCM.
 
std::string GetExternalClockName () override
 
Bool_t NeedsExternalClock () override
 
void SetExternalClockPtr (const VQwHardwareChannel *clock) override
 
void SetExternalClockName (const std::string name) override
 
Double_t GetNormClockValue () override
 
VQwBCMoperator= (const VQwBCM &value) override
 Polymorphic copy-assign from VQwBCM if types match.
 
VQwBCMoperator+= (const VQwBCM &value) override
 Polymorphic add-assign from VQwBCM if types match.
 
VQwBCMoperator-= (const VQwBCM &value) override
 Polymorphic subtract-assign from VQwBCM.
 
void SetBCMForCombo (VQwBCM *bcm, Double_t weight, Double_t sumqw) override
 
QwBCMoperator= (const QwBCM &value)
 Copy-assign from another BCM (event-scoped data).
 
QwBCMoperator+= (const QwBCM &value)
 Add-assign from another BCM (sum raw channels).
 
QwBCMoperator-= (const QwBCM &value)
 Subtract-assign from another BCM (difference raw channels).
 
void Ratio (const VQwBCM &numer, const VQwBCM &denom) override
 Polymorphic ratio formation for BCM.
 
void Ratio (const QwBCM &numer, const QwBCM &denom)
 Type-specific ratio formation for BCM.
 
void Scale (Double_t factor) override
 Scale the underlying channel by a constant factor.
 
void AccumulateRunningSum (const VQwBCM &, Int_t count=0, Int_t ErrorMask=0xFFFFFFF) override
 Accumulate running sums from another BCM into this one.
 
void DeaccumulateRunningSum (VQwBCM &value, Int_t ErrorMask=0xFFFFFFF) override
 Remove a single entry from the running sums using a source value.
 
void CalculateRunningAverage () override
 Update running averages for the underlying channel.
 
Bool_t CheckForBurpFail (const VQwDataElement *ev_error) override
 Check for burp failures by delegating to the underlying channel.
 
void SetPedestal (Double_t ped) override
 Set the pedestal value for the beam current monitor.
 
void SetCalibrationFactor (Double_t calib) override
 Set the calibration factor for the beam current monitor.
 
void ConstructHistograms (TDirectory *folder, TString &prefix) override
 Define histograms for this BCM (delegated to underlying channel).
 
void FillHistograms () override
 Fill histograms for this BCM if enabled.
 
void ConstructBranchAndVector (TTree *tree, TString &prefix, QwRootTreeBranchVector &values) override
 Construct ROOT branches and value vector entries.
 
void ConstructBranch (TTree *tree, TString &prefix) override
 Construct ROOT branches for this BCM (if enabled).
 
void ConstructBranch (TTree *tree, TString &prefix, QwParameterFile &modulelist) override
 Construct ROOT branches for this BCM using a trim file filter.
 
void FillTreeVector (QwRootTreeBranchVector &values) const override
 Fill tree vector entries for this BCM.
 
std::vector< QwDBInterfaceGetDBEntry ()
 
std::vector< QwErrDBInterfaceGetErrDBEntry ()
 
Double_t GetValue () override
 Get the current value of the beam current.
 
Double_t GetValueError () override
 Get the statistical error on the beam current.
 
Double_t GetValueWidth () override
 Get the width of the beam current distribution.
 
- Public Member Functions inherited from VQwBCM
 ~VQwBCM () override
 
UInt_t UpdateErrorFlag () override
 Update the error flag based on the error flags of internally contained objects Return parameter is the "Eventcut Error Flag".
 
virtual void GetProjectedCharge (VQwBCM *)
 
virtual size_t GetNumberOfElements ()
 
virtual TString GetSubElementName (Int_t)
 
virtual const VQwHardwareChannelGetCharge () const
 
- Public Member Functions inherited from VQwDataElement
 VQwDataElement ()
 Default constructor.
 
 VQwDataElement (const VQwDataElement &value)
 Copy constructor.
 
 ~VQwDataElement () override
 Virtual destructor.
 
void CopyFrom (const VQwDataElement &value)
 
Bool_t IsNameEmpty () const
 Is the name of this element empty?
 
void SetElementName (const TString &name)
 Set the name of this element.
 
virtual const TString & GetElementName () const
 Get the name of this element.
 
size_t GetNumberOfDataWords ()
 Get the number of data words in this data element.
 
UInt_t GetGoodEventCount () const
 
virtual void AssignValueFrom (const VQwDataElement *)
 
VQwDataElementoperator+= (const VQwDataElement &)
 Addition-assignment operator.
 
VQwDataElementoperator-= (const VQwDataElement &)
 Subtraction-assignment operator.
 
void Sum (const VQwDataElement &, const VQwDataElement &)
 Sum operator (base class fallback throws runtime error)
 
void Difference (const VQwDataElement &, const VQwDataElement &)
 Difference operator (base class fallback throws runtime error)
 
void Ratio (const VQwDataElement &, const VQwDataElement &)
 Ratio operator (base class fallback throws runtime error)
 
void SetSingleEventCuts (UInt_t, Double_t, Double_t, Double_t)
 set the upper and lower limits (fULimit and fLLimit), stability % and the error flag on this channel
 
Bool_t CheckForBurpFail (const VQwDataElement *)
 
virtual void SetNeedsExternalClock (Bool_t)
 
TString GetSubsystemName () const
 Return the name of the inheriting subsystem name.
 
void SetSubsystemName (TString sysname)
 Set the name of the inheriting subsystem name.
 
TString GetModuleType () const
 Return the type of the beam instrument.
 
void SetModuleType (TString ModuleType)
 set the type of the beam instrument
 
- Public Member Functions inherited from MQwHistograms
void ShareHistograms (const MQwHistograms *source)
 Share histogram pointers between objects.
 

Protected Member Functions

VQwHardwareChannelGetCharge () override
 
- Protected Member Functions inherited from VQwBCM
 VQwBCM (VQwDataElement &beamcurrent)
 
 VQwBCM (VQwDataElement &beamcurrent, TString)
 
- Protected Member Functions inherited from VQwDataElement
void SetNumberOfDataWords (const UInt_t &numwords)
 Set the number of data words in this data element.
 
VQwDataElementoperator= (const VQwDataElement &value)
 Arithmetic assignment operator: Should only copy event-based data.
 
void UpdateErrorFlag (const UInt_t &error)
 
- Protected Member Functions inherited from MQwHistograms
 MQwHistograms ()
 Default constructor.
 
 MQwHistograms (const MQwHistograms &source)
 Copy constructor.
 
virtual ~MQwHistograms ()
 Virtual destructor.
 
MQwHistogramsoperator= (const MQwHistograms &value)
 
void Fill_Pointer (TH1_ptr hist_ptr, Double_t value)
 
void AddHistogram (TH1 *h)
 Register a histogram.
 

Protected Attributes

fBeamCurrent
 
- Protected Attributes inherited from VQwBCM
VQwDataElementfBeamCurrent_ref
 
- Protected Attributes inherited from VQwDataElement
TString fElementName
 Name of this data element.
 
UInt_t fNumberOfDataWords
 Number of raw data words in this data element.
 
UInt_t fGoodEventCount
 Number of good events accumulated in this element.
 
TString fSubsystemName
 
TString fModuleType
 
UInt_t fErrorFlag
 This the standard error code generated for the channel that contains the global/local/stability flags and the Device error code (Unique error code for HW failures)
 
UInt_t fErrorConfigFlag
 contains the global/local/stability flags
 
- Protected Attributes inherited from MQwHistograms
std::vector< TH1_ptrfHistograms
 Histograms associated with this data element.
 

Private Attributes

Double_t fResolution
 

Friends

class QwCombinedBCM< T >
 

Additional Inherited Members

- Public Types inherited from VQwDataElement
enum  EDataToSave { kRaw = 0 , kDerived , kMoments }
 
- Static Public Member Functions inherited from VQwBCM
static VQwBCMCreate (TString subsystemname, TString type, TString name, TString clock="")
 Factory method to create a concrete BCM instance for the requested module type.
 
static VQwBCMCreate (const VQwBCM &source)
 Copy constructor factory method to clone a BCM from an existing instance.
 
static VQwBCMCreateCombo (TString subsystemname, TString type, TString name)
 Factory method to create a concrete Combined BCM for the requested module type.
 
static VQwBCMCreateCombo (const VQwBCM &source)
 

Detailed Description

template<typename T>
class QwBCM< T >

Templated concrete beam current monitor implementation.

Template class that implements a beam current monitor using a specified hardware channel type T. Handles event decoding, calibration, single-event cuts, mock data generation, and database output. Supports external clock normalization and statistical analysis.

Definition at line 36 of file QwBCM.h.

Constructor & Destructor Documentation

◆ QwBCM() [1/5]

template<typename T>
QwBCM< T >::QwBCM ( )
inline

Definition at line 40 of file QwBCM.h.

40: VQwBCM(fBeamCurrent) { };
T fBeamCurrent
Definition QwBCM.h:187
VQwBCM(VQwDataElement &beamcurrent)
Definition VQwBCM.h:64

References fBeamCurrent, and VQwBCM::VQwBCM().

Referenced by AccumulateRunningSum(), CheckForBurpFail(), DeaccumulateRunningSum(), operator+=(), operator+=(), operator-=(), operator-=(), operator=(), operator=(), QwBCM(), QwCombinedBCM< T >::QwCombinedBCM(), Ratio(), Ratio(), QwCombinedBCM< T >::SetBCMForCombo(), and UpdateErrorFlag().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ QwBCM() [2/5]

template<typename T>
QwBCM< T >::QwBCM ( TString name)
inline

Definition at line 41 of file QwBCM.h.

43 };
Templated concrete beam current monitor implementation.
Definition QwBCM.h:36
void InitializeChannel(TString name, TString datatosave) override
Initialize the BCM with a name and data-saving mode.
Definition QwBCM.cc:54

References fBeamCurrent, InitializeChannel(), and VQwBCM::VQwBCM().

+ Here is the call graph for this function:

◆ QwBCM() [3/5]

template<typename T>
QwBCM< T >::QwBCM ( TString subsystemname,
TString name )
inline

Definition at line 44 of file QwBCM.h.

48 };
void SetSubsystemName(TString sysname)
Set the name of the inheriting subsystem name.

References fBeamCurrent, InitializeChannel(), VQwDataElement::SetSubsystemName(), and VQwBCM::VQwBCM().

+ Here is the call graph for this function:

◆ QwBCM() [4/5]

template<typename T>
QwBCM< T >::QwBCM ( TString subsystemname,
TString name,
TString type,
TString clock = "" )
inline

Definition at line 49 of file QwBCM.h.

51 fBeamCurrent.SetExternalClockName(clock.Data());
54 };

References fBeamCurrent, InitializeChannel(), VQwDataElement::SetSubsystemName(), and VQwBCM::VQwBCM().

+ Here is the call graph for this function:

◆ QwBCM() [5/5]

template<typename T>
QwBCM< T >::QwBCM ( const QwBCM< T > & source)
inline

Definition at line 55 of file QwBCM.h.

References fBeamCurrent, QwBCM(), and VQwBCM::VQwBCM().

+ Here is the call graph for this function:

◆ ~QwBCM()

template<typename T>
QwBCM< T >::~QwBCM ( )
inlineoverride

Definition at line 59 of file QwBCM.h.

59{ };

Member Function Documentation

◆ AccumulateRunningSum()

template<typename T>
void QwBCM< T >::AccumulateRunningSum ( const VQwBCM< T > & value,
Int_t count = 0,
Int_t ErrorMask = 0xFFFFFFF )
overridevirtual

Accumulate running sums from another BCM into this one.

Implements VQwBCM.

Definition at line 527 of file QwBCM.cc.

527 {
528 fBeamCurrent.AccumulateRunningSum(
529 dynamic_cast<const QwBCM<T>* >(&value)->fBeamCurrent, count, ErrorMask);
530}
QwBCM()
Definition QwBCM.h:40

References fBeamCurrent, QwBCM(), and VQwBCM::VQwBCM().

+ Here is the call graph for this function:

◆ AddRandomEventDriftParameters()

template<typename T>
void QwBCM< T >::AddRandomEventDriftParameters ( Double_t amplitude,
Double_t phase,
Double_t frequency )
overridevirtual

Add additional drift parameters to the drift model.

Implements VQwBCM.

Definition at line 170 of file QwBCM.cc.

171{
172 fBeamCurrent.AddRandomEventDriftParameters(amplitude, phase, frequency);
173}

References fBeamCurrent.

◆ ApplyHWChecks()

template<typename T>
Bool_t QwBCM< T >::ApplyHWChecks ( )

Apply hardware checks and return whether the event is valid.

Returns
kTRUE if no hardware error was detected; otherwise kFALSE.

Definition at line 235 of file QwBCM.cc.

236{
238
239 UInt_t deviceerror=fBeamCurrent.ApplyHWChecks();//will check for HW consistency and return the error code (=0 is HW good)
240 eventokay=(deviceerror & 0x0);//if no HW error return true
241
242 return eventokay;
243}

References fBeamCurrent.

Referenced by ProcessEvent().

+ Here is the caller graph for this function:

◆ ApplyResolutionSmearing()

template<typename T>
void QwBCM< T >::ApplyResolutionSmearing ( )
overridevirtual

Smear the channel by the configured resolution.

Reimplemented from VQwBCM.

Definition at line 191 of file QwBCM.cc.

191 {
192 fBeamCurrent.SmearByResolution(fResolution);
193}
Double_t fResolution
Definition QwBCM.h:191

References fBeamCurrent, and fResolution.

◆ ApplySingleEventCuts()

template<typename T>
Bool_t QwBCM< T >::ApplySingleEventCuts ( )
overridevirtual

Apply single-event cuts for this BCM and return pass/fail.

Returns
kTRUE if event passes, otherwise kFALSE.

Implements VQwBCM.

Reimplemented in QwCombinedBCM< T >.

Definition at line 279 of file QwBCM.cc.

280{
281 //std::cout<<" QwBCM::SingleEventCuts() "<<std::endl;
283
284 if (fBeamCurrent.ApplySingleEventCuts()) {
285 status = kTRUE;
286 } else {
287 status &= kFALSE;
288 }
289 return status;
290}

References fBeamCurrent.

Referenced by QwCombinedBCM< T >::ApplySingleEventCuts().

+ Here is the caller graph for this function:

◆ CalculateRunningAverage()

template<typename T>
void QwBCM< T >::CalculateRunningAverage ( )
overridevirtual

Update running averages for the underlying channel.

Implements VQwBCM.

Definition at line 492 of file QwBCM.cc.

493{
494 fBeamCurrent.CalculateRunningAverage();
495}

References fBeamCurrent.

◆ CheckForBurpFail()

template<typename T>
Bool_t QwBCM< T >::CheckForBurpFail ( const VQwDataElement * ev_error)
overridevirtual

Check for burp failures by delegating to the underlying channel.

Parameters
ev_errorReference BCM to compare against.
Returns
kTRUE if a burp failure was detected; otherwise kFALSE.

Reimplemented from VQwBCM.

Definition at line 503 of file QwBCM.cc.

503 {
505 //QwError << "************* " << this->GetElementName() << " <<<this, event>>> " << ev_error->GetElementName() << " *****************" << QwLog::endl;
506 try {
507 if(typeid(*ev_error)==typeid(*this)) {
508 //std::cout<<" Here in VQwBCM::CheckForBurpFail \n";
509 if (this->GetElementName()!="") {
510 const QwBCM<T>* value_bcm = dynamic_cast<const QwBCM<T>* >(ev_error);
511 burpstatus |= fBeamCurrent.CheckForBurpFail(&(value_bcm->fBeamCurrent));
512 }
513 } else {
514 TString loc="Standard exception from QwBCM::CheckForBurpFail :"+
515 ev_error->GetElementName()+" "+this->GetElementName()+" are not of the "
516 +"same type";
517 throw std::invalid_argument(loc.Data());
518 }
519 } catch (std::exception& e) {
520 std::cerr<< e.what()<<std::endl;
521 }
522 return burpstatus;
523}
virtual const TString & GetElementName() const
Get the name of this element.

References fBeamCurrent, VQwDataElement::GetElementName(), QwBCM(), and VQwDataElement::VQwDataElement().

+ Here is the call graph for this function:

◆ ClearEventData()

template<typename T>
void QwBCM< T >::ClearEventData ( )
overridevirtual

Clear event-scoped data in the underlying channel.

Implements VQwBCM.

Definition at line 136 of file QwBCM.cc.

137{
138 fBeamCurrent.ClearEventData();
139}

References fBeamCurrent.

Referenced by QwCombinedBCM< T >::ProcessEvent().

+ Here is the caller graph for this function:

◆ ConstructBranch() [1/2]

template<typename T>
void QwBCM< T >::ConstructBranch ( TTree * tree,
TString & prefix )
overridevirtual

Construct ROOT branches for this BCM (if enabled).

Implements VQwBCM.

Definition at line 604 of file QwBCM.cc.

605{
606 if (GetElementName()==""){
607 // This channel is not used, so skip filling the histograms.
608 } else
609 {
610 fBeamCurrent.ConstructBranch(tree, prefix);
611 // this functions doesn't do anything yet
612 }
613}

References fBeamCurrent, and VQwDataElement::GetElementName().

+ Here is the call graph for this function:

◆ ConstructBranch() [2/2]

template<typename T>
void QwBCM< T >::ConstructBranch ( TTree * tree,
TString & prefix,
QwParameterFile & modulelist )
overridevirtual

Construct ROOT branches for this BCM using a trim file filter.

Implements VQwBCM.

Definition at line 617 of file QwBCM.cc.

618{
620
622 devicename.ToLower();
623 if (GetElementName()==""){
624 // This channel is not used, so skip filling the histograms.
625 } else
626 {
627
628 //QwMessage <<" QwBCM "<<devicename<<QwLog::endl;
629 if (modulelist.HasValue(devicename)){
630 fBeamCurrent.ConstructBranch(tree, prefix);
631 QwMessage <<" Tree leave added to "<<devicename<<QwLog::endl;
632 }
633 // this functions doesn't do anything yet
634 }
635}

References QwLog::endl(), fBeamCurrent, VQwDataElement::GetElementName(), QwParameterFile::HasValue(), and QwMessage.

+ Here is the call graph for this function:

◆ ConstructBranchAndVector()

template<typename T>
void QwBCM< T >::ConstructBranchAndVector ( TTree * tree,
TString & prefix,
QwRootTreeBranchVector & values )
overridevirtual

Construct ROOT branches and value vector entries.

Parameters
treeOutput tree.
prefixBranch name prefix.
valuesOutput value vector to be appended.

Implements VQwBCM.

Definition at line 592 of file QwBCM.cc.

593{
594 if (this->GetElementName()==""){
595 // This channel is not used, so skip
596 } else
597 {
598 fBeamCurrent.ConstructBranchAndVector(tree, prefix,values);
599 }
600}

References fBeamCurrent, and VQwDataElement::GetElementName().

+ Here is the call graph for this function:

◆ ConstructHistograms()

template<typename T>
void QwBCM< T >::ConstructHistograms ( TDirectory * folder,
TString & prefix )
overridevirtual

Define histograms for this BCM (delegated to underlying channel).

Parameters
folderROOT folder to contain histograms.
prefixHistogram name prefix.

Implements VQwBCM.

Definition at line 559 of file QwBCM.cc.

560{
561 if (this->GetElementName()=="")
562 {
563 // This channel is not used, so skip filling the histograms.
564 }
565 else
566 {
567 fBeamCurrent.ConstructHistograms(folder, prefix);
568 }
569}

References fBeamCurrent, and VQwDataElement::GetElementName().

+ Here is the call graph for this function:

◆ DeaccumulateRunningSum()

template<typename T>
void QwBCM< T >::DeaccumulateRunningSum ( VQwBCM< T > & value,
Int_t ErrorMask = 0xFFFFFFF )
overridevirtual

Remove a single entry from the running sums using a source value.

Implements VQwBCM.

Definition at line 534 of file QwBCM.cc.

534 {
535 fBeamCurrent.DeaccumulateRunningSum(dynamic_cast<QwBCM<T>* >(&value)->fBeamCurrent, ErrorMask);
536}

References fBeamCurrent, QwBCM(), and VQwBCM::VQwBCM().

+ Here is the call graph for this function:

◆ EncodeEventData()

template<typename T>
void QwBCM< T >::EncodeEventData ( std::vector< UInt_t > & buffer)
overridevirtual

Encode current event data into an output buffer.

Implements VQwBCM.

Definition at line 216 of file QwBCM.cc.

217{
218 fBeamCurrent.EncodeEventData(buffer);
219}

References fBeamCurrent.

◆ FillHistograms()

template<typename T>
void QwBCM< T >::FillHistograms ( )
overridevirtual

Fill histograms for this BCM if enabled.

Implements VQwBCM.

Definition at line 573 of file QwBCM.cc.

574{
575 if (this->GetElementName()=="")
576 {
577 // This channel is not used, so skip filling the histograms.
578 }
579 else
580 {
581 fBeamCurrent.FillHistograms();
582 }
583}

References fBeamCurrent, and VQwDataElement::GetElementName().

+ Here is the call graph for this function:

◆ FillRawEventData()

template<typename T>
void QwBCM< T >::FillRawEventData ( )
overridevirtual

Materialize the current event state as raw event data.

Reimplemented from VQwBCM.

Definition at line 196 of file QwBCM.cc.

197{
198 fBeamCurrent.SetRawEventData();
199}

References fBeamCurrent.

◆ FillTreeVector()

template<typename T>
void QwBCM< T >::FillTreeVector ( QwRootTreeBranchVector & values) const
overridevirtual

Fill tree vector entries for this BCM.

Implements VQwBCM.

Definition at line 639 of file QwBCM.cc.

640{
641 if (this->GetElementName()==""){
642 // This channel is not used, so skip filling the histograms.
643 } else
644 {
645 fBeamCurrent.FillTreeVector(values);
646 // this functions doesn't do anything yet
647 }
648}

References fBeamCurrent, and VQwDataElement::GetElementName().

+ Here is the call graph for this function:

◆ GetCharge()

template<typename T>
VQwHardwareChannel * QwBCM< T >::GetCharge ( )
inlineoverrideprotectedvirtual

Implements VQwBCM.

Reimplemented in QwCombinedBCM< T >.

Definition at line 124 of file QwBCM.h.

124 {
125 return &fBeamCurrent;
126 };

References fBeamCurrent.

◆ GetDBEntry()

template<typename T>
std::vector< QwDBInterface > QwBCM< T >::GetDBEntry ( )

◆ GetErrDBEntry()

template<typename T>
std::vector< QwErrDBInterface > QwBCM< T >::GetErrDBEntry ( )

◆ GetErrorCode()

template<typename T>
UInt_t QwBCM< T >::GetErrorCode ( ) const
inline

Definition at line 108 of file QwBCM.h.

108{return (fBeamCurrent.GetErrorCode());};

References fBeamCurrent.

◆ GetEventcutErrorFlag()

template<typename T>
UInt_t QwBCM< T >::GetEventcutErrorFlag ( )
inlineoverridevirtual

return the error flag on this channel/device

Reimplemented from VQwDataElement.

Definition at line 102 of file QwBCM.h.

102 {//return the error flag
103 return fBeamCurrent.GetEventcutErrorFlag();
104 }

References fBeamCurrent.

◆ GetExternalClockName()

template<typename T>
std::string QwBCM< T >::GetExternalClockName ( )
inlineoverridevirtual

Reimplemented from VQwDataElement.

Definition at line 130 of file QwBCM.h.

130{ return fBeamCurrent.GetExternalClockName(); };

References fBeamCurrent.

◆ GetNormClockValue()

template<typename T>
Double_t QwBCM< T >::GetNormClockValue ( )
inlineoverridevirtual

Implements VQwBCM.

Definition at line 134 of file QwBCM.h.

134{ return fBeamCurrent.GetNormClockValue();}

References fBeamCurrent.

◆ GetValue()

template<typename T>
Double_t QwBCM< T >::GetValue ( )
overridevirtual

Get the current value of the beam current.

Implements VQwBCM.

Definition at line 698 of file QwBCM.cc.

699{
700 return fBeamCurrent.GetValue();
701}

References fBeamCurrent.

◆ GetValueError()

template<typename T>
Double_t QwBCM< T >::GetValueError ( )
overridevirtual

Get the statistical error on the beam current.

Implements VQwBCM.

Definition at line 706 of file QwBCM.cc.

707{
708 return fBeamCurrent.GetValueError();
709}

References fBeamCurrent.

◆ GetValueWidth()

template<typename T>
Double_t QwBCM< T >::GetValueWidth ( )
overridevirtual

Get the width of the beam current distribution.

Implements VQwBCM.

Definition at line 713 of file QwBCM.cc.

714{
715 return fBeamCurrent.GetValueWidth();
716}

References fBeamCurrent.

◆ IncrementErrorCounters()

template<typename T>
void QwBCM< T >::IncrementErrorCounters ( )
overridevirtual

Increment error counters (number of failed events).

Implements VQwBCM.

Definition at line 296 of file QwBCM.cc.

297{// report number of events failed due to HW and event cut failure
298 fBeamCurrent.IncrementErrorCounters();
299}

References fBeamCurrent.

◆ InitializeChannel() [1/3]

template<typename T>
void QwBCM< T >::InitializeChannel ( TString name,
TString datatosave )
overridevirtual

Initialize the BCM with a name and data-saving mode.

Parameters
nameDetector name used for branches and histograms.
datatosaveStorage mode (e.g., "raw" or "derived").

Implements VQwBCM.

Reimplemented in QwCombinedBCM< T >.

Definition at line 54 of file QwBCM.cc.

55{
56 SetPedestal(0.);
58 SetResolution(0.0);
59 fBeamCurrent.InitializeChannel(name,datatosave);
60 this->SetElementName(name);
61}
void SetElementName(const TString &name)
Set the name of this element.
void SetPedestal(Double_t ped) override
Set the pedestal value for the beam current monitor.
Definition QwBCM.cc:33
void SetCalibrationFactor(Double_t calib) override
Set the calibration factor for the beam current monitor.
Definition QwBCM.cc:43
void SetResolution(Double_t resolution)
Definition QwBCM.h:79

References fBeamCurrent, SetCalibrationFactor(), VQwDataElement::SetElementName(), SetPedestal(), and SetResolution().

Referenced by QwBCM(), QwBCM(), and QwBCM().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ InitializeChannel() [2/3]

template<typename T>
void QwBCM< T >::InitializeChannel ( TString subsystem,
TString name,
TString datatosave )
overridevirtual

Initialize the BCM with subsystem and name.

Parameters
subsystemSubsystem identifier.
nameDetector name used for branches and histograms.
datatosaveStorage mode (e.g., "raw" or "derived").

Implements VQwBCM.

Reimplemented in QwCombinedBCM< T >.

Definition at line 70 of file QwBCM.cc.

70 {
71 SetPedestal(0.);
73 SetResolution(0.0);
74 fBeamCurrent.InitializeChannel(subsystem, "QwBCM", name, datatosave);
76}

References fBeamCurrent, SetCalibrationFactor(), VQwDataElement::SetElementName(), SetPedestal(), and SetResolution().

+ Here is the call graph for this function:

◆ InitializeChannel() [3/3]

template<typename T>
void QwBCM< T >::InitializeChannel ( TString subsystem,
TString name,
TString type,
TString datatosave )

Initialize the BCM with subsystem, module type, and name.

Parameters
subsystemSubsystem identifier.
nameDetector name used for branches and histograms.
typeModule type tag used in ROOT foldering.
datatosaveStorage mode (e.g., "raw" or "derived").

Definition at line 86 of file QwBCM.cc.

86 {
87 SetPedestal(0.);
89 SetResolution(0.0);
91 fBeamCurrent.InitializeChannel(subsystem, "QwBCM", name, datatosave);
93}
void SetModuleType(TString ModuleType)
set the type of the beam instrument

References fBeamCurrent, SetCalibrationFactor(), VQwDataElement::SetElementName(), VQwDataElement::SetModuleType(), SetPedestal(), and SetResolution().

+ Here is the call graph for this function:

◆ LoadChannelParameters()

template<typename T>
void QwBCM< T >::LoadChannelParameters ( QwParameterFile & paramfile)
inlineoverridevirtual

Implements VQwBCM.

Definition at line 70 of file QwBCM.h.

70 {
71 fBeamCurrent.LoadChannelParameters(paramfile);
72 };

References fBeamCurrent.

◆ LoadMockDataParameters()

template<typename T>
void QwBCM< T >::LoadMockDataParameters ( QwParameterFile & paramfile)
overridevirtual

Load mock-data configuration for the underlying channel.

Parameters
paramfileParameter file reader positioned at channel section.

Reimplemented from VQwDataElement.

Reimplemented in QwCombinedBCM< T >.

Definition at line 100 of file QwBCM.cc.

100 {
101/*
102 Bool_t ldebug=kFALSE;
103 Double_t asym=0.0, mean=0.0, sigma=0.0;
104*/
105 Double_t res=0.0;
106
107 if (paramfile.GetLine().find("resolution")!=std::string::npos){
108 paramfile.GetNextToken();
109 res = paramfile.GetTypedNextToken<Double_t>();
110 this->SetResolution(res);
111 } else {
112/*
113 asym = paramfile.GetTypedNextToken<Double_t>();
114 mean = paramfile.GetTypedNextToken<Double_t>();
115 sigma = paramfile.GetTypedNextToken<Double_t>();
116
117 if (ldebug==1) {
118 std::cout << "#################### \n";
119 std::cout << "asym, mean, sigma \n" << std::endl;
120 std::cout << asym << " / "
121 << mean << " / "
122 << sigma << " / "
123 << std::endl;
124 }
125 this->SetRandomEventParameters(mean, sigma);
126 this->SetRandomEventAsymmetry(asym);
127*/
128 //std::cout << "In QwBCM: ChannelName = " << GetElementName() << std::endl;
129 fBeamCurrent.SetMockDataAsDiff();
130 fBeamCurrent.LoadMockDataParameters(paramfile);
131 }
132}

References fBeamCurrent, QwParameterFile::GetLine(), QwParameterFile::GetNextToken(), QwParameterFile::GetTypedNextToken(), and SetResolution().

+ Here is the call graph for this function:

◆ NeedsExternalClock()

template<typename T>
Bool_t QwBCM< T >::NeedsExternalClock ( )
inlineoverridevirtual

Implements VQwBCM.

Definition at line 131 of file QwBCM.h.

131{ return fBeamCurrent.NeedsExternalClock(); };

References fBeamCurrent.

◆ operator+=() [1/2]

template<typename T>
QwBCM< T > & QwBCM< T >::operator+= ( const QwBCM< T > & value)

Add-assign from another BCM (sum raw channels).

Definition at line 392 of file QwBCM.cc.

393{
394 if (this->GetElementName()!="")
395 {
397 }
398 return *this;
399}

References fBeamCurrent, VQwDataElement::GetElementName(), and QwBCM().

+ Here is the call graph for this function:

◆ operator+=() [2/2]

template<typename T>
VQwBCM & QwBCM< T >::operator+= ( const VQwBCM< T > & value)
overridevirtual

Polymorphic add-assign from VQwBCM if types match.

Implements VQwBCM.

Definition at line 403 of file QwBCM.cc.

404{
405 try {
406 if(typeid(value)==typeid(*this)) {
407 // std::cout<<" Here in QwBCM::operator+= \n";
408 if (this->GetElementName()!="") {
409 const QwBCM<T>* value_bcm = dynamic_cast<const QwBCM<T>* >(&value);
410 QwBCM<T>* this_cast = dynamic_cast<QwBCM<T>* >(this);
412 }
413 } else {
414 TString loc="Standard exception from QwBCM::operator+= :"+
415 value.GetElementName()+" "+this->GetElementName()+" are not of the "
416 +"same type";
417 throw std::invalid_argument(loc.Data());
418 }
419 } catch (std::exception& e) {
420 std::cerr<< e.what()<<std::endl;
421 }
422
423 return *this;
424}

References fBeamCurrent, VQwDataElement::GetElementName(), QwBCM(), and VQwBCM::VQwBCM().

+ Here is the call graph for this function:

◆ operator-=() [1/2]

template<typename T>
QwBCM< T > & QwBCM< T >::operator-= ( const QwBCM< T > & value)

Subtract-assign from another BCM (difference raw channels).

Definition at line 441 of file QwBCM.cc.

442{
443 try {
444 if(typeid(value)==typeid(*this)) {
445 // std::cout<<" Here in QwBCM::operator-= \n";
446 if (this->GetElementName()!="") {
447 const QwBCM<T>* value_bcm = dynamic_cast<const QwBCM<T>* >(&value);
448 QwBCM<T>* this_cast = dynamic_cast<QwBCM<T>* >(this);
450 }
451 } else {
452 TString loc="Standard exception from QwBCM::operator-= :"+
453 value.GetElementName()+" "+this->GetElementName()+" are not of the "
454 +"same type";
455 throw std::invalid_argument(loc.Data());
456 }
457 } catch (std::exception& e) {
458 std::cerr<< e.what()<<std::endl;
459 }
460 return *this;
461}

References fBeamCurrent, VQwDataElement::GetElementName(), and QwBCM().

+ Here is the call graph for this function:

◆ operator-=() [2/2]

template<typename T>
VQwBCM & QwBCM< T >::operator-= ( const VQwBCM< T > & value)
overridevirtual

Polymorphic subtract-assign from VQwBCM.

Implements VQwBCM.

Definition at line 428 of file QwBCM.cc.

429{
430 if (this->GetElementName()!="")
431 {
432 const QwBCM<T>* value_bcm = dynamic_cast<const QwBCM<T>* >(&value);
433 QwBCM<T>* this_cast = dynamic_cast<QwBCM<T>* >(this);
435 }
436 return *this;
437}

References fBeamCurrent, VQwDataElement::GetElementName(), QwBCM(), and VQwBCM::VQwBCM().

+ Here is the call graph for this function:

◆ operator=() [1/2]

template<typename T>
QwBCM< T > & QwBCM< T >::operator= ( const QwBCM< T > & value)

Copy-assign from another BCM (event-scoped data).

Definition at line 346 of file QwBCM.cc.

347{
348// std::cout<<" Here in QwBCM::operator= \n";
349 if (this->GetElementName()!="")
350 {
352 }
353// std::cout<<" to be copied \n";
354// value.Print();
355// std::cout<<" copied \n";
356// this->Print();
357
358 return *this;
359}

References fBeamCurrent, VQwDataElement::GetElementName(), and QwBCM().

+ Here is the call graph for this function:

◆ operator=() [2/2]

template<typename T>
VQwBCM & QwBCM< T >::operator= ( const VQwBCM< T > & value)
overridevirtual

Polymorphic copy-assign from VQwBCM if types match.

Implements VQwBCM.

Reimplemented in QwCombinedBCM< T >.

Definition at line 363 of file QwBCM.cc.

364{
365 try {
366 if(typeid(value)==typeid(*this)) {
367 // std::cout<<" Here in QwBCM::operator= \n";
368 if (this->GetElementName()!="") {
369 const QwBCM<T>* value_bcm = dynamic_cast<const QwBCM<T>* >(&value);
370 QwBCM<T>* this_cast = dynamic_cast<QwBCM<T>* >(this);
372 }
373 } else {
374 TString loc="Standard exception from QwBCM::operator= :"+
375 value.GetElementName()+" "+this->GetElementName()+" are not of the "
376 +"same type";
377 throw std::invalid_argument(loc.Data());
378 }
379 } catch (std::exception& e) {
380 std::cerr<< e.what()<<std::endl;
381 }
382// std::cout<<" to be copied \n";
383// value.Print();
384// std::cout<<" copied \n";
385// this->Print();
386
387 return *this;
388}

References fBeamCurrent, VQwDataElement::GetElementName(), QwBCM(), and VQwBCM::VQwBCM().

+ Here is the call graph for this function:

◆ PrintErrorCounters()

template<typename T>
void QwBCM< T >::PrintErrorCounters ( ) const
overridevirtual

Print error counters (const overload).

Reimplemented from VQwDataElement.

Definition at line 303 of file QwBCM.cc.

304{// report number of events failed due to HW and event cut failure
305 fBeamCurrent.PrintErrorCounters();
306}

References fBeamCurrent.

◆ PrintInfo()

template<typename T>
void QwBCM< T >::PrintInfo ( ) const
overridevirtual

Print detailed information for this BCM.

Reimplemented from VQwDataElement.

Definition at line 546 of file QwBCM.cc.

547{
548 std::cout << "QwVQWK_Channel Info " << std::endl;
549 fBeamCurrent.PrintInfo();
550}

References fBeamCurrent.

◆ PrintValue()

template<typename T>
void QwBCM< T >::PrintValue ( ) const
overridevirtual

Print a compact value summary for this BCM.

Reimplemented from VQwDataElement.

Definition at line 539 of file QwBCM.cc.

540{
541 fBeamCurrent.PrintValue();
542}

References fBeamCurrent.

◆ ProcessEvBuffer()

template<typename T>
Int_t QwBCM< T >::ProcessEvBuffer ( UInt_t * buffer,
UInt_t word_position_in_buffer,
UInt_t subelement = 0 )
overridevirtual

Process the raw event buffer and decode into the channel.

Returns
The updated buffer word position.

Implements VQwBCM.

Reimplemented in QwCombinedBCM< T >.

Definition at line 337 of file QwBCM.cc.

338{
340
342}

References fBeamCurrent, and QwBPMStripline< T >::subelement.

◆ ProcessEvent()

template<typename T>
void QwBCM< T >::ProcessEvent ( )
overridevirtual

Apply hardware checks and process the event for this BCM.

Implements VQwBCM.

Reimplemented in QwCombinedBCM< T >.

Definition at line 224 of file QwBCM.cc.

225{
226 this->ApplyHWChecks();//first apply HW checks and update HW error flags. Calling this routine either in ApplySingleEventCuts or here do not make any difference for a BCM but do for a BPMs because they have derived devices.
227 fBeamCurrent.ProcessEvent();
228}
Bool_t ApplyHWChecks()
Apply hardware checks and return whether the event is valid.
Definition QwBCM.cc:235

References ApplyHWChecks(), and fBeamCurrent.

+ Here is the call graph for this function:

◆ RandomizeEventData()

template<typename T>
void QwBCM< T >::RandomizeEventData ( int helicity = 0,
double time = 0 )
overridevirtual

Generate mock event data for this BCM.

Parameters
helicityHelicity state indicator.
timeEvent time or timestamp proxy.

Implements VQwBCM.

Reimplemented in QwCombinedBCM< T >.

Definition at line 207 of file QwBCM.cc.

208{
209 fBeamCurrent.RandomizeEventData(helicity, time);
210 fBeamCurrent.SetRawEventData();
211
212}

References fBeamCurrent.

◆ Ratio() [1/2]

template<typename T>
void QwBCM< T >::Ratio ( const QwBCM< T > & numer,
const QwBCM< T > & denom )

Type-specific ratio formation for BCM.

Definition at line 473 of file QwBCM.cc.

474{
475 // std::cout<<"QwBCM::Ratio element name ="<<GetElementName()<<" \n";
476 if (this->GetElementName()!="")
477 {
478 // std::cout<<"here in \n";
480 }
481}

References fBeamCurrent, VQwDataElement::GetElementName(), and QwBCM().

+ Here is the call graph for this function:

◆ Ratio() [2/2]

template<typename T>
void QwBCM< T >::Ratio ( const VQwBCM< T > & numer,
const VQwBCM< T > & denom )
overridevirtual

Polymorphic ratio formation for BCM.

Reimplemented from VQwBCM.

Definition at line 465 of file QwBCM.cc.

466{
467 Ratio(*dynamic_cast<const QwBCM<T>* >(&numer),
468 *dynamic_cast<const QwBCM<T>* >(&denom));
469}
void Ratio(const VQwBCM &numer, const VQwBCM &denom) override
Polymorphic ratio formation for BCM.
Definition QwBCM.cc:465

References QwBCM(), Ratio(), and VQwBCM::VQwBCM().

Referenced by Ratio().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Scale()

template<typename T>
void QwBCM< T >::Scale ( Double_t factor)
overridevirtual

Scale the underlying channel by a constant factor.

Implements VQwBCM.

Definition at line 485 of file QwBCM.cc.

486{
487 fBeamCurrent.Scale(factor);
488}

References fBeamCurrent.

◆ SetBCMForCombo()

template<typename T>
void QwBCM< T >::SetBCMForCombo ( VQwBCM< T > * bcm,
Double_t weight,
Double_t sumqw )
inlineoverridevirtual

Implements VQwBCM.

Reimplemented in QwCombinedBCM< T >.

Definition at line 144 of file QwBCM.h.

144 {
145 std::cerr<<"SetBCMForCombo for QwCombinedBCM<T> not defined!!\n";
146 };

References VQwBCM::VQwBCM().

+ Here is the call graph for this function:

◆ SetCalibrationFactor()

template<typename T>
void QwBCM< T >::SetCalibrationFactor ( Double_t calibration)
overridevirtual

Set the calibration factor for the beam current monitor.

Parameters
calibrationMultiplicative calibration factor.

Implements VQwBCM.

Reimplemented in QwCombinedBCM< T >.

Definition at line 43 of file QwBCM.cc.

44{
45 fBeamCurrent.SetCalibrationFactor(calibration);
46}

References fBeamCurrent.

Referenced by InitializeChannel(), InitializeChannel(), InitializeChannel(), and QwCombinedBCM< T >::SetCalibrationFactor().

+ Here is the caller graph for this function:

◆ SetDefaultSampleSize()

template<typename T>
void QwBCM< T >::SetDefaultSampleSize ( Int_t sample_size)
overridevirtual

Set the default sample size used by the channel.

Implements VQwBCM.

Definition at line 268 of file QwBCM.cc.

268 {
269 fBeamCurrent.SetDefaultSampleSize((size_t)sample_size);
270}

References fBeamCurrent.

◆ SetEventCutMode()

template<typename T>
void QwBCM< T >::SetEventCutMode ( Int_t bcuts)
inlineoverridevirtual

Implements VQwBCM.

Definition at line 116 of file QwBCM.h.

116 {
117 fBeamCurrent.SetEventCutMode(bcuts);
118 }

References fBeamCurrent.

◆ SetExternalClockName()

template<typename T>
void QwBCM< T >::SetExternalClockName ( const std::string name)
inlineoverridevirtual

Implements VQwBCM.

Definition at line 133 of file QwBCM.h.

133{ fBeamCurrent.SetExternalClockName(name);};

References fBeamCurrent.

◆ SetExternalClockPtr()

template<typename T>
void QwBCM< T >::SetExternalClockPtr ( const VQwHardwareChannel * clock)
inlineoverridevirtual

Implements VQwBCM.

Definition at line 132 of file QwBCM.h.

132{fBeamCurrent.SetExternalClockPtr(clock);};

References fBeamCurrent.

◆ SetExternalRandomVariable()

template<typename T>
void QwBCM< T >::SetExternalRandomVariable ( Double_t random_variable)

Set the external random variable to drive mock data.

Parameters
random_variableExternal random value.

Definition at line 154 of file QwBCM.cc.

155{
156 fBeamCurrent.SetExternalRandomVariable(random_variable);
157}

References fBeamCurrent.

◆ SetPedestal()

template<typename T>
void QwBCM< T >::SetPedestal ( Double_t pedestal)
overridevirtual

Set the pedestal value for the beam current monitor.

Parameters
pedestalPedestal offset to apply to the raw signal.

Implements VQwBCM.

Reimplemented in QwCombinedBCM< T >.

Definition at line 33 of file QwBCM.cc.

34{
35 fBeamCurrent.SetPedestal(pedestal);
36}

References fBeamCurrent.

Referenced by InitializeChannel(), InitializeChannel(), InitializeChannel(), and QwCombinedBCM< T >::SetPedestal().

+ Here is the caller graph for this function:

◆ SetRandomEventAsymmetry()

template<typename T>
void QwBCM< T >::SetRandomEventAsymmetry ( Double_t asymmetry)
overridevirtual

Set an asymmetry parameter applied to helicity states.

Implements VQwBCM.

Definition at line 184 of file QwBCM.cc.

185{
186 fBeamCurrent.SetRandomEventAsymmetry(asymmetry);
187}

References fBeamCurrent.

◆ SetRandomEventDriftParameters()

template<typename T>
void QwBCM< T >::SetRandomEventDriftParameters ( Double_t amplitude,
Double_t phase,
Double_t frequency )

Configure deterministic drift parameters applied per event.

Definition at line 163 of file QwBCM.cc.

164{
165 fBeamCurrent.SetRandomEventDriftParameters(amplitude, phase, frequency);
166}

References fBeamCurrent.

◆ SetRandomEventParameters()

template<typename T>
void QwBCM< T >::SetRandomEventParameters ( Double_t mean,
Double_t sigma )
overridevirtual

Configure Gaussian mock data parameters.

Implements VQwBCM.

Definition at line 177 of file QwBCM.cc.

178{
179 fBeamCurrent.SetRandomEventParameters(mean, sigma);
180}

References fBeamCurrent.

◆ SetResolution()

template<typename T>
void QwBCM< T >::SetResolution ( Double_t resolution)
inline

Definition at line 79 of file QwBCM.h.

79 {
81 }

References fResolution.

Referenced by InitializeChannel(), InitializeChannel(), InitializeChannel(), LoadMockDataParameters(), and QwCombinedBCM< T >::LoadMockDataParameters().

+ Here is the caller graph for this function:

◆ SetSingleEventCuts() [1/2]

template<typename T>
Int_t QwBCM< T >::SetSingleEventCuts ( Double_t mean = 0,
Double_t sigma = 0 )

Set basic single-event cut limits.

Definition at line 248 of file QwBCM.cc.

248 {//std::vector<Double_t> & dEventCuts){//two limits and sample size
249 fBeamCurrent.SetSingleEventCuts(LL,UL);
250 return 1;
251}

References fBeamCurrent.

◆ SetSingleEventCuts() [2/2]

template<typename T>
void QwBCM< T >::SetSingleEventCuts ( UInt_t errorflag,
Double_t min = 0,
Double_t max = 0,
Double_t stability = 0,
Double_t burplevel = 0 )
overridevirtual

Inherited from VQwDataElement to set the upper and lower limits (fULimit and fLLimit), stability % and the error flag on this channel.

Configure detailed single-event cuts for this BCM.

Implements VQwBCM.

Definition at line 257 of file QwBCM.cc.

257 {
258 //set the unique tag to identify device type (bcm,bpm & etc)
260 QwMessage<<"QwBCM Error Code passing to QwVQWK_Ch "<<errorflag<<" "<<stability<<QwLog::endl;
261 //QwError<<"***************************"<<typeid(fBeamCurrent).name()<<QwLog::endl;
262 fBeamCurrent.SetSingleEventCuts(errorflag,LL,UL,stability,burplevel);
263
264}

References QwLog::endl(), fBeamCurrent, kBCMErrorFlag, and QwMessage.

+ Here is the call graph for this function:

◆ UpdateErrorFlag()

template<typename T>
void QwBCM< T >::UpdateErrorFlag ( const VQwBCM< T > * ev_error)
overridevirtual

Merge error flags from a reference BCM into this instance.

Implements VQwBCM.

Definition at line 311 of file QwBCM.cc.

311 {
312 try {
313 if(typeid(*ev_error)==typeid(*this)) {
314 // std::cout<<" Here in QwBCM::UpdateErrorFlag \n";
315 if (this->GetElementName()!="") {
316 const QwBCM<T>* value_bcm = dynamic_cast<const QwBCM<T>* >(ev_error);
317 fBeamCurrent.UpdateErrorFlag(value_bcm->fBeamCurrent);
318 }
319 } else {
320 TString loc="Standard exception from QwBCM::UpdateErrorFlag :"+
321 ev_error->GetElementName()+" "+this->GetElementName()+" are not of the "
322 +"same type";
323 throw std::invalid_argument(loc.Data());
324 }
325 } catch (std::exception& e) {
326 std::cerr<< e.what()<<std::endl;
327 }
328};

References fBeamCurrent, VQwDataElement::GetElementName(), QwBCM(), and VQwBCM::VQwBCM().

+ Here is the call graph for this function:

◆ UseExternalRandomVariable()

template<typename T>
void QwBCM< T >::UseExternalRandomVariable ( )

Use an external random variable source for mock data.

Definition at line 144 of file QwBCM.cc.

145{
146 fBeamCurrent.UseExternalRandomVariable();
147}

References fBeamCurrent.

Friends And Related Symbol Documentation

◆ QwCombinedBCM< T >

template<typename T>
friend class QwCombinedBCM< T >
friend

Definition at line 1 of file QwBCM.h.

References VQwBCM::QwCombinedBCM.

Field Documentation

◆ fBeamCurrent

template<typename T>
T QwBCM< T >::fBeamCurrent
protected

Definition at line 187 of file QwBCM.h.

Referenced by AccumulateRunningSum(), AddRandomEventDriftParameters(), ApplyHWChecks(), ApplyResolutionSmearing(), ApplySingleEventCuts(), QwCombinedBCM< T >::ApplySingleEventCuts(), CalculateRunningAverage(), CheckForBurpFail(), ClearEventData(), ConstructBranch(), ConstructBranch(), ConstructBranchAndVector(), ConstructHistograms(), DeaccumulateRunningSum(), EncodeEventData(), FillHistograms(), FillRawEventData(), FillTreeVector(), GetCharge(), QwCombinedBCM< T >::GetCharge(), GetErrorCode(), GetEventcutErrorFlag(), GetExternalClockName(), GetNormClockValue(), QwCombinedBCM< T >::GetProjectedCharge(), GetValue(), GetValueError(), GetValueWidth(), IncrementErrorCounters(), InitializeChannel(), InitializeChannel(), InitializeChannel(), QwCombinedBCM< T >::InitializeChannel(), QwCombinedBCM< T >::InitializeChannel(), QwCombinedBCM< T >::InitializeChannel(), LoadChannelParameters(), LoadMockDataParameters(), QwCombinedBCM< T >::LoadMockDataParameters(), NeedsExternalClock(), operator+=(), operator+=(), operator-=(), operator-=(), operator=(), operator=(), QwCombinedBCM< T >::operator=(), QwCombinedBCM< T >::operator=(), PrintErrorCounters(), PrintInfo(), PrintValue(), ProcessEvBuffer(), ProcessEvent(), QwCombinedBCM< T >::ProcessEvent(), QwBCM(), QwBCM(), QwBCM(), QwBCM(), QwBCM(), RandomizeEventData(), QwCombinedBCM< T >::RandomizeEventData(), Ratio(), Scale(), SetCalibrationFactor(), SetDefaultSampleSize(), SetEventCutMode(), SetExternalClockName(), SetExternalClockPtr(), SetExternalRandomVariable(), SetPedestal(), SetRandomEventAsymmetry(), SetRandomEventDriftParameters(), SetRandomEventParameters(), SetSingleEventCuts(), SetSingleEventCuts(), UpdateErrorFlag(), QwCombinedBCM< T >::UpdateErrorFlag(), and UseExternalRandomVariable().

◆ fResolution

template<typename T>
Double_t QwBCM< T >::fResolution
private

Definition at line 191 of file QwBCM.h.

Referenced by ApplyResolutionSmearing(), and SetResolution().


The documentation for this class was generated from the following files: