CMS 3D CMS Logo

Functions
reco::tau::qcuts Namespace Reference

Functions

bool AND (const TrackBaseRef &track, const RecoTauQualityCuts::TrackQCutFuncCollection &cuts)
 
bool AND_cand (const Candidate &cand, const RecoTauQualityCuts::CandQCutFuncCollection &cuts)
 
bool etMin_cand (const Candidate &cand, double cut)
 
bool mapAndCutByType (const Candidate &cand, const RecoTauQualityCuts::CandQCutFuncMap &funcMap)
 
bool minPackedCandVertexWeight (const pat::PackedCandidate &pCand, const reco::VertexRef *pv, double cut)
 
bool minTrackVertexWeight (const TrackBaseRef &track, const reco::VertexRef *pv, double cut)
 
bool minTrackVertexWeight (const TrackRef &track, const reco::VertexRef *pv, double cut)
 
bool minTrackVertexWeight_cand (const Candidate &cand, const reco::VertexRef *pv, double cut)
 
bool ptMin (const TrackBaseRef &track, double cut)
 
bool ptMin_cand (const Candidate &cand, double cut)
 
bool trkChi2 (const Track *track, double cut)
 
bool trkChi2_cand (const Candidate &cand, double cut)
 
bool trkLongitudinalImpactParameter (const TrackBase *track, const reco::VertexRef *pv, double cut)
 
bool trkLongitudinalImpactParameter_cand (const Candidate &cand, const reco::VertexRef *pv, double cut)
 
bool trkLongitudinalImpactParameterWrtTrack (const Track *track, const Track *leadTrack, const reco::VertexRef *pv, double cut)
 DZ cut, with respect to the current lead rack. More...
 
bool trkLongitudinalImpactParameterWrtTrack_cand (const Candidate &cand, const reco::Track *leadTrack, const reco::VertexRef *pv, double cut)
 
bool trkPixelHits (const Track *track, int cut)
 
bool trkPixelHits_cand (const Candidate &cand, int cut)
 
bool trkTrackerHits (const Track *track, int cut)
 
bool trkTrackerHits_cand (const Candidate &cand, int cut)
 
bool trkTransverseImpactParameter (const Track *track, const reco::VertexRef *pv, double cut)
 
bool trkTransverseImpactParameter_cand (const Candidate &cand, const reco::VertexRef *pv, double cut)
 

Function Documentation

◆ AND()

bool reco::tau::qcuts::AND ( const TrackBaseRef track,
const RecoTauQualityCuts::TrackQCutFuncCollection cuts 
)

Definition at line 268 of file RecoTauQualityCuts.cc.

268  {
269  for (auto const& func : cuts) {
270  if (!func(track))
271  return false;
272  }
273  return true;
274  }

References L1TMuonDQMOffline_cfi::cuts, TrackCollections2monitor_cff::func, and HLT_2018_cff::track.

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

◆ AND_cand()

bool reco::tau::qcuts::AND_cand ( const Candidate cand,
const RecoTauQualityCuts::CandQCutFuncCollection cuts 
)

Definition at line 276 of file RecoTauQualityCuts.cc.

276  {
277  for (auto const& func : cuts) {
278  if (!func(cand))
279  return false;
280  }
281  return true;
282  }

References L1TMuonDQMOffline_cfi::cuts, and TrackCollections2monitor_cff::func.

Referenced by mapAndCutByType().

◆ etMin_cand()

bool reco::tau::qcuts::etMin_cand ( const Candidate cand,
double  cut 
)

Definition at line 67 of file RecoTauQualityCuts.cc.

67  {
68  LogDebug("TauQCuts") << "<etMin_cand>: Et = " << cand.et() << ", cut = " << cut;
69  return (cand.et() > cut);
70  }

References TkAlMuonSelectors_cfi::cut, and LogDebug.

◆ mapAndCutByType()

bool reco::tau::qcuts::mapAndCutByType ( const Candidate cand,
const RecoTauQualityCuts::CandQCutFuncMap funcMap 
)

Definition at line 285 of file RecoTauQualityCuts.cc.

285  {
286  // Find the cuts that for this particle type
287  RecoTauQualityCuts::CandQCutFuncMap::const_iterator cuts = funcMap.find(std::abs(cand.pdgId()));
288  // Return false if we dont' know how to deal with this particle type
289  if (cuts == funcMap.end())
290  return false;
291  return AND_cand(cand, cuts->second); // Otherwise AND all the cuts
292  }

References funct::abs(), AND_cand(), and L1TMuonDQMOffline_cfi::cuts.

◆ minPackedCandVertexWeight()

bool reco::tau::qcuts::minPackedCandVertexWeight ( const pat::PackedCandidate pCand,
const reco::VertexRef pv,
double  cut 
)

Definition at line 210 of file RecoTauQualityCuts.cc.

210  {
211  if (pv->isNull()) {
212  edm::LogError("QCutsNoPrimaryVertex") << "Primary vertex Ref in "
213  << "RecoTauQualityCuts is invalid. - minPackedCandVertexWeight";
214  return false;
215  }
216  //there is some low granular information on track weight in the vertex available with packed cands
217  double weight = -9.9;
218  if (pCand.vertexRef().isNonnull() && pCand.vertexRef().key() == pv->key()) {
219  int quality = pCand.pvAssociationQuality();
221  weight = 0.6; //0.6 as proxy for weight above 0.5
223  weight = 0.1; //0.6 as proxy for weight below 0.5
224  }
225  LogDebug("TauQCuts") << " packedCand: Pt = " << pCand.pt() << ", eta = " << pCand.eta()
226  << ", phi = " << pCand.phi();
227  LogDebug("TauQCuts") << " vertex: x = " << (*pv)->position().x() << ", y = " << (*pv)->position().y()
228  << ", z = " << (*pv)->position().z();
229  LogDebug("TauQCuts") << "--> trackWeight from packedCand = " << weight << " (cut = " << cut << ")";
230  return (weight >= cut);
231  }

References TkAlMuonSelectors_cfi::cut, pat::PackedCandidate::eta(), edm::Ref< C, T, F >::isNonnull(), edm::Ref< C, T, F >::key(), LogDebug, pat::PackedCandidate::phi(), pat::PackedCandidate::pt(), MetAnalyzer::pv(), pat::PackedCandidate::pvAssociationQuality(), qcdUeDQM_cfi::quality, pat::PackedCandidate::UsedInFitLoose, pat::PackedCandidate::UsedInFitTight, and pat::PackedCandidate::vertexRef().

Referenced by reco::tau::RecoTauQualityCuts::filterChargedCand(), and minTrackVertexWeight_cand().

◆ minTrackVertexWeight() [1/2]

bool reco::tau::qcuts::minTrackVertexWeight ( const TrackBaseRef track,
const reco::VertexRef pv,
double  cut 
)

Definition at line 182 of file RecoTauQualityCuts.cc.

182  {
183  if (pv->isNull()) {
184  edm::LogError("QCutsNoPrimaryVertex") << "Primary vertex Ref in "
185  << "RecoTauQualityCuts is invalid. - minTrackVertexWeight";
186  return false;
187  }
188  LogDebug("TauQCuts") << " track: Pt = " << track->pt() << ", eta = " << track->eta()
189  << ", phi = " << track->phi();
190  LogDebug("TauQCuts") << " vertex: x = " << (*pv)->position().x() << ", y = " << (*pv)->position().y()
191  << ", z = " << (*pv)->position().z();
192  LogDebug("TauQCuts") << "--> trackWeight = " << (*pv)->trackWeight(track) << " (cut = " << cut << ")";
193  return ((*pv)->trackWeight(track) >= cut);
194  }

References TkAlMuonSelectors_cfi::cut, LogDebug, MetAnalyzer::pv(), and HLT_2018_cff::track.

Referenced by minTrackVertexWeight_cand().

◆ minTrackVertexWeight() [2/2]

bool reco::tau::qcuts::minTrackVertexWeight ( const TrackRef track,
const reco::VertexRef pv,
double  cut 
)

Definition at line 196 of file RecoTauQualityCuts.cc.

