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

Comparing UserCode/MitAna/PhysicsMod/src/RunLumiSelectionMod.cc (file contents):
Revision 1.3 by bendavid, Sat May 29 18:10:15 2010 UTC vs.
Revision 1.4 by bendavid, Tue Jun 29 15:51:53 2010 UTC

# Line 16 | Line 16 | RunLumiSelectionMod::RunLumiSelectionMod
16    fNEvents(0),
17    fNAcceped(0),
18    fNFailed(0),
19 <  fAcceptCurrentRunLumi(kFALSE)
19 >  fAcceptCurrentRunLumi(kFALSE),
20 >  fRunLumiGraph(0)
21   {
22    // Constructor.
23   }
# Line 54 | Line 55 | void RunLumiSelectionMod::Process()
55        fAcceptCurrentRunLumi = fAcceptedRunsLumis.HasRunLumi(runLumi);
56      }
57      fCurrentRunLumi = runLumi;
58 +    if (fAcceptCurrentRunLumi) {
59 +      fRunLumiSet.Add(runLumi);
60 +    }
61      if (0) {
62        printf("Run %u, Lumi %u, accepted = %i\n",runLumi.first,runLumi.second,fAcceptCurrentRunLumi);
63      }
# Line 79 | Line 83 | void RunLumiSelectionMod::Process()
83   void RunLumiSelectionMod::SlaveBegin()
84   {
85  
86 + //   fRunLumiVector = new RunLumiVector;
87 + //   fRunLumiVector->SetName("ProcessedRunsLumis");
88 + //   AddOutput(fRunLumiVector);
89 +
90   }
91  
92   //--------------------------------------------------------------------------------------------------
# Line 86 | Line 94 | void RunLumiSelectionMod::SlaveTerminate
94   {
95    // Save number of accepted events.
96  
97 +  const RunLumiSet::SetType &theset = fRunLumiSet.runLumiSet();
98 +
99 +  UInt_t setSize = theset.size();
100 +  Double_t *runArray = new Double_t[setSize];
101 +  Double_t *lumiArray = new Double_t[setSize];
102 +  
103 +  UInt_t arrayPos = 0;
104 +  for (RunLumiSet::SetType::const_iterator it = theset.begin(); it!=theset.end(); ++it) {
105 +    printf("first = %u, second = %u\n",it->first,it->second);
106 +    runArray[arrayPos] = it->first;
107 +    lumiArray[arrayPos] = it->second;
108 +    ++arrayPos;
109 +  }
110 +
111 +  fRunLumiGraph = new TGraph(setSize,runArray,lumiArray);
112 +  fRunLumiGraph->SetName("ProcessedRunsLumis");
113 +  AddOutput(fRunLumiGraph);
114 +  
115 +  delete runArray;
116 +  delete lumiArray;
117 +  
118    SaveNEventsProcessed();
119   }
120  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines