EIC Software
Reference for
EIC
simulation and reconstruction software on GitHub
Home page
Related Pages
Modules
Namespaces
Classes
Files
External Links
File List
File Members
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 ----------------------------------------------------
23
PndEventCounterTask::~PndEventCounterTask
()
24
{
25
}
26
// -------------------------------------------------------------------------
27
28
void
PndEventCounterTask::StartTimer
(){
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"
,
45
fEvtCounter
,
fNEvts
,t,(t-
fTimeOffset
)*(
fNEvts
-
fEvtCounter
)/
fEvtCounter
);
46
}
47
return
;
48
}
49
50
ClassImp
(
PndEventCounterTask
);
51
EicRoot
blob
master
PndTools
generalTools
PndEventCounterTask.cxx
Built by
Jin Huang
. updated:
Mon Jan 22 2024 12:43:37
using
1.8.2 with
EIC GitHub integration