ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/TreeMod/src/AnaFwkMod.cc
(Generate patch)

Comparing UserCode/MitAna/TreeMod/src/AnaFwkMod.cc (file contents):
Revision 1.2 by loizides, Wed Nov 19 17:16:10 2008 UTC vs.
Revision 1.3 by loizides, Tue Nov 25 15:57:49 2008 UTC

# Line 12 | Line 12 | ClassImp(mithep::AnaFwkMod)
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   {
# Line 26 | Line 24 | void AnaFwkMod::Process()
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        }
# Line 54 | Line 52 | void AnaFwkMod::Process()
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   }
# Line 65 | Line 63 | void AnaFwkMod::SlaveBegin()
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   }
# Line 77 | Line 72 | void AnaFwkMod::SlaveTerminate()
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;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines