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.8 by khahn, Mon Apr 30 23:54:34 2012 UTC vs.
Revision 1.9 by khahn, Tue May 1 16:38:35 2012 UTC

# Line 423 | 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