196  {
197  if (pv->isNull()) {
198  edm::LogError("QCutsNoPrimaryVertex") << "Primary vertex Ref in "
199  << "RecoTauQualityCuts is invalid. - minTrackVertexWeight";
200  return false;
201  }
202  LogDebug("TauQCuts") << " track: Pt = " << track->pt() << ", eta = " << track->eta()
203  << ", phi = " << track->phi();
204  LogDebug("TauQCuts") << " vertex: x = " << (*pv)->position().x() << ", y = " << (*pv)->position().y()
205  << ", z = " << (*pv)->position().z();
206  LogDebug("TauQCuts") << "--> trackWeight = " << (*pv)->trackWeight(track) << " (cut = " << cut << ")";
207  return ((*pv)->trackWeight(track) >= cut);
208  }

References TkAlMuonSelectors_cfi::cut, LogDebug, MetAnalyzer::pv(), and HLT_2018_cff::track.

◆ minTrackVertexWeight_cand()

bool reco::tau::qcuts::minTrackVertexWeight_cand ( const Candidate cand,
const reco::VertexRef pv,
double  cut 
)

Definition at line 233 of file RecoTauQualityCuts.cc.

233  {
234  auto track = getTrackRef(cand);
235  if (track.isNonnull()) {
236  return minTrackVertexWeight(track, pv, cut);
237  }
238  auto gsfTrack = getGsfTrackRef(cand);
239  if (gsfTrack.isNonnull()) {
240  return minTrackVertexWeight(gsfTrack, pv, cut);
241  }
242 
243  const pat::PackedCandidate* pCand = dynamic_cast<const pat::PackedCandidate*>(&cand);
244  if (pCand != nullptr && cand.charge() != 0) {
245  return minPackedCandVertexWeight(*pCand, pv, cut);
246  }
247  LogDebug("TauQCuts") << "<minTrackVertexWeight_cand>: weight = N/A, cut = " << cut;
248  return false;
249  }

References TkAlMuonSelectors_cfi::cut, LogDebug, minPackedCandVertexWeight(), minTrackVertexWeight(), MetAnalyzer::pv(), and HLT_2018_cff::track.

◆ ptMin()

bool reco::tau::qcuts::ptMin ( const TrackBaseRef track,
double  cut 
)

Definition at line 57 of file RecoTauQualityCuts.cc.

57  {
58  LogDebug("TauQCuts") << "<ptMin>: Pt = " << track->pt() << ", cut = " << cut;
59  return (track->pt() > cut);
60  }

References TkAlMuonSelectors_cfi::cut, LogDebug, and HLT_2018_cff::track.

◆ ptMin_cand()

bool reco::tau::qcuts::ptMin_cand ( const Candidate cand,
double  cut 
)

Definition at line 62 of file RecoTauQualityCuts.cc.

62  {
63  LogDebug("TauQCuts") << "<ptMin_cand>: Pt = " << cand.pt() << ", cut = " << cut;
64  return (cand.pt() > cut);
65  }

References TkAlMuonSelectors_cfi::cut, and LogDebug.

◆ trkChi2()

bool reco::tau::qcuts::trkChi2 ( const Track track,
double  cut 
)

Definition at line 251 of file RecoTauQualityCuts.cc.

251  {
252  LogDebug("TauQCuts") << "<trkChi2>: chi^2 = " << track->normalizedChi2() << ", cut = " << cut;
253  return (track->normalizedChi2() <= cut);
254  }

References TkAlMuonSelectors_cfi::cut, LogDebug, and HLT_2018_cff::track.

Referenced by trkChi2_cand().

◆ trkChi2_cand()

bool reco::tau::qcuts::trkChi2_cand ( const Candidate cand,
double  cut 
)

Definition at line 256 of file RecoTauQualityCuts.cc.

256  {
257  auto track = getTrack(cand);
258  if (track) {
259  LogDebug("TauQCuts") << "<trkChi2_cand>: chi^2 = " << track->normalizedChi2() << ", cut = " << cut;
260  return trkChi2(track, cut);
261  } else {
262  LogDebug("TauQCuts") << "<trkChi2_cand>: chi^2 = N/A, cut = " << cut;
263  return false;
264  }
265  }

References TkAlMuonSelectors_cfi::cut, getTrack(), LogDebug, HLT_2018_cff::track, and trkChi2().

◆ trkLongitudinalImpactParameter()

bool reco::tau::qcuts::trkLongitudinalImpactParameter ( const TrackBase track,
const reco::VertexRef pv,
double  cut 
)

Definition at line 133 of file RecoTauQualityCuts.cc.

133  {
134  if (pv->isNull()) {
135  edm::LogError("QCutsNoPrimaryVertex") << "Primary vertex Ref in "
136  << "RecoTauQualityCuts is invalid. - trkLongitudinalImpactParameter";
137  return false;
138  }
139  LogDebug("TauQCuts") << " track: Pt = " << track->pt() << ", eta = " << track->eta()
140  << ", phi = " << track->phi();
141  LogDebug("TauQCuts") << " vertex: x = " << (*pv)->position().x() << ", y = " << (*pv)->position().y()
142  << ", z = " << (*pv)->position().z();
143  LogDebug("TauQCuts") << "--> dz = " << std::fabs(track->dz((*pv)->position())) << " (cut = " << cut << ")";
144  return (std::fabs(track->dz((*pv)->position())) <= cut);
145  }

References TkAlMuonSelectors_cfi::cut, LogDebug, MetAnalyzer::pv(), and HLT_2018_cff::track.

Referenced by trkLongitudinalImpactParameter_cand().

◆ trkLongitudinalImpactParameter_cand()

bool reco::tau::qcuts::trkLongitudinalImpactParameter_cand ( const Candidate cand,
const reco::VertexRef pv,
double  cut 
)

Definition at line 147 of file RecoTauQualityCuts.cc.

147  {
148  auto track = getTrack(cand);
149  if (track) {
151  } else {
152  LogDebug("TauQCuts") << "<trkLongitudinalImpactParameter_cand>: dZ = N/A, cut = " << cut;
153  return false;
154  }
155  }

References TkAlMuonSelectors_cfi::cut, getTrack(), LogDebug, MetAnalyzer::pv(), HLT_2018_cff::track, and trkLongitudinalImpactParameter().

◆ trkLongitudinalImpactParameterWrtTrack()

bool reco::tau::qcuts::trkLongitudinalImpactParameterWrtTrack ( const Track track,
const Track leadTrack,
const reco::VertexRef pv,
double  cut 
)

DZ cut, with respect to the current lead rack.

Definition at line 158 of file RecoTauQualityCuts.cc.

161  {
162  if (!leadTrack) {
163  edm::LogError("QCutsNoValidLeadTrack")
164  << "Lead track Ref in "
165  << "RecoTauQualityCuts is invalid. - trkLongitudinalImpactParameterWrtTrack";
166  return false;
167  }
168  return (std::fabs(track->dz((*pv)->position()) - leadTrack->dz((*pv)->position())) <= cut);
169  }

References TkAlMuonSelectors_cfi::cut, singlePfTauSkim_cff::leadTrack, and HLT_2018_cff::track.

Referenced by trkLongitudinalImpactParameterWrtTrack_cand().

◆ trkLongitudinalImpactParameterWrtTrack_cand()

bool reco::tau::qcuts::trkLongitudinalImpactParameterWrtTrack_cand ( const Candidate cand,
const reco::Track leadTrack,
const reco::VertexRef pv,
double  cut 
)

◆ trkPixelHits()

bool reco::tau::qcuts::trkPixelHits ( const Track track,
int  cut 
)

Definition at line 72 of file RecoTauQualityCuts.cc.

72  {
73  // For some reason, the number of hits is signed
74  LogDebug("TauQCuts") << "<trkPixelHits>: #Pxl hits = " << track->hitPattern().numberOfValidPixelHits()
75  << ", cut = " << cut;
76  return (track->hitPattern().numberOfValidPixelHits() >= cut);
77  }

References TkAlMuonSelectors_cfi::cut, LogDebug, and HLT_2018_cff::track.

