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

Comparing UserCode/MitHzz4l/Selection/src/applySelectionZ4L.cc (file contents):
Revision 1.1 by khahn, Fri Feb 17 14:53:32 2012 UTC vs.
Revision 1.2 by anlevin, Fri Feb 17 15:09:42 2012 UTC

# Line 119 | Line 119 | int main(int argc, char** argv)
119    GenInfoStruct geninfo;
120  
121    AngleTuple nt( (const char*)ofname, (const char*)"zznt");
122  nt.makeAngleBranch(angles);
122    nt.makeKinematicsBranch(kinematics);
123    nt.makeInfoBranch(evtinfo);
124  
# Line 147 | Line 146 | int main(int argc, char** argv)
146    // setup CiC cuts
147    initCiCSelection();
148    CICStruct cicTightCuts = getCiCCuts("tight");
150
151
152  //
153  // tmva
154  //
155  TMVA::Reader * reader = new TMVA::Reader( "V" );
156  reader->AddVariable( "costheta1",     &angles.costheta1);
157  reader->AddVariable( "costheta2",     &angles.costheta2);
158  reader->AddVariable( "costhetastar",  &angles.costhetastar);
159  reader->AddVariable( "Phi",           &angles.Phi);
160  reader->AddVariable( "Phi1",          &angles.Phi1);
161  reader->AddSpectator( "m4l",          &kinematics.m4l);
162  reader->AddVariable( "mZ2",           &kinematics.mZ2);
163  reader->AddVariable( "ZZpt",           &kinematics.ZZpt);
164  reader->AddVariable( "ZZeta",           &kinematics.ZZeta);
165
166
167  char wfilename[512]; sprintf(wfilename, "./weights/hzz4lTMVA_mH%d_BDTG.weights.xml", ctrl.mH);
168  reader->BookMVA("BDTG", wfilename);
149    
150    
151    //##########################################################################
152    // Setup tree I/O
153    //##########################################################################
154    
175  //
176  // Access samples and fill histograms
177  TFile *inputFile=0;
178  TTree *eventTree=0;  
179  
155    // Data structures to store info from TTrees
156    mithep::TEventInfo *info    = new mithep::TEventInfo();
157    mithep::TGenInfo    *ginfo  = new mithep::TGenInfo();
# Line 193 | Line 168 | int main(int argc, char** argv)
168    if( ctrl.mc ) { chain->SetBranchAddress("Gen",        &ginfo);}
169  
170    int count=0, pass=0;
196  float passcorr=0., passcorr_errup=0., passcorr_errdown=0.;
197  float denom[3]={0.,0.,0.};
198  float numer[3]={0.,0.,0.};
199  float numercorr[3]={0.,0.,0.};
200
171    UInt_t imax = chain->GetEntries();
172    cout << "nEntries: " << imax << endl;
173  
174  
175    //##########################################################################
176 <  // Loop !!!!!!!!! should alternate events here and +1 in the training ...
176 >  // Loop !!!!!!!!!
177    //##########################################################################
178    for(UInt_t ientry=0; ientry<imax; ientry++)
179      {
# Line 222 | Line 192 | int main(int argc, char** argv)
192      
193      
194        EventData ret4l =
195 <        apply_HZZ4L_selection(ctrl, info,
196 <                              electronArr,
197 <                              cicTightCuts,
198 <                              &electronPreSelectionCic,
199 <                              &failsCicSelection,
200 <                              muonArr,
201 <                              &muonPreSelection,
202 <                              &passMuonSelection,
203 <                              &pairwiseIsoSelection);
195 >        apply_Z4L_selection(ctrl, info,
196 >                            electronArr,
197 >                            cicTightCuts,
198 >                            &electronPreSelectionCic,
199 >                            &failsCicSelection,
200 >                            muonArr,
201 >                            &muonPreSelection,
202 >                            &passMuonSelection,
203 >                            &pairwiseIsoSelection);
204        if( ctrl.debug ) cout << endl;
205        
206        if( ret4l.status.pass() ) {
207          
208          runevtvec.push_back(pair<unsigned,unsigned> (info->runNum,info->evtNum) );
209          
240        fillAngles(ret4l,angles);
210          fillKinematics(ret4l,kinematics);
211          fillEventInfo(info,evtinfo);
212          if(ctrl.mc) fillGenInfo(ginfo,geninfo);
213  
245        /*
246        // only for Higgs < 140
247        geninfo.weight *= h_w_hpt->GetBinContent(h_w_hpt->FindBin(geninfo.pt_zz));
248        angles.bdt = reader->EvaluateMVA("BDTG");
249        */
214          nt.Fill();
215          
216          cerr  << "PASS:: "
217                << "\trun: " << evtinfo.run
218                << "\tevt: " << evtinfo.evt
255              << "\tlumi: " << evtinfo.lumi
256              << "\tcostheta1: " << angles.costheta1
257              << "\tcostheta2: " << angles.costheta2
258              << "\tcostheta*: " << angles.costhetastar
259              << "\tbdt: " << angles.bdt
219                << endl;
220          pass++;
221          //      if( pass > 3 ) break;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines