![]() |
ATLAS Offline Software
|
Forward declare. More...
#include <CounterBase.h>
Public Member Functions | |
| CounterBase ()=delete | |
| Forbid default constructor. More... | |
| CounterBase (const std::string &name, const MonitorBase *parent) | |
| Construct counter. More... | |
| virtual | ~CounterBase ()=default |
| Default destructor. More... | |
| CounterBase & | operator= (const CounterBase &)=delete |
| Forbid assignment. More... | |
| CounterBase (const CounterBase &)=delete | |
| Forbid copy. More... | |
| const std::string & | getName () const |
| Getter for Counter's name. More... | |
| const MonitorBase * | getParent () const |
| Return cached non-owning const ptr to this Counter's parent Monitor. More... | |
| bool | variableExists (const std::string &name) const |
| Check if a variable of a given name exists. More... | |
| Variable & | getVariable (const std::string &name) |
| Returns a mutable reference to a named Variable. More... | |
| StatusCode | fill (const std::string &name, float value, float weight=1.0) |
| Fill (for per-Call) or accumulate in a buffer (for per-Event) a quantity histogrammed by a named Variable. More... | |
| StatusCode | fill (const std::string &name, float xvalue, float yvalue, float weight) |
| Fill (for per-Call) or accumulate in a buffer (for per-Event) a quantity histogrammed by a named Variable. More... | |
| StatusCode | increment (const std::string &name, float weight=1.0) |
| Convenience function. More... | |
| StatusCode | setDenominator (const std::string &name, float value) |
| Optional for per-Event Variables. More... | |
| virtual StatusCode | endEvent (float weight=1.0) |
| Called by the framework. More... | |
| virtual StatusCode | newEvent (const CostData &data, size_t index, float weight=1.0)=0 |
| Pure virtual interface called by Monitor to instruct this Counter to perform its analysis. More... | |
Protected Member Functions | |
| void | regHistogram (const std::string &name, const std::string &title, const VariableType type=VariableType::kPerCall, const LogType xaxis=kLog, const float min=0.1, const float max=1000000., const size_t bins=70) |
| Book a histogram for this Counter, to be filled in per-event monitoring. More... | |
| void | regTProfile (const std::string &name, const std::string &title, const VariableType type=VariableType::kPerCall, const LogType xaxis=kLog, const float min=0.1, const float max=1000000., const size_t bins=70) |
| Book a TProfile for this Counter, to be filled in per-event monitoring. More... | |
| void | regHistogram (const std::string &name, const std::string &title, const VariableType type, const LogType xaxis, const float xmin, const float xmax, const size_t xbins, const LogType yaxis, const float ymin, const float ymax, const size_t ybins) |
| Book a 2D histogram for this Counter, to be filled in per-event monitoring. More... | |
| TH1 * | bookGetPointer (TH1 *hist, const std::string &tDir="") const |
| Appends Counter name (to histogram path) and forwards histogram book request to parent Monitor. More... | |
| float | timeToMilliSec (const uint64_t start, const uint64_t stop) const |
| Helper function. More... | |
Private Attributes | |
| const std::string | m_name |
| Counter's name. More... | |
| const MonitorBase * | m_parent |
| Counter's parent Monitor. More... | |
| std::unordered_map< std::string, Variable > | m_variables |
| Store of Counter's Variables. More... | |
Forward declare.
Base class for all "Counter" objects, with common histogram management functionality.
A Counter object represents a logical object which has monitored properties. A counter might represent an Algorithm, a Chain, a Lumi block, a ROS, etc. Each specialisation will have its own set of histograms.
Definition at line 25 of file CounterBase.h.
|
delete |
Forbid default constructor.
| CounterBase::CounterBase | ( | const std::string & | name, |
| const MonitorBase * | parent | ||
| ) |
|
virtualdefault |
Default destructor.
|
delete |
Forbid copy.
|
protected |
Appends Counter name (to histogram path) and forwards histogram book request to parent Monitor.
| [in] | hist | Bare pointer to histogram. Ownership transferred to THistSvc. |
| [in] | tDir | Histogram name & directory. |
Definition at line 233 of file CounterBase.cxx.
|
virtual |
Called by the framework.
Causes per-Event Variables to fill their histograms with their accumulated data.
Definition at line 225 of file CounterBase.cxx.
| StatusCode CounterBase::fill | ( | const std::string & | name, |
| float | value, | ||
| float | weight = 1.0 |
||
| ) |
Fill (for per-Call) or accumulate in a buffer (for per-Event) a quantity histogrammed by a named Variable.
| [in] | name | Variable to increment |
| [in] | value | The payload value |
| [in] | weight | Global event weight |
Definition at line 191 of file CounterBase.cxx.
| StatusCode CounterBase::fill | ( | const std::string & | name, |
| float | xvalue, | ||
| float | yvalue, | ||
| float | weight | ||
| ) |
Fill (for per-Call) or accumulate in a buffer (for per-Event) a quantity histogrammed by a named Variable.
| [in] | name | Variable to increment |
| [in] | xvalue | The payload x-axis value |
| [in] | yvalue | The payload y-axis value |
| [in] | weight | Global event weight |
Definition at line 200 of file CounterBase.cxx.
| const std::string & CounterBase::getName | ( | ) | const |
Getter for Counter's name.
Definition at line 17 of file CounterBase.cxx.
| const MonitorBase * CounterBase::getParent | ( | ) | const |
Return cached non-owning const ptr to this Counter's parent Monitor.
Definition at line 22 of file CounterBase.cxx.
Returns a mutable reference to a named Variable.
Throws if no such Variable exists. Used when more complicated logic is needed on a Variable than simply using the fill() method.
| [in] | name | Variable to return |
Definition at line 182 of file CounterBase.cxx.
| StatusCode CounterBase::increment | ( | const std::string & | name, |
| float | weight = 1.0 |
||
| ) |
|
pure virtual |
Pure virtual interface called by Monitor to instruct this Counter to perform its analysis.
| [in] | data | Access to event data |
| [in] | index | Index within appropriate event data container which is to be analysed by this Counter |
| [in] | weight | Global event weight |
Implemented in CounterThread, CounterROS, CounterChain, CounterAlgorithm, CounterSequence, and CounterGlobal.
|
delete |
Forbid assignment.
|
protected |
Book a 2D histogram for this Counter, to be filled in per-event monitoring.
| [in] | name | The name of the histogram (and corresponding Variable) |
| [in] | title | ROOT histogram title string in format "title;xaxis;yaxis" |
| [in] | xaxis | Controls if the x-axis should use fixed-width or logarithmic bin boundaries. |
| [in] | xmin | X-axis minimum bound. |
| [in] | xmax | X-axis maximum bound. |
| [in] | xbins | Number of histogram bins. |
| [in] | yaxis | Controls if the y-axis should use fixed-width or logarithmic bin boundaries. |
| [in] | ymin | Y-axis minimum bound. |
| [in] | ymax | Y-axis maximum bound. |
| [in] | ybins | Number of histogram bins. |
Definition at line 109 of file CounterBase.cxx.
|
protected |
Book a histogram for this Counter, to be filled in per-event monitoring.
| [in] | name | The name of the histogram (and corresponding Variable) |
| [in] | title | ROOT histogram title string in format "title;xaxis;yaxis" |
| [in] | xaxis | Controls if the x-axis should use fixed-width or logarithmic bin boundaries. |
| [in] | min | X-axis minimum bound. |
| [in] | max | X-axis maximum bound. |
| [in] | bins | Number of histogram bins. |
Definition at line 27 of file CounterBase.cxx.
|
protected |
Book a TProfile for this Counter, to be filled in per-event monitoring.
| [in] | name | The name of the histogram (and corresponding Variable) |
| [in] | title | ROOT histogram title string in format "title;xaxis;yaxis" |
| [in] | xaxis | Controls if the x-axis should use fixed-width or logarithmic bin boundaries. |
| [in] | min | X-axis minimum bound. |
| [in] | max | X-axis maximum bound. |
| [in] | bins | Number of histogram bins. |
Definition at line 68 of file CounterBase.cxx.
| StatusCode CounterBase::setDenominator | ( | const std::string & | name, |
| float | value | ||
| ) |
Optional for per-Event Variables.
Sets a denominator to divide the value through by before filling.
| [in] | name | Variable to set the denominator for. |
| [in] | value | The denominator |
Definition at line 210 of file CounterBase.cxx.
Helper function.
Compute the time difference in discreet microseconds and covert to fractional milliseconds.
Definition at line 243 of file CounterBase.cxx.
| bool CounterBase::variableExists | ( | const std::string & | name | ) | const |
Check if a variable of a given name exists.
| [in] | name | Name of Variable. |
Definition at line 178 of file CounterBase.cxx.
|
private |
Counter's name.
Definition at line 203 of file CounterBase.h.
|
private |
Counter's parent Monitor.
Cached non-owning const pointer.
Definition at line 204 of file CounterBase.h.
|
private |
Store of Counter's Variables.
These wrap a histogram pointer. Keyed by name.
Definition at line 205 of file CounterBase.h.
1.8.18