CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions
reco::tau::qcuts Namespace Reference

Functions

bool AND (const PFCandidate &cand, const RecoTauQualityCuts::QCutFuncCollection &cuts)
 
bool etMin (const PFCandidate &cand, double cut)
 
bool mapAndCutByType (const PFCandidate &cand, const RecoTauQualityCuts::QCutFuncMap &funcMap)
 
bool minTrackVertexWeight (const PFCandidate &cand, const reco::VertexRef *pv, double cut)
 
bool ptMin (const PFCandidate &cand, double cut)
 
bool trkChi2 (const PFCandidate &cand, double cut)
 
bool trkLongitudinalImpactParameter (const PFCandidate &cand, const reco::VertexRef *pv, double cut)
 
bool trkLongitudinalImpactParameterWrtTrack (const PFCandidate &cand, const reco::TrackBaseRef *trk, double cut)
 DZ cut, with respect to the current lead rack. More...
 
bool trkPixelHits (const PFCandidate &cand, int cut)
 
bool trkTrackerHits (const PFCandidate &cand, int cut)
 
bool trkTransverseImpactParameter (const PFCandidate &cand, const reco::VertexRef *pv, double cut)
 

Function Documentation

bool reco::tau::qcuts::AND ( const PFCandidate &  cand,
const RecoTauQualityCuts::QCutFuncCollection &  cuts 
)

Definition at line 117 of file RecoTauQualityCuts.cc.

Referenced by mapAndCutByType(), egHLT::EgObjTrigCut< T >::pass(), egHLT::EgEvtTrigCut< T >::pass(), stor::TriggerSelector::TreeElement::returnStatus(), and stor::TriggerSelector::TreeElement::TreeElement().

118  {
119  BOOST_FOREACH(const RecoTauQualityCuts::QCutFunc& func, cuts) {
120  if (!func(cand))
121  return false;
122  }
123  return true;
124 }
bool reco::tau::qcuts::etMin ( const PFCandidate &  cand,
double  cut 
)
bool reco::tau::qcuts::mapAndCutByType ( const PFCandidate &  cand,
const RecoTauQualityCuts::QCutFuncMap &  funcMap 
)

Definition at line 127 of file RecoTauQualityCuts.cc.

References AND(), hpstanc_transforms::cuts, and reco::PFCandidate::particleId().

Referenced by reco::tau::RecoTauQualityCuts::RecoTauQualityCuts().

128  {
129  // Find the cuts that for this particle type
130  RecoTauQualityCuts::QCutFuncMap::const_iterator cuts =
131  funcMap.find(cand.particleId());
132  // Return false if we dont' know how to deal w/ this particle type
133  if (cuts == funcMap.end())
134  return false;
135  else
136  // Otherwise AND all the cuts
137  return AND(cand, cuts->second);
138 }
bool AND(const PFCandidate &cand, const RecoTauQualityCuts::QCutFuncCollection &cuts)
bool reco::tau::qcuts::minTrackVertexWeight ( const PFCandidate &  cand,
const reco::VertexRef pv,
double  cut 
)

Definition at line 97 of file RecoTauQualityCuts.cc.

References GOODCOLL_filter_cfg::cut, edm::Ref< C, T, F >::isNull(), and CommonMethods::weight().

Referenced by reco::tau::RecoTauQualityCuts::RecoTauQualityCuts().

98  {
99  if (pv->isNull()) {
100  edm::LogError("QCutsNoPrimaryVertex") << "Primary vertex Ref in " <<
101  "RecoTauQualityCuts is invalid. - minTrackVertexWeight";
102  return false;
103  }
104  auto trk = getTrackRef(cand);
105  if (!trk) return false;
106  double weight = (*pv)->trackWeight(trk);
107  return weight >= cut;
108 }
bool isNull() const
Checks for null.
Definition: Ref.h:247
bool reco::tau::qcuts::ptMin ( const PFCandidate &  cand,
double  cut 
)

Definition at line 32 of file RecoTauQualityCuts.cc.

References GOODCOLL_filter_cfg::cut, and reco::LeafCandidate::pt().

Referenced by reco::tau::RecoTauQualityCuts::RecoTauQualityCuts().

32  {
33  return cand.pt() > cut;
34 }
bool reco::tau::qcuts::trkChi2 ( const PFCandidate &  cand,
double  cut 
)

Definition at line 110 of file RecoTauQualityCuts.cc.

References GOODCOLL_filter_cfg::cut, and reco::tau::getTrack().

Referenced by reco::tau::RecoTauQualityCuts::RecoTauQualityCuts().

