The Gaudi Framework  v29r0 (ff2e7097)
SequencerTimerTool.h
Go to the documentation of this file.
1 #ifndef SEQUENCERTIMERTOOL_H
2 #define SEQUENCERTIMERTOOL_H 1
3 
4 // Include files
5 // from Gaudi
8 
9 // local
10 #include "TimerForSequencer.h"
11 
26 {
27 
28 public:
32 
33 public:
36 
37  ~SequencerTimerTool() override = default;
38 
40  StatusCode initialize() override;
41 
43  StatusCode finalize() override;
44 
46  int addTimer( const std::string& name ) override;
47 
49  void increaseIndent() override { m_indent += 1; }
50 
52  void decreaseIndent() override { m_indent = std::max( m_indent - 1, 0 ); }
53 
55  void start( int index ) override { m_timerList[index].start(); }
56 
58  double stop( int index ) override { return m_timerList[index].stop(); }
59 
61  double lastTime( int index ) override { return m_timerList[index].lastTime(); }
62 
64  const std::string& name( int index ) override { return m_timerList[index].name(); }
65 
67  int indexByName( const std::string& name ) override;
68 
70  bool globalTiming() override { return m_globalTiming; };
71 
73  void saveHistograms() override;
74 
75 private:
76  Gaudi::Property<int> m_shots{this, "Shots", 3500000, "number of shots for CPU normalization"};
77  Gaudi::Property<bool> m_normalised{this, "Normalised", false, "normalise the time to a nominal PIII"};
78  Gaudi::Property<bool> m_globalTiming{this, "GlobalTiming", false};
80  "number of characters to be used in algorithm name column"};
81 
82  int m_indent = 0;
84  double m_normFactor = 0.001;
85  double m_speedRatio = 0;
86 };
87 #endif // SEQUENCERTIMERTOOL_H
StatusCode initialize() override
initialize method, to compute the normalization factor
void increaseIndent() override
Increase the indentation of the name.
Implementation of property with value of concrete type.
Definition: Property.h:319
virtual const std::string & type() const =0
The type of an AlgTool, meaning the concrete AlgTool class.
Gaudi::Property< bool > m_normalised
virtual StatusCode start()=0
Start (from INITIALIZED to RUNNING).
void start(int index) override
start the counter, i.e.
Header file for class : GaudiHistoTool.
~SequencerTimerTool() override=default
Destructor.
int indexByName(const std::string &name) override
returns the index of the counter with that name, or -1
Simple class to extend the functionality of class GaudiTool.
STL class.
Gaudi::Property< int > m_shots
void saveHistograms() override
prepares and saves the timing histograms
double stop(int index) override
stop the counter, return the elapsed time
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:28
Definition of the basic interface.
Definition: IInterface.h:277
T max(T...args)
int addTimer(const std::string &name) override
add a timer entry with the specified name
int m_indent
Amount of indentation.
virtual StatusCode stop()=0
Stop (from RUNNING to INITIALIZED).
Implements the time measurement inside a sequencer.
Implements the time measurement inside a sequencer.
bool globalTiming() override
returns the flag telling that global timing is wanted
std::vector< TimerForSequencer > m_timerList
SequencerTimerTool(const std::string &type, const std::string &name, const IInterface *parent)
Standard constructor.
Gaudi::Property< bool > m_globalTiming
void decreaseIndent() override
Decrease the indentation of the name.
Gaudi::Property< std::string::size_type > m_headerSize
const std::string & name(int index) override
returns the name of the counter
virtual const IInterface * parent() const =0
The parent of the concrete AlgTool.
StatusCode finalize() override
finalize method, to print the time summary table
virtual const std::string & name() const =0
Retrieve the name of the instance.
double lastTime(int index) override
returns the last time
double m_normFactor
Factor to convert to standard CPU (1 GHz PIII)