CMS 3D CMS Logo

RecoTauQualityCuts.cc
Go to the documentation of this file.
8 
9 namespace reco::tau {
10 
11 namespace {
12  const reco::Track* getTrack(const Candidate& cand)
13  {
14  const PFCandidate* pfCandPtr = dynamic_cast<const PFCandidate*>(&cand);
15  if (pfCandPtr) {
16  // Get the KF track if it exists. Otherwise, see if PFCandidate has a GSF track.
17  if ( pfCandPtr->trackRef().isNonnull() ) return pfCandPtr->trackRef().get();
18  else if ( pfCandPtr->gsfTrackRef().isNonnull() ) return pfCandPtr->gsfTrackRef().get();
19  else return nullptr;
20  }
21 
22  const pat::PackedCandidate* packedCand = dynamic_cast<const pat::PackedCandidate*>(&cand);
23  if (packedCand && packedCand->hasTrackDetails())
24  return &packedCand->pseudoTrack();
25 
26  return nullptr;
27  }
28 
29  const reco::TrackRef getTrackRef(const Candidate& cand)
30  {
31  const PFCandidate* pfCandPtr = dynamic_cast<const PFCandidate*>(&cand);
32  if (pfCandPtr)
33  return pfCandPtr->trackRef();
34 
35  return reco::TrackRef();
36  }
37 
38  const reco::TrackBaseRef getGsfTrackRef(const Candidate& cand)
39  {
40  const PFCandidate* pfCandPtr = dynamic_cast<const PFCandidate*>(&cand);
41  if (pfCandPtr) {
42  return reco::TrackBaseRef(pfCandPtr->gsfTrackRef());
43  }
44  return reco::TrackBaseRef();
45 
46  }
47 
48 
49  // Translate GsfTrackRef to TrackBaseRef
50  template <typename T>
51  reco::TrackBaseRef convertRef(const T& ref) {
52  return reco::TrackBaseRef(ref);
53  }
54 }
55 
56 // Quality cut implementations
57 namespace qcuts {
58 
59 bool ptMin(const TrackBaseRef& track, double cut)
60 {
61  LogDebug("TauQCuts") << "<ptMin>: Pt = " << track->pt() << ", cut = " << cut ;
62  return (track->pt() > cut);
63 }
64 
65 bool ptMin_cand(const Candidate& cand, double cut)
66 {
67  LogDebug("TauQCuts") << "<ptMin_cand>: Pt = " << cand.pt() << ", cut = " << cut ;
68  return (cand.pt() > cut);
69 }
70 
71 bool etMin_cand(const Candidate& cand, double cut)
72 {
73  LogDebug("TauQCuts") << "<etMin_cand>: Et = " << cand.et() << ", cut = " << cut ;
74  return (cand.et() > cut);
75 }
76 
77 bool trkPixelHits(const Track* track, int cut)
78 {
79  // For some reason, the number of hits is signed
80  LogDebug("TauQCuts") << "<trkPixelHits>: #Pxl hits = " << track->hitPattern().numberOfValidPixelHits() << ", cut = " << cut ;
81  return (track->hitPattern().numberOfValidPixelHits() >= cut);
82 }
83 
84 bool trkPixelHits_cand(const Candidate& cand, int cut)
85 {
86  // For some reason, the number of hits is signed
87  auto track = getTrack(cand);
88  if ( track ) {
89  LogDebug("TauQCuts") << "<trkPixelHits_cand>: #Pxl hits = " << trkPixelHits(track, cut) << ", cut = " << cut ;
90  return trkPixelHits(track, cut);
91  } else {
92  LogDebug("TauQCuts") << "<trkPixelHits_cand>: #Pxl hits = N/A, cut = " << cut ;
93  return false;
94  }
95 }
96 
97 bool trkTrackerHits(const Track* track, int cut)
98 {
99  LogDebug("TauQCuts") << "<trkTrackerHits>: #Trk hits = " << track->hitPattern().numberOfValidHits() << ", cut = " << cut ;
100  return (track->hitPattern().numberOfValidHits() >= cut);
101 }
102 
103 bool trkTrackerHits_cand(const Candidate& cand, int cut)
104 {
105  auto track = getTrack(cand);
106  if ( track ) {
107  LogDebug("TauQCuts") << "<trkTrackerHits>: #Trk hits = " << track->hitPattern().numberOfValidHits() << ", cut = " << cut ;
108  return trkTrackerHits(track, cut);
109  } else {
110  LogDebug("TauQCuts") << "<trkTrackerHits>: #Trk hits = N/A, cut = " << cut ;
111  return false;
112  }
113 }
114 
116 {
117  if ( pv->isNull() ) {
118  edm::LogError("QCutsNoPrimaryVertex") << "Primary vertex Ref in " <<
119  "RecoTauQualityCuts is invalid. - trkTransverseImpactParameter";
120  return false;
121  }
122  LogDebug("TauQCuts") << " track: Pt = " << track->pt() << ", eta = " << track->eta() << ", phi = " << track->phi() ;
123  LogDebug("TauQCuts") << " vertex: x = " << (*pv)->position().x() << ", y = " << (*pv)->position().y() << ", z = " << (*pv)->position().z() ;
124  LogDebug("TauQCuts") << "--> dxy = " << std::fabs(track->dxy((*pv)->position())) << " (cut = " << cut << ")" ;
125  return (std::fabs(track->dxy((*pv)->position())) <= cut);
126 }
127 
129 {
130  auto track = getTrack(cand);
131  if ( track ) {
132  return trkTransverseImpactParameter(track, pv, cut);
133  } else {
134  LogDebug("TauQCuts") << "<trkTransverseImpactParameter_cand>: dXY = N/A, cut = " << cut ;
135  return false;
136  }
137 }
138 
140 {
141  if ( pv->isNull() ) {
142  edm::LogError("QCutsNoPrimaryVertex") << "Primary vertex Ref in " <<
143  "RecoTauQualityCuts is invalid. - trkLongitudinalImpactParameter";
144  return false;
145  }
146  LogDebug("TauQCuts") << " track: Pt = " << track->pt() << ", eta = " << track->eta() << ", phi = " << track->phi() ;
147  LogDebug("TauQCuts") << " vertex: x = " << (*pv)->position().x() << ", y = " << (*pv)->position().y() << ", z = " << (*pv)->position().z() ;
148  LogDebug("TauQCuts") << "--> dz = " << std::fabs(track->dz((*pv)->position())) << " (cut = " << cut << ")" ;
149  return (std::fabs(track->dz((*pv)->position())) <= cut);
150 }
151 
153 {
154  auto track = getTrack(cand);
155  if ( track ) {
156  return trkLongitudinalImpactParameter(track, pv, cut);
157  } else {
158  LogDebug("TauQCuts") << "<trkLongitudinalImpactParameter_cand>: dZ = N/A, cut = " << cut ;
159  return false;
160  }
161 }
162 
165 {
166  if (!leadTrack) {
167  edm::LogError("QCutsNoValidLeadTrack") << "Lead track Ref in " <<
168  "RecoTauQualityCuts is invalid. - trkLongitudinalImpactParameterWrtTrack";
169  return false;
170  }
171  return (std::fabs(track->dz((*pv)->position()) - leadTrack->dz((*pv)->position())) <= cut);
172 }
173 
175 {
176  auto track = getTrack(cand);
177  if ( track ) return trkLongitudinalImpactParameterWrtTrack(track, leadTrack, pv, cut);
178  else return false;
179 }
180 
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() << ", phi = " << track->phi() ;
189  LogDebug("TauQCuts") << " vertex: x = " << (*pv)->position().x() << ", y = " << (*pv)->position().y() << ", z = " << (*pv)->position().z() ;
190  LogDebug("TauQCuts") << "--> trackWeight = " << (*pv)->trackWeight(track) << " (cut = " << cut << ")" ;
191  return ((*pv)->trackWeight(track) >= cut);
192 }
193 
195 {
196  if ( pv->isNull() ) {
197  edm::LogError("QCutsNoPrimaryVertex") << "Primary vertex Ref in " <<
198  "RecoTauQualityCuts is invalid. - minTrackVertexWeight";
199  return false;
200  }
201  LogDebug("TauQCuts") << " track: Pt = " << track->pt() << ", eta = " << track->eta() << ", phi = " << track->phi() ;
202  LogDebug("TauQCuts") << " vertex: x = " << (*pv)->position().x() << ", y = " << (*pv)->position().y() << ", z = " << (*pv)->position().z() ;
203  LogDebug("TauQCuts") << "--> trackWeight = " << (*pv)->trackWeight(track) << " (cut = " << cut << ")" ;
204  return ((*pv)->trackWeight(track) >= cut);
205 }
206 
208 
209  if ( pv->isNull() ) {
210  edm::LogError("QCutsNoPrimaryVertex") << "Primary vertex Ref in " <<
211  "RecoTauQualityCuts is invalid. - minPackedCandVertexWeight";
212  return false;
213  }
214  //there is some low granular information on track weight in the vertex available with packed cands
215  double weight = -9.9;
216  if( pCand.vertexRef().isNonnull() && pCand.vertexRef().key() == pv->key() ){
217  int quality = pCand.pvAssociationQuality();
218  if( quality == pat::PackedCandidate::UsedInFitTight ) weight = 0.6;//0.6 as proxy for weight above 0.5
219  else if( quality == pat::PackedCandidate::UsedInFitLoose ) weight = 0.1;//0.6 as proxy for weight below 0.5
220  }
221  LogDebug("TauQCuts") << " packedCand: Pt = " << pCand.pt() << ", eta = " << pCand.eta() << ", phi = " << pCand.phi() ;
222  LogDebug("TauQCuts") << " vertex: x = " << (*pv)->position().x() << ", y = " << (*pv)->position().y() << ", z = " << (*pv)->position().z() ;
223  LogDebug("TauQCuts") << "--> trackWeight from packedCand = " << weight << " (cut = " << cut << ")" ;
224  return (weight >= cut);
225 }
226 
227 bool minTrackVertexWeight_cand(const Candidate& cand, const reco::VertexRef* pv, double cut)
228 {
229  auto track = getTrackRef(cand);
230  if ( track.isNonnull() ) {
231  return minTrackVertexWeight(track, pv, cut);
232  }
233  auto gsfTrack = getGsfTrackRef(cand);
234  if ( gsfTrack.isNonnull() ) {
235  return minTrackVertexWeight(gsfTrack, pv, cut);
236  }
237 
238  const pat::PackedCandidate* pCand = dynamic_cast<const pat::PackedCandidate*>(&cand);
239  if( pCand != nullptr && cand.charge() != 0) {
240  return minPackedCandVertexWeight(*pCand, pv, cut);
241  }
242  LogDebug("TauQCuts") << "<minTrackVertexWeight_cand>: weight = N/A, cut = " << cut ;
243  return false;
244 }
245 
246 bool trkChi2(const Track* track, double cut)
247 {
248  LogDebug("TauQCuts") << "<trkChi2>: chi^2 = " << track->normalizedChi2() << ", cut = " << cut ;
249  return (track->normalizedChi2() <= cut);
250 }
251 
252 bool trkChi2_cand(const Candidate& cand, double cut)
253 {
254  auto track = getTrack(cand);
255  if ( track ) {
256  LogDebug("TauQCuts") << "<trkChi2_cand>: chi^2 = " << track->normalizedChi2() << ", cut = " << cut ;
257  return trkChi2(track, cut);
258  } else {
259  LogDebug("TauQCuts") << "<trkChi2_cand>: chi^2 = N/A, cut = " << cut ;
260  return false;
261  }
262 }
263 
264 // And a set of qcuts
266 {
267  for(auto const& func : cuts ) {
268  if ( !func(track) ) return false;
269  }
270  return true;
271 }
272 
274 {
275  for(auto const& func : cuts ) {
276  if ( !func(cand) ) return false;
277  }
278  return true;
279 }
280 
281 // Get the set of Q cuts for a given type (i.e. gamma)
283 {
284  // Find the cuts that for this particle type
285  RecoTauQualityCuts::CandQCutFuncMap::const_iterator cuts = funcMap.find(std::abs(cand.pdgId()));
286  // Return false if we dont' know how to deal with this particle type
287  if ( cuts == funcMap.end() ) return false;
288  return AND_cand(cand, cuts->second); // Otherwise AND all the cuts
289 }
290 
291 } // end qcuts implementation namespace
292 
294 {
295  // Setup all of our predicates
296  CandQCutFuncCollection chargedHadronCuts;
297  CandQCutFuncCollection gammaCuts;
298  CandQCutFuncCollection neutralHadronCuts;
299 
300  // Make sure there are no extra passed options
301  std::set<std::string> passedOptionSet;
302  std::vector<std::string> passedOptions = qcuts.getParameterNames();
303 
304  for(auto const& option : passedOptions) {
305  passedOptionSet.insert(option);
306  }
307 
308  unsigned int nCuts = 0;
309  auto getDouble = [&qcuts, &passedOptionSet, &nCuts](const std::string& name) {
310  if(qcuts.exists(name)) {
311  ++nCuts;
312  passedOptionSet.erase(name);
313  return qcuts.getParameter<double>(name);
314  }
315  return -1.0;
316  };
317  auto getUint = [&qcuts, &passedOptionSet, &nCuts](const std::string& name) -> unsigned int {
318  if(qcuts.exists(name)) {
319  ++nCuts;
320  passedOptionSet.erase(name);
321  return qcuts.getParameter<unsigned int>(name);
322  }
323  return 0;
324  };
325 
326  // Build all the QCuts for tracks
327  minTrackPt_ = getDouble("minTrackPt");
328  maxTrackChi2_ = getDouble("maxTrackChi2");
329  minTrackPixelHits_ = getUint("minTrackPixelHits");
330  minTrackHits_ = getUint("minTrackHits");
331  maxTransverseImpactParameter_ = getDouble("maxTransverseImpactParameter");
332  maxDeltaZ_ = getDouble("maxDeltaZ");
333  maxDeltaZToLeadTrack_ = getDouble("maxDeltaZToLeadTrack");
334  // Require tracks to contribute a minimum weight to the associated vertex.
335  minTrackVertexWeight_ = getDouble("minTrackVertexWeight");
336 
337  // Use bit-wise & to avoid conditional code
338  checkHitPattern_ = (minTrackHits_ > 0) || (minTrackPixelHits_ > 0);
339  checkPV_ = (maxTransverseImpactParameter_ >= 0) ||
340  (maxDeltaZ_ >= 0) ||
341  (maxDeltaZToLeadTrack_ >= 0) ||
342  (minTrackVertexWeight_ >= 0);
343 
344  // Build the QCuts for gammas
345  minGammaEt_ = getDouble("minGammaEt");
346 
347  // Build QCuts for netural hadrons
348  minNeutralHadronEt_ = getDouble("minNeutralHadronEt");
349 
350  // Check if there are any remaining unparsed QCuts
351  if ( !passedOptionSet.empty() ) {
352  std::string unParsedOptions;
353  bool thereIsABadParameter = false;
354  for(auto const& option : passedOptionSet ) {
355  // Workaround for HLT - TODO FIXME
356  if ( option == "useTracksInsteadOfPFHadrons" ) {
357  // Crash if true - no one should have this option enabled.
358  if ( qcuts.getParameter<bool>("useTracksInsteadOfPFHadrons") ) {
359  throw cms::Exception("DontUseTracksInQcuts")
360  << "The obsolete exception useTracksInsteadOfPFHadrons "
361  << "is set to true in the quality cut config." << std::endl;
362  }
363  continue;
364  }
365 
366  // If we get to this point, there is a real unknown parameter
367  thereIsABadParameter = true;
368 
369  unParsedOptions += option;
370  unParsedOptions += "\n";
371  }
372  if ( thereIsABadParameter ) {
373  throw cms::Exception("BadQualityCutConfig")
374  << " The PSet passed to the RecoTauQualityCuts class had"
375  << " the following unrecognized options: " << std::endl
376  << unParsedOptions;
377  }
378  }
379 
380  // Make sure there are at least some quality cuts
381  if ( !nCuts ) {
382  throw cms::Exception("BadQualityCutConfig")
383  << " No options were passed to the quality cut class!" << std::endl;
384  }
385 }
386 
387 std::pair<edm::ParameterSet, edm::ParameterSet> factorizePUQCuts(const edm::ParameterSet& input)
388 {
389  edm::ParameterSet puCuts;
390  edm::ParameterSet nonPUCuts;
391 
392  std::vector<std::string> inputNames = input.getParameterNames();
393  for(auto const& cut : inputNames ) {
394  if ( cut == "minTrackVertexWeight" ||
395  cut == "maxDeltaZ" ||
396  cut == "maxDeltaZToLeadTrack" ) {
397  puCuts.copyFrom(input, cut);
398  } else {
399  nonPUCuts.copyFrom(input, cut);
400  }
401  }
402  return std::make_pair(puCuts, nonPUCuts);
403 }
404 
406 {
407  if (!filterTrack_(track.get()))
408  return false;
409  if(minTrackVertexWeight_ >= 0. && !(pv_->trackWeight(convertRef(track)) >= minTrackVertexWeight_)) return false;
410  return true;
411 }
412 
414 {
415  if (!filterTrack_(track.get()))
416  return false;
417  if(minTrackVertexWeight_ >= 0. && !(pv_->trackWeight(convertRef(track)) >= minTrackVertexWeight_)) return false;
418  return true;
419 }
420 
422 {
423  return filterTrack_(&track);
424 }
425 
427 {
428  if(minTrackPt_ >= 0 && !(track->pt() > minTrackPt_)) return false;
429  if(maxTrackChi2_ >= 0 && !(track->normalizedChi2() <= maxTrackChi2_)) return false;
430  if(checkHitPattern_) {
431  const reco::HitPattern &hitPattern = track->hitPattern();
432  if(minTrackPixelHits_ > 0 && !(hitPattern.numberOfValidPixelHits() >= minTrackPixelHits_)) return false;
433  if(minTrackHits_ > 0 && !(hitPattern.numberOfValidHits() >= minTrackHits_)) return false;
434  }
435  if(checkPV_ && pv_.isNull()) {
436  edm::LogError("QCutsNoPrimaryVertex") << "Primary vertex Ref in " <<
437  "RecoTauQualityCuts is invalid. - filterTrack";
438  return false;
439  }
440 
441  if(maxTransverseImpactParameter_ >= 0 &&
442  !(std::fabs(track->dxy(pv_->position())) <= maxTransverseImpactParameter_))
443  return false;
444  if(maxDeltaZ_ >= 0 && !(std::fabs(track->dz(pv_->position())) <= maxDeltaZ_)) return false;
445  if(maxDeltaZToLeadTrack_ >= 0) {
446  if ( !leadTrack_) {
447  edm::LogError("QCutsNoValidLeadTrack") << "Lead track Ref in " <<
448  "RecoTauQualityCuts is invalid. - filterTrack";
449  return false;
450  }
451 
452  if(!(std::fabs(track->dz(pv_->position()) - leadTrack_->dz(pv_->position())) <= maxDeltaZToLeadTrack_))
453  return false;
454  }
455 
456  return true;
457 }
458 
460 
461  if (cand.charge() == 0)
462  return true;
463  const pat::PackedCandidate* pCand = dynamic_cast<const pat::PackedCandidate*>(&cand);
464  if (pCand == nullptr)
465  return true;
466 
467  //Get track, it should be present for cands with pT(charged)>0.5GeV
468  //and check track quality critera other than vertex weight
469  auto track = getTrack(cand);
470  if (track != nullptr){
471  if (!filterTrack(*track))
472  return false;
473  } else {//Candidates without track (pT(charged)<0.5GeV): Can still check pT and calculate dxy and dz
474  if(minTrackPt_ >= 0 && !(pCand->pt() > minTrackPt_)) return false;
475  if(checkPV_ && pv_.isNull()) {
476  edm::LogError("QCutsNoPrimaryVertex") << "Primary vertex Ref in " <<
477  "RecoTauQualityCuts is invalid. - filterChargedCand";
478  return false;
479  }
480 
481  if(maxTransverseImpactParameter_ >= 0 &&
482  !(std::fabs(pCand->dxy(pv_->position())) <= maxTransverseImpactParameter_))
483  return false;
484  if(maxDeltaZ_ >= 0 && !(std::fabs(pCand->dz(pv_->position())) <= maxDeltaZ_)) return false;
485  if(maxDeltaZToLeadTrack_ >= 0) {
486  if ( leadTrack_ == nullptr) {
487  edm::LogError("QCutsNoValidLeadTrack") << "Lead track Ref in " <<
488  "RecoTauQualityCuts is invalid. - filterChargedCand";
489  return false;
490  }
491 
492  if(!(std::fabs(pCand->dz(pv_->position()) - leadTrack_->dz(pv_->position())) <= maxDeltaZToLeadTrack_))
493  return false;
494  }
495  }
496  if(minTrackVertexWeight_ >= 0. &&
497  !(qcuts::minPackedCandVertexWeight(*pCand, &pv_, minTrackVertexWeight_)))
498  return false;
499 
500  return true;
501 }
502 
504  if(minGammaEt_ >= 0 && !(cand.et() > minGammaEt_)) return false;
505  return true;
506 }
507 
509  if(minNeutralHadronEt_ >= 0 && !(cand.et() > minNeutralHadronEt_)) return false;
510  return true;
511 }
512 
514  switch(std::abs(cand.pdgId())) {
515  case 22:
516  return filterGammaCand(cand);
517  case 130:
518  return filterNeutralHadronCand(cand);
519  // We use the same qcuts for muons/electrons and charged hadrons.
520  case 211:
521  case 11:
522  case 13:
523  // no cuts ATM (track cuts applied in filterCand)
524  return true;
525  // Return false if we dont' know how to deal with this particle type
526  default:
527  return false;
528  };
529  return false;
530 }
531 
533 {
534  auto trackRef = getTrackRef(cand);
535  bool result = true;
536 
537  if (trackRef.isNonnull()) {
538  result = filterTrack(trackRef);
539  }
540  else {
541  auto gsfTrackRef = getGsfTrackRef(cand);
542  if (gsfTrackRef.isNonnull())
543  result = filterTrack(gsfTrackRef);
544  else if (cand.charge() != 0) {
545  result = filterChargedCand(cand);
546  }
547  }
548 
549  if(result)
550  result = filterCandByType(cand);
551 
552  return result;
553 }
554 
556 {
557  leadTrack_ = &leadTrack;
558 }
559 
561 {
562  leadTrack_ = getTrack(leadCand);
563 }
564 
566 {
567  if ( leadCand.isNonnull() ) {
568  leadTrack_ = getTrack(*leadCand);
569  } else {
570  // Set null
571  leadTrack_ = nullptr;
572  }
573 }
574 
575 } // end namespace reco::tau
#define LogDebug(id)
virtual float dz(size_t ipv=0) const
dz with respect to the PV[ipv]
std::map< int, CandQCutFuncCollection > CandQCutFuncMap
value_type const * get() const
Definition: RefToBase.h:234
void setLeadTrack(const reco::Track &leadTrack) const
Update the leading track.
T getParameter(std::string const &) const
bool minTrackVertexWeight(const TrackBaseRef &track, const reco::VertexRef *pv, double cut)
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:251
bool AND_cand(const Candidate &cand, const RecoTauQualityCuts::CandQCutFuncCollection &cuts)
bool trkLongitudinalImpactParameterWrtTrack(const Track *track, const Track *leadTrack, const reco::VertexRef *pv, double cut)
DZ cut, with respect to the current lead rack.
RecoTauQualityCuts(const edm::ParameterSet &qcuts)
double normalizedChi2() const
chi-squared divided by n.d.o.f. (or chi-squared * 1e6 if n.d.o.f. is zero)
Definition: TrackBase.h:600
int numberOfValidHits() const
Definition: HitPattern.h:896
bool exists(std::string const &parameterName) const
checks if a parameter exists
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:684
Definition: weight.py:1
key_type key() const
Accessor for product key.
Definition: Ref.h:263
bool filterCand(const reco::Candidate &cand) const
Filter a single Candidate.
const reco::VertexRef vertexRef() const
InputIterator leadCand(InputIterator begin, InputIterator end)
bool trkPixelHits_cand(const Candidate &cand, int cut)
static std::string const input
Definition: EdmProvDump.cc:48
std::vector< CandQCutFunc > CandQCutFuncCollection
virtual double et() const =0
transverse energy
void copyFrom(ParameterSet const &from, std::string const &name)
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:690
edm::RefToBase< reco::Track > TrackBaseRef
persistent reference to a Track, using views
Definition: TrackFwd.h:36
const PVAssociationQuality pvAssociationQuality() const
virtual int pdgId() const =0
PDG identifier.
bool trkTrackerHits_cand(const Candidate &cand, int cut)
bool filterCandByType(const reco::Candidate &cand) const
double pt() const
track transverse momentum
Definition: TrackBase.h:660
bool ptMin_cand(const Candidate &cand, double cut)
def pv(vc)
Definition: MetAnalyzer.py:7
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool trkChi2_cand(const Candidate &cand, double cut)
virtual const reco::Track & pseudoTrack() const
bool trkChi2(const Track *track, double cut)
double pt() const override
transverse momentum
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:243
std::pair< edm::ParameterSet, edm::ParameterSet > factorizePUQCuts(const edm::ParameterSet &inputSet)
bool trkLongitudinalImpactParameter_cand(const Candidate &cand, const reco::VertexRef *pv, double cut)
std::vector< TrackQCutFunc > TrackQCutFuncCollection
std::vector< std::string > getParameterNames() const
bool etMin_cand(const Candidate &cand, double cut)
bool ptMin(const TrackBaseRef &track, double cut)
bool isNull() const
Checks for null.
Definition: Ref.h:248
bool filterTrack_(const reco::Track *track) const
bool mapAndCutByType(const Candidate &cand, const RecoTauQualityCuts::CandQCutFuncMap &funcMap)
bool hasTrackDetails() const
Return true if a bestTrack can be extracted from this Candidate.
double dz() const
dz parameter (= dsz/cos(lambda)). This is the track z0 w.r.t (0,0,0) only if the refPoint is close to...
Definition: TrackBase.h:648
double eta() const override
momentum pseudorapidity
double phi() const override
momentum azimuthal angle
static const TrackGhostTrackState * getTrack(const BasicGhostTrackState *basic)
bool trkTransverseImpactParameter(const Track *track, const reco::VertexRef *pv, double cut)
bool filterChargedCand(const reco::Candidate &cand) const
or a single charged candidate
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
Definition: TrackBase.h:485
virtual double pt() const =0
transverse momentum
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
Definition: TrackFwd.h:21
bool filterNeutralHadronCand(const reco::Candidate &cand) const
bool trkTrackerHits(const Track *track, int cut)
virtual int charge() const =0
electric charge
bool trkLongitudinalImpactParameterWrtTrack_cand(const Candidate &cand, const reco::Track *leadTrack, const reco::VertexRef *pv, double cut)
bool trkPixelHits(const Track *track, int cut)
bool AND(const TrackBaseRef &track, const RecoTauQualityCuts::TrackQCutFuncCollection &cuts)
int numberOfValidPixelHits() const
Definition: HitPattern.h:916
bool filterGammaCand(const reco::Candidate &cand) const
virtual float dxy() const
dxy with respect to the PV ref
double dxy() const
dxy parameter. (This is the transverse impact parameter w.r.t. to (0,0,0) ONLY if refPoint is close t...
Definition: TrackBase.h:630
long double T
bool trkLongitudinalImpactParameter(const TrackBase *track, const reco::VertexRef *pv, double cut)
bool minPackedCandVertexWeight(const pat::PackedCandidate &pCand, const reco::VertexRef *pv, double cut)
bool filterTrack(const reco::TrackBaseRef &track) const
Filter a single Track.
bool minTrackVertexWeight_cand(const Candidate &cand, const reco::VertexRef *pv, double cut)
bool trkTransverseImpactParameter_cand(const Candidate &cand, const reco::VertexRef *pv, double cut)