110  {
111  auto trk = getTrack(cand);
112  if (!trk) return false;
113  return trk->normalizedChi2() <= cut;
114 }
static const TrackGhostTrackState * getTrack(const BasicGhostTrackState *basic)
bool reco::tau::qcuts::trkLongitudinalImpactParameter ( const PFCandidate &  cand,
const reco::VertexRef pv,
double  cut 
)

Definition at line 66 of file RecoTauQualityCuts.cc.

References abs, GOODCOLL_filter_cfg::cut, reco::tau::getTrack(), and edm::Ref< C, T, F >::isNull().

Referenced by reco::tau::RecoTauQualityCuts::RecoTauQualityCuts().

68  {
69  if (pv->isNull()) {
70  edm::LogError("QCutsNoPrimaryVertex") << "Primary vertex Ref in " <<
71  "RecoTauQualityCuts is invalid. - trkLongitudinalImpactParameter";
72  return false;
73  }
74  auto trk = getTrack(cand);
75  if (!trk) return false;
76  double difference = std::abs(trk->dz((*pv)->position()));
77  //std::cout << "QCUTS LIP: track vz: " << trk->vz() <<
78  //" diff: " << difference << " cut: " << cut << std::endl;
79  return difference <= cut;
80 }
#define abs(x)
Definition: mlp_lapack.h:159
bool isNull() const
Checks for null.
Definition: Ref.h:247
static const TrackGhostTrackState * getTrack(const BasicGhostTrackState *basic)
bool reco::tau::qcuts::trkLongitudinalImpactParameterWrtTrack ( const PFCandidate &  cand,
const reco::TrackBaseRef trk,
double  cut 
)

DZ cut, with respect to the current lead rack.

Definition at line 83 of file RecoTauQualityCuts.cc.

References abs, GOODCOLL_filter_cfg::cut, and reco::tau::getTrack().

Referenced by reco::tau::RecoTauQualityCuts::RecoTauQualityCuts().

84  {
85  if (trk->isNull()) {
86  edm::LogError("QCutsNoValidLeadTrack") << "Lead track Ref in " <<
87  "RecoTauQualityCuts is invalid. - trkLongitudinalImpactParameterWrtTrack";
88  return false;
89  }
90  auto candTrk = getTrack(cand);
91  if (!candTrk) return false;
92  double difference = std::abs((*trk)->vz() - candTrk->vz());
93  return difference <= cut;
94 }
#define abs(x)
Definition: mlp_lapack.h:159
static const TrackGhostTrackState * getTrack(const BasicGhostTrackState *basic)
bool reco::tau::qcuts::trkPixelHits ( const PFCandidate &  cand,
int  cut 
)

Definition at line 40 of file RecoTauQualityCuts.cc.

References GOODCOLL_filter_cfg::cut, and reco::tau::getTrack().

Referenced by reco::tau::RecoTauQualityCuts::RecoTauQualityCuts().

40  {
41  // For some reason, the number of hits is signed
42  auto trk = getTrack(cand);
43  if (!trk) return false;
44  return trk->hitPattern().numberOfValidPixelHits() >= cut;
45 }
static const TrackGhostTrackState * getTrack(const BasicGhostTrackState *basic)
bool reco::tau::qcuts::trkTrackerHits ( const PFCandidate &  cand,
int  cut 
)

Definition at line 47 of file RecoTauQualityCuts.cc.

References GOODCOLL_filter_cfg::cut, and reco::tau::getTrack().

Referenced by reco::tau::RecoTauQualityCuts::RecoTauQualityCuts().

47  {
48  auto trk = getTrack(cand);
49  if (!trk) return false;
50  return trk->hitPattern().numberOfValidHits() >= cut;
51 }
static const TrackGhostTrackState * getTrack(const BasicGhostTrackState *basic)
bool reco::tau::qcuts::trkTransverseImpactParameter ( const PFCandidate &  cand,
const reco::VertexRef pv,
double  cut 
)

Definition at line 53 of file RecoTauQualityCuts.cc.

References abs, GOODCOLL_filter_cfg::cut, reco::tau::getTrack(), and edm::Ref< C, T, F >::isNull().

Referenced by reco::tau::RecoTauQualityCuts::RecoTauQualityCuts().

55  {
56  if (pv->isNull()) {
57  edm::LogError("QCutsNoPrimaryVertex") << "Primary vertex Ref in " <<
58  "RecoTauQualityCuts is invalid. - trkTransverseImpactParameter";
59  return false;
60  }
61  auto trk = getTrack(cand);
62  if (!trk) return false;
63  return std::abs(trk->dxy((*pv)->position())) <= cut;
64 }
#define abs(x)
Definition: mlp_lapack.h:159
bool isNull() const
Checks for null.
Definition: Ref.h:247
static const TrackGhostTrackState * getTrack(const BasicGhostTrackState *basic)