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.4 by dkralph, Thu Sep 22 18:01:19 2011 UTC vs.
Revision 1.8 by khahn, Fri Oct 14 11:20:25 2011 UTC

# Line 37 | Line 37 | using namespace std;
37   #include "TElectron.hh"
38   #include "TMuon.hh"
39   #include "TJet.hh"
40 + #include "SiMVAElectronSelection.h"
41   #include "RunLumiRangeMap.h"
42  
43   //
# Line 47 | Line 48 | using namespace std;
48   #include "Selection.h"
49   #include "HZZCiCElectronSelection.h"
50   #include "HZZLikelihoodElectronSelection.h"
51 + #include "HZZBDTElectronSelection.h"
52   #include "SampleWeight.h"
53  
54 + //#define BDTFAIL_THEIR_EVENTS
55   //#define THEIR_EVENTS
56  
57   //=== MAIN =================================================================================================
# Line 96 | Line 99 | int main(int argc, char** argv)
99    //--------------------------------------------------------------------------------------------------------------
100    TH1F * h_evt = new TH1F("hevt", "hevt", 2, 0, 2 );
101    TH1F * h_evtfail = new TH1F("hevtfail", "hevtfail", 1024, 0, 1024 );
102 <  TNtuple * passtuple = new TNtuple( "passtuple", "passtuple", "run:evt:lumi:channel:mZ1:mZ2:m4l:pt4l:w" );
102 >  //  TNtuple * passtuple = new TNtuple( "passtuple", "passtuple", "run:evt:lumi:channel:mZ1:mZ2:m4l:pt4l:w" );
103 >  TTree * passtuple = new TTree("passtuple", "passtuple" );
104 >  unsigned run, evt, lumi, channel;
105 >  float mZ1, mZ2, m4l, pt4l;
106 >  double w;
107 >  passtuple->Branch("run", &run);
108 >  passtuple->Branch("evt", &evt);
109 >  passtuple->Branch("lumi", &lumi);
110 >  passtuple->Branch("mZ1", &mZ1);
111 >  passtuple->Branch("mZ2", &mZ2);
112 >  passtuple->Branch("m4l", &m4l);
113 >  passtuple->Branch("pt4l", &pt4l);
114 >  passtuple->Branch("w", &w);
115    initCiCSelection();
116 <  initLikSelection();
116 >  if(ctrl.eleSele=="lik") initLikSelection();
117 >  if(ctrl.eleSele=="bdt") initBDTSelection();
118 >  if(ctrl.eleSele=="si" ) initSiMVAElectronSelection();
119    initRunLumiRangeMap();
120  
121    //
# Line 132 | Line 149 | int main(int argc, char** argv)
149  
150  
151    cout << "nEntries: " << chain->GetEntries() << endl;
152 <  for(UInt_t ientry=0; ientry<chain->GetEntries(); ientry++) {          
152 >  for(UInt_t ientry=0; ientry<chain->GetEntries(); ientry++) {
153  
154      chain->GetEntry(ientry);
155      if(!(ientry%100000)) cout << "entry: " << ientry << endl;
# Line 165 | Line 182 | int main(int argc, char** argv)
182             info->evtNum == 10347106   ||
183             info->evtNum == 107360878  ) ) continue;
184   #endif
185 +
186 +
187 + #ifdef BDTFAIL_THEIR_EVENTS
188 +    if( !( info->evtNum == 78213037   ||
189 +           info->evtNum == 876658967  ) ) continue;
190 +          
191 + #endif
192  
193      unsigned evtfail = fails_HZZ4L_selection(ctrl, info, electronArr, muonArr, eventweight, passtuple);    
194      h_evtfail->Fill( evtfail, eventweight );
195 <    if( ctrl.debug ) cout << endl << endl;  
195 >
196            
197    } //end loop over data    
198  
# Line 197 | Line 221 | int main(int argc, char** argv)
221    file->Close();
222    delete file;
223  
224 +  // map<TString,TMVA::Reader*>::iterator it;
225 +  // for(it=readers.begin(); it!=readers.end(); it++) delete (*it).second;
226 +
227    cerr << "done!" << endl;
228   }
229  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines