JAPAn
Just Another Parity Analyzer
|
Wrapper around a scaler channel to monitor beam halo rates. More...
#include <QwHaloMonitor.h>
Public Member Functions | |
QwHaloMonitor () | |
QwHaloMonitor (TString name) | |
QwHaloMonitor (TString subsystemname, TString name) | |
QwHaloMonitor (const QwHaloMonitor &source) | |
~QwHaloMonitor () override | |
void | InitializeChannel (TString name) |
Initialize the halo monitor with a detector name. | |
void | InitializeChannel (TString subsystem, TString name) |
Initialize the halo monitor with subsystem and name. | |
void | ClearEventData () override |
Clear event-scoped data in the underlying counter. | |
void | LoadChannelParameters (QwParameterFile ¶mfile) override |
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 |
void | PrintErrorCounters () |
void | UpdateHWErrorCount () |
Int_t | ProcessEvBuffer (UInt_t *buffer, UInt_t num_words_left, UInt_t index=0) override |
Decode the raw event buffer into the underlying counter. | |
void | ProcessEvent () |
Process event (delegated to the underlying counter). | |
QwHaloMonitor & | operator= (const QwHaloMonitor &value) |
Copy-assign from another halo monitor. | |
QwHaloMonitor & | operator+= (const QwHaloMonitor &value) |
Add-assign from another halo monitor (sum counters). | |
QwHaloMonitor & | operator-= (const QwHaloMonitor &value) |
Subtract-assign from another halo monitor (difference counters). | |
void | Sum (QwHaloMonitor &value1, QwHaloMonitor &value2) |
Sum two halo monitors into this instance. | |
void | Difference (QwHaloMonitor &value1, QwHaloMonitor &value2) |
Compute the difference of two halo monitors into this instance. | |
void | Ratio (QwHaloMonitor &numer, QwHaloMonitor &denom) |
Form the ratio of two halo monitors into this instance. | |
void | Offset (Double_t Offset) |
void | Scale (Double_t Offset) |
Scale the underlying counter by a constant factor. | |
void | SetPedestal (Double_t ped) |
void | SetCalibrationFactor (Double_t factor) |
void | AccumulateRunningSum (const QwHaloMonitor &value, Int_t count=0, Int_t ErrorMask=0xFFFFFFF) |
Accumulate running sums from another monitor into this one. | |
void | DeaccumulateRunningSum (QwHaloMonitor &value, Int_t ErrorMask=0xFFFFFFF) |
Remove a single entry from the running sums using a source value. | |
void | CalculateRunningAverage () |
Update running averages for the underlying counter. | |
Bool_t | ApplySingleEventCuts () |
Apply single-event cuts on the underlying counter. | |
void | IncrementErrorCounters () |
UInt_t | GetEventcutErrorFlag () override |
return the error flag on this channel/device | |
Bool_t | CheckForBurpFail (const VQwDataElement *ev_error) |
Check for burp failures by delegating to the underlying counter. | |
UInt_t | UpdateErrorFlag () override |
Update the error flag based on the error flags of internally contained objects Return parameter is the "Eventcut Error Flag". | |
void | UpdateErrorFlag (const QwHaloMonitor *ev_error) |
void | PrintErrorCounters () const override |
Print accumulated error counters for this monitor. | |
Bool_t | ApplyHWChecks () |
Apply hardware checks (no hardware errors for simple counters). | |
void | SetSingleEventCuts (UInt_t errorflag, Double_t min, Double_t max, Double_t stability, Double_t burplevel) |
void | SetEventCutMode (Int_t bcuts) |
void | ConstructHistograms (TDirectory *folder, TString &prefix) override |
Define histograms for this monitor (delegated to underlying counter). | |
void | FillHistograms () override |
Fill histograms for this monitor if enabled. | |
void | ConstructBranchAndVector (TTree *tree, TString &prefix, QwRootTreeBranchVector &values) |
Construct ROOT branches and value vector entries. | |
void | ConstructBranch (TTree *tree, TString &prefix) |
void | ConstructBranch (TTree *tree, TString &prefix, QwParameterFile &modulelist) |
void | FillTreeVector (QwRootTreeBranchVector &values) const |
VQwHardwareChannel * | GetScaler () |
const VQwHardwareChannel * | GetScaler () const |
Double_t | GetValue () |
void | PrintValue () const override |
Print a compact value summary for this monitor. | |
void | PrintInfo () const override |
Print detailed information for this monitor. | |
![]() | |
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. | |
virtual void | LoadMockDataParameters (QwParameterFile &) |
size_t | GetNumberOfDataWords () |
Get the number of data words in this data element. | |
UInt_t | GetGoodEventCount () const |
virtual void | AssignValueFrom (const VQwDataElement *) |
VQwDataElement & | operator+= (const VQwDataElement &) |
Addition-assignment operator. | |
VQwDataElement & | operator-= (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 | |
![]() | |
void | ShareHistograms (const MQwHistograms *source) |
Share histogram pointers between objects. | |
Private Attributes | |
QwSIS3801D24_Channel | fHalo_Counter |
Int_t | fDeviceErrorCode |
Bool_t | bEVENTCUTMODE |
Static Private Attributes | |
static const Bool_t | kDEBUG |
Additional Inherited Members | |
![]() | |
enum | EDataToSave { kRaw = 0 , kDerived , kMoments } |
![]() | |
void | SetNumberOfDataWords (const UInt_t &numwords) |
Set the number of data words in this data element. | |
VQwDataElement & | operator= (const VQwDataElement &value) |
Arithmetic assignment operator: Should only copy event-based data. | |
void | UpdateErrorFlag (const UInt_t &error) |
![]() | |
MQwHistograms () | |
Default constructor. | |
MQwHistograms (const MQwHistograms &source) | |
Copy constructor. | |
virtual | ~MQwHistograms () |
Virtual destructor. | |
MQwHistograms & | operator= (const MQwHistograms &value) |
void | Fill_Pointer (TH1_ptr hist_ptr, Double_t value) |
void | AddHistogram (TH1 *h) |
Register a histogram. | |
![]() | |
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 | |
![]() | |
std::vector< TH1_ptr > | fHistograms |
Histograms associated with this data element. | |
Wrapper around a scaler channel to monitor beam halo rates.
Definition at line 40 of file QwHaloMonitor.h.
|
inline |
Definition at line 44 of file QwHaloMonitor.h.
Referenced by AccumulateRunningSum(), CheckForBurpFail(), DeaccumulateRunningSum(), Difference(), GetScaler(), operator+=(), operator-=(), operator=(), QwHaloMonitor(), Ratio(), Sum(), UpdateErrorFlag(), and UpdateHWErrorCount().
|
inline |
Definition at line 45 of file QwHaloMonitor.h.
References InitializeChannel().
|
inline |
Definition at line 48 of file QwHaloMonitor.h.
References InitializeChannel().
|
inline |
Definition at line 51 of file QwHaloMonitor.h.
References fHalo_Counter, QwHaloMonitor(), and VQwDataElement::VQwDataElement().
|
inlineoverride |
Definition at line 55 of file QwHaloMonitor.h.
void QwHaloMonitor::AccumulateRunningSum | ( | const QwHaloMonitor & | value, |
Int_t | count = 0, | ||
Int_t | ErrorMask = 0xFFFFFFF ) |
Accumulate running sums from another monitor into this one.
Definition at line 145 of file QwHaloMonitor.cc.
References fHalo_Counter, and QwHaloMonitor().
Bool_t QwHaloMonitor::ApplyHWChecks | ( | ) |
Apply hardware checks (no hardware errors for simple counters).
Definition at line 68 of file QwHaloMonitor.cc.
Bool_t QwHaloMonitor::ApplySingleEventCuts | ( | ) |
Apply single-event cuts on the underlying counter.
Definition at line 76 of file QwHaloMonitor.cc.
References fHalo_Counter.
void QwHaloMonitor::CalculateRunningAverage | ( | ) |
Update running averages for the underlying counter.
Definition at line 155 of file QwHaloMonitor.cc.
References fHalo_Counter.
Bool_t QwHaloMonitor::CheckForBurpFail | ( | const VQwDataElement * | ev_error | ) |
Check for burp failures by delegating to the underlying counter.
ev_error | Reference halo monitor to compare against. |
Definition at line 178 of file QwHaloMonitor.cc.
References fHalo_Counter, VQwDataElement::GetElementName(), QwHaloMonitor(), and VQwDataElement::VQwDataElement().
|
overridevirtual |
Clear event-scoped data in the underlying counter.
Reimplemented from VQwDataElement.
Definition at line 48 of file QwHaloMonitor.cc.
References fHalo_Counter.
void QwHaloMonitor::ConstructBranch | ( | TTree * | tree, |
TString & | prefix ) |
Definition at line 242 of file QwHaloMonitor.cc.
References fHalo_Counter, and VQwDataElement::GetElementName().
void QwHaloMonitor::ConstructBranch | ( | TTree * | tree, |
TString & | prefix, | ||
QwParameterFile & | modulelist ) |
Definition at line 255 of file QwHaloMonitor.cc.
References QwLog::endl(), fHalo_Counter, VQwDataElement::GetElementName(), QwParameterFile::HasValue(), and QwMessage.
void QwHaloMonitor::ConstructBranchAndVector | ( | TTree * | tree, |
TString & | prefix, | ||
QwRootTreeBranchVector & | values ) |
Construct ROOT branches and value vector entries.
tree | Output tree. |
prefix | Branch name prefix. |
values | Output value vector to be appended. |
Definition at line 231 of file QwHaloMonitor.cc.
References fHalo_Counter, and VQwDataElement::GetElementName().
|
overridevirtual |
Define histograms for this monitor (delegated to underlying counter).
folder | ROOT folder to contain histograms. |
prefix | Histogram name prefix. |
Implements VQwDataElement.
Definition at line 204 of file QwHaloMonitor.cc.
References fHalo_Counter, and VQwDataElement::GetElementName().
void QwHaloMonitor::DeaccumulateRunningSum | ( | QwHaloMonitor & | value, |
Int_t | ErrorMask = 0xFFFFFFF ) |
Remove a single entry from the running sums using a source value.
Definition at line 150 of file QwHaloMonitor.cc.
References fHalo_Counter, and QwHaloMonitor().
void QwHaloMonitor::Difference | ( | QwHaloMonitor & | value1, |
QwHaloMonitor & | value2 ) |
Compute the difference of two halo monitors into this instance.
Definition at line 124 of file QwHaloMonitor.cc.
References QwHaloMonitor().
|
overridevirtual |
Fill histograms for this monitor if enabled.
Implements VQwDataElement.
Definition at line 215 of file QwHaloMonitor.cc.
References fHalo_Counter, and VQwDataElement::GetElementName().
void QwHaloMonitor::FillTreeVector | ( | QwRootTreeBranchVector & | values | ) | const |
Definition at line 277 of file QwHaloMonitor.cc.
References fHalo_Counter, and VQwDataElement::GetElementName().
|
inlineoverridevirtual |
return the error flag on this channel/device
Reimplemented from VQwDataElement.
Definition at line 96 of file QwHaloMonitor.h.
References fHalo_Counter.
Referenced by UpdateErrorFlag().
|
inlineoverridevirtual |
Reimplemented from VQwDataElement.
Definition at line 65 of file QwHaloMonitor.h.
References fHalo_Counter.
|
inlineoverridevirtual |
Reimplemented from VQwDataElement.
Definition at line 69 of file QwHaloMonitor.h.
References fHalo_Counter.
|
inline |
Definition at line 129 of file QwHaloMonitor.h.
References fHalo_Counter.
Referenced by GetScaler().
|
inline |
Definition at line 133 of file QwHaloMonitor.h.
References GetScaler(), and QwHaloMonitor().
|
inline |
Definition at line 137 of file QwHaloMonitor.h.
References fHalo_Counter.
|
inline |
Definition at line 95 of file QwHaloMonitor.h.
References fHalo_Counter.
void QwHaloMonitor::InitializeChannel | ( | TString | name | ) |
Initialize the halo monitor with a detector name.
name | Detector name used for branches and histograms. |
Definition at line 42 of file QwHaloMonitor.cc.
References fHalo_Counter, and VQwDataElement::SetElementName().
Referenced by QwHaloMonitor(), and QwHaloMonitor().
void QwHaloMonitor::InitializeChannel | ( | TString | subsystem, |
TString | name ) |
Initialize the halo monitor with subsystem and name.
subsystem | Subsystem identifier. |
name | Detector name used for branches and histograms. |
Definition at line 33 of file QwHaloMonitor.cc.
References fHalo_Counter, and VQwDataElement::SetElementName().
|
inlineoverridevirtual |
Reimplemented from VQwDataElement.
Definition at line 62 of file QwHaloMonitor.h.
References fHalo_Counter.
|
inlineoverridevirtual |
Reimplemented from VQwDataElement.
Definition at line 66 of file QwHaloMonitor.h.
References fHalo_Counter.
void QwHaloMonitor::Offset | ( | Double_t | Offset | ) |
QwHaloMonitor & QwHaloMonitor::operator+= | ( | const QwHaloMonitor & | value | ) |
Add-assign from another halo monitor (sum counters).
Definition at line 99 of file QwHaloMonitor.cc.
References fHalo_Counter, VQwDataElement::GetElementName(), and QwHaloMonitor().
QwHaloMonitor & QwHaloMonitor::operator-= | ( | const QwHaloMonitor & | value | ) |
Subtract-assign from another halo monitor (difference counters).
Definition at line 108 of file QwHaloMonitor.cc.
References fHalo_Counter, VQwDataElement::GetElementName(), and QwHaloMonitor().
QwHaloMonitor & QwHaloMonitor::operator= | ( | const QwHaloMonitor & | value | ) |
Copy-assign from another halo monitor.
Definition at line 90 of file QwHaloMonitor.cc.
References fHalo_Counter, VQwDataElement::GetElementName(), and QwHaloMonitor().
void QwHaloMonitor::PrintErrorCounters | ( | ) |
|
overridevirtual |
Print accumulated error counters for this monitor.
Reimplemented from VQwDataElement.
Definition at line 83 of file QwHaloMonitor.cc.
References fHalo_Counter.
|
overridevirtual |
Print detailed information for this monitor.
Reimplemented from VQwDataElement.
Definition at line 167 of file QwHaloMonitor.cc.
References fHalo_Counter.
|
overridevirtual |
Print a compact value summary for this monitor.
Reimplemented from VQwDataElement.
Definition at line 161 of file QwHaloMonitor.cc.
References fHalo_Counter.
|
overridevirtual |
Decode the raw event buffer into the underlying counter.
Implements VQwDataElement.
Definition at line 61 of file QwHaloMonitor.cc.
References fHalo_Counter.
void QwHaloMonitor::ProcessEvent | ( | ) |
Process event (delegated to the underlying counter).
Definition at line 54 of file QwHaloMonitor.cc.
References fHalo_Counter.
void QwHaloMonitor::Ratio | ( | QwHaloMonitor & | numer, |
QwHaloMonitor & | denom ) |
Form the ratio of two halo monitors into this instance.
Definition at line 130 of file QwHaloMonitor.cc.
References fHalo_Counter, VQwDataElement::GetElementName(), and QwHaloMonitor().
void QwHaloMonitor::Scale | ( | Double_t | Offset | ) |
Scale the underlying counter by a constant factor.
Definition at line 139 of file QwHaloMonitor.cc.
References fHalo_Counter.
|
inline |
Definition at line 89 of file QwHaloMonitor.h.
References fHalo_Counter.
|
inline |
Definition at line 111 of file QwHaloMonitor.h.
References fHalo_Counter.
|
inlineoverridevirtual |
Reimplemented from VQwDataElement.
Definition at line 68 of file QwHaloMonitor.h.
References fHalo_Counter.
|
inlineoverridevirtual |
Reimplemented from VQwDataElement.
Definition at line 67 of file QwHaloMonitor.h.
References fHalo_Counter.
|
inline |
Definition at line 88 of file QwHaloMonitor.h.
References fHalo_Counter.
|
inline |
Definition at line 107 of file QwHaloMonitor.h.
References QwLog::endl(), fHalo_Counter, and QwError.
void QwHaloMonitor::Sum | ( | QwHaloMonitor & | value1, |
QwHaloMonitor & | value2 ) |
Sum two halo monitors into this instance.
Definition at line 118 of file QwHaloMonitor.cc.
References QwHaloMonitor().
|
inlineoverridevirtual |
Update the error flag based on the error flags of internally contained objects Return parameter is the "Eventcut Error Flag".
Reimplemented from VQwDataElement.
Definition at line 100 of file QwHaloMonitor.h.
References GetEventcutErrorFlag().
|
inline |
Definition at line 101 of file QwHaloMonitor.h.
References fHalo_Counter, and QwHaloMonitor().
void QwHaloMonitor::UpdateHWErrorCount | ( | ) |
|
private |
Definition at line 157 of file QwHaloMonitor.h.
|
private |
Definition at line 156 of file QwHaloMonitor.h.
|
private |
Definition at line 154 of file QwHaloMonitor.h.
Referenced by AccumulateRunningSum(), ApplySingleEventCuts(), CalculateRunningAverage(), CheckForBurpFail(), ClearEventData(), ConstructBranch(), ConstructBranch(), ConstructBranchAndVector(), ConstructHistograms(), DeaccumulateRunningSum(), FillHistograms(), FillTreeVector(), GetEventcutErrorFlag(), GetExternalClockName(), GetNormClockValue(), GetScaler(), GetValue(), IncrementErrorCounters(), InitializeChannel(), InitializeChannel(), LoadChannelParameters(), NeedsExternalClock(), operator+=(), operator-=(), operator=(), PrintErrorCounters(), PrintInfo(), PrintValue(), ProcessEvBuffer(), ProcessEvent(), QwHaloMonitor(), Ratio(), Scale(), SetCalibrationFactor(), SetEventCutMode(), SetExternalClockName(), SetExternalClockPtr(), SetPedestal(), SetSingleEventCuts(), and UpdateErrorFlag().
|
staticprivate |
Definition at line 152 of file QwHaloMonitor.h.