12 |
|
//-------------------------------------------------------------------------------------------------- |
13 |
|
AnaFwkMod::AnaFwkMod(const char *name, const char *title) : |
14 |
|
BaseMod(name,title), |
15 |
– |
fNEventsProcessed(0), |
16 |
– |
hDEvents(0), |
15 |
|
fSWtotal(0), |
16 |
|
fSWevent(0) |
17 |
|
{ |
24 |
|
// Do event counting and print out timing information. |
25 |
|
|
26 |
|
// counting events |
27 |
< |
fNEventsProcessed++; |
27 |
> |
IncNEventsProcessed(); |
28 |
|
|
29 |
|
// check if printout should be done |
30 |
|
Bool_t doPrint = 0; |
31 |
|
|
32 |
|
MDB(kAnalysis, 4) { |
33 |
< |
if (fNEventsProcessed % 1000 == 0) |
33 |
> |
if (GetNEventsProcessed() % 1000 == 0) |
34 |
|
doPrint = 1; |
35 |
|
} else { |
36 |
|
MDB(kAnalysis, 3) { |
37 |
< |
if (fNEventsProcessed % 10000 == 0) |
37 |
> |
if (GetNEventsProcessed() % 10000 == 0) |
38 |
|
doPrint = 1; |
39 |
|
} else { |
40 |
|
MDB(kAnalysis, 2) { |
41 |
< |
if (fNEventsProcessed % 50000 == 0) |
41 |
> |
if (GetNEventsProcessed() % 50000 == 0) |
42 |
|
doPrint = 1; |
43 |
|
} else { |
44 |
|
MDB(kAnalysis, 1) { |
45 |
< |
if (fNEventsProcessed % 250000 == 0) |
45 |
> |
if (GetNEventsProcessed() % 250000 == 0) |
46 |
|
doPrint = 1; |
47 |
|
} |
48 |
|
} |
52 |
|
if (doPrint) { |
53 |
|
fSWevent->Stop(); |
54 |
|
Info("Process", "Events %d -> %.2gs real, %.2gs cpu (%.2g real, %.2g cpu per event)", |
55 |
< |
fNEventsProcessed, fSWevent->RealTime(), fSWevent->CpuTime(), |
56 |
< |
fSWevent->RealTime()/fNEventsProcessed, fSWevent->CpuTime()/fNEventsProcessed); |
55 |
> |
GetNEventsProcessed(), fSWevent->RealTime(), fSWevent->CpuTime(), |
56 |
> |
fSWevent->RealTime()/GetNEventsProcessed(), fSWevent->CpuTime()/GetNEventsProcessed()); |
57 |
|
fSWevent->Start(); |
58 |
|
} |
59 |
|
} |
63 |
|
{ |
64 |
|
// Book our histogram and start the stop watches. |
65 |
|
|
68 |
– |
hDEvents = new TH1D("hDEvents","Total number of processed events",1,-0.5,0.5); |
69 |
– |
AddOutput(hDEvents); |
70 |
– |
|
66 |
|
fSWtotal = new TStopwatch; |
67 |
|
fSWevent = new TStopwatch; |
68 |
|
} |
72 |
|
{ |
73 |
|
// Fill event histogram and printout timing information. |
74 |
|
|
75 |
< |
hDEvents->Fill(0.0,fNEventsProcessed); |
81 |
< |
hDEvents->SetEntries(fNEventsProcessed); |
75 |
> |
SaveNEventsProcessed(); |
76 |
|
|
77 |
|
fSWtotal->Stop(); |
78 |
|
fSWevent->Stop(); |
79 |
|
|
80 |
|
MDB(kAnalysis, 1) |
81 |
|
Info("SlaveTerminate", "Events %d -> %.2gs real, %.2gs cpu (%.2gs real, %.2gs cpu per event)", |
82 |
< |
fNEventsProcessed, fSWtotal->RealTime(), fSWtotal->CpuTime(), |
83 |
< |
fSWtotal->RealTime()/fNEventsProcessed, fSWtotal->CpuTime()/fNEventsProcessed); |
82 |
> |
GetNEventsProcessed(), fSWtotal->RealTime(), fSWtotal->CpuTime(), |
83 |
> |
fSWtotal->RealTime()/GetNEventsProcessed(), fSWtotal->CpuTime()/GetNEventsProcessed()); |
84 |
|
|
85 |
|
delete fSWtotal; |
86 |
|
delete fSWevent; |