test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes
R2DTimerObserver Class Reference

#include <R2DTimerObserver.h>

Inheritance diagram for R2DTimerObserver:
BaseEvent< T >

Classes

class  LastMeasurement
 

Public Member Functions

void init (const std::string &name)
 
TimingReport::Itemitem ()
 
const LastMeasurementlastMeasurement ()
 
 R2DTimerObserver ()
 
 R2DTimerObserver (const std::string name)
 
void start ()
 
void stop ()
 
- Public Member Functions inherited from BaseEvent< T >
virtual ~BaseEvent ()
 

Private Types

typedef
TimingReport::ItemObserver::event 
TimerState
 

Private Member Functions

virtual void operator() (const TimerState &timerState)
 from base class More...
 

Private Attributes

TimerState lastState
 
LastMeasurement theMeasurement
 
TimingReport::Itemtimer_item
 

Additional Inherited Members

- Public Types inherited from BaseEvent< T >
typedef T event
 

Detailed Description

utility to get the real/cpu time betwen last TimingReport::Item start-stop. actual timer initialisation by initTiming(..) from PixelRecoUtilities. example usage: R2DTimerObserver tm("timer name"); .... { TimeMe t(tm.item(),false); ... } last_real = tm.lastMeasurement().real();

Definition at line 7 of file R2DTimerObserver.h.

Member Typedef Documentation

Definition at line 19 of file R2DTimerObserver.h.

Constructor & Destructor Documentation

R2DTimerObserver::R2DTimerObserver ( )
inline

Definition at line 49 of file R2DTimerObserver.h.

49 : timer_item(0), lastState(0,0) { }
TimerState lastState
TimingReport::Item * timer_item
R2DTimerObserver::R2DTimerObserver ( const std::string  name)
inline

Definition at line 50 of file R2DTimerObserver.h.

References init().

50 : lastState(0,0) { init( name) ; }
TimerState lastState
void init(const std::string &name)

Member Function Documentation

void R2DTimerObserver::init ( const std::string &  name)
inline

Definition at line 43 of file R2DTimerObserver.h.

References TimingReport::current(), TimingReport::Item::setObs(), TimingReport::Item::switchCPU(), and timer_item.

Referenced by R2DTimerObserver().

43  {
45  timer_item->switchCPU(false);
46  timer_item->setObs(this);
47  }
static TimingReport * current()
Definition: TimingReport.cc:21
void setObs(MyObserver *io)
Definition: TimingReport.h:44
TimingReport::Item * timer_item
Item & switchCPU(bool ion)
Definition: TimingReport.h:31
TimingReport::Item& R2DTimerObserver::item ( )
inline
const LastMeasurement& R2DTimerObserver::lastMeasurement ( )
inline

Definition at line 52 of file R2DTimerObserver.h.

References theMeasurement.

Referenced by SiPixelRawToDigi::produce(), and SiPixelDigiToRaw::produce().

52 { return theMeasurement; }
LastMeasurement theMeasurement
virtual void R2DTimerObserver::operator() ( const TimerState timerState)
inlineprivatevirtual

from base class

Implements BaseEvent< T >.

Definition at line 35 of file R2DTimerObserver.h.

References lastState, and theMeasurement.

35  {
36  theMeasurement = LastMeasurement(timerState.first-lastState.first,
37  timerState.second-lastState.second);
38  lastState = timerState;
39  }
LastMeasurement theMeasurement
TimerState lastState
void R2DTimerObserver::start ( void  )
inline
void R2DTimerObserver::stop ( )
inline

Definition at line 56 of file R2DTimerObserver.h.

References TimingReport::Item::stop(), and timer_item.

Referenced by SiPixelRawToDigi::produce(), and SiPixelDigiToRaw::produce().

56 { timer_item->stop(); }
TimingReport::Item * timer_item

Member Data Documentation

TimerState R2DTimerObserver::lastState
private

Definition at line 31 of file R2DTimerObserver.h.

Referenced by operator()().

LastMeasurement R2DTimerObserver::theMeasurement
private

Definition at line 32 of file R2DTimerObserver.h.

Referenced by lastMeasurement(), and operator()().

TimingReport::Item* R2DTimerObserver::timer_item
private

Definition at line 30 of file R2DTimerObserver.h.

Referenced by init(), item(), start(), and stop().