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

Comparing UserCode/MitHzz4l/LeptonSelection/src/MuonSelection.cc (file contents):
Revision 1.4 by khahn, Thu Apr 26 06:56:18 2012 UTC vs.
Revision 1.9 by khahn, Tue May 1 16:38:35 2012 UTC

# Line 19 | Line 19 | extern Float_t computePFMuonIso(const mi
19                          const Double_t dRMax);
20  
21   //--------------------------------------------------------------------------------------------------
22 + SelectionStatus muonDummyVeto(ControlFlags &ctrl,
23 +                              const mithep::Muon *muon,
24 +                              const mithep::Vertex &vtx)
25 + //--------------------------------------------------------------------------------------------------
26 + {
27 +  SelectionStatus status;
28 +  status.setStatus(SelectionStatus::PRESELECTION);
29 +  return status;  
30 + }
31 +
32 + //--------------------------------------------------------------------------------------------------
33 + SelectionStatus muonCutBasedVeto(ControlFlags &ctrl,
34 +                                 const mithep::Muon *muon,
35 +                                 const mithep::Vertex &vtx)
36 + //--------------------------------------------------------------------------------------------------
37 + {
38 +  //
39 +  // Loose cut-based ID for isolation veto
40 +  //
41 +  bool ret = true;
42 +  
43 +  if(!(muon->IsGlobalMuon() || muon->IsTrackerMuon())) ret = false;
44 +  if( muon->NValidHits() < 11 )                        ret = false;
45 +  if( fabs(muon->Ip3dPVSignificance()) >= 4 )          ret = false;
46 +
47 +  SelectionStatus status;
48 +  if( ret ) status.setStatus(SelectionStatus::PRESELECTION);
49 +  return status;
50 + }
51 +
52 +
53 + //--------------------------------------------------------------------------------------------------
54   SelectionStatus noPreSelection( ControlFlags &ctrl,  const mithep::Muon * mu )
55  
56   //--------------------------------------------------------------------------------------------------
# Line 43 | Line 75 | SelectionStatus muonPreSelection( Contro
75    ret &= ( fabs(mu->Ip3dPVSignificance()) < 4 );
76    if(ctrl.debug) cout << "and pass IP (" << mu->Ip3dPVSignificance() << ") ? ... " << ret << endl;  
77    ret &= ( mu->Pt() > 5 );
78 <  if(ctrl.debug) cout << "and >5 GeV ? ... " << ret << endl;  
79 <  ret &= ( fabs(mu->Eta()) < 2.4 );
80 <  if(ctrl.debug) cout << "and < 2.4 eta ? ... " << ret << endl;  
81 <  ret &=  (mu->IsTrackerMuon() && mu->HasTrackerTrk());
78 >  if(ctrl.debug) cout << "and >5 GeV (" << mu->Pt() << ") ? ... " << ret << endl;  
79 >  ret &= ( fabs(mu->Eta()) <= 2.4 );
80 >  if(ctrl.debug) cout << "and < 2.4 eta (" << mu->Eta() << ")? ... " << ret << endl;  
81 >  ret &=  (mu->IsTrackerMuon() && mu->HasTrackerTrk() &&
82 >           (mu->Quality().QualityMask().Mask() & mithep::MuonQuality::AllArbitrated));
83    if(ctrl.debug) cout << "and isTrackerMuon ? ... " << ret << endl;  
84 +  //  ret &=  (mu->IsoR03SumPt()/mu->Pt() < 0.7 );
85    ret &=  (mu->IsoR03SumPt()/mu->Pt() < 0.7 );
86    if(ctrl.debug) cout << "and loose trk iso ? ... " << ret << endl;  
87  
# Line 353 | Line 387 | SelectionStatus muonIDMVASelection(Contr
387    bool pass = false;
388    
389    if( mu->IsGlobalMuon() && mu->IsTrackerMuon()
390 <      && fabs(mu->Eta()) < 1.5 && mu->Pt() < 10 && mvaval >= MUON_IDMVA_CUT_BIN0)  pass = true;
390 >      && fabs(mu->Eta()) <= 1.5 && mu->Pt() <= 10 && mvaval >= MUON_IDMVA_CUT_BIN0)  pass = true;
391    else if( mu->IsGlobalMuon() && mu->IsTrackerMuon()
392 <           && fabs(mu->Eta()) < 1.5 && mu->Pt() > 10 && mvaval >= MUON_IDMVA_CUT_BIN1)  pass = true;
392 >           && fabs(mu->Eta()) <= 1.5 && mu->Pt() > 10 && mvaval >= MUON_IDMVA_CUT_BIN1)  pass = true;
393    else if( mu->IsGlobalMuon() && mu->IsTrackerMuon()
394 <           && fabs(mu->Eta()) > 1.5 && mu->Pt() < 10 && mvaval >= MUON_IDMVA_CUT_BIN2)  pass = true;
394 >           && fabs(mu->Eta()) > 1.5 && mu->Pt() <= 10 && mvaval >= MUON_IDMVA_CUT_BIN2)  pass = true;
395    else if( mu->IsGlobalMuon() && mu->IsTrackerMuon()
396             && fabs(mu->Eta()) > 1.5 && mu->Pt() > 10 && mvaval >= MUON_IDMVA_CUT_BIN3)  pass = true;
397    else if( !(mu->IsGlobalMuon()) && mu->IsTrackerMuon()
# Line 389 | Line 423 | void initMuonIDMVA()
423                         mithep::MuonIDMVA::kIDV0,
424                         kTRUE, weightFiles);
425   }
426 +
427 + //--------------------------------------------------------------------------------------------------
428 + SelectionStatus muonIDPFSelection(ControlFlags &ctrl,
429 +                                  const mithep::Muon *mu,
430 +                                  const mithep::Vertex & vtx,
431 +                                  const mithep::Array<mithep::PFCandidate> * pfCandidates )
432 + //--------------------------------------------------------------------------------------------------
433 + {
434 +  bool pass = false;
435 +  SelectionStatus status; // init'ed to FAIL
436 +  
437 +  // check that muon is tracker
438 +  if( !(mu->IsTrackerMuon()) )   return status;
439 +
440 +  // check that it matches to a PF muon
441 +  for( int i=0; i<pfCandidates->GetEntries(); i++ ) {
442 +    const mithep::PFCandidate *pf = (mithep::PFCandidate*)((*pfCandidates)[i]);
443 +    if( pf->HasTrackerTrk() ) {
444 +      if( pf->TrackerTrk() == mu->TrackerTrk() && abs(pf->PFType()) == mithep::PFCandidate::eMuon ) {
445 +        pass = true;
446 +        break;
447 +      }
448 +    }
449 +  }
450 +
451 +  if( pass ) {
452 +    status.orStatus(SelectionStatus::LOOSEID);
453 +    status.orStatus(SelectionStatus::TIGHTID);
454 +  }
455 +
456 +  return status;
457 + }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines