JAPAn
Just Another Parity Analyzer
|
Data handler that evaluates alarm conditions and writes status outputs. More...
#include <QwAlarmHandler.h>
Data Structures | |
struct | alarmObject |
Public Types | |
typedef std::vector< VQwHardwareChannel * >::iterator | Iterator_HdwChan |
typedef std::vector< VQwHardwareChannel * >::const_iterator | ConstIterator_HdwChan |
![]() | |
enum | EQwHandleType { kHandleTypeUnknown =0 , kHandleTypeMps , kHandleTypeAsym , kHandleTypeDiff , kHandleTypeYield } |
typedef std::vector< VQwHardwareChannel * >::iterator | Iterator_HdwChan |
typedef std::vector< VQwHardwareChannel * >::const_iterator | ConstIterator_HdwChan |
Public Member Functions | |
QwAlarmHandler (const TString &name) | |
Constructor with name. | |
QwAlarmHandler (const QwAlarmHandler &source) | |
Copy constructor. | |
~QwAlarmHandler () override | |
Virtual destructor. | |
Int_t | LoadChannelMap (const std::string &mapfile) override |
Load the channels and sensitivities. | |
Int_t | ConnectChannels (QwSubsystemArrayParity &yield, QwSubsystemArrayParity &asym, QwSubsystemArrayParity &diff) override |
Connect to Channels (event only) | |
void | ProcessData () override |
Process a single event: update alarm states and outputs. | |
void | CheckAlarms () |
void | UpdateAlarmFile () |
void | ParseConfigFile (QwParameterFile &) override |
![]() | |
VQwDataHandler (const TString &name) | |
VQwDataHandler (const VQwDataHandler &source) | |
void | SetPointer (QwHelicityPattern *ptr) |
void | SetPointer (QwSubsystemArrayParity *ptr) |
virtual Int_t | ConnectChannels (QwSubsystemArrayParity &) |
Int_t | ConnectChannels (QwHelicityPattern &helicitypattern) |
virtual void | UpdateBurstCounter (Short_t burstcounter) |
virtual void | FinishDataHandler () |
~VQwDataHandler () override | |
TString | GetName () |
virtual void | ClearEventData () |
void | InitRunningSum () |
void | AccumulateRunningSum () |
virtual void | AccumulateRunningSum (VQwDataHandler &value, Int_t count=0, Int_t ErrorMask=0xFFFFFFF) |
void | CalculateRunningAverage () |
void | PrintValue () const |
void | WritePromptSummary (QwPromptSummary *ps, TString type) |
virtual void | ConstructTreeBranches (QwRootFile *treerootfile, const std::string &treeprefix="", const std::string &branchprefix="") |
virtual void | FillTreeBranches (QwRootFile *treerootfile) |
virtual void | ConstructNTupleFields (QwRootFile *treerootfile, const std::string &treeprefix="", const std::string &branchprefix="") |
RNTuple methods. | |
virtual void | FillNTupleFields (QwRootFile *treerootfile) |
virtual void | ConstructHistograms (TDirectory *, TString &) |
Construct the histograms in a folder with a prefix. | |
virtual void | FillHistograms () |
Fill the histograms. | |
void | FillTreeVector (QwRootTreeBranchVector &values) const |
void | ConstructBranchAndVector (TTree *tree, TString &prefix, QwRootTreeBranchVector &values) |
void | SetRunLabel (TString x) |
Int_t | LoadChannelMap () |
Bool_t | PublishInternalValues () const override |
Publish all variables of the subsystem. | |
Bool_t | PublishByRequest (TString device_name) override |
Try to publish an internal variable matching the submitted name. | |
![]() | |
MQwPublishable_child () | |
Default constructor Initializes the child object and sets up self-reference for publishing. | |
MQwPublishable_child (const MQwPublishable_child &source) | |
Copy constructor. | |
virtual | ~MQwPublishable_child () |
Virtual destructor. | |
void | SetParent (QwDataHandlerArray *parent) |
Set the parent container for this child object. | |
QwDataHandlerArray * | GetParent () const |
Get the parent container for this child object. | |
![]() | |
~MQwCloneable () override | |
Virtual destructor. | |
VQwDataHandler * | Clone () const override |
Concrete clone method. | |
const VQwFactory< VQwDataHandler > * | Factory () const override |
Factory getter. | |
![]() | |
virtual | ~VQwCloneable () |
Virtual destructor. | |
std::string | GetClassName () const |
Get demangled name of this class. | |
Protected Member Functions | |
QwAlarmHandler () | |
Default constructor (Protected for child class access) | |
std::pair< std::string, std::string > | ParseAlarmMapVariable (const string &, char) |
![]() | |
VQwDataHandler () | |
virtual Int_t | ConnectChannels (QwSubsystemArrayParity &asym, QwSubsystemArrayParity &diff) |
void | SetEventcutErrorFlagPointer (const UInt_t *errorflagptr) |
UInt_t | GetEventcutErrorFlag () const |
std::pair< EQwHandleType, std::string > | ParseHandledVariable (const std::string &variable) |
void | CalcOneOutput (const VQwHardwareChannel *dv, VQwHardwareChannel *output, std::vector< const VQwHardwareChannel * > &ivs, std::vector< Double_t > &sens) |
![]() | |
Bool_t | RequestExternalValue (const TString &name, VQwHardwareChannel *value) const |
Retrieve the variable name from other subsystem arrays Get the value corresponding to some variable name from a different data array. | |
const VQwHardwareChannel * | RequestExternalPointer (const TString &name) const |
Retrieve a pointer to an external variable by name Requests a direct pointer to a variable from sibling subsystems via the parent container. | |
Bool_t | PublishInternalValue (const TString name, const TString desc, const VQwHardwareChannel *element) const |
Publish a variable from this child into the parent container. | |
Protected Attributes | |
std::string | fAlarmOutputFile = "adaqfs/home/apar/bin/onlineAlarms.csv" |
UInt_t | fCounter = 0 |
int | fAlarmNupdate = 350 |
int | fAlarmActive = 0 |
std::vector< alarmObject > | fAlarmObjectList |
![]() | |
Int_t | fPriority |
Short_t | fBurstCounter |
When a datahandler array is processed, handlers with lower priority will be processed before handlers with higher priority. | |
TString | fName |
std::string | fMapFile |
std::string | fTreeName |
std::string | fTreeComment |
std::string | fPrefix |
TString | run_label |
const UInt_t * | fErrorFlagPtr |
Error flag pointer. | |
QwSubsystemArrayParity * | fSubsystemArray |
Single event pointer. | |
QwHelicityPattern * | fHelicityPattern |
Helicity pattern pointer. | |
std::vector< std::string > | fDependentFull |
std::vector< EQwHandleType > | fDependentType |
std::vector< std::string > | fDependentName |
std::vector< const VQwHardwareChannel * > | fDependentVar |
std::vector< Double_t > | fDependentValues |
std::vector< VQwHardwareChannel * > | fOutputVar |
std::vector< Double_t > | fOutputValues |
std::vector< std::vector< TString > > | fPublishList |
std::string | ParseSeparator |
Bool_t | fKeepRunningSum |
Bool_t | fRunningsumFillsTree |
VQwDataHandler * | fRunningsum |
Additional Inherited Members | |
![]() | |
static VQwDataHandler * | Create (const std::string &name) |
Object creation. | |
static QwAlarmHandler * | Cast (QwAlarmHandler *type) |
Object dynamic cast. | |
Data handler that evaluates alarm conditions and writes status outputs.
Connects to configured variables and checks them against user-defined alarm thresholds or patterns. Can periodically write a CSV status file for online monitoring and provides simple state tracking to avoid flapping.
Definition at line 22 of file QwAlarmHandler.h.
typedef std::vector<VQwHardwareChannel*>::const_iterator QwAlarmHandler::ConstIterator_HdwChan |
Definition at line 26 of file QwAlarmHandler.h.
typedef std::vector<VQwHardwareChannel*>::iterator QwAlarmHandler::Iterator_HdwChan |
Definition at line 25 of file QwAlarmHandler.h.
QwAlarmHandler::QwAlarmHandler | ( | const TString & | name | ) |
Constructor with name.
Definition at line 21 of file QwAlarmHandler.cc.
References VQwDataHandler::ParseSeparator, and VQwDataHandler::VQwDataHandler().
Referenced by QwAlarmHandler().
QwAlarmHandler::QwAlarmHandler | ( | const QwAlarmHandler & | source | ) |
Copy constructor.
Definition at line 27 of file QwAlarmHandler.cc.
References QwAlarmHandler(), and VQwDataHandler::VQwDataHandler().
|
inlineoverride |
|
inlineprotected |
Default constructor (Protected for child class access)
Definition at line 76 of file QwAlarmHandler.h.
void QwAlarmHandler::CheckAlarms | ( | ) |
Definition at line 323 of file QwAlarmHandler.cc.
References QwLog::endl(), fAlarmObjectList, and QwError.
Referenced by ProcessData().
|
overridevirtual |
Connect to Channels (event only)
Connect to channels across subsystem arrays
Establish pointers to input variables (yield/asym/diff) and prepare output channels for alarm evaluation.
yield | Subsystem array containing per-MPS yields |
asym | Subsystem array containing asymmetries |
diff | Subsystem array containing differences |
Fill vector of pointers to the relevant data elements
Reimplemented from VQwDataHandler.
Definition at line 157 of file QwAlarmHandler.cc.
References QwLog::endl(), fAlarmObjectList, QwSubsystemArrayParity::GetEventcutErrorFlagPointer(), VQwDataHandler::kHandleTypeAsym, VQwDataHandler::kHandleTypeDiff, VQwDataHandler::kHandleTypeMps, VQwDataHandler::kHandleTypeYield, QwWarning, MQwPublishable< U, T >::ReturnInternalValue(), and VQwDataHandler::SetEventcutErrorFlagPointer().
|
overridevirtual |
Load the channels and sensitivities.
Load the channel map
mapfile | Filename of map file |
Reimplemented from VQwDataHandler.
Definition at line 70 of file QwAlarmHandler.cc.
References QwAlarmHandler::alarmObject::alarmParameterMap, QwAlarmHandler::alarmObject::alarmParameterMapStr, QwAlarmHandler::alarmObject::alarmStatus, QwAlarmHandler::alarmObject::analysisType, QwAlarmHandler::alarmObject::eventcutErrorFlag, fAlarmObjectList, QwParameterFile::GetNextToken(), QwParameterFile::LineIsEmpty(), QwAlarmHandler::alarmObject::NsinceLastViolation, QwAlarmHandler::alarmObject::Nviolated, ParseAlarmMapVariable(), VQwDataHandler::ParseHandledVariable(), QwParameterFile::ReadNextLine(), QwParameterFile::TrimComment(), QwParameterFile::TrimWhitespace(), and QwAlarmHandler::alarmObject::value.
|
protected |
Definition at line 46 of file QwAlarmHandler.cc.
Referenced by LoadChannelMap().
|
overridevirtual |
Parse configuration file for map file, priority, tree settings.
Reimplemented from VQwDataHandler.
Definition at line 33 of file QwAlarmHandler.cc.
References fAlarmActive, fAlarmNupdate, fAlarmOutputFile, VQwDataHandler::ParseConfigFile(), and QwParameterFile::PopValue().
|
overridevirtual |
Process a single event: update alarm states and outputs.
Checks all configured alarm conditions against current inputs and updates any associated status channels. May periodically write an overview CSV if enabled by configuration.
Reimplemented from VQwDataHandler.
Definition at line 262 of file QwAlarmHandler.cc.
References CheckAlarms(), fAlarmActive, fAlarmNupdate, fCounter, and UpdateAlarmFile().
void QwAlarmHandler::UpdateAlarmFile | ( | ) |
Definition at line 385 of file QwAlarmHandler.cc.
References fAlarmObjectList, and fAlarmOutputFile.
Referenced by ProcessData().
|
protected |
Definition at line 81 of file QwAlarmHandler.h.
Referenced by ParseConfigFile(), and ProcessData().
|
protected |
Definition at line 80 of file QwAlarmHandler.h.
Referenced by ParseConfigFile(), and ProcessData().
|
protected |
Definition at line 112 of file QwAlarmHandler.h.
Referenced by CheckAlarms(), ConnectChannels(), LoadChannelMap(), and UpdateAlarmFile().
|
protected |
Definition at line 78 of file QwAlarmHandler.h.
Referenced by ParseConfigFile(), and UpdateAlarmFile().
|
protected |
Definition at line 79 of file QwAlarmHandler.h.
Referenced by ProcessData().