Referenced by trkPixelHits_cand().

◆ trkPixelHits_cand()

bool reco::tau::qcuts::trkPixelHits_cand ( const Candidate cand,
int  cut 
)

Definition at line 79 of file RecoTauQualityCuts.cc.

79  {
80  // For some reason, the number of hits is signed
81  auto track = getTrack(cand);
82  if (track) {
83  LogDebug("TauQCuts") << "<trkPixelHits_cand>: #Pxl hits = " << trkPixelHits(track, cut) << ", cut = " << cut;
84  return trkPixelHits(track, cut);
85  } else {
86  LogDebug("TauQCuts") << "<trkPixelHits_cand>: #Pxl hits = N/A, cut = " << cut;
87  return false;
88  }
89  }

References TkAlMuonSelectors_cfi::cut, getTrack(), LogDebug, HLT_2018_cff::track, and trkPixelHits().

◆ trkTrackerHits()

bool reco::tau::qcuts::trkTrackerHits ( const Track track,
int  cut 
)

Definition at line 91 of file RecoTauQualityCuts.cc.

91  {
92  LogDebug("TauQCuts") << "<trkTrackerHits>: #Trk hits = " << track->hitPattern().numberOfValidHits()
93  << ", cut = " << cut;
94  return (track->hitPattern().numberOfValidHits() >= cut);
95  }

References TkAlMuonSelectors_cfi::cut, LogDebug, and HLT_2018_cff::track.

Referenced by trkTrackerHits_cand().

◆ trkTrackerHits_cand()

bool reco::tau::qcuts::trkTrackerHits_cand ( const Candidate cand,
int  cut 
)

Definition at line 97 of file RecoTauQualityCuts.cc.

97  {
98  auto track = getTrack(cand);
99  if (track) {
100  LogDebug("TauQCuts") << "<trkTrackerHits>: #Trk hits = " << track->hitPattern().numberOfValidHits()
101  << ", cut = " << cut;
102  return trkTrackerHits(track, cut);
103  } else {
104  LogDebug("TauQCuts") << "<trkTrackerHits>: #Trk hits = N/A, cut = " << cut;
105  return false;
106  }
107  }

References TkAlMuonSelectors_cfi::cut, getTrack(), LogDebug, HLT_2018_cff::track, and trkTrackerHits().

◆ trkTransverseImpactParameter()

bool reco::tau::qcuts::trkTransverseImpactParameter ( const Track track,
const reco::VertexRef pv,
double  cut 
)

Definition at line 109 of file RecoTauQualityCuts.cc.

109  {
110  if (pv->isNull()) {
111  edm::LogError("QCutsNoPrimaryVertex") << "Primary vertex Ref in "
112  << "RecoTauQualityCuts is invalid. - trkTransverseImpactParameter";
113  return false;
114  }
115  LogDebug("TauQCuts") << " track: Pt = " << track->pt() << ", eta = " << track->eta()
116  << ", phi = " << track->phi();
117  LogDebug("TauQCuts") << " vertex: x = " << (*pv)->position().x() << ", y = " << (*pv)->position().y()
118  << ", z = " << (*pv)->position().z();
119  LogDebug("TauQCuts") << "--> dxy = " << std::fabs(track->dxy((*pv)->position())) << " (cut = " << cut << ")";
120  return (std::fabs(track->dxy((*pv)->position())) <= cut);
121  }

References TkAlMuonSelectors_cfi::cut, LogDebug, MetAnalyzer::pv(), and HLT_2018_cff::track.

Referenced by trkTransverseImpactParameter_cand().

◆ trkTransverseImpactParameter_cand()

bool reco::tau::qcuts::trkTransverseImpactParameter_cand ( const Candidate cand,
const reco::VertexRef pv,
double  cut 
)

Definition at line 123 of file RecoTauQualityCuts.cc.

123  {
124  auto track = getTrack(cand);
125  if (track) {
127  } else {
128  LogDebug("TauQCuts") << "<trkTransverseImpactParameter_cand>: dXY = N/A, cut = " << cut;
129  return false;
130  }
131  }

