All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
SequencerTimerTool.h
Go to the documentation of this file.
1 // $Id: SequencerTimerTool.h,v 1.7 2005/07/29 16:49:43 hmd Exp $
2 #ifndef SEQUENCERTIMERTOOL_H
3 #define SEQUENCERTIMERTOOL_H 1
4 
5 // Include files
6 // from Gaudi
9 
10 // local
11 #include "TimerForSequencer.h"
12 
13 
28  virtual public ISequencerTimerTool
29 {
30 
31 public:
32 
36 
37 public:
38 
40  SequencerTimerTool( const std::string& type,
41  const std::string& name,
42  const IInterface* parent);
43 
44  virtual ~SequencerTimerTool( );
45 
47  virtual StatusCode initialize();
48 
50  virtual StatusCode finalize();
51 
53  virtual int addTimer( const std::string& name );
54 
56  virtual void increaseIndent() { m_indent += 2; }
57 
59  virtual void decreaseIndent()
60  {
61  m_indent -= 2;
62  if ( 0 > m_indent ) m_indent = 0;
63  }
64 
66  void start( int index ) { m_timerList[index].start(); }
67 
69  double stop( int index ) { return m_timerList[index].stop(); }
70 
72  double lastTime( int index ) { return m_timerList[index].lastTime(); }
73 
75  const std::string& name( int index ) { return m_timerList[index].name(); }
76 
78  int indexByName( const std::string& name );
79 
81  virtual bool globalTiming() { return m_globalTiming; };
82 
84  virtual void saveHistograms();
85 
86 private:
87 
88  int m_shots;
89  bool m_normalised;
90  int m_indent;
91  std::vector<TimerForSequencer> m_timerList;
92  double m_normFactor;
93  double m_speedRatio;
95  std::string::size_type m_headerSize;
96 
97 };
98 #endif // SEQUENCERTIMERTOOL_H
virtual StatusCode start()=0
Start (from INITIALIZED to RUNNING).
int indexByName(const std::string &name)
returns the index of the counter with that name, or -1
virtual bool globalTiming()
returns the flag telling that global timing is wanted
virtual StatusCode initialize()
initialize method, to compute the normalization factor
Header file for class : GaudiHistoTool.
int m_shots
Number of shots for CPU normalization.
double lastTime(int index)
returns the last time
void start(int index)
start the counter, i.e.
virtual const std::string & name() const =0
Retrieve the name of the instance.
virtual void increaseIndent()
Increase the indentation of the name.
std::string::size_type m_headerSize
Size of the name field.
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
const std::string & name(int index)
returns the name of the counter
Definition of the basic interface.
Definition: IInterface.h:160
Simple class to extend the functionality of class GaudiTool.
virtual void decreaseIndent()
Decrease the indentation of the name.
virtual const std::string & type() const =0
The type of an AlgTool, meaning the concrete AlgTool class.
virtual void saveHistograms()
prepares and saves the timing histograms
virtual const IInterface * parent() const =0
The parent of the concrete AlgTool.
int m_indent
Amount of indentation.
double stop(int index)
stop the counter, return the elapsed time
virtual ~SequencerTimerTool()
Destructor.
virtual StatusCode stop()=0
Stop (from RUNNING to INITIALIZED).
Implements the time measurement inside a sequencer.
Implements the time measurement inside a sequencer.
std::vector< TimerForSequencer > m_timerList
bool m_normalised
Is the time scaled to a nominal PIII ?
SequencerTimerTool(const std::string &type, const std::string &name, const IInterface *parent)
Standard constructor.
virtual int addTimer(const std::string &name)
add a timer entry with the specified name
virtual StatusCode finalize()
finalize method, to print the time summary table
double m_normFactor
Factor to convert to standard CPU (1 GHz PIII)