Public Member Functions | Private Attributes | Static Private Attributes

TGo4Ratemeter Class Reference

#include <TGo4Ratemeter.h>

List of all members.

Public Member Functions

 TGo4Ratemeter ()
virtual ~TGo4Ratemeter ()
Double_t GetRate () const
Double_t GetTime () const
ULong64_t GetCurrentCount () const
Double_t GetAvRate () const
Bool_t Update (Int_t increment=1)
void Reset ()
Bool_t TestUpdate ()
void SetUpdateInterval (double v)

Private Attributes

ULong64_t fuCurrentCount
ULong64_t fuLastCount
Double_t fdRate
Double_t fdTime
TTimeStamp fLastTm
Bool_t fbUpdateDone
ULong64_t fuNextCheckCnt
ULong64_t fuCheckInterval
Double_t fdUpdateInterval

Static Private Attributes

static const Double_t fgdUPDATEINTERVAL = 1.0

Detailed Description

Class containing event counter and ratemeter services.

Definition at line 24 of file TGo4Ratemeter.h.


Constructor & Destructor Documentation

TGo4Ratemeter::TGo4Ratemeter (  ) 

Definition at line 19 of file TGo4Ratemeter.cxx.

TGo4Ratemeter::~TGo4Ratemeter (  )  [virtual]

Definition at line 33 of file TGo4Ratemeter.cxx.


Member Function Documentation

Double_t TGo4Ratemeter::GetAvRate (  )  const [inline]

Definition at line 36 of file TGo4Ratemeter.h.

References fdTime, and fuCurrentCount.

Referenced by TGo4DabcPlayer::RatemeterUpdate(), and TGo4AnalysisClient::UpdateStatus().

ULong64_t TGo4Ratemeter::GetCurrentCount (  )  const [inline]
Double_t TGo4Ratemeter::GetRate (  )  const [inline]
Double_t TGo4Ratemeter::GetTime (  )  const [inline]

Definition at line 32 of file TGo4Ratemeter.h.

References fdTime.

Referenced by TGo4DabcPlayer::RatemeterUpdate(), and TGo4AnalysisClient::UpdateStatus().

void TGo4Ratemeter::Reset (  ) 
void TGo4Ratemeter::SetUpdateInterval ( double  v  )  [inline]

Set update interval in seconds - default is 1

Definition at line 53 of file TGo4Ratemeter.h.

References fdUpdateInterval.

Referenced by TGo4Analysis::RunImplicitLoop().

Bool_t TGo4Ratemeter::TestUpdate (  ) 

Test if update has been called since last test.. To be called from watch thread to check if main thread is still active. If not, watch thread has to update status and rate itself.

Definition at line 93 of file TGo4Ratemeter.cxx.

References fbUpdateDone.

Referenced by TGo4AnalysisClient::TestRatemeter().

Bool_t TGo4Ratemeter::Update ( Int_t  increment = 1  ) 

Update counter and rate values. Parameter increment may specify the number of counts to add before the new rate is calculated. Return kTRUE if new rate is calculated

Definition at line 50 of file TGo4Ratemeter.cxx.

References fbUpdateDone, fdRate, fdTime, fdUpdateInterval, fLastTm, fuCheckInterval, fuCurrentCount, fuLastCount, and fuNextCheckCnt.

Referenced by TGo4Analysis::RunImplicitLoop(), and TGo4AnalysisClient::UpdateRate().


Member Data Documentation

Bool_t TGo4Ratemeter::fbUpdateDone [private]

True if update has been performed since last TestZero call.

Definition at line 75 of file TGo4Ratemeter.h.

Referenced by Reset(), TestUpdate(), and Update().

Double_t TGo4Ratemeter::fdRate [private]

Current eventrate (events/sec).

Definition at line 66 of file TGo4Ratemeter.h.

Referenced by GetRate(), Reset(), and Update().

Double_t TGo4Ratemeter::fdTime [private]

Time sum since last ratemeter reset. in s.

Definition at line 69 of file TGo4Ratemeter.h.

Referenced by GetAvRate(), GetTime(), Reset(), and Update().

Double_t TGo4Ratemeter::fdUpdateInterval [private]

Configured interval in seconds before two updates

Definition at line 84 of file TGo4Ratemeter.h.

Referenced by SetUpdateInterval(), and Update().

const Double_t TGo4Ratemeter::fgdUPDATEINTERVAL = 1.0 [static, private]

Definition at line 57 of file TGo4Ratemeter.h.

TTimeStamp TGo4Ratemeter::fLastTm [private]

Time when last rate measurement was done

Definition at line 72 of file TGo4Ratemeter.h.

Referenced by Reset(), and Update().

ULong64_t TGo4Ratemeter::fuCheckInterval [private]

How often time should be checked

Definition at line 81 of file TGo4Ratemeter.h.

Referenced by Reset(), and Update().

ULong64_t TGo4Ratemeter::fuCurrentCount [private]

Number of events processed since last start.

Definition at line 60 of file TGo4Ratemeter.h.

Referenced by GetAvRate(), GetCurrentCount(), Reset(), and Update().

ULong64_t TGo4Ratemeter::fuLastCount [private]

Number of events processed at last ratemeter update.

Definition at line 63 of file TGo4Ratemeter.h.

Referenced by Reset(), and Update().

ULong64_t TGo4Ratemeter::fuNextCheckCnt [private]

Next counter value when time will be checked

Definition at line 78 of file TGo4Ratemeter.h.

Referenced by Reset(), and Update().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines