15 using namespace boost;
35 , maxDPtOPt_(getParameter<double>(iConfig,
"maxDPtOPt", 1.0))
36 , minTrackerHits_(getParameter<
int>(iConfig,
"minTrackerHits", 8))
37 , minPixelHits_(getParameter<
int>(iConfig,
"minPixelHits", 1))
38 , trackQuality_(
reco::
TrackBase::qualityByName(getParameter<
std::
string>(iConfig,
"trackQuality",
"highPurity")))
39 , errorCompScale_(getParameter<double>(iConfig,
"ptErrorScale", 4.0))
40 , eventFractionCleaning_(getParameter<double>(iConfig,
"eventFractionForCleaning", 0.75))
41 , dzPV_(getParameter<double>(iConfig,
"dzPV", 0.2))
42 , postCleaning_(getParameter<
bool>(iConfig,
"postMuonCleaning",
false))
43 , minPostCleaningPt_(getParameter<double>(iConfig,
"minPtForPostCleaning", 20.))
44 , eventFactorCosmics_(getParameter<double>(iConfig,
"eventFactorForCosmics", 10.))
45 , metSigForCleaning_(getParameter<double>(iConfig,
"metSignificanceForCleaning", 3.))
46 , metSigForRejection_(getParameter<double>(iConfig,
"metSignificanceForRejection", 4.))
47 , metFactorCleaning_(getParameter<double>(iConfig,
"metFactorForCleaning", 4.))
48 , eventFractionRejection_(getParameter<double>(iConfig,
"eventFractionForRejection", 0.75))
49 , metFactorRejection_(getParameter<double>(iConfig,
"metFactorForRejection", 4.))
50 , metFactorHighEta_(getParameter<double>(iConfig,
"metFactorForHighEta", 4.))
51 , ptFactorHighEta_(getParameter<double>(iConfig,
"ptFactorForHighEta", 2.))
52 , metFactorFake_(getParameter<double>(iConfig,
"metFactorForFakes", 4.))
53 , minPunchThroughMomentum_(getParameter<double>(iConfig,
"minMomentumForPunchThrough", 100.))
54 , minPunchThroughEnergy_(getParameter<double>(iConfig,
"minEnergyForPunchThrough", 100.))
55 , punchThroughFactor_(getParameter<double>(iConfig,
"punchThroughFactor", 3.))
56 , punchThroughMETFactor_(getParameter<double>(iConfig,
"punchThroughMETFactor", 4.))
57 , cosmicRejDistance_(getParameter<double>(iConfig,
"cosmicRejectionDistance", 1.))
165 if ( !muonRef.
isNonnull() )
return false;
167 if ( !muonRef->isGlobalMuon() )
return false;
168 if ( !muonRef->isStandAloneMuon() )
return false;
171 if ( muonRef->isTrackerMuon() ) {
176 int nMatches = muonRef->numberOfMatches();
177 bool quality = nMatches > 2 || isTM2DCompatibilityTight;
190 if ( ( standAloneMu->hitPattern().numberOfValidMuonDTHits() < 22 &&
191 standAloneMu->hitPattern().numberOfValidMuonCSCHits() < 15 ) ||
192 standAloneMu->normalizedChi2() > 10. ||
193 standAloneMu->ptError()/standAloneMu->pt() > 0.20 ) {
201 if ( combinedMu->normalizedChi2() > standAloneMu->normalizedChi2() ) {
208 result = standAloneMu->pt() > trackerMu->pt() ;
213 combinedMu->ptError()/combinedMu->pt() <
214 std::min(0.20,standAloneMu->ptError()/standAloneMu->pt());
228 if ( !muonRef.
isNonnull() )
return false;
230 if(!muonRef->isTrackerMuon())
return false;
237 if(nTrackerHits<=12)
return false;
243 if(!isAllArbitrated || !isTM2DCompatibilityTight)
return false;
245 if((trackerMu->ptError()/trackerMu->pt() > 0.10)){
256 if ( !muonRef.
isNonnull() )
return false;
257 if ( !muonRef->isGlobalMuon() )
return false;
258 if ( !muonRef->isStandAloneMuon() )
return false;
265 standAloneMu->hitPattern().numberOfValidMuonDTHits() +
266 2*standAloneMu->hitPattern().numberOfValidMuonCSCHits();
270 if ( muonRef->isTrackerMuon() ){
272 bool result = combinedMu->normalizedChi2() < 100.;
277 int nMatches = muonRef->numberOfMatches();
279 quality = laststation && nMuonHits > 12 && nMatches > 1;
288 if ( nMuonHits <=15 ||
289 standAloneMu->normalizedChi2() > 10. ||
290 standAloneMu->ptError()/standAloneMu->pt() > 0.20 ) {
295 if ( combinedMu->normalizedChi2() > standAloneMu->normalizedChi2() ) {
304 if(standAloneMu->pt() > trackerMu->pt() || combinedMu->normalizedChi2()<5.) quality =
true;
309 if(combinedMu->ptError()/combinedMu->pt() <
std::min(0.20,standAloneMu->ptError()/standAloneMu->pt()))
325 if ( !muonRef.
isNonnull() )
return false;
326 if(!muonRef->isTrackerMuon())
return false;
330 if(trackerMu->ptError()/trackerMu->pt() > 0.20)
return false;
333 if(trackerMu->pt()>20.)
return false;
338 bool quality = isAllArbitrated && isTMLastStationAngTight;
348 if ( !muonRef.
isNonnull() )
return false;
349 if ( !muonRef->isIsolationValid() )
return false;
352 if ( !muonRef->isGlobalMuon() )
return false;
358 if ( !muonRef->isTrackerMuon() ){
359 if(standAloneMu->hitPattern().numberOfValidMuonDTHits() == 0 &&
360 standAloneMu->hitPattern().numberOfValidMuonCSCHits() ==0)
return false;
366 double smallestMuPt = combinedMu->pt();
368 if(standAloneMu->pt()<smallestMuPt) smallestMuPt = standAloneMu->pt();
370 if(muonRef->isTrackerMuon())
373 if(trackerMu->pt() < smallestMuPt) smallestMuPt= trackerMu->pt();
377 double sumPtR03 = muonRef->isolationR03().sumPt;
379 double relIso = sumPtR03/smallestMuPt;
384 if(relIso<0.1)
return true;
393 if(!muonRef->isTrackerMuon())
return false;
395 if(muonRef->numberOfMatches()<2)
return false;
400 if(combinedMuon->hitPattern().numberOfValidTrackerHits()<11)
return false;
402 if(combinedMuon->hitPattern().numberOfValidPixelHits()==0)
return false;
404 if(combinedMuon->hitPattern().numberOfValidMuonHits()==0)
return false;
426 bool isGL = muonRef->isGlobalMuon();
427 bool isTR = muonRef->isTrackerMuon();
428 bool isST = muonRef->isStandAloneMuon();
430 std::cout<<
" GL: "<<isGL<<
" TR: "<<isTR<<
" ST: "<<isST<<std::endl;
431 std::cout<<
" nMatches "<<muonRef->numberOfMatches()<<std::endl;
433 if ( muonRef->isGlobalMuon() ){
435 std::cout<<
" GL, pt: " << combinedMu->pt()
436 <<
" +/- " << combinedMu->ptError()/combinedMu->pt()
437 <<
" chi**2 GBL : " << combinedMu->normalizedChi2()<<std::endl;
438 std::cout<<
" Total Muon Hits : " << combinedMu->hitPattern().numberOfValidMuonHits()
439 <<
"/" << combinedMu->hitPattern().numberOfLostMuonHits()
440 <<
" DT Hits : " << combinedMu->hitPattern().numberOfValidMuonDTHits()
441 <<
"/" << combinedMu->hitPattern().numberOfLostMuonDTHits()
442 <<
" CSC Hits : " << combinedMu->hitPattern().numberOfValidMuonCSCHits()
443 <<
"/" << combinedMu->hitPattern().numberOfLostMuonCSCHits()
444 <<
" RPC Hits : " << combinedMu->hitPattern().numberOfValidMuonRPCHits()
445 <<
"/" << combinedMu->hitPattern().numberOfLostMuonRPCHits()<<std::endl;
447 std::cout<<
" # of Valid Tracker Hits "<<combinedMu->hitPattern().numberOfValidTrackerHits()<<std::endl;
448 std::cout<<
" # of Valid Pixel Hits "<<combinedMu->hitPattern().numberOfValidPixelHits()<<std::endl;
450 if ( muonRef->isStandAloneMuon() ){
452 std::cout<<
" ST, pt: " << standAloneMu->pt()
453 <<
" +/- " << standAloneMu->ptError()/standAloneMu->pt()
454 <<
" eta : " << standAloneMu->eta()
455 <<
" DT Hits : " << standAloneMu->hitPattern().numberOfValidMuonDTHits()
456 <<
"/" << standAloneMu->hitPattern().numberOfLostMuonDTHits()
457 <<
" CSC Hits : " << standAloneMu->hitPattern().numberOfValidMuonCSCHits()
458 <<
"/" << standAloneMu->hitPattern().numberOfLostMuonCSCHits()
459 <<
" RPC Hits : " << standAloneMu->hitPattern().numberOfValidMuonRPCHits()
460 <<
"/" << standAloneMu->hitPattern().numberOfLostMuonRPCHits()
461 <<
" chi**2 STA : " << standAloneMu->normalizedChi2()<<std::endl;
465 if ( muonRef->isTrackerMuon() ){
468 std::cout<<
" TR, pt: " << trackerMu->pt()
469 <<
" +/- " << trackerMu->ptError()/trackerMu->pt()
470 <<
" chi**2 TR : " << trackerMu->normalizedChi2()<<std::endl;
474 <<
"TMLastStationAngTight " 476 <<
"TMLastStationLoose " 478 <<
"TMLastStationTight " 480 <<
"TMOneStationLoose " 482 <<
"TMOneStationTight " 484 <<
"TMLastStationOptimizedLowPtLoose " 486 <<
"TMLastStationOptimizedLowPtTight " 488 <<
"TMLastStationOptimizedBarrelLowPtLoose " 490 <<
"TMLastStationOptimizedBarrelLowPtTight " 498 <<
"TM2DCompatibilityTight " 503 if ( muonRef->isGlobalMuon() && muonRef->isTrackerMuon() && muonRef->isStandAloneMuon() ){
508 double sigmaCombined = combinedMu->ptError()/(combinedMu->pt()*combinedMu->pt());
509 double sigmaTracker = trackerMu->ptError()/(trackerMu->pt()*trackerMu->pt());
510 double sigmaStandAlone = standAloneMu->ptError()/(standAloneMu->pt()*standAloneMu->pt());
512 bool combined = combinedMu->ptError()/combinedMu->pt() < 0.20;
513 bool tracker = trackerMu->ptError()/trackerMu->pt() < 0.20;
514 bool standAlone = standAloneMu->ptError()/standAloneMu->pt() < 0.20;
516 double delta1 = combined && tracker ?
517 fabs(1./combinedMu->pt() -1./trackerMu->pt())
518 /
sqrt(sigmaCombined*sigmaCombined + sigmaTracker*sigmaTracker) : 100.;
519 double delta2 = combined && standAlone ?
520 fabs(1./combinedMu->pt() -1./standAloneMu->pt())
521 /
sqrt(sigmaCombined*sigmaCombined + sigmaStandAlone*sigmaStandAlone) : 100.;
522 double delta3 = standAlone && tracker ?
523 fabs(1./standAloneMu->pt() -1./trackerMu->pt())
524 /
sqrt(sigmaStandAlone*sigmaStandAlone + sigmaTracker*sigmaTracker) : 100.;
527 standAloneMu->hitPattern().numberOfValidMuonDTHits()+
528 standAloneMu->hitPattern().numberOfValidMuonCSCHits() > 0 ?
531 std::cout <<
"delta = " << delta <<
" delta1 "<<delta1<<
" delta2 "<<delta2<<
" delta3 "<<delta3<<std::endl;
534 combinedMu->ptError()/combinedMu->pt()
535 / (trackerMu->ptError()/trackerMu->pt());
537 std::cout<<
" ratio "<<ratio<<
" combined mu pt "<<combinedMu->pt()<<std::endl;
543 double sumPtR03 = muonRef->isolationR03().sumPt;
544 double emEtR03 = muonRef->isolationR03().emEt;
545 double hadEtR03 = muonRef->isolationR03().hadEt;
546 double relIsoR03 = (sumPtR03 + emEtR03 + hadEtR03)/muonRef->pt();
547 double sumPtR05 = muonRef->isolationR05().sumPt;
548 double emEtR05 = muonRef->isolationR05().emEt;
549 double hadEtR05 = muonRef->isolationR05().hadEt;
550 double relIsoR05 = (sumPtR05 + emEtR05 + hadEtR05)/muonRef->pt();
551 std::cout<<
" 0.3 Radion Rel Iso: "<<relIsoR03<<
" sumPt "<<sumPtR03<<
" emEt "<<emEtR03<<
" hadEt "<<hadEtR03<<std::endl;
552 std::cout<<
" 0.5 Radion Rel Iso: "<<relIsoR05<<
" sumPt "<<sumPtR05<<
" emEt "<<emEtR05<<
" hadEt "<<hadEtR05<<std::endl;
569 std::vector<reco::Muon::MuonTrackTypePair>
out;
572 if(muon->globalTrack().
isNonnull() && muon->globalTrack()->pt()>0)
573 if(muon->globalTrack()->ptError()/muon->globalTrack()->pt()<dpt)
576 if(muon->innerTrack().
isNonnull() && muon->innerTrack()->pt()>0)
577 if(muon->innerTrack()->ptError()/muon->innerTrack()->pt()<dpt)
580 bool pickyExists=
false;
581 double pickyDpt=99999.;
582 if(muon->pickyTrack().
isNonnull() && muon->pickyTrack()->pt()>0) {
583 pickyDpt = muon->pickyTrack()->ptError()/muon->pickyTrack()->pt();
589 bool dytExists=
false;
590 double dytDpt=99999.;
591 if(muon->dytTrack().
isNonnull() && muon->dytTrack()->pt()>0) {
592 dytDpt = muon->dytTrack()->ptError()/muon->dytTrack()->pt();
602 if(muon->tpfmsTrack().
isNonnull() && muon->tpfmsTrack()->pt()>0) {
603 double tpfmsDpt = muon->tpfmsTrack()->ptError()/muon->tpfmsTrack()->pt();
604 if( ( (pickyExists && tpfmsDpt<pickyDpt) || (!pickyExists) ) &&
605 ( (dytExists && tpfmsDpt<dytDpt) || (!dytExists) ) &&
610 if(includeSA && muon->outerTrack().
isNonnull())
611 if(muon->outerTrack()->ptError()/muon->outerTrack()->pt()<dpt)
629 using namespace reco;
656 std::vector<reco::Muon::MuonTrackTypePair> validTracks =
goodMuonTracks(muon);
662 if( validTracks.empty())
671 TrackRef bestTrack = bestTrackPair.first;
677 TrackRef trackWithSmallestError = trackPairWithSmallestError.first;
681 bestTrack->ptError()/bestTrack->pt()>
errorCompScale_*trackWithSmallestError->ptError()/trackWithSmallestError->pt() )) {
682 bestTrack = trackWithSmallestError;
683 trackType = trackPairWithSmallestError.second;
686 bestTrack->ptError()/bestTrack->pt()>
errorCompScale_*trackWithSmallestError->ptError()/trackWithSmallestError->pt()) {
687 bestTrack = trackWithSmallestError;
688 trackType = trackPairWithSmallestError.second;
693 changeTrack(candidate,std::make_pair(bestTrack,trackType));
703 using namespace reco;
707 double px = bestTrack->px();
708 double py = bestTrack->py();
709 double pz = bestTrack->pz();
710 double energy =
sqrt(bestTrack->p()*bestTrack->p() + 0.1057*0.1057);
712 candidate.
setCharge(bestTrack->charge()>0 ? 1 : -1);
733 return *std::min_element(tracks.begin(),tracks.end(),
sorter);
747 for(reco::PFCandidateCollection::const_iterator
i = pfc->begin();
i!=pfc->end();++
i) {
761 using namespace reco;
804 std::vector<int>
muons;
807 for(
unsigned int i=0;
i<cands->size();++
i) {
816 std::sort(muons.begin(),muons.end(),comparator);
820 double METXCosmics=0;
821 double METYCosmics=0;
822 double SUMETCosmics=0.0;
824 for(
unsigned int i=0;
i<muons.size();++
i) {
831 cosmics.push_back(muons[i]);
832 METXCosmics +=pfc.
px();
833 METYCosmics +=pfc.
py();
834 SUMETCosmics +=pfc.
pt();
837 double MET2Cosmics = METXCosmics*METXCosmics+METYCosmics*METYCosmics;
840 for(
unsigned int i=0;
i<cosmics.size();++
i) {
846 for(
unsigned int i=0;
i<muons.size();++
i) {
875 for (
unsigned imu = 0; imu < muons->size(); ++imu ) {
879 for(
unsigned i=0;
i<cands->size();
i++) {
886 if ( pfc.
muonRef()->innerTrack() == muonRef->innerTrack())
891 if ( pfc.
muonRef()->isStandAloneMuon() && muonRef->isStandAloneMuon() ) {
892 double dEta = pfc.
muonRef()->standAloneMuon()->eta() - muonRef->standAloneMuon()->eta();
893 double dPhi = pfc.
muonRef()->standAloneMuon()->phi() - muonRef->standAloneMuon()->phi();
894 double dR =
sqrt(dEta*dEta + dPhi*dPhi);
904 if ( used ||hadron||(!muonRef.
isNonnull()) )
continue;
912 if(!tracks.empty()) {
915 std::vector<reco::Muon::MuonTrackTypePair> tracksThatChangeMET =
tracksPointingAtMET(tracks);
917 if (!tracksThatChangeMET.empty()) {
924 int charge = bestTrackType.first->charge()>0 ? 1 : -1;
926 bestTrackType.first->py(),
927 bestTrackType.first->pz(),
928 sqrt(bestTrackType.first->p()*bestTrackType.first->p()+0.1057*0.1057));
937 cands->back().setTrackRef( muonRef->track() );
939 cands->back().setMuonRef(muonRef);
950 std::pair<double,double>
954 double METXNO =
METX_-pfc.
px();
955 double METYNO =
METY_-pfc.
py();
956 std::vector<double> met2;
957 for (
unsigned int i=0;
i<tracks.size();++
i) {
958 met2.push_back(
pow(METXNO+tracks.at(
i).first->px(),2)+
pow(METYNO+tracks.at(
i).first->py(),2));
965 return std::make_pair(*std::min_element(met2.begin(),met2.end()),*std::max_element(met2.begin(),met2.end()));
967 return std::make_pair(0,0);
973 using namespace reco;
977 double METNOX =
METX_ - pfc.
px();
978 double METNOY =
METY_ - pfc.
py();
990 if(tracks.size()>1) {
992 std::vector<reco::Muon::MuonTrackTypePair> tracksThatChangeMET =
tracksWithBetterMET(tracks,pfc);
994 if (!tracksThatChangeMET.empty()) {
1008 if (!(pfc.
muonRef()->isGlobalMuon() && pfc.
muonRef()->isTrackerMuon())) {
1011 double newMET2 = METNOX*METNOX+METNOY*METNOY;
1029 std::vector<reco::Muon::MuonTrackTypePair>
1031 std::vector<reco::Muon::MuonTrackTypePair> outputTracks;
1033 double METNOX =
METX_ - pfc.
px();
1034 double METNOY =
METY_ - pfc.
py();
1038 double newSUMET=0.0;
1043 for(
unsigned int i=0;
i<tracks.size();++
i) {
1045 newSUMET = SUMETNO+tracks.at(
i).first->pt()-
sumetPU_;
1046 newMET2 =
pow(METNOX+tracks.at(
i).first->px(),2)+
pow(METNOY+tracks.at(
i).first->py(),2);
1049 outputTracks.push_back(tracks.at(
i));
1053 return outputTracks;
1057 std::vector<reco::Muon::MuonTrackTypePair>
1059 std::vector<reco::Muon::MuonTrackTypePair> outputTracks;
1064 for(
unsigned int i=0;
i<tracks.size();++
i) {
1066 newMET2 =
pow(
METX_+tracks.at(
i).first->px(),2)+
pow(
METY_+tracks.at(
i).first->py(),2);
1069 outputTracks.push_back(tracks.at(
i));
1073 return outputTracks;
1081 using namespace reco;
1089 double METXNO =
METX_-pfc.
pt();
1090 double METYNO =
METY_-pfc.
pt();
1091 double MET2NO = METXNO*METXNO+METYNO*METYNO;
1099 fake1 =fabs ( pfc.
eta() ) > 2.15 &&
1100 met2.first<met2.second/2 &&
1113 if(fake1 || fake2||punchthrough) {
1116 if ( !eleInBlocks.empty() ) {
1117 PFBlockRef blockRefMuon = eleInBlocks[0].first;
1118 unsigned indexMuon = eleInBlocks[0].second;
1119 if (eleInBlocks.size()>1)
1120 indexMuon = eleInBlocks[1].
second;
1124 bool hadron =
false;
1125 for (
unsigned i = imu+1;
i < cands->size(); ++
i ) {
1128 if ( ele.empty() ) {
1132 unsigned indexHadron = ele[0].second;
1134 if ( blockRefHadron.
key() != blockRefMuon.
key() )
break;
1136 if ( indexHadron == indexMuon &&
1141 if ( hadron )
break;
1146 double rescaleFactor = cands->at(iHad).p()/cands->at(imu).p();
1147 METX_ -= cands->at(imu).px() + cands->at(iHad).px();
1148 METY_ -= cands->at(imu).py() + cands->at(iHad).py();
1149 sumet_ -=cands->at(imu).pt();
1150 cands->at(imu).rescaleMomentum(rescaleFactor);
1155 METX_ += cands->at(imu).px();
1156 METY_ += cands->at(imu).py();
1157 sumet_ += cands->at(imu).pt();
1159 }
else if ( fake1 || fake2 ) {
1160 METX_ -= cands->at(imu).px();
1161 METY_ -= cands->at(imu).py();
1162 sumet_ -= cands->at(imu).pt();
1175 size_t N = indices.size();
1176 size_t collSize = obj->size();
1178 for (
size_t i = 0 ;
i <
N ; ++
i)
1179 obj->at(indices.at(
i)) = obj->at(collSize-
i-1);
1181 obj->resize(collSize - indices.size());
T getParameter(std::string const &) const
Abstract base class for a PFBlock element (track, cluster...)
static bool isIsolatedMuon(const reco::PFBlockElement &elt)
bool cleanMismeasured(reco::PFCandidate &, unsigned int)
static bool isTightMuonPOG(const reco::MuonRef &muonRef)
void removeDeadCandidates(reco::PFCandidateCollection *, const std::vector< unsigned int > &)
bool isNonnull() const
Checks for non-null.
std::unique_ptr< reco::PFCandidateCollection > pfPunchThroughMuonCleanedCandidates_
the collection of punch-through cleaned muon candidates
double eta() const final
momentum pseudorapidity
double rawEcalEnergy() const
return corrected Ecal energy
void addMissingMuons(edm::Handle< reco::MuonCollection >, reco::PFCandidateCollection *cands)
static bool isMuon(const reco::PFBlockElement &elt)
const double minPunchThroughEnergy_
static bool isTrackerLooseMuon(const reco::PFBlockElement &elt)
const double metFactorRejection_
double px() const final
x coordinate of momentum vector
PFMuonAlgo(edm::ParameterSet const &)
constructor
std::unique_ptr< reco::PFCandidateCollection > pfFakeMuonCleanedCandidates_
the collection of fake cleaned muon candidates
static bool isGlobalLooseMuon(const reco::PFBlockElement &elt)
const double minPunchThroughMomentum_
bool exists(std::string const ¶meterName) const
checks if a parameter exists
bool cleanPunchThroughAndFakes(reco::PFCandidate &, reco::PFCandidateCollection *, unsigned int)
void setInputsForCleaning(reco::VertexCollection const &)
double pt() const final
transverse momentum
std::vector< Vertex > VertexCollection
collection of Vertex objects
reco::Muon::MuonTrackTypePair MuonTrackTypePair
const double punchThroughFactor_
std::unique_ptr< reco::PFCandidateCollection > pfCleanedTrackerAndGlobalMuonCandidates_
the collection of tracker/global cleaned muon candidates
key_type key() const
Accessor for product key.
const double metFactorCleaning_
static void printMuonProperties(const reco::MuonRef &muonRef)
std::vector< MuonTrackTypePair > tracksPointingAtMET(const std::vector< MuonTrackTypePair > &)
bool hasValidTrack(const reco::MuonRef &muonRef, bool loose=false)
static bool isGlobalTightMuon(const reco::PFBlockElement &elt)
std::vector< ElementInBlock > ElementsInBlocks
reco::TrackRef trackRef() const
MuonTrackTypePair getTrackWithSmallestError(const std::vector< MuonTrackTypePair > &)
U second(std::pair< T, U > const &p)
void setCharge(Charge q) final
set electric charge
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
void setVertexSource(PFVertexType vt)
reco::Muon::MuonTrackTypePair tevOptimized(const reco::TrackRef &combinedTrack, const reco::TrackRef &trackerTrack, const reco::TrackRef &tpfmsTrack, const reco::TrackRef &pickyTrack, const reco::TrackRef &dytTrack, const double ptThreshold=200., const double tune1=17., const double tune2=40., const double dptcut=0.25)
const double metFactorHighEta_
const double cosmicRejDistance_
void setMuonTrackType(const reco::Muon::MuonTrackType &type)
set the Best Muon Track Ref
void setParticleType(ParticleType type)
set Particle Type
const double minPostCleaningPt_
std::vector< reco::Muon::MuonTrackTypePair > goodMuonTracks(const reco::MuonRef &muon, bool includeSA=false)
void estimateEventQuantities(const reco::PFCandidateCollection *)
const double ptFactorHighEta_
void changeTrack(reco::PFCandidate &, const MuonTrackTypePair &)
const double eventFractionCleaning_
bool isGoodMuon(const reco::Muon &muon, SelectionType type, reco::Muon::ArbitrationType arbitrationType=reco::Muon::SegmentAndTrackArbitration)
main GoodMuon wrapper call
reco::MuonRef muonRef() const
std::unique_ptr< reco::PFCandidateCollection > pfAddedMuonCandidates_
the collection of added muon candidates
const double metFactorFake_
std::vector< reco::PFCandidate > PFCandidateCollection
collection of PFCandidates
double p() const final
magnitude of momentum vector
std::vector< unsigned int > maskedIndices_
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
static bool isLooseMuon(const reco::PFBlockElement &elt)
double py() const final
y coordinate of momentum vector
const double eventFactorCosmics_
std::pair< double, double > getMinMaxMET2(const reco::PFCandidate &)
int numberOfValidTrackerHits() const
Particle reconstructed by the particle flow algorithm.
void setMuonRef(const reco::MuonRef &ref)
set muon reference
const reco::VertexCollection * vertices_
MuonTrackType
map for Global Muon refitters
const double punchThroughMETFactor_
const reco::MuonRef & muonRef() const override
virtual ParticleType particleId() const
std::pair< TrackRef, Muon::MuonTrackType > MuonTrackTypePair
std::unique_ptr< reco::PFCandidateCollection > pfCosmicsMuonCleanedCandidates_
the collection of cosmics cleaned muon candidates
std::vector< MuonTrackTypePair > tracksWithBetterMET(const std::vector< MuonTrackTypePair > &, const reco::PFCandidate &)
void postClean(reco::PFCandidateCollection *)
const ElementsInBlocks & elementsInBlocks() const
std::vector< reco::Muon::MuonTrackTypePair > muonTracks(const reco::MuonRef &muon, bool includeSA=false, double dpt=1e+9)
const double eventFractionRejection_
void setP4(const LorentzVector &p4) final
set 4-momentum
const double errorCompScale_
Power< A, B >::type pow(const A &a, const B &b)
const double metSigForCleaning_
static bool isTrackerTightMuon(const reco::PFBlockElement &elt)
double rawHcalEnergy() const
return raw Hcal energy
const reco::TrackBase::TrackQuality trackQuality_
const double metSigForRejection_
std::unique_ptr< reco::PFCandidateCollection > pfPunchThroughHadronCleanedCandidates_
the collection of punch-through cleaned neutral hadron candidates
bool reconstructMuon(reco::PFCandidate &, const reco::MuonRef &, bool allowLoose=false)