105 if ( !muonRef.
isNonnull() )
return false;
107 if ( !muonRef->isGlobalMuon() )
return false;
108 if ( !muonRef->isStandAloneMuon() )
return false;
111 if ( muonRef->isTrackerMuon() ) {
116 int nMatches = muonRef->numberOfMatches();
117 bool quality = nMatches > 2 || isTM2DCompatibilityTight;
119 return result && quality;
130 if ( ( standAloneMu->hitPattern().numberOfValidMuonDTHits() < 22 &&
131 standAloneMu->hitPattern().numberOfValidMuonCSCHits() < 15 ) ||
132 standAloneMu->normalizedChi2() > 10. ||
133 standAloneMu->ptError()/standAloneMu->pt() > 0.20 ) {
141 if ( combinedMu->normalizedChi2() > standAloneMu->normalizedChi2() ) {
148 result = standAloneMu->pt() > trackerMu->pt() ;
153 combinedMu->ptError()/combinedMu->pt() <
154 std::min(0.20,standAloneMu->ptError()/standAloneMu->pt());
168 if ( !muonRef.
isNonnull() )
return false;
170 if(!muonRef->isTrackerMuon())
return false;
177 if(nTrackerHits<=12)
return false;
183 if(!isAllArbitrated || !isTM2DCompatibilityTight)
return false;
185 if((trackerMu->ptError()/trackerMu->pt() > 0.10)){
196 if ( !muonRef.
isNonnull() )
return false;
197 if ( !muonRef->isGlobalMuon() )
return false;
198 if ( !muonRef->isStandAloneMuon() )
return false;
205 standAloneMu->hitPattern().numberOfValidMuonDTHits() +
206 2*standAloneMu->hitPattern().numberOfValidMuonCSCHits();
208 bool quality =
false;
210 if ( muonRef->isTrackerMuon() ){
212 bool result = combinedMu->normalizedChi2() < 100.;
217 int nMatches = muonRef->numberOfMatches();
219 quality = laststation && nMuonHits > 12 && nMatches > 1;
221 return result && quality;
228 if ( nMuonHits <=15 ||
229 standAloneMu->normalizedChi2() > 10. ||
230 standAloneMu->ptError()/standAloneMu->pt() > 0.20 ) {
235 if ( combinedMu->normalizedChi2() > standAloneMu->normalizedChi2() ) {
244 if(standAloneMu->pt() > trackerMu->pt() || combinedMu->normalizedChi2()<5.) quality =
true;
249 if(combinedMu->ptError()/combinedMu->pt() <
std::min(0.20,standAloneMu->ptError()/standAloneMu->pt()))
265 if ( !muonRef.
isNonnull() )
return false;
266 if(!muonRef->isTrackerMuon())
return false;
270 if(trackerMu->ptError()/trackerMu->pt() > 0.20)
return false;
273 if(trackerMu->pt()>20.)
return false;
278 bool quality = isAllArbitrated && isTMLastStationAngTight;
288 if ( !muonRef.
isNonnull() )
return false;
289 if ( !muonRef->isIsolationValid() )
return false;
292 if ( !muonRef->isGlobalMuon() )
return false;
298 if ( !muonRef->isTrackerMuon() ){
299 if(standAloneMu->hitPattern().numberOfValidMuonDTHits() == 0 &&
300 standAloneMu->hitPattern().numberOfValidMuonCSCHits() ==0)
return false;
306 double smallestMuPt = combinedMu->pt();
308 if(standAloneMu->pt()<smallestMuPt) smallestMuPt = standAloneMu->pt();
310 if(muonRef->isTrackerMuon())
313 if(trackerMu->pt() < smallestMuPt) smallestMuPt= trackerMu->pt();
316 double sumPtR03 = muonRef->isolationR03().sumPt;
317 double emEtR03 = muonRef->isolationR03().emEt;
318 double hadEtR03 = muonRef->isolationR03().hadEt;
320 double relIso = (sumPtR03 + emEtR03 + hadEtR03)/smallestMuPt;
322 if(relIso<0.1)
return true;
331 if(!muonRef->isTrackerMuon())
return false;
333 if(muonRef->numberOfMatches()<2)
return false;
338 if(combinedMuon->hitPattern().numberOfValidTrackerHits()<11)
return false;
340 if(combinedMuon->hitPattern().numberOfValidPixelHits()==0)
return false;
342 if(combinedMuon->hitPattern().numberOfValidMuonHits()==0)
return false;
353 bool isGL = muonRef->isGlobalMuon();
354 bool isTR = muonRef->isTrackerMuon();
355 bool isST = muonRef->isStandAloneMuon();
357 std::cout<<
" GL: "<<isGL<<
" TR: "<<isTR<<
" ST: "<<isST<<std::endl;
358 std::cout<<
" nMatches "<<muonRef->numberOfMatches()<<std::endl;
360 if ( muonRef->isGlobalMuon() ){
362 std::cout<<
" GL, pt: " << combinedMu->pt()
363 <<
" +/- " << combinedMu->ptError()/combinedMu->pt()
364 <<
" chi**2 GBL : " << combinedMu->normalizedChi2()<<std::endl;
365 std::cout<<
" Total Muon Hits : " << combinedMu->hitPattern().numberOfValidMuonHits()
366 <<
"/" << combinedMu->hitPattern().numberOfLostMuonHits()
367 <<
" DT Hits : " << combinedMu->hitPattern().numberOfValidMuonDTHits()
368 <<
"/" << combinedMu->hitPattern().numberOfLostMuonDTHits()
369 <<
" CSC Hits : " << combinedMu->hitPattern().numberOfValidMuonCSCHits()
370 <<
"/" << combinedMu->hitPattern().numberOfLostMuonCSCHits()
371 <<
" RPC Hits : " << combinedMu->hitPattern().numberOfValidMuonRPCHits()
372 <<
"/" << combinedMu->hitPattern().numberOfLostMuonRPCHits()<<std::endl;
374 std::cout<<
" # of Valid Tracker Hits "<<combinedMu->hitPattern().numberOfValidTrackerHits()<<std::endl;
375 std::cout<<
" # of Valid Pixel Hits "<<combinedMu->hitPattern().numberOfValidPixelHits()<<std::endl;
377 if ( muonRef->isStandAloneMuon() ){
379 std::cout<<
" ST, pt: " << standAloneMu->pt()
380 <<
" +/- " << standAloneMu->ptError()/standAloneMu->pt()
381 <<
" eta : " << standAloneMu->eta()
382 <<
" DT Hits : " << standAloneMu->hitPattern().numberOfValidMuonDTHits()
383 <<
"/" << standAloneMu->hitPattern().numberOfLostMuonDTHits()
384 <<
" CSC Hits : " << standAloneMu->hitPattern().numberOfValidMuonCSCHits()
385 <<
"/" << standAloneMu->hitPattern().numberOfLostMuonCSCHits()
386 <<
" RPC Hits : " << standAloneMu->hitPattern().numberOfValidMuonRPCHits()
387 <<
"/" << standAloneMu->hitPattern().numberOfLostMuonRPCHits()
388 <<
" chi**2 STA : " << standAloneMu->normalizedChi2()<<std::endl;
392 if ( muonRef->isTrackerMuon() ){
395 std::cout<<
" TR, pt: " << trackerMu->pt()
396 <<
" +/- " << trackerMu->ptError()/trackerMu->pt()
397 <<
" chi**2 TR : " << trackerMu->normalizedChi2()<<std::endl;
401 <<
"TMLastStationAngTight "
403 <<
"TMLastStationLoose "
405 <<
"TMLastStationTight "
407 <<
"TMOneStationLoose "
409 <<
"TMOneStationTight "
411 <<
"TMLastStationOptimizedLowPtLoose "
413 <<
"TMLastStationOptimizedLowPtTight "
415 <<
"TMLastStationOptimizedBarrelLowPtLoose "
417 <<
"TMLastStationOptimizedBarrelLowPtTight "
425 <<
"TM2DCompatibilityTight "
430 if ( muonRef->isGlobalMuon() && muonRef->isTrackerMuon() && muonRef->isStandAloneMuon() ){
435 double sigmaCombined = combinedMu->ptError()/(combinedMu->pt()*combinedMu->pt());
436 double sigmaTracker = trackerMu->ptError()/(trackerMu->pt()*trackerMu->pt());
437 double sigmaStandAlone = standAloneMu->ptError()/(standAloneMu->pt()*standAloneMu->pt());
439 bool combined = combinedMu->ptError()/combinedMu->pt() < 0.20;
440 bool tracker = trackerMu->ptError()/trackerMu->pt() < 0.20;
441 bool standAlone = standAloneMu->ptError()/standAloneMu->pt() < 0.20;
443 double delta1 = combined && tracker ?
444 fabs(1./combinedMu->pt() -1./trackerMu->pt())
445 /
sqrt(sigmaCombined*sigmaCombined + sigmaTracker*sigmaTracker) : 100.;
446 double delta2 = combined && standAlone ?
447 fabs(1./combinedMu->pt() -1./standAloneMu->pt())
448 /
sqrt(sigmaCombined*sigmaCombined + sigmaStandAlone*sigmaStandAlone) : 100.;
449 double delta3 = standAlone && tracker ?
450 fabs(1./standAloneMu->pt() -1./trackerMu->pt())
451 /
sqrt(sigmaStandAlone*sigmaStandAlone + sigmaTracker*sigmaTracker) : 100.;
454 standAloneMu->hitPattern().numberOfValidMuonDTHits()+
455 standAloneMu->hitPattern().numberOfValidMuonCSCHits() > 0 ?
458 std::cout <<
"delta = " << delta <<
" delta1 "<<delta1<<
" delta2 "<<delta2<<
" delta3 "<<delta3<<std::endl;
461 combinedMu->ptError()/combinedMu->pt()
462 / (trackerMu->ptError()/trackerMu->pt());
464 std::cout<<
" ratio "<<ratio<<
" combined mu pt "<<combinedMu->pt()<<std::endl;
470 double sumPtR03 = muonRef->isolationR03().sumPt;
471 double emEtR03 = muonRef->isolationR03().emEt;
472 double hadEtR03 = muonRef->isolationR03().hadEt;
473 double relIsoR03 = (sumPtR03 + emEtR03 + hadEtR03)/muonRef->pt();
474 double sumPtR05 = muonRef->isolationR05().sumPt;
475 double emEtR05 = muonRef->isolationR05().emEt;
476 double hadEtR05 = muonRef->isolationR05().hadEt;
477 double relIsoR05 = (sumPtR05 + emEtR05 + hadEtR05)/muonRef->pt();
478 std::cout<<
" 0.3 Radion Rel Iso: "<<relIsoR03<<
" sumPt "<<sumPtR03<<
" emEt "<<emEtR03<<
" hadEt "<<hadEtR03<<std::endl;
479 std::cout<<
" 0.5 Radion Rel Iso: "<<relIsoR05<<
" sumPt "<<sumPtR05<<
" emEt "<<emEtR05<<
" hadEt "<<hadEtR05<<std::endl;
Abstract base class for a PFBlock element (track, cluster...)
static bool isIsolatedMuon(const reco::PFBlockElement &elt)
static bool isTightMuonPOG(const reco::MuonRef &muonRef)
static bool isMuon(const reco::PFBlockElement &elt)
Check if a block element is a muon.
static bool isTrackerLooseMuon(const reco::PFBlockElement &elt)
static bool isGlobalLooseMuon(const reco::PFBlockElement &elt)
static void printMuonProperties(const reco::MuonRef &muonRef)
static bool isGlobalTightMuon(const reco::PFBlockElement &elt)
bool isNonnull() const
Checks for non-null.
reco::MuonRef muonRef() const
const T & max(const T &a, const T &b)
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
bool isGoodMuon(const reco::Muon &muon, SelectionType type, reco::Muon::ArbitrationType arbitrationType=reco::Muon::SegmentAndTrackArbitration)
main GoodMuon wrapper call
static bool isLooseMuon(const reco::PFBlockElement &elt)
int numberOfValidTrackerHits() const
static bool isTrackerTightMuon(const reco::PFBlockElement &elt)