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 |
+ |
} |