PandaRoot
PndEventCounterTask.h
Go to the documentation of this file.
1 
8 #ifndef PNDEVENTCOUNTERTASK_H
9 #define PNDEVENTCOUNTERTASK_H
10 
11 #include "FairTask.h"
12 #include "TStopwatch.h"
13 
14 class TClonesArray;
15 
16 class PndEventCounterTask : public FairTask {
17  public:
18  PndEventCounterTask(const char *name = "Event Counter", Int_t nev = 1, Int_t talk = 1);
19  virtual ~PndEventCounterTask();
20  virtual void SetParContainers() { return; }
21  virtual InitStatus Init();
22  virtual InitStatus ReInit() { return kSUCCESS; }
23  virtual void Exec(Option_t *opt);
24  void SetVerbose(Int_t iVerbose) { fVerbose = iVerbose; }
25  void SetAnnounce(Int_t iann) { fEvtTalk = iann; }
26  void SetNEvts(Int_t n) { fNEvts = n; }
27  Int_t GetEventCount() const { return fEvtCounter; }
28  Double_t GetTime()
29  {
30  return fTimer.RealTime();
31  fTimer.Continue();
32  }
33 
34  private:
35  void StartTimer();
36  Bool_t fInitialiezed;
37  Int_t fEvtCounter;
38  Int_t fEvtTalk;
39  Int_t fNEvts;
40  Double_t fTimeOffset;
41  TStopwatch fTimer;
42  ClassDef(PndEventCounterTask, 1);
43 };
44 
45 #endif
virtual InitStatus ReInit()
virtual InitStatus Init()
PndEventCounterTask(const char *name="Event Counter", Int_t nev=1, Int_t talk=1)
virtual ~PndEventCounterTask()
virtual void Exec(Option_t *opt)
virtual void SetParContainers()
void SetVerbose(Int_t iVerbose)
Int_t GetEventCount() const
Task to print the event number, the time needed per event and the expected remaining time...
void SetAnnounce(Int_t iann)