CMS 3D CMS Logo

Public Types | Public Member Functions | Private Attributes

reco::tau::RecoTauQualityCuts Class Reference

#include <RecoTauQualityCuts.h>

List of all members.

Public Types

typedef boost::function< bool(const
PFCandidate &)> 
QCutFunc
typedef std::vector< QCutFuncQCutFuncCollection
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 QCutFuncpredicate () 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_

Detailed Description

Definition at line 30 of file RecoTauQualityCuts.h.


Member Typedef Documentation

typedef boost::function<bool (const PFCandidate&)> reco::tau::RecoTauQualityCuts::QCutFunc

Definition at line 33 of file RecoTauQualityCuts.h.

Definition at line 34 of file RecoTauQualityCuts.h.

Definition at line 35 of file RecoTauQualityCuts.h.


Constructor & Destructor Documentation

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_));
}

Member Function Documentation

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);
    }
template<typename PFCandRefType >
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); }
template<typename Coll >
Coll reco::tau::RecoTauQualityCuts::filterRefs ( const Coll &  refcoll,
bool  invert = false 
) const [inline]
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]

Member Data Documentation

Definition at line 67 of file RecoTauQualityCuts.h.

Referenced by filter(), predicate(), and RecoTauQualityCuts().

Definition at line 63 of file RecoTauQualityCuts.h.

Referenced by RecoTauQualityCuts(), and setPV().

Definition at line 65 of file RecoTauQualityCuts.h.

Referenced by RecoTauQualityCuts().