ATLAS Offline Software
|
Forward declare. More...
#include <MonitorBase.h>
Public Member Functions | |
MonitorBase ()=delete | |
Forbid default constructor. More... | |
MonitorBase (const std::string &name, const MonitoredRange *parent) | |
Construct monitor. More... | |
virtual | ~MonitorBase ()=default |
Default destructor. More... | |
MonitorBase & | operator= (const MonitorBase &)=delete |
Forbid assignment. More... | |
MonitorBase (const MonitorBase &)=delete | |
Forbid copy. More... | |
const std::string & | getName () const |
Getter for Monitor's name. More... | |
const MonitoredRange * | getParent () const |
Return cached non-owning const ptr to this Monitor's parent Range. More... | |
TH1 * | bookGetPointer (TH1 *hist, const std::string &tDir="") const |
Appends Monitor name (to histogram path) and forwards histogram book request to parent Range. More... | |
bool | counterExists (const std::string &name) const |
Check if a counter of a given name exists. More... | |
CounterBase * | getCounter (const std::string &name) |
Retrieve counter by name. More... | |
virtual StatusCode | newEvent (const CostData &data, float weight=1.)=0 |
Pure virtual interface called by Range to instruct this Monitor to perform its analysis. More... | |
virtual StatusCode | endEvent (float weight=1.) |
Called by the framework. More... | |
MsgStream & | msg () |
Logging. More... | |
MsgStream & | msg (const MSG::Level lvl) |
Logging on a given level. More... | |
bool | msgLvl (const MSG::Level lvl) |
Returns if requested level is same or higher than logging level. More... | |
Protected Member Functions | |
virtual std::unique_ptr< CounterBase > | newCounter (const std::string &name)=0 |
Pure virtual Counter instantiation specialisation. More... | |
Protected Attributes | |
std::unordered_map< std::string, std::unique_ptr< CounterBase > > | m_counters |
Storage of Monitor's collection of Counters. More... | |
MsgStream | m_msgStream |
Logging member. More... | |
Private Attributes | |
const std::string | m_name |
Monitor's name. More... | |
const MonitoredRange * | m_parent |
Monitor's parent Range. More... | |
Forward declare.
Base class for all "Monitor" objects, which maintain a collection of Counters of a given specialisation.
A Monitor is responsible for monitoring a specific feature of an event. It could be, monitoring all Chains, all ROS', all Algorithms, etc. It maintains an internal name-keyed map of Counters of a given specialisation and for a given event it loops over all instances of the feature it monitors and dispatches to the matching Counter objects.
Definition at line 33 of file Trigger/TrigCost/TrigCostAnalysis/src/MonitorBase.h.
|
delete |
Forbid default constructor.
MonitorBase::MonitorBase | ( | const std::string & | name, |
const MonitoredRange * | parent | ||
) |
Construct monitor.
[in] | name | Monitor's name |
[in] | parent | Monitor's parent Range, cached non-owning pointer. |
Definition at line 11 of file Trigger/TrigCost/TrigCostAnalysis/src/MonitorBase.cxx.
|
virtualdefault |
Default destructor.
|
delete |
Forbid copy.
TH1 * MonitorBase::bookGetPointer | ( | TH1 * | hist, |
const std::string & | tDir = "" |
||
) | const |
Appends Monitor name (to histogram path) and forwards histogram book request to parent Range.
[in] | hist | Bare pointer to histogram. Ownership transferred to THistSvc. |
[in] | tDir | Histogram name & directory. |
Definition at line 37 of file Trigger/TrigCost/TrigCostAnalysis/src/MonitorBase.cxx.
bool MonitorBase::counterExists | ( | const std::string & | name | ) | const |
Check if a counter of a given name exists.
[in] | name | Name of Counter. |
Definition at line 47 of file Trigger/TrigCost/TrigCostAnalysis/src/MonitorBase.cxx.
|
virtual |
Called by the framework.
Causes per-Event Variables to fill their histograms with their accumulated data.
Definition at line 29 of file Trigger/TrigCost/TrigCostAnalysis/src/MonitorBase.cxx.
CounterBase * MonitorBase::getCounter | ( | const std::string & | name | ) |
Retrieve counter by name.
If no such counter exists, a new one will be instanced and returned.
[in] | name | Name of Counter. |
Definition at line 52 of file Trigger/TrigCost/TrigCostAnalysis/src/MonitorBase.cxx.
const std::string & MonitorBase::getName | ( | ) | const |
Getter for Monitor's name.
Definition at line 19 of file Trigger/TrigCost/TrigCostAnalysis/src/MonitorBase.cxx.
const MonitoredRange * MonitorBase::getParent | ( | ) | const |
Return cached non-owning const ptr to this Monitor's parent Range.
Definition at line 24 of file Trigger/TrigCost/TrigCostAnalysis/src/MonitorBase.cxx.
MsgStream & MonitorBase::msg | ( | ) |
Logging.
Definition at line 64 of file Trigger/TrigCost/TrigCostAnalysis/src/MonitorBase.cxx.
MsgStream & MonitorBase::msg | ( | const MSG::Level | lvl | ) |
Logging on a given level.
[in] | lvl | Verbosity level |
Definition at line 68 of file Trigger/TrigCost/TrigCostAnalysis/src/MonitorBase.cxx.
bool MonitorBase::msgLvl | ( | const MSG::Level | lvl | ) |
Returns if requested level is same or higher than logging level.
[in] | lvl | Verbosity level |
Definition at line 72 of file Trigger/TrigCost/TrigCostAnalysis/src/MonitorBase.cxx.
|
protectedpure virtual |
Pure virtual Counter instantiation specialisation.
Derived Monitor must instantiate a concrete Counter of the correct type for the Monitor and return it wrapped in an owning unique ptr.
[in] | name | Name of Counter to mint. |
Implemented in MonitorChain, MonitorSequence, MonitorAlgorithm, MonitorAlgorithmClass, MonitorChainAlgorithm, MonitorGlobal, MonitorROS, and MonitorThreadOccupancy.
Pure virtual interface called by Range to instruct this Monitor to perform its analysis.
[in] | data | Access to event data |
[in] | weight | Global event weight |
Implemented in MonitorChain, MonitorSequence, MonitorAlgorithm, MonitorAlgorithmClass, MonitorChainAlgorithm, MonitorGlobal, MonitorROS, and MonitorThreadOccupancy.
|
delete |
Forbid assignment.
|
protected |
Storage of Monitor's collection of Counters.
Keyed by name.
Definition at line 138 of file Trigger/TrigCost/TrigCostAnalysis/src/MonitorBase.h.
|
protected |
Logging member.
Definition at line 140 of file Trigger/TrigCost/TrigCostAnalysis/src/MonitorBase.h.
|
private |
Monitor's name.
Definition at line 144 of file Trigger/TrigCost/TrigCostAnalysis/src/MonitorBase.h.
|
private |
Monitor's parent Range.
Cached non-owning const ptr.
Definition at line 145 of file Trigger/TrigCost/TrigCostAnalysis/src/MonitorBase.h.