24 template<
class TauType,
class TauDiscriminator>
33 ~TauDiscriminationAgainstMuon()
override {}
38 double discriminate(
const TauRef&)
const override;
41 bool evaluateMuonVeto(
const reco::Muon&)
const;
47 enum { kNoSegMatch, kTwoDCut, kMerePresence, kCombined };
48 int discriminatorOption_;
50 double coeffCaloComp_;
51 double coeffSegmComp_;
55 template<
class TauType,
class TauDiscriminator>
56 TauDiscriminationAgainstMuon<TauType, TauDiscriminator>::TauDiscriminationAgainstMuon(
const edm::ParameterSet&
cfg)
64 if ( discriminatorOption_string ==
"noSegMatch" ) discriminatorOption_ = kNoSegMatch;
65 else if ( discriminatorOption_string ==
"twoDCut" ) discriminatorOption_ = kTwoDCut;
66 else if ( discriminatorOption_string ==
"merePresence" ) discriminatorOption_ = kMerePresence;
67 else if ( discriminatorOption_string ==
"combined" ) discriminatorOption_ = kCombined;
72 coeffCaloComp_ = cfg.
getParameter<
double>(
"caloCompCoefficient");
73 coeffSegmComp_ = cfg.
getParameter<
double>(
"segmCompCoefficient");
77 template<
class TauType,
class TauDiscriminator>
78 void TauDiscriminationAgainstMuon<TauType, TauDiscriminator>::beginEvent(
const edm::Event& evt,
const edm::EventSetup& evtSetup)
83 template<
class TauType,
class TauDiscriminator>
84 bool TauDiscriminationAgainstMuon<TauType, TauDiscriminator>::evaluateMuonVeto(
const reco::Muon&
muon)
const 88 if ( discriminatorOption_ == kNoSegMatch ) {
90 }
else if ( discriminatorOption_ == kTwoDCut ) {
93 if ( (coeffCaloComp_*segmComp + coeffSegmComp_*caloComp) > muonCompCut_ ) decision =
false;
94 }
else if ( discriminatorOption_ == kMerePresence ) {
96 }
else if ( discriminatorOption_ == kCombined ) {
97 unsigned int muonType = 0;
102 bool eta_veto = ( fabs(muon.
eta()) > 2.3 || (fabs(muon.
eta()) > 1.4 && fabs(muon.
eta()) < 1.6) ) ?
true :
false;
103 bool phi_veto = ( muon.
phi() < 0.1 && muon.
phi() > -0.1 ) ?
true :
false;
105 if ( muonType != 1 || muon.
numberOfMatches() > 0 || eta_veto || phi_veto ) decision =
false;
111 template<
class TauType,
class TauDiscriminator>
112 double TauDiscriminationAgainstMuon<TauType, TauDiscriminator>::discriminate(
const TauRef&
tau)
const 114 bool decision =
true;
116 for ( reco::MuonCollection::const_iterator muon = muons_->
begin();
117 muon != muons_->
end(); ++
muon ) {
118 if (
reco::deltaR(muon->
p4(), tau->p4()) < dRmatch_ ) decision &= evaluateMuonVeto(*muon);
121 return (decision ? 1. : 0.);
T getParameter(std::string const &) const
double eta() const final
momentum pseudorapidity
edm::Ref< TauBxCollection > TauRef
#define DEFINE_FWK_MODULE(type)
bool exists(std::string const ¶meterName) const
checks if a parameter exists
std::vector< Tau > TauCollection
TauDiscriminationAgainstMuon< CaloTau, CaloTauDiscriminator > CaloRecoTauDiscriminationAgainstMuon
bool isTrackerMuon() const override
int numberOfMatches(unsigned int type=SegmentAndTrackArbitration) const
get number of chambers with matched segments
bool isGlobalMuon() const override
const_iterator end() const
last daughter const_iterator
float segmentCompatibility(const reco::Muon &muon, reco::Muon::ArbitrationType arbitrationType=reco::Muon::SegmentAndTrackArbitration)
const LorentzVector & p4() const final
four-momentum Lorentz vector
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
constexpr auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
const_iterator begin() const
first daughter const_iterator
bool isCaloMuon() const override
double phi() const final
momentum azimuthal angle
float caloCompatibility() const