EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PndEventCounterTask.cxx
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file PndEventCounterTask.cxx
1 // -------------------------------------------------------------------------
2 // ----- PndEventCounterTask source file -----
3 // ----- Created 24/09/10 by R. Kliemt -----
4 // -------------------------------------------------------------------------
5 
6 #include "PndEventCounterTask.h"
7 #include <iostream>
8 
9 PndEventCounterTask::PndEventCounterTask(const char* name, Int_t nev, Int_t talk) :
10 FairTask(name),
11 fInitialiezed(kFALSE),
12 fEvtCounter(0),
13 fEvtTalk(talk),
14 fNEvts(nev),
15 fTimeOffset(0.),
16 fTimer()
17 {
18  fTimer.Start();
19 }
20 // -------------------------------------------------------------------------
21 
22 // ----- Destructor ----------------------------------------------------
24 {
25 }
26 // -------------------------------------------------------------------------
27 
29  fTimeOffset=fTimer.RealTime();
30  fTimer.Continue();
31  fEvtCounter = 0;
32  fInitialiezed = kTRUE;
33 }
34 
35 // ----- Public method Exec --------------------------------------------
36 void PndEventCounterTask::Exec(Option_t* opt)
37 {
38  if (!fInitialiezed) StartTimer();
39  fEvtCounter++;
40  if(fEvtCounter%fEvtTalk == 0 || fVerbose>1)
41  {
42  Double_t t=fTimer.RealTime();
43  fTimer.Continue();
44  printf("Event %i/%i : time %6.1f sec, (%6.0f sec remaining)\n",
46  }
47  return;
48 }
49 
51