ATLAS Offline Software
|
Concrete implimentation of Counter to monitor all algorithms executing on a single thread. More...
#include <CounterThread.h>
Public Member Functions | |
CounterThread ()=delete | |
Forbid default constructor. More... | |
CounterThread (const std::string &name, const MonitorBase *parent) | |
Construct counter. More... | |
virtual | ~CounterThread ()=default |
Default destructor. More... | |
CounterThread & | operator= (const CounterThread &)=delete |
Forbid assignment. More... | |
CounterThread (const CounterThread &)=delete | |
Forbid copy. More... | |
virtual StatusCode | newEvent (const CostData &data, size_t index, const float weight=1.0) override |
Concrete implementation. More... | |
StatusCode | postProcess (float weight=1.0) |
Apply post-processing to the Counter, before endEvent is called. More... | |
uint64_t | getLowTimestamp () const |
Get the lowest timestamp of this single thread. More... | |
uint64_t | getHighTimestamp () const |
Get the highest timestamp of this single thread. More... | |
void | setAllThreadsTimestamps (uint64_t low, uint64_t high) |
Set the low and high timestamps over all threads. 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... | |
Public Attributes | |
uint64_t | m_lowTimestamp |
Records the lowest timestamp seen on this single thread in an event. More... | |
uint64_t | m_highTimestamp |
Records the highest timestamp seen on this single thread in an event. More... | |
uint64_t | m_globalLowTimestamp |
Records the lowest timestamp seen over all threads in an event. More... | |
uint64_t | m_globalHighTimestamp |
Records the highest timestamp seen over all threads in an event. 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 | 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... | |
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... | |
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... | |
Concrete implimentation of Counter to monitor all algorithms executing on a single thread.
Definition at line 14 of file CounterThread.h.
|
delete |
Forbid default constructor.
CounterThread::CounterThread | ( | const std::string & | name, |
const MonitorBase * | parent | ||
) |
Construct counter.
[in] | name | Counter's name |
[in] | parent | Counter's parent monitor, cached non-owning pointer. |
Definition at line 9 of file CounterThread.cxx.
|
virtualdefault |
Default destructor.
|
delete |
Forbid copy.
|
protectedinherited |
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.
|
virtualinherited |
Called by the framework.
Causes per-Event Variables to fill their histograms with their accumulated data.
Definition at line 225 of file CounterBase.cxx.
|
inherited |
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.
|
inherited |
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.
uint64_t CounterThread::getHighTimestamp | ( | ) | const |
Get the highest timestamp of this single thread.
Definition at line 102 of file CounterThread.cxx.
uint64_t CounterThread::getLowTimestamp | ( | ) | const |
Get the lowest timestamp of this single thread.
Definition at line 97 of file CounterThread.cxx.
|
inherited |
Getter for Counter's name.
Definition at line 17 of file CounterBase.cxx.
|
inherited |
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.
|
inherited |
|
overridevirtual |
Concrete implementation.
Monitores algorithm at specified index for this counter's thread.
[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 |
Implements CounterBase.
Definition at line 32 of file CounterThread.cxx.
|
delete |
Forbid assignment.
StatusCode CounterThread::postProcess | ( | float | weight = 1.0 | ) |
Apply post-processing to the Counter, before endEvent is called.
[in] | weight | Global event weight |
Definition at line 54 of file CounterThread.cxx.
|
protectedinherited |
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.
|
protectedinherited |
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.
|
protectedinherited |
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.
void CounterThread::setAllThreadsTimestamps | ( | uint64_t | low, |
uint64_t | high | ||
) |
Set the low and high timestamps over all threads.
Definition at line 107 of file CounterThread.cxx.
|
inherited |
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.
|
protectedinherited |
Helper function.
Compute the time difference in discreet microseconds and covert to fractional milliseconds.
Definition at line 243 of file CounterBase.cxx.
|
inherited |
Check if a variable of a given name exists.
[in] | name | Name of Variable. |
Definition at line 178 of file CounterBase.cxx.
uint64_t CounterThread::m_globalHighTimestamp |
Records the highest timestamp seen over all threads in an event.
Definition at line 76 of file CounterThread.h.
uint64_t CounterThread::m_globalLowTimestamp |
Records the lowest timestamp seen over all threads in an event.
Definition at line 75 of file CounterThread.h.
uint64_t CounterThread::m_highTimestamp |
Records the highest timestamp seen on this single thread in an event.
Definition at line 73 of file CounterThread.h.
uint64_t CounterThread::m_lowTimestamp |
Records the lowest timestamp seen on this single thread in an event.
Definition at line 72 of file CounterThread.h.
|
privateinherited |
Counter's name.
Definition at line 203 of file CounterBase.h.
|
privateinherited |
Counter's parent Monitor.
Cached non-owning const pointer.
Definition at line 204 of file CounterBase.h.
|
privateinherited |
Store of Counter's Variables.
These wrap a histogram pointer. Keyed by name.
Definition at line 205 of file CounterBase.h.