#include <RecoTauQualityCuts.h>
Public Types | |
typedef boost::function< bool(const PFCandidate &)> | QCutFunc |
typedef std::vector< QCutFunc > | QCutFuncCollection |
typedef std::map < PFCandidate::ParticleType, QCutFuncCollection > | QCutFuncMap |
Public Member Functions | |
bool | filter (const reco::PFCandidate &cand) const |
Filter a single PFCandidate. | |
template<typename PFCandRefType > | |
bool | filterRef (const PFCandRefType &cand) const |
Filter a PFCandidate held by a smart pointer or Ref. | |
template<typename Coll > | |
Coll | filterRefs (const Coll &refcoll, bool invert=false) const |
Filter a ref vector of PFCandidates. | |
const QCutFunc & | predicate () const |
Get the predicate used to filter. | |
RecoTauQualityCuts (const edm::ParameterSet &qcuts) | |
void | setPV (const reco::VertexRef &vtx) const |
Update the primary vertex. | |
Private Attributes | |
QCutFunc | predicate_ |
reco::VertexRef | pv_ |
QCutFuncMap | qcuts_ |
Definition at line 30 of file RecoTauQualityCuts.h.
typedef boost::function<bool (const PFCandidate&)> reco::tau::RecoTauQualityCuts::QCutFunc |
Definition at line 33 of file RecoTauQualityCuts.h.
typedef std::vector<QCutFunc> reco::tau::RecoTauQualityCuts::QCutFuncCollection |
Definition at line 34 of file RecoTauQualityCuts.h.
typedef std::map<PFCandidate::ParticleType, QCutFuncCollection> reco::tau::RecoTauQualityCuts::QCutFuncMap |
Definition at line 35 of file RecoTauQualityCuts.h.
reco::tau::RecoTauQualityCuts::RecoTauQualityCuts | ( | const edm::ParameterSet & | qcuts | ) | [explicit] |
Definition at line 91 of file RecoTauQualityCuts.cc.
References reco::PFCandidate::e, reco::tau::qcuts::etMin(), edm::ParameterSet::exists(), reco::PFCandidate::gamma, edm::ParameterSet::getParameter(), h, reco::PFCandidate::h0, reco::tau::qcuts::mapAndCutByType(), reco::PFCandidate::mu, predicate_, reco::tau::qcuts::ptMin(), pv_, qcuts_, reco::tau::qcuts::trkChi2(), reco::tau::qcuts::trkLongitudinalImpactParameter(), reco::tau::qcuts::trkPixelHits(), reco::tau::qcuts::trkTrackerHits(), and reco::tau::qcuts::trkTransverseImpactParameter().
{ // Setup all of our predicates QCutFuncCollection chargedHadronCuts; QCutFuncCollection gammaCuts; QCutFuncCollection neutralHadronCuts; // Build all the QCuts for tracks if (qcuts.exists("minTrackPt")) chargedHadronCuts.push_back( boost::bind(qcuts::ptMin, _1, qcuts.getParameter<double>("minTrackPt"))); if (qcuts.exists("maxTrackChi2")) chargedHadronCuts.push_back( boost::bind(qcuts::trkChi2, _1, qcuts.getParameter<double>("maxTrackChi2"))); if (qcuts.exists("minTrackPixelHits")) chargedHadronCuts.push_back(boost::bind( qcuts::trkPixelHits, _1, qcuts.getParameter<uint32_t>("minTrackPixelHits"))); if (qcuts.exists("minTrackHits")) chargedHadronCuts.push_back(boost::bind( qcuts::trkTrackerHits, _1, qcuts.getParameter<uint32_t>("minTrackHits"))); // The impact parameter functions are bound to our member PV, since they // need it to compute the discriminant value. if (qcuts.exists("maxTransverseImpactParameter")) chargedHadronCuts.push_back(boost::bind( qcuts::trkTransverseImpactParameter, _1, &pv_, qcuts.getParameter<double>("maxTransverseImpactParameter"))); if (qcuts.exists("maxDeltaZ")) chargedHadronCuts.push_back(boost::bind( qcuts::trkLongitudinalImpactParameter, _1, &pv_, qcuts.getParameter<double>("maxDeltaZ"))); // Build the QCuts for gammas if (qcuts.exists("minGammaEt")) gammaCuts.push_back(boost::bind( qcuts::etMin, _1, qcuts.getParameter<double>("minGammaEt"))); // Build QCuts for netural hadrons if (qcuts.exists("minNeutralHadronEt")) neutralHadronCuts.push_back(boost::bind( qcuts::etMin, _1, qcuts.getParameter<double>("minNeutralHadronEt"))); // Map our QCut collections to the particle Ids they are associated to. qcuts_[PFCandidate::h] = chargedHadronCuts; qcuts_[PFCandidate::gamma] = gammaCuts; qcuts_[PFCandidate::h0] = neutralHadronCuts; // We use the same qcuts for muons/electrons and charged hadrons. qcuts_[PFCandidate::e] = chargedHadronCuts; qcuts_[PFCandidate::mu] = chargedHadronCuts; // Build a final level predicate that works on any PFCand predicate_ = boost::bind(qcuts::mapAndCutByType, _1, boost::cref(qcuts_)); }
bool reco::tau::RecoTauQualityCuts::filter | ( | const reco::PFCandidate & | cand | ) | const [inline] |
Filter a single PFCandidate.
Definition at line 43 of file RecoTauQualityCuts.h.
References predicate_.
Referenced by filterRef().
{ return predicate_(cand); }
bool reco::tau::RecoTauQualityCuts::filterRef | ( | const PFCandRefType & | cand | ) | const [inline] |
Filter a PFCandidate held by a smart pointer or Ref.
Definition at line 48 of file RecoTauQualityCuts.h.
References filter().
Referenced by filterRefs().
{ return filter(*cand); }
Coll reco::tau::RecoTauQualityCuts::filterRefs | ( | const Coll & | refcoll, |
bool | invert = false |
||
) | const [inline] |
Filter a ref vector of PFCandidates.
Definition at line 51 of file RecoTauQualityCuts.h.
References filterRef(), and convertSQLitetoXML_cfg::output.
Referenced by reco::tau::RecoTauBuilderCombinatoricPlugin::operator()(), reco::tau::RecoTauBuilderConePlugin::operator()(), reco::tau::RecoTauPiZeroStripPlugin::operator()(), reco::tau::RecoTauPiZeroCombinatoricPlugin::operator()(), and reco::tau::RecoTauPiZeroTrivialPlugin::operator()().
{ Coll output; BOOST_FOREACH(const typename Coll::value_type cand, refcoll) { if (filterRef(cand)^invert) output.push_back(cand); } return output; }
const QCutFunc& reco::tau::RecoTauQualityCuts::predicate | ( | ) | const [inline] |
Get the predicate used to filter.
Definition at line 41 of file RecoTauQualityCuts.h.
References predicate_.
{ return predicate_; }
void reco::tau::RecoTauQualityCuts::setPV | ( | const reco::VertexRef & | vtx | ) | const [inline] |
Update the primary vertex.
Definition at line 39 of file RecoTauQualityCuts.h.
References pv_.
Referenced by reco::tau::RecoTauPiZeroStripPlugin::beginEvent(), reco::tau::RecoTauBuilderCombinatoricPlugin::operator()(), and reco::tau::RecoTauBuilderConePlugin::operator()().
{ pv_ = vtx; }
Definition at line 67 of file RecoTauQualityCuts.h.
Referenced by filter(), predicate(), and RecoTauQualityCuts().
reco::VertexRef reco::tau::RecoTauQualityCuts::pv_ [mutable, private] |
Definition at line 63 of file RecoTauQualityCuts.h.
Referenced by RecoTauQualityCuts(), and setPV().
Definition at line 65 of file RecoTauQualityCuts.h.
Referenced by RecoTauQualityCuts().