31 maxNumberOfMatches_ = iConfig.
exists(
"maxNumberOfMatches") ? iConfig.
getParameter<
int>(
"maxNumberOfMatches") : 0;
32 checkNumMatches_ = iConfig.
exists(
"checkNumMatches") ? iConfig.
getParameter<
bool>(
"checkNumMatches") :
false;
37 double discriminate(
const PFTauRef& pfTau)
override;
53 if ( thePFTauRef->hasMuonReference() ) {
55 MuonRef muonref = thePFTauRef->leadPFChargedHadrCand()->muonRef();
56 if ( discriminatorOption_ ==
"noSegMatch" ) {
57 if ( muonref ->numberOfMatches() > maxNumberOfMatches_ ) decision =
false;
58 }
else if (discriminatorOption_ ==
"twoDCut") {
60 double calo= muonref->caloCompatibility();
61 double border = calo *
a + seg *
b +
c;
62 if ( border > 0 ) decision =
false;
63 }
else if ( discriminatorOption_ ==
"merePresence" ) {
65 }
else if (discriminatorOption_ ==
"combined" ) {
66 unsigned int muType = 0;
67 if ( muonref->isGlobalMuon() ) muType = 1;
68 else if ( muonref->isCaloMuon() ) muType = 2;
69 else if ( muonref->isTrackerMuon() ) muType = 3;
70 double muonEnergyFraction = thePFTauRef->pfTauTagInfoRef()->pfjetRef()->chargedMuEnergyFraction();
71 bool eta_veto =
false;
72 bool phi_veto =
false;
73 if ( fabs(muonref->eta()) > 2.3 || (fabs(muonref->eta()) > 1.4 && fabs(muonref->eta()) < 1.6)) eta_veto =
true;
74 if ( muonref->phi() < 0.1 && muonref->phi() > -0.1) phi_veto =
true;
75 if ( muType != 1 || muonref ->numberOfMatches() > 0 || eta_veto || phi_veto || muonEnergyFraction > 0.9 ) decision =
false;
76 }
else if ( discriminatorOption_ ==
"noAllArbitrated" || discriminatorOption_ ==
"noAllArbitratedWithHOP" ) {
77 if(checkNumMatches_ && muonref ->numberOfMatches() > maxNumberOfMatches_) decision =
false;
79 }
else if ( discriminatorOption_ ==
"HOP" ) {
83 <<
" Invalid Discriminator option = " << discriminatorOption_ <<
" --> please check cfi file !!\n";
88 if ( discriminatorOption_ ==
"HOP" || discriminatorOption_ ==
"noAllArbitratedWithHOP" ) {
89 if ( thePFTauRef->leadPFChargedHadrCand().
isNonnull() ) {
90 double muonCaloEn = thePFTauRef->leadPFChargedHadrCand()->hcalEnergy() + thePFTauRef->leadPFChargedHadrCand()->ecalEnergy();
91 if ( thePFTauRef->decayMode() == 0 && muonCaloEn < (hop_*thePFTauRef->leadPFChargedHadrCand()->p()) ) decision =
false;
95 return (decision ? 1. : 0.);
T getParameter(std::string const &) const
#define DEFINE_FWK_MODULE(type)
bool exists(std::string const ¶meterName) const
checks if a parameter exists
bool isNonnull() const
Checks for non-null.
float segmentCompatibility(const reco::Muon &muon, reco::Muon::ArbitrationType arbitrationType=reco::Muon::SegmentAndTrackArbitration)
bool isGoodMuon(const reco::Muon &muon, SelectionType type, reco::Muon::ArbitrationType arbitrationType=reco::Muon::SegmentAndTrackArbitration)
main GoodMuon wrapper call
PFRecoTauDiscriminationAgainstMuon(const edm::ParameterSet &iConfig)
~PFRecoTauDiscriminationAgainstMuon()
double discriminate(const PFTauRef &pfTau) override
std::string discriminatorOption_