References TkAlMuonSelectors_cfi::cut, getTrack(), LogDebug, MetAnalyzer::pv(), HLT_2018_cff::track, and trkTransverseImpactParameter().

pat::PackedCandidate::vertexRef
const reco::VertexRef vertexRef() const
Definition: PackedCandidate.h:737
TkAlMuonSelectors_cfi.cut
cut
Definition: TkAlMuonSelectors_cfi.py:5
reco::tau::qcuts::minPackedCandVertexWeight
bool minPackedCandVertexWeight(const pat::PackedCandidate &pCand, const reco::VertexRef *pv, double cut)
Definition: RecoTauQualityCuts.cc:210
reco::tau::qcuts::trkLongitudinalImpactParameter
bool trkLongitudinalImpactParameter(const TrackBase *track, const reco::VertexRef *pv, double cut)
Definition: RecoTauQualityCuts.cc:133
reco::tau::qcuts::trkLongitudinalImpactParameterWrtTrack
bool trkLongitudinalImpactParameterWrtTrack(const Track *track, const Track *leadTrack, const reco::VertexRef *pv, double cut)
DZ cut, with respect to the current lead rack.
Definition: RecoTauQualityCuts.cc:158
pat::PackedCandidate::pvAssociationQuality
const PVAssociationQuality pvAssociationQuality() const
Definition: PackedCandidate.h:729
pat::PackedCandidate::UsedInFitLoose
Definition: PackedCandidate.h:726
singlePfTauSkim_cff.leadTrack
leadTrack
Definition: singlePfTauSkim_cff.py:22
reco::tau::qcuts::trkChi2
bool trkChi2(const Track *track, double cut)
Definition: RecoTauQualityCuts.cc:251
pat::PackedCandidate::pt
double pt() const override
transverse momentum
Definition: PackedCandidate.h:523
reco::tau::qcuts::trkTransverseImpactParameter
bool trkTransverseImpactParameter(const Track *track, const reco::VertexRef *pv, double cut)
Definition: RecoTauQualityCuts.cc:109
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
edm::LogError
Definition: MessageLogger.h:183
reco::tau::qcuts::minTrackVertexWeight
bool minTrackVertexWeight(const TrackRef &track, const reco::VertexRef *pv, double cut)
Definition: RecoTauQualityCuts.cc:196
pat::PackedCandidate
Definition: PackedCandidate.h:22
edm::Ref::isNonnull
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
cand
Definition: decayParser.h:34
reco::tau::qcuts::trkTrackerHits
bool trkTrackerHits(const Track *track, int cut)
Definition: RecoTauQualityCuts.cc:91
pat::PackedCandidate::phi
double phi() const override
momentum azimuthal angle
Definition: PackedCandidate.h:529
MetAnalyzer.pv
def pv(vc)
Definition: MetAnalyzer.py:7
TrackCollections2monitor_cff.func
func
Definition: TrackCollections2monitor_cff.py:359
getTrack
static const TrackGhostTrackState * getTrack(const BasicGhostTrackState *basic)
Definition: GhostTrackState.cc:49
qcdUeDQM_cfi.quality
quality
Definition: qcdUeDQM_cfi.py:31
edm::Ref::key
key_type key() const
Accessor for product key.
Definition: Ref.h:250
HLT_2018_cff.track
track
Definition: HLT_2018_cff.py:10352
L1TMuonDQMOffline_cfi.cuts
cuts
Definition: L1TMuonDQMOffline_cfi.py:41
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
reco::tau::qcuts::AND_cand
bool AND_cand(const Candidate &cand, const RecoTauQualityCuts::CandQCutFuncCollection &cuts)
Definition: RecoTauQualityCuts.cc:276
pat::PackedCandidate::UsedInFitTight
Definition: PackedCandidate.h:727
reco::tau::qcuts::trkPixelHits
bool trkPixelHits(const Track *track, int cut)
Definition: RecoTauQualityCuts.cc:72
weight
Definition: weight.py:1
pat::PackedCandidate::eta
double eta() const override
momentum pseudorapidity
Definition: PackedCandidate.h:563