ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitHzz4l/Selection/src/applySelection.cc
(Generate patch)

Comparing UserCode/MitHzz4l/Selection/src/applySelection.cc (file contents):
Revision 1.9 by khahn, Mon Oct 17 16:23:43 2011 UTC vs.
Revision 1.10 by dkralph, Sun Oct 23 11:52:41 2011 UTC

# Line 97 | Line 97 | int main(int argc, char** argv)
97    //
98    // Setup
99    //--------------------------------------------------------------------------------------------------------------
100 +  const char * ofname;
101 +  if( strcmp( ctrl.outputfile.c_str(), "") ) {
102 +    ofname = ctrl.outputfile.c_str();
103 +  } else {
104 +    ofname = "tmp.root";
105 +  }
106 +  TFile *file = new TFile(ofname, "RECREATE");
107    TH1F * h_evt = new TH1F("hevt", "hevt", 2, 0, 2 );
108    TH1F * h_evtfail = new TH1F("hevtfail", "hevtfail", 1024, 0, 1024 );
109    //  TNtuple * passtuple = new TNtuple( "passtuple", "passtuple", "run:evt:lumi:channel:mZ1:mZ2:m4l:pt4l:w" );
# Line 118 | Line 125 | int main(int argc, char** argv)
125    initCiCSelection();
126    if(ctrl.eleSele=="lik") initLikSelection();
127    if(ctrl.eleSele=="bdt") initBDTSelection();
128 <  if(ctrl.eleSele=="si" ) initSiMVAElectronSelection();
128 >  // if(ctrl.eleSele=="si" ) initSiMVAElectronSelection();
129    initRunLumiRangeMap();
130  
131    //
132    // Loop
133    //--------------------------------------------------------------------------------------------------------------
134 +  if(ctrl.fakeScheme!="none") {cout << "wrong executable!" << endl; assert(0);}
135    
136    //
137    // Access samples and fill histograms
# Line 152 | Line 160 | int main(int argc, char** argv)
160  
161    int count=0, pass=0;
162    cout << "nEntries: " << chain->GetEntries() << endl;
163 <  for(UInt_t ientry=0; ientry<chain->GetEntries(); ientry++) {
164 <
163 >  cerr << "nEntries: " << chain->GetEntries() << endl;
164 >  UInt_t imax = chain->GetEntries();
165 >  for(UInt_t ientry=0; ientry<imax; ientry++) {
166      chain->GetEntry(ientry);
167 <    if(!(ientry%100000)) cout << "entry: " << ientry << endl;
167 >    if(!(ientry%100000)) cerr << "entry: " << ientry << endl;
168  
169      // get event weight for this file                                                    
170      double eventweight=1;
# Line 202 | Line 211 | int main(int argc, char** argv)
211            
212   #endif
213  
214 <    unsigned evtfail = fails_HZZ4L_selection(ctrl, info, electronArr, muonArr, eventweight, passtuple);    
214 >    unsigned evtfail = fails_HZZ4L_selection(ctrl, info, electronArr, muonArr, eventweight, passtuple);
215 >
216 > #ifdef THEIR_EVENTS
217 >    if(evtfail!=0) cout << "Failed!" << endl;
218 > #endif
219 >    
220      h_evtfail->Fill( evtfail, eventweight );
221  
222      count++;
# Line 227 | Line 241 | int main(int argc, char** argv)
241    //--------------------------------------------------------------------------------------------------------------
242    // Save Histograms;
243    //==============================================================================================================
244 <  const char * ofname;
245 <  if( strcmp( ctrl.outputfile.c_str(), "") ) {
246 <    ofname = ctrl.outputfile.c_str();
247 <  } else {
248 <    ofname = "tmp.root";
249 <  }
244 >  // const char * ofname;
245 >  // if( strcmp( ctrl.outputfile.c_str(), "") ) {
246 >  //   ofname = ctrl.outputfile.c_str();
247 >  // } else {
248 >  //   ofname = "tmp.root";
249 >  // }
250  
251 <  TFile *file = new TFile(ofname, "RECREATE");
251 >  // TFile *file = new TFile(ofname, "RECREATE");
252 >  gROOT->cd(file->GetPath());
253    h_evt->Write();
254    h_evtfail->Write();
255    passtuple->Write();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines