CMS 3D CMS Logo

Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes

R2DTimerObserver Class Reference

#include <R2DTimerObserver.h>

Inheritance diagram for R2DTimerObserver:
BaseEvent< T >

List of all members.

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 ()

Private Types

typedef
TimingReport::ItemObserver::event 
TimerState

Private Member Functions

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

Private Attributes

TimerState lastState
LastMeasurement theMeasurement
TimingReport::Itemtimer_item

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.

: timer_item(0), lastState(0,0) { }
R2DTimerObserver::R2DTimerObserver ( const std::string  name) [inline]

Definition at line 50 of file R2DTimerObserver.h.

References init().

: lastState(0,0) { init( name) ; }

Member Function Documentation

void R2DTimerObserver::init ( const std::string &  name) [inline]
TimingReport::Item& R2DTimerObserver::item ( ) [inline]

Definition at line 53 of file R2DTimerObserver.h.

References timer_item.

{ return *timer_item; }
const LastMeasurement& R2DTimerObserver::lastMeasurement ( ) [inline]

Definition at line 52 of file R2DTimerObserver.h.

References theMeasurement.

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

{ return theMeasurement; }
virtual void R2DTimerObserver::operator() ( const TimerState timerState) [inline, private, virtual]

from base class

Implements BaseEvent< T >.

Definition at line 35 of file R2DTimerObserver.h.

References lastState, and theMeasurement.

                                                         {
    theMeasurement = LastMeasurement(timerState.first-lastState.first,
                                     timerState.second-lastState.second);
    lastState = timerState;
  }
void R2DTimerObserver::start ( void  ) [inline]
void R2DTimerObserver::stop ( ) [inline]

Member Data Documentation

Definition at line 31 of file R2DTimerObserver.h.

Referenced by operator()().

Definition at line 32 of file R2DTimerObserver.h.

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

Definition at line 30 of file R2DTimerObserver.h.

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