24 template<
class TauType,
class TauDiscriminator>
33 ~TauDiscriminationAgainstMuon() {}
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
#define DEFINE_FWK_MODULE(type)
bool isTrackerMuon() const
bool exists(std::string const ¶meterName) const
checks if a parameter exists
bool isGlobalMuon() const
std::vector< Tau > TauCollection
edm::Ref< TauCollection > TauRef
double deltaR(const T1 &t1, const T2 &t2)
TauDiscriminationAgainstMuon< CaloTau, CaloTauDiscriminator > CaloRecoTauDiscriminationAgainstMuon
virtual double eta() const
momentum pseudorapidity
const_iterator end() const
last daughter const_iterator
float segmentCompatibility(const reco::Muon &muon, reco::Muon::ArbitrationType arbitrationType=reco::Muon::SegmentAndTrackArbitration)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
int numberOfMatches(ArbitrationType type=SegmentAndTrackArbitration) const
get number of chambers with matched segments
const_iterator begin() const
first daughter const_iterator
virtual double phi() const
momentum azimuthal angle
virtual const LorentzVector & p4() const
four-momentum Lorentz vector
float caloCompatibility() const