|
JAPAn
Just Another Parity Analyzer
|
Data handler that replaces time-ordered strip-chart trees with TProfiles. More...
#include <QwTrendHandler.h>
Inheritance diagram for QwTrendHandler:
Collaboration diagram for QwTrendHandler:Public Member Functions | |
| QwTrendHandler (const TString &name) | |
| Constructor with name. | |
| QwTrendHandler (const QwTrendHandler &source) | |
| Copy constructor. | |
| ~QwTrendHandler () override | |
| Virtual destructor. | |
| Int_t | LoadChannelMap (const std::string &mapfile) override |
| Load the list of channels to trend (and binning) from the map file. | |
| Int_t | ConnectChannels (QwSubsystemArrayParity &event) override |
| Connect to channels from the per-MPS (event) subsystem array. | |
| void | ProcessData () override |
| Read the current value of each connected channel. | |
| void | ConstructHistograms (TDirectory *folder, TString &prefix) override |
| Book one TProfile strip chart per connected channel. | |
| void | FillHistograms () override |
| Fill each strip chart at the current time-ordering index. | |
Public Member Functions inherited from VQwDataHandler | |
| VQwDataHandler (const TString &name) | |
| VQwDataHandler (const VQwDataHandler &source) | |
| virtual void | ParseConfigFile (QwParameterFile &file) |
| void | SetPointer (QwHelicityPattern *ptr) |
| void | SetPointer (QwSubsystemArrayParity *ptr) |
| virtual Int_t | ConnectChannels (QwSubsystemArrayParity &, QwSubsystemArrayParity &asym, QwSubsystemArrayParity &diff) |
| 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) |
| 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. | |
Public Member Functions inherited from MQwPublishable_child< QwDataHandlerArray, VQwDataHandler > | |
| 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. | |
Public Member Functions inherited from MQwCloneable< VQwDataHandler, QwTrendHandler > | |
| ~MQwCloneable () override | |
| Virtual destructor. | |
| VQwDataHandler * | Clone () const override |
| Concrete clone method. | |
| const VQwFactory< VQwDataHandler > * | Factory () const override |
| Factory getter. | |
Public Member Functions inherited from VQwCloneable< VQwDataHandler > | |
| virtual | ~VQwCloneable () |
| Virtual destructor. | |
| std::string | GetClassName () const |
| Get demangled name of this class. | |
Protected Member Functions | |
| QwTrendHandler () | |
| Default constructor (protected for factory/child access) | |
Protected Member Functions inherited from VQwDataHandler | |
| 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) |
Protected Member Functions inherited from MQwPublishable_child< QwDataHandlerArray, VQwDataHandler > | |
| 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 | |
| Int_t | fNbins |
| Number of x bins for the strip-chart profiles (bounded storage) | |
| Double_t | fBinWidth |
| UInt_t | fErrorFlagMask |
| Skip filling when (errorflag & mask) != 0 (0 disables the check) | |
| Long64_t | fCounter |
| Time-ordering index incremented once per filled event/pattern. | |
| Bool_t | fRolling |
| std::vector< TH1 * > | fTrend |
Protected Attributes inherited from VQwDataHandler | |
| 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 | |
Public Types inherited from VQwDataHandler | |
| enum | EQwHandleType { kHandleTypeUnknown =0 , kHandleTypeMps , kHandleTypeAsym , kHandleTypeDiff , kHandleTypeYield } |
| typedef std::vector< VQwHardwareChannel * >::iterator | Iterator_HdwChan |
| typedef std::vector< VQwHardwareChannel * >::const_iterator | ConstIterator_HdwChan |
Static Public Member Functions inherited from MQwCloneable< VQwDataHandler, QwTrendHandler > | |
| static VQwDataHandler * | Create (const std::string &name) |
| Object creation. | |
| static QwTrendHandler * | Cast (QwTrendHandler *type) |
| Object dynamic cast. | |
Data handler that replaces time-ordered strip-chart trees with TProfiles.
Traditional monitoring plots draw a channel value versus event (or pattern) number by streaming every event into a TTree and later projecting value:CodaEventNumber. That keeps a full, unbinned copy of the data on disk purely so a strip chart can be drawn.
QwTrendHandler instead pre-books one TProfile per configured channel with the time-ordering index (a monotonically increasing counter that mirrors the event/pattern number) on the x-axis and the channel value on the y-axis. Each bin then stores the mean and RMS of the channel over that slice of the run, which is exactly what a strip chart conveys, at a tiny fraction of the storage cost and with no TTree required.
The x-axis auto-extends (TH1::kXaxis) so runs of arbitrary length are handled without knowing the event count in advance. Because the profiles are ordinary ROOT histograms written into the histogram file, Panguin renders them with the existing -type prof option with no plotting-side changes.
Definition at line 39 of file QwTrendHandler.h.
| QwTrendHandler::QwTrendHandler | ( | const TString & | name | ) |
Constructor with name.
Definition at line 22 of file QwTrendHandler.cc.
References fBinWidth, fCounter, fErrorFlagMask, fNbins, fRolling, VQwDataHandler::ParseSeparator, and VQwDataHandler::VQwDataHandler().
Referenced by QwTrendHandler().
Here is the call graph for this function:
Here is the caller graph for this function:| QwTrendHandler::QwTrendHandler | ( | const QwTrendHandler & | source | ) |
Copy constructor.
Copy constructor (histograms are rebuilt, not copied)
Definition at line 34 of file QwTrendHandler.cc.
References fBinWidth, fCounter, fErrorFlagMask, fNbins, fRolling, QwTrendHandler(), and VQwDataHandler::VQwDataHandler().
Here is the call graph for this function:
|
override |
Virtual destructor.
Destructor.
Definition at line 47 of file QwTrendHandler.cc.
References fTrend.
|
inlineprotected |
Default constructor (protected for factory/child access)
Definition at line 71 of file QwTrendHandler.h.
|
overridevirtual |
Connect to channels from the per-MPS (event) subsystem array.
| event | Subsystem array providing per-MPS yields/mps channels |
Connect to the requested channels in the per-MPS (event) subsystem array.
Reimplemented from VQwDataHandler.
Definition at line 115 of file QwTrendHandler.cc.
References QwLog::endl(), VQwDataHandler::fDependentName, VQwDataHandler::fDependentType, VQwDataHandler::fDependentVar, QwSubsystemArrayParity::GetEventcutErrorFlagPointer(), VQwDataHandler::kHandleTypeAsym, VQwDataHandler::kHandleTypeDiff, QwWarning, and VQwDataHandler::SetEventcutErrorFlagPointer().
Here is the call graph for this function:
|
overridevirtual |
Book one TProfile strip chart per connected channel.
Book one TProfile strip chart per connected channel.
Reimplemented from VQwDataHandler.
Definition at line 150 of file QwTrendHandler.cc.
References fBinWidth, VQwDataHandler::fDependentVar, VQwDataHandler::fName, fNbins, fRolling, and fTrend.
|
overridevirtual |
Fill each strip chart at the current time-ordering index.
Fill each strip chart at the current time-ordering index.
Reimplemented from VQwDataHandler.
Definition at line 206 of file QwTrendHandler.cc.
References fBinWidth, fCounter, VQwDataHandler::fDependentValues, fErrorFlagMask, VQwDataHandler::fErrorFlagPtr, fNbins, fRolling, and fTrend.
|
overridevirtual |
Load the list of channels to trend (and binning) from the map file.
Load the list of channels to trend, plus optional binning.
Map format (one channel token per line):
The type prefix (asym/diff/yield/mps) selects which subsystem array supplies the channel; the remainder is the channel name.
| mapfile | Filename of map file |
Reimplemented from VQwDataHandler.
Definition at line 71 of file QwTrendHandler.cc.
References QwLog::endl(), fBinWidth, VQwDataHandler::fDependentFull, VQwDataHandler::fDependentName, VQwDataHandler::fDependentType, fErrorFlagMask, QwParameterFile::FileHasVariablePair(), VQwDataHandler::fName, fNbins, QwParameterFile::GetLine(), QwParameterFile::GetNextToken(), QwParameterFile::GetUInt(), QwParameterFile::LineHasSectionHeader(), QwParameterFile::LineIsEmpty(), VQwDataHandler::ParseHandledVariable(), QwMessage, QwParameterFile::ReadNextLine(), QwParameterFile::RewindToFileStart(), QwParameterFile::TrimComment(), and QwParameterFile::TrimWhitespace().
Here is the call graph for this function:
|
overridevirtual |
Read the current value of each connected channel.
Read the current value of each connected channel.
Reimplemented from VQwDataHandler.
Definition at line 138 of file QwTrendHandler.cc.
References VQwDataHandler::fDependentValues, and VQwDataHandler::fDependentVar.
|
protected |
Initial event/pattern indices per bin; the axis auto-extends (doubling the bin width) once the run grows past fNbins*fBinWidth events
Definition at line 77 of file QwTrendHandler.h.
Referenced by ConstructHistograms(), FillHistograms(), LoadChannelMap(), QwTrendHandler(), and QwTrendHandler().
|
protected |
Time-ordering index incremented once per filled event/pattern.
Definition at line 81 of file QwTrendHandler.h.
Referenced by FillHistograms(), QwTrendHandler(), and QwTrendHandler().
|
protected |
Skip filling when (errorflag & mask) != 0 (0 disables the check)
Definition at line 79 of file QwTrendHandler.h.
Referenced by FillHistograms(), LoadChannelMap(), QwTrendHandler(), and QwTrendHandler().
|
protected |
Number of x bins for the strip-chart profiles (bounded storage)
Definition at line 74 of file QwTrendHandler.h.
Referenced by ConstructHistograms(), FillHistograms(), LoadChannelMap(), QwTrendHandler(), and QwTrendHandler().
|
protected |
True when booked into a fixed-size live TMapFile (ConstructHistograms was called with folder == NULL). In that mode the strip chart is a rolling window drawn with a plain TH1D value trace (SetBinContent): the time index wraps back to the left edge and each new event overwrites its bin. TProfile's several internal arrays (fArray/fSumw2/fBinEntries/fBinSumw2) are not marshalled robustly by TMapFile::Update() and crash the live monitor, so TProfiles are used only for the (auto-extending) file output.
Definition at line 90 of file QwTrendHandler.h.
Referenced by ConstructHistograms(), FillHistograms(), QwTrendHandler(), and QwTrendHandler().
|
protected |
One strip chart per connected channel (owned by the ROOT output directory). Held as the TH1 base so file mode can use a TProfile (mean +/- RMS) while live TMapFile mode uses a robust TH1D value trace.
Definition at line 95 of file QwTrendHandler.h.
Referenced by ConstructHistograms(), FillHistograms(), and ~QwTrendHandler().