30 maxNumberOfMatches_ = iConfig.
getParameter<
int>(
"maxNumberOfMatches");
31 checkNumMatches_ = iConfig.
getParameter<
bool>(
"checkNumMatches");
36 double discriminate(
const PFTauRef& pfTau)
const override;
53 if (thePFTauRef->hasMuonReference()) {
54 MuonRef muonref = thePFTauRef->leadPFChargedHadrCand()->muonRef();
55 if (discriminatorOption_ ==
"noSegMatch") {
56 if (muonref->numberOfMatches() > maxNumberOfMatches_)
58 }
else if (discriminatorOption_ ==
"twoDCut") {
60 double calo = muonref->caloCompatibility();
61 double border =
calo *
a + seg *
b +
c;
64 }
else if (discriminatorOption_ ==
"merePresence") {
66 }
else if (discriminatorOption_ ==
"combined") {
67 unsigned int muType = 0;
68 if (muonref->isGlobalMuon())
70 else if (muonref->isCaloMuon())
72 else if (muonref->isTrackerMuon())
75 const reco::PFJet* pfJetPtr = dynamic_cast<const reco::PFJet*>(thePFTauRef->pfTauTagInfoRef()->pfjetRef().
get());
79 throw cms::Exception(
"Type Mismatch") <<
"The PFTau was not made from PFJets, and this outdated algorithm was "
80 "not updated to cope with PFTaus made from other Jets.\n";
81 bool eta_veto =
false;
82 bool phi_veto =
false;
83 if (fabs(muonref->eta()) > 2.3 || (fabs(muonref->eta()) > 1.4 && fabs(muonref->eta()) < 1.6))
85 if (muonref->phi() < 0.1 && muonref->phi() > -0.1)
87 if (muType != 1 || muonref->numberOfMatches() > 0 || eta_veto || phi_veto ||
muonEnergyFraction > 0.9)
89 }
else if (discriminatorOption_ ==
"noAllArbitrated" || discriminatorOption_ ==
"noAllArbitratedWithHOP") {
90 if (checkNumMatches_ && muonref->numberOfMatches() > maxNumberOfMatches_)
94 }
else if (discriminatorOption_ ==
"HOP") {
98 <<
" Invalid Discriminator option = " << discriminatorOption_ <<
" --> please check cfi file !!\n";
103 if (discriminatorOption_ ==
"HOP" || discriminatorOption_ ==
"noAllArbitratedWithHOP") {
104 if (thePFTauRef->leadPFChargedHadrCand().
isNonnull()) {
106 thePFTauRef->leadPFChargedHadrCand()->hcalEnergy() + thePFTauRef->leadPFChargedHadrCand()->ecalEnergy();
107 if (thePFTauRef->decayMode() == 0 && muonCaloEn < (hop_ * thePFTauRef->leadPFChargedHadrCand()->p()))
112 return (decision ? 1. : 0.);
118 desc.
add<
double>(
"a", 0.5);
119 desc.
add<
double>(
"c", 0.0);
120 desc.
add<
double>(
"b", 0.5);
127 psd1.
add<
double>(
"cut");
134 desc.
add<
double>(
"HoPMin", 0.2);
135 desc.
add<
int>(
"maxNumberOfMatches", 0);
136 desc.
add<
bool>(
"checkNumMatches",
false);
137 descriptions.
add(
"pfRecoTauDiscriminationAgainstMuon", desc);