![]() |
![]() |
#include <LeptonSelector.h>
Public Member Functions | |
bool | isAny () const |
bool | isNegative () const |
bool | isPositive () const |
LeptonSelector (const edm::ParameterSet ¶ms) | |
bool | operator() (const reco::SoftLeptonProperties &properties, bool use3d=true) const |
~LeptonSelector () | |
Private Types | |
enum | sign { negative = -1, any = 0, positive = 1 } |
optionally select leptons based on their impact parameter sign More... | |
Static Private Member Functions | |
static sign | option (const std::string &election) |
Private Attributes | |
reco::SoftLeptonProperties::quality::Generic | m_leptonId |
float | m_qualityCut |
sign | m_sign |
Definition at line 12 of file LeptonSelector.h.
enum btag::LeptonSelector::sign [private] |
optionally select leptons based on their impact parameter sign
Definition at line 26 of file LeptonSelector.h.
LeptonSelector::LeptonSelector | ( | const edm::ParameterSet & | params | ) |
Definition at line 12 of file LeptonSelector.cc.
References edm::ParameterSet::exists(), edm::ParameterSet::getParameter(), m_leptonId, and m_qualityCut.
: m_sign(option(params.getParameter<std::string>("ipSign"))), m_leptonId(reco::SoftLeptonProperties::quality::btagLeptonCands), m_qualityCut(0.5) { if (params.exists("leptonId") || params.exists("reco::SoftLeptonProperties::qualityCut")) { std::string leptonId = params.getParameter<std::string>("leptonId"); m_leptonId = reco::SoftLeptonProperties::quality::byName<reco::SoftLeptonProperties::quality::Generic>(leptonId.c_str()); m_qualityCut = params.getParameter<double>("reco::SoftLeptonProperties::qualityCut"); } }
LeptonSelector::~LeptonSelector | ( | ) |
Definition at line 24 of file LeptonSelector.cc.
{ }
bool btag::LeptonSelector::isAny | ( | ) | const [inline] |
bool btag::LeptonSelector::isNegative | ( | ) | const [inline] |
Definition at line 21 of file LeptonSelector.h.
References m_sign, and negative.
Referenced by ElectronTagger::discriminator(), LeptonTaggerByIP::discriminator(), MuonTagger::discriminator(), and operator()().
bool btag::LeptonSelector::isPositive | ( | ) | const [inline] |
Definition at line 20 of file LeptonSelector.h.
References m_sign, and positive.
Referenced by operator()().
bool LeptonSelector::operator() | ( | const reco::SoftLeptonProperties & | properties, |
bool | use3d = true |
||
) | const |
Definition at line 28 of file LeptonSelector.cc.
References reco::SoftLeptonProperties::quality::btagLeptonCands, isNegative(), isPositive(), m_leptonId, m_qualityCut, reco::SoftLeptonProperties::quality(), sip, reco::SoftLeptonProperties::sip2d, reco::SoftLeptonProperties::sip3d, and reco::SoftLeptonProperties::quality::undef.
{ float sip = use3d ? properties.sip3d : properties.sip2d; if ((isPositive() && sip <= 0.0) || (isNegative() && sip >= 0.0)) return false; bool candSelection = (m_leptonId == reco::SoftLeptonProperties::quality::btagLeptonCands); float quality = properties.quality(m_leptonId, !candSelection); if (candSelection && quality == reco::SoftLeptonProperties::quality::undef) return true; // for backwards compatibility return quality > m_qualityCut; }
LeptonSelector::sign LeptonSelector::option | ( | const std::string & | election | ) | [static, private] |
Definition at line 43 of file LeptonSelector.cc.
References any, edm::errors::Configuration, Exception, negative, and positive.
{ if (selection == "any") return any; else if (selection == "negative") return negative; else if (selection == "positive") return positive; else throw edm::Exception( edm::errors::Configuration ) << "invalid parameter specified for soft lepton selection"; }
Definition at line 35 of file LeptonSelector.h.
Referenced by LeptonSelector(), and operator()().
float btag::LeptonSelector::m_qualityCut [private] |
Definition at line 36 of file LeptonSelector.h.
Referenced by LeptonSelector(), and operator()().
sign btag::LeptonSelector::m_sign [private] |
Definition at line 34 of file LeptonSelector.h.
Referenced by isAny(), isNegative(), and isPositive().