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.6 by dkralph, Wed Jun 13 14:11:22 2012 UTC vs.
Revision 1.7 by dkralph, Mon Jun 18 06:56:17 2012 UTC

# Line 216 | 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 261 | 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 {
272 <        ret.status.setStatus(SelectionStatus::FAIL);
273 <      }
274 <      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   }
277
278 // //----------------------------------------------------------------------------
279 // //
280 // // Get primary vertices
281 // // Assumes primary vertices are ordered by sum-pT^2 (as should be in CMSSW)
282 // // NOTE: if no PV is found from fitting tracks, the beamspot is used
283 // //
284 // //----------------------------------------------------------------------------
285 // bool setPV(ControlFlags ctrl,
286 //         const mithep::Array<mithep::Vertex> * vtxArr,
287 //         const mithep::Vertex* &vtx)
288 // //----------------------------------------------------------------------------
289 // {
290
291 //   const mithep::Vertex *bestPV = 0;    
292 //   float best_sumpt=-1;
293
294 //   // good PV requirements
295 //   const UInt_t   fMinNTracksFit = 0;
296 //   const Double_t fMinNdof       = 4;
297 //   const Double_t fMaxAbsZ       = 24;
298 //   const Double_t fMaxRho        = 2;
299  
300 //   for(int i=0; i<vtxArr->GetEntries(); ++i) {
301 //     const mithep::Vertex *pv = (mithep::Vertex*)(vtxArr->At(i));
302 //     if( ctrl.debug ) cout << "vertex :: " << i << "\tntrks: " << pv->NTracks() << endl;
303    
304 //     // Select best PV for corrected d0; if no PV passing cuts, the first PV in the collection will be used
305 //     if(!pv->IsValid())                                continue;
306 //     if(pv->NTracksFit()       < fMinNTracksFit)       continue;
307 //     if(pv->Ndof()              < fMinNdof)         continue;
308 //     if(fabs(pv->Z()) > fMaxAbsZ)                   continue;
309 //     if(pv->Position().Rho()   > fMaxRho)           continue;    
310    
311 //     // take the first ...
312 //     bestPV = pv;
313 //     break;
314
315 //     // this never reached ...    
316 //     float tmp_sumpt=0;
317 //     for( int t=0; t<pv->NTracks(); t++ )
318 //       tmp_sumpt += pv->Trk(t)->Pt();
319    
320 //     if( tmp_sumpt > best_sumpt  ) {
321 //       bestPV = pv;
322 //       best_sumpt = tmp_sumpt;
323 //       if( ctrl.debug) cout << "new PV set, pt : " << best_sumpt << endl;
324 //     }
325 //   }
326        
327 //   // sync
328 //   if(!bestPV)
329 //     return false;
330 //   else {    
331 //     vtx = bestPV;
332 //     return true;
333 //   }  
334 // };
275   //----------------------------------------------------------------------------------------
276   bool has_ssof_lepton(ControlFlags &ctrl)
277   {
# Line 362 | Line 302 | bool has_ssof_lepton(ControlFlags &ctrl)
302  
303    return has_ssof;
304   }
365 // //----------------------------------------------------------------------------------------
366 // void getEATargets(ControlFlags &ctrl, mithep::MuonTools::EMuonEffectiveAreaTarget &eraMu, mithep::ElectronTools::EElectronEffectiveAreaTarget &eraEle)
367 // {
368 //   if( !ctrl.mc && ctrl.era == 2011 ) {
369 //     eraMu  = mithep::MuonTools::kMuEAData2011;
370 //     eraEle = mithep::ElectronTools::kEleEAData2011;
371 //   } else if( !ctrl.mc && ctrl.era == 2012 ) {
372 //     eraMu  = mithep::MuonTools::kMuEAData2012;
373 //     eraEle = mithep::ElectronTools::kEleEAData2012;
374 //   } else if( ctrl.mc && ctrl.era == 2011 ) {
375 //     eraMu  = mithep::MuonTools::kMuEAFall11MC;
376 //     eraEle = mithep::ElectronTools::kEleEAFall11MC;
377 //   } else if( ctrl.mc && ctrl.era == 2012 ) {
378 //     eraMu  = mithep::MuonTools::kMuEAData2012;
379 //     eraEle = mithep::ElectronTools::kEleEAData2012;
380 //   } else {
381 //     cerr << "unknown era for effective areas ... quitting." << endl;
382 //     exit(1);
383 //   }
384 // }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines