32 maxNumberOfMatches_ = iConfig.
getParameter<
int>(
"maxNumberOfMatches");
33 checkNumMatches_ = iConfig.
getParameter<
bool>(
"checkNumMatches");
38 double discriminate(
const PFTauRef& pfTau)
const override;
56 if ( thePFTauRef->hasMuonReference() ) {
58 MuonRef muonref = thePFTauRef->leadPFChargedHadrCand()->muonRef();
59 if ( discriminatorOption_ ==
"noSegMatch" ) {
60 if ( muonref ->numberOfMatches() > maxNumberOfMatches_ ) decision =
false;
61 }
else if (discriminatorOption_ ==
"twoDCut") {
63 double calo= muonref->caloCompatibility();
64 double border = calo *
a + seg *
b +
c;
65 if ( border > 0 ) decision =
false;
66 }
else if ( discriminatorOption_ ==
"merePresence" ) {
68 }
else if (discriminatorOption_ ==
"combined" ) {
69 unsigned int muType = 0;
70 if ( muonref->isGlobalMuon() ) muType = 1;
71 else if ( muonref->isCaloMuon() ) muType = 2;
72 else if ( muonref->isTrackerMuon() ) muType = 3;
77 }
else throw cms::Exception(
"Type Mismatch") <<
"The PFTau was not made from PFJets, and this outdated algorithm was not updated to cope with PFTaus made from other Jets.\n";
78 bool eta_veto =
false;
79 bool phi_veto =
false;
80 if ( fabs(muonref->eta()) > 2.3 || (fabs(muonref->eta()) > 1.4 && fabs(muonref->eta()) < 1.6)) eta_veto =
true;
81 if ( muonref->phi() < 0.1 && muonref->phi() > -0.1) phi_veto =
true;
82 if ( muType != 1 || muonref ->numberOfMatches() > 0 || eta_veto || phi_veto || muonEnergyFraction > 0.9 ) decision =
false;
83 }
else if ( discriminatorOption_ ==
"noAllArbitrated" || discriminatorOption_ ==
"noAllArbitratedWithHOP" ) {
84 if(checkNumMatches_ && muonref ->numberOfMatches() > maxNumberOfMatches_) decision =
false;
86 }
else if ( discriminatorOption_ ==
"HOP" ) {
90 <<
" Invalid Discriminator option = " << discriminatorOption_ <<
" --> please check cfi file !!\n";
95 if ( discriminatorOption_ ==
"HOP" || discriminatorOption_ ==
"noAllArbitratedWithHOP" ) {
96 if ( thePFTauRef->leadPFChargedHadrCand().
isNonnull() ) {
97 double muonCaloEn = thePFTauRef->leadPFChargedHadrCand()->hcalEnergy() + thePFTauRef->leadPFChargedHadrCand()->ecalEnergy();
98 if ( thePFTauRef->decayMode() == 0 && muonCaloEn < (hop_*thePFTauRef->leadPFChargedHadrCand()->p()) ) decision =
false;
102 return (decision ? 1. : 0.);
109 desc.
add<
double>(
"a", 0.5);
110 desc.
add<
double>(
"c", 0.0);
111 desc.
add<
double>(
"b", 0.5);
118 psd1.
add<
double>(
"cut");
125 desc.
add<
double>(
"HoPMin", 0.2);
126 desc.
add<
int>(
"maxNumberOfMatches", 0);
127 desc.
add<
bool>(
"checkNumMatches",
false);
128 descriptions.
add(
"pfRecoTauDiscriminationAgainstMuon", desc);
T getParameter(std::string const &) const
ParameterDescriptionBase * addOptional(U const &iLabel, T const &value)
bool isNonnull() const
Checks for non-null.
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
double discriminate(const PFTauRef &pfTau) const override
Jets made from PFObjects.
~PFRecoTauDiscriminationAgainstMuon() override
#define DEFINE_FWK_MODULE(type)
float segmentCompatibility(const reco::Muon &muon, reco::Muon::ArbitrationType arbitrationType=reco::Muon::SegmentAndTrackArbitration)
T const * get() const
Returns C++ pointer to the item.
ParameterDescriptionBase * add(U const &iLabel, T const &value)
bool isGoodMuon(const reco::Muon &muon, SelectionType type, reco::Muon::ArbitrationType arbitrationType=reco::Muon::SegmentAndTrackArbitration)
main GoodMuon wrapper call
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
PFRecoTauDiscriminationAgainstMuon(const edm::ParameterSet &iConfig)
float chargedMuEnergyFraction() const
chargedMuEnergyFraction
std::string discriminatorOption_