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

Comparing UserCode/MitHzz4l/NonMCBackground/src/SelectionEMU.cc (file contents):
Revision 1.4 by dkralph, Tue Jun 12 22:04:06 2012 UTC vs.
Revision 1.7 by dkralph, Mon Jun 18 06:56:17 2012 UTC

# Line 25 | Line 25
25   #include "CommonDefs.h"
26   #include "SelectionDefs.h"
27   #include "FSR.h"
28 < #include "UtilFuncs.h"
28 > #include "SelectionFuncs.h"
29  
30  
31   extern vector<SimpleLepton> failingLeptons;
# Line 144 | Line 144 | EventData apply_HZZ4L_EMU_selection(Cont
144        tmplep.isLoose = musel.loose();
145        tmplep.status  = musel;    
146        tmplep.fsrRecoveryAttempted = false;
147 <      tmplep.tightCutsApplied   = false;
147 >      SelectionStatus tmpstat = PassWwMuonSel(mu,vtx,pfCandidates);
148 >      tmplep.tightCutsApplied = tmpstat.tight();
149        lepvec.push_back(tmplep);
150        if( ctrl.debug ) cout << endl;
151      }
# Line 215 | Line 216 | EventData apply_HZZ4L_EMU_selection(Cont
216        for (vector<SimpleLepton>::iterator it2=lepvec.begin(); it2 != lepvec.end(); it2++ ) {
217          if ( it2 == it1 )                       continue;
218          if ( abs(it2->type) != 13 )             continue;
219 <        if( !(it2->status.looseIDAndPre()) )    continue;
219 >        // if( !(it2->status.looseIDAndPre()) )    continue;
220          TVector3 mvec = it2->vec.Vect();
221          
222          if ( evec.DrEtaPhi(mvec) < 0.05 ) {
# Line 260 | Line 261 | EventData apply_HZZ4L_EMU_selection(Cont
261      //******************************************************************************
262      // W + (OF SS lepton) Selection
263      //******************************************************************************
264 <    if(ctrl.fakeScheme.Contains("emu-")) {
265 <      if(has_ssof_lepton(ctrl)) {
266 <        ret.status.setStatus(SelectionStatus::EVTPASS);
267 <        ret.Z1leptons.push_back(passingLeptons[0]);
268 <        ret.Z1leptons.push_back(passingLeptons[0]);
269 <        ret.Z2leptons.push_back(passingLeptons[0]);
270 <        ret.Z2leptons.push_back(passingLeptons[0]);
271 <      } else {
271 <        ret.status.setStatus(SelectionStatus::FAIL);
272 <      }
273 <      return ret;
264 >    if(has_ssof_lepton(ctrl)) {
265 >      ret.status.setStatus(SelectionStatus::EVTPASS);
266 >      ret.Z1leptons.push_back(passingLeptons[0]);
267 >      ret.Z1leptons.push_back(passingLeptons[0]);
268 >      ret.Z2leptons.push_back(passingLeptons[0]);
269 >      ret.Z2leptons.push_back(passingLeptons[0]);
270 >    } else {
271 >      ret.status.setStatus(SelectionStatus::FAIL);
272      }
273 +    return ret;
274   }
276
277 // //----------------------------------------------------------------------------
278 // //
279 // // Get primary vertices
280 // // Assumes primary vertices are ordered by sum-pT^2 (as should be in CMSSW)
281 // // NOTE: if no PV is found from fitting tracks, the beamspot is used
282 // //
283 // //----------------------------------------------------------------------------
284 // bool setPV(ControlFlags ctrl,
285 //         const mithep::Array<mithep::Vertex> * vtxArr,
286 //         const mithep::Vertex* &vtx)
287 // //----------------------------------------------------------------------------
288 // {
289
290 //   const mithep::Vertex *bestPV = 0;    
291 //   float best_sumpt=-1;
292
293 //   // good PV requirements
294 //   const UInt_t   fMinNTracksFit = 0;
295 //   const Double_t fMinNdof       = 4;
296 //   const Double_t fMaxAbsZ       = 24;
297 //   const Double_t fMaxRho        = 2;
298  
299 //   for(int i=0; i<vtxArr->GetEntries(); ++i) {
300 //     const mithep::Vertex *pv = (mithep::Vertex*)(vtxArr->At(i));
301 //     if( ctrl.debug ) cout << "vertex :: " << i << "\tntrks: " << pv->NTracks() << endl;
302    
303 //     // Select best PV for corrected d0; if no PV passing cuts, the first PV in the collection will be used
304 //     if(!pv->IsValid())                                continue;
305 //     if(pv->NTracksFit()       < fMinNTracksFit)       continue;
306 //     if(pv->Ndof()              < fMinNdof)         continue;
307 //     if(fabs(pv->Z()) > fMaxAbsZ)                   continue;
308 //     if(pv->Position().Rho()   > fMaxRho)           continue;    
309    
310 //     // take the first ...
311 //     bestPV = pv;
312 //     break;
313
314 //     // this never reached ...    
315 //     float tmp_sumpt=0;
316 //     for( int t=0; t<pv->NTracks(); t++ )
317 //       tmp_sumpt += pv->Trk(t)->Pt();
318    
319 //     if( tmp_sumpt > best_sumpt  ) {
320 //       bestPV = pv;
321 //       best_sumpt = tmp_sumpt;
322 //       if( ctrl.debug) cout << "new PV set, pt : " << best_sumpt << endl;
323 //     }
324 //   }
325        
326 //   // sync
327 //   if(!bestPV)
328 //     return false;
329 //   else {    
330 //     vtx = bestPV;
331 //     return true;
332 //   }  
333 // };
275   //----------------------------------------------------------------------------------------
276   bool has_ssof_lepton(ControlFlags &ctrl)
277   {
# Line 361 | Line 302 | bool has_ssof_lepton(ControlFlags &ctrl)
302  
303    return has_ssof;
304   }
364 // //----------------------------------------------------------------------------------------
365 // void getEATargets(ControlFlags &ctrl, mithep::MuonTools::EMuonEffectiveAreaTarget &eraMu, mithep::ElectronTools::EElectronEffectiveAreaTarget &eraEle)
366 // {
367 //   if( !ctrl.mc && ctrl.era == 2011 ) {
368 //     eraMu  = mithep::MuonTools::kMuEAData2011;
369 //     eraEle = mithep::ElectronTools::kEleEAData2011;
370 //   } else if( !ctrl.mc && ctrl.era == 2012 ) {
371 //     eraMu  = mithep::MuonTools::kMuEAData2012;
372 //     eraEle = mithep::ElectronTools::kEleEAData2012;
373 //   } else if( ctrl.mc && ctrl.era == 2011 ) {
374 //     eraMu  = mithep::MuonTools::kMuEAFall11MC;
375 //     eraEle = mithep::ElectronTools::kEleEAFall11MC;
376 //   } else if( ctrl.mc && ctrl.era == 2012 ) {
377 //     eraMu  = mithep::MuonTools::kMuEAData2012;
378 //     eraEle = mithep::ElectronTools::kEleEAData2012;
379 //   } else {
380 //     cerr << "unknown era for effective areas ... quitting." << endl;
381 //     exit(1);
382 //   }
383 // }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines