CMS 3D CMS Logo

Functions
PFTrackAlgoTools Namespace Reference

Functions

double dPtCut (const reco::TrackBase::TrackAlgorithm &, const std::vector< double > &, bool)
 
double errorScale (const reco::TrackBase::TrackAlgorithm &, const std::vector< double > &)
 
bool goodPtResolution (const reco::TrackRef &, const std::vector< double > &DPtovPtCut, const std::vector< unsigned > &NHitCut, bool useIterTracking, bool debug=false)
 
bool highQuality (const reco::TrackBase::TrackAlgorithm &)
 
bool isFifthStep (const reco::TrackBase::TrackAlgorithm &)
 
bool isGoodForEGM (const reco::TrackBase::TrackAlgorithm &)
 
bool isGoodForEGMPrimary (const reco::TrackBase::TrackAlgorithm &)
 
unsigned int nHitCut (const reco::TrackBase::TrackAlgorithm &, const std::vector< unsigned int > &, bool)
 
bool nonIterative (const reco::TrackBase::TrackAlgorithm &)
 
bool step45 (const reco::TrackBase::TrackAlgorithm &)
 
bool step5 (const reco::TrackBase::TrackAlgorithm &)
 

Function Documentation

double PFTrackAlgoTools::dPtCut ( const reco::TrackBase::TrackAlgorithm algo,
const std::vector< double > &  cuts,
bool  hltIterativeTracking = true 
)

Definition at line 6 of file PFTrackAlgoTools.cc.

References reco::TrackBase::ctf, reco::TrackBase::detachedQuadStep, reco::TrackBase::detachedTripletStep, reco::TrackBase::duplicateMerge, reco::TrackBase::highPtTripletStep, reco::TrackBase::hltIter0, reco::TrackBase::hltIter1, reco::TrackBase::hltIter2, reco::TrackBase::hltIter3, reco::TrackBase::hltIter4, reco::TrackBase::hltIterX, reco::TrackBase::initialStep, reco::TrackBase::jetCoreRegionalStep, reco::TrackBase::lowPtQuadStep, reco::TrackBase::lowPtTripletStep, reco::TrackBase::mixedTripletStep, reco::TrackBase::muonSeededStepInOut, reco::TrackBase::muonSeededStepOutIn, reco::TrackBase::pixelLessStep, reco::TrackBase::pixelPairStep, and reco::TrackBase::tobTecStep.

Referenced by goodPtResolution().

6  {
7  switch (algo) {
16  return cuts[0];
19  return cuts[1];
21  return cuts[2];
23  return cuts[3];
25  return cuts[4];
28  return cuts.at(5);
32  return cuts[0];
34  return hltIterativeTracking ? cuts[1] : cuts[0];
36  return hltIterativeTracking ? cuts[2] : cuts[0];
38  return cuts[0];
39  default:
40  return hltIterativeTracking ? cuts.at(5):cuts[0];
41 
42  }
43  }
double PFTrackAlgoTools::errorScale ( const reco::TrackBase::TrackAlgorithm algo,
const std::vector< double > &  errorScale 
)

Definition at line 88 of file PFTrackAlgoTools.cc.

References reco::TrackBase::ctf, reco::TrackBase::detachedQuadStep, reco::TrackBase::detachedTripletStep, reco::TrackBase::duplicateMerge, reco::TrackBase::highPtTripletStep, reco::TrackBase::hltIter0, reco::TrackBase::hltIter1, reco::TrackBase::hltIter2, reco::TrackBase::hltIter3, reco::TrackBase::hltIter4, reco::TrackBase::hltIterX, reco::TrackBase::initialStep, reco::TrackBase::jetCoreRegionalStep, reco::TrackBase::lowPtQuadStep, reco::TrackBase::lowPtTripletStep, reco::TrackBase::mixedTripletStep, reco::TrackBase::muonSeededStepInOut, reco::TrackBase::muonSeededStepOutIn, reco::TrackBase::pixelLessStep, reco::TrackBase::pixelPairStep, and reco::TrackBase::tobTecStep.

Referenced by PFAlgo::processBlock().

88  {
89  switch (algo) {
109  return 1.0;
111  return errorScale[0];
113  return errorScale[1];
114  default:
115  return 1E9;
116  }
117  }
bool PFTrackAlgoTools::goodPtResolution ( const reco::TrackRef trackref,
const std::vector< double > &  DPtovPtCut,
const std::vector< unsigned > &  NHitCut,
bool  useIterTracking,
bool  debug = false 
)

Definition at line 252 of file PFTrackAlgoTools.cc.

References dPtCut(), reco::TrackBase::highPurity, LogDebug, electrons_cff::lostHits, nHitCut(), AlCaHLTBitMon_ParallelJobs::p, PVValHelper::pT, mathSSE::sqrt(), and reco::HitPattern::TRACK_HITS.

Referenced by GeneralTracksImporter::importToBlock(), GeneralTracksImporterWithVeto::importToBlock(), and HGCalTrackCollectionProducer::produce().

256  {
257  //recheck that the track is high purity!
258  if (!trackref->quality(reco::TrackBase::highPurity))
259  return false;
260 
261  const double p = trackref->p();
262  const double pT = trackref->pt();
263  const double dpT = trackref->ptError();
264  const unsigned int nHit =
265  trackref->hitPattern().trackerLayersWithMeasurement();
266  const unsigned int nLostHit =
267  trackref->hitPattern().trackerLayersWithoutMeasurement(reco::HitPattern::TRACK_HITS);
268  const unsigned int lostHits = trackref->numberOfLostHits();
269  const double sigmaHad = std::sqrt(1.20*1.20/p+0.06*0.06) / (1.+lostHits);
270 
271  // Protection against 0 momentum tracks
272  if ( p < 0.05 ) return false;
273 
274  LogDebug("goodPtResolution") << " PFBlockAlgo: PFrecTrack->Track Pt= "
275  << pT << " DPt = " << dpT << std::endl;
276 
277 
278  double dptCut = dPtCut(trackref->algo(),DPtovPtCut,useIterTracking);
279  unsigned int nhitCut = nHitCut(trackref->algo(),NHitCut,useIterTracking);
280 
281  if ( ( dptCut > 0. &&
282  dpT/pT > dptCut*sigmaHad ) ||
283  nHit < nhitCut ) {
284  LogDebug("goodPtResolution") << " PFBlockAlgo: skip badly measured track"
285  << ", P = " << p
286  << ", Pt = " << pT
287  << " DPt = " << dpT
288  << ", N(hits) = " << nHit
289  << " (Lost : " << lostHits << "/" << nLostHit << ")"
290  << ", Algo = " << trackref->algo()
291  << std::endl;
292  LogDebug("goodPtResolution") << " cut is DPt/Pt < " << dptCut * sigmaHad << std::endl;
293  LogDebug("goodPtResolution") << " cut is NHit >= " << nhitCut << std::endl;
294  return false;
295  }
296 
297  return true;
298 }
#define LogDebug(id)
unsigned int nHitCut(const reco::TrackBase::TrackAlgorithm &, const std::vector< unsigned int > &, bool)
T sqrt(T t)
Definition: SSEVec.h:18
double dPtCut(const reco::TrackBase::TrackAlgorithm &, const std::vector< double > &, bool)
bool PFTrackAlgoTools::highQuality ( const reco::TrackBase::TrackAlgorithm algo)

Definition at line 202 of file PFTrackAlgoTools.cc.

References reco::TrackBase::detachedQuadStep, reco::TrackBase::detachedTripletStep, reco::TrackBase::duplicateMerge, reco::TrackBase::highPtTripletStep, reco::TrackBase::initialStep, reco::TrackBase::jetCoreRegionalStep, reco::TrackBase::lowPtQuadStep, reco::TrackBase::lowPtTripletStep, and reco::TrackBase::pixelPairStep.

Referenced by PFDisplacedVertexFinder::fitVertexFromSeed().

bool PFTrackAlgoTools::isFifthStep ( const reco::TrackBase::TrackAlgorithm algo)

Definition at line 170 of file PFTrackAlgoTools.cc.

References reco::TrackBase::ctf, reco::TrackBase::detachedQuadStep, reco::TrackBase::detachedTripletStep, reco::TrackBase::duplicateMerge, reco::TrackBase::highPtTripletStep, reco::TrackBase::hltIter0, reco::TrackBase::hltIter1, reco::TrackBase::hltIter2, reco::TrackBase::hltIter3, reco::TrackBase::hltIter4, reco::TrackBase::hltIterX, reco::TrackBase::initialStep, reco::TrackBase::jetCoreRegionalStep, reco::TrackBase::lowPtQuadStep, reco::TrackBase::lowPtTripletStep, reco::TrackBase::mixedTripletStep, reco::TrackBase::muonSeededStepInOut, reco::TrackBase::muonSeededStepOutIn, reco::TrackBase::pixelLessStep, reco::TrackBase::pixelPairStep, and reco::TrackBase::tobTecStep.

Referenced by PFElecTkProducer::produce().

170  {
171  switch (algo) {
192  return false;
194  return true;
195  default:
196  return true;
197  }
198 
199 }
bool PFTrackAlgoTools::isGoodForEGM ( const reco::TrackBase::TrackAlgorithm algo)

Definition at line 120 of file PFTrackAlgoTools.cc.

References reco::TrackBase::ctf, reco::TrackBase::detachedQuadStep, reco::TrackBase::detachedTripletStep, reco::TrackBase::duplicateMerge, reco::TrackBase::highPtTripletStep, reco::TrackBase::hltIter0, reco::TrackBase::hltIter1, reco::TrackBase::hltIter2, reco::TrackBase::hltIter3, reco::TrackBase::hltIter4, reco::TrackBase::hltIterX, reco::TrackBase::initialStep, reco::TrackBase::jetCoreRegionalStep, reco::TrackBase::lowPtQuadStep, reco::TrackBase::lowPtTripletStep, reco::TrackBase::mixedTripletStep, reco::TrackBase::muonSeededStepInOut, reco::TrackBase::muonSeededStepOutIn, and reco::TrackBase::pixelPairStep.

Referenced by PFEGammaFilters::isElectronSafeForJetMET(), PFElectronAlgo::SetIDOutputs(), PFElectronAlgo::SetLinks(), and PFEGammaAlgo::unlinkRefinableObjectKFandECALMatchedToHCAL().

120  {
121 
122 
123  switch (algo) {
143  return true;
144  default:
145  return false;
146  }
147 
148 }
bool PFTrackAlgoTools::isGoodForEGMPrimary ( const reco::TrackBase::TrackAlgorithm algo)

Definition at line 150 of file PFTrackAlgoTools.cc.

References reco::TrackBase::cosmics, reco::TrackBase::ctf, reco::TrackBase::detachedQuadStep, reco::TrackBase::detachedTripletStep, reco::TrackBase::duplicateMerge, reco::TrackBase::highPtTripletStep, reco::TrackBase::initialStep, reco::TrackBase::lowPtQuadStep, reco::TrackBase::lowPtTripletStep, reco::TrackBase::mixedTripletStep, and reco::TrackBase::pixelPairStep.

Referenced by PFEGammaAlgo::removeOrLinkECALClustersToKFTracks().

unsigned int PFTrackAlgoTools::nHitCut ( const reco::TrackBase::TrackAlgorithm algo,
const std::vector< unsigned int > &  cuts,
bool  hltIterativeTracking = true 
)

Definition at line 47 of file PFTrackAlgoTools.cc.

References reco::TrackBase::ctf, reco::TrackBase::detachedQuadStep, reco::TrackBase::detachedTripletStep, reco::TrackBase::duplicateMerge, reco::TrackBase::highPtTripletStep, reco::TrackBase::hltIter0, reco::TrackBase::hltIter1, reco::TrackBase::hltIter2, reco::TrackBase::hltIter3, reco::TrackBase::hltIter4, reco::TrackBase::hltIterX, reco::TrackBase::initialStep, reco::TrackBase::jetCoreRegionalStep, reco::TrackBase::lowPtQuadStep, reco::TrackBase::lowPtTripletStep, reco::TrackBase::mixedTripletStep, reco::TrackBase::muonSeededStepInOut, reco::TrackBase::muonSeededStepOutIn, reco::TrackBase::pixelLessStep, reco::TrackBase::pixelPairStep, and reco::TrackBase::tobTecStep.

Referenced by goodPtResolution().

47  {
48  switch (algo) {
57  return cuts[0];
60  return cuts[1];
62  return cuts[2];
64  return cuts[3];
66  return cuts[4];
69  return cuts.at(5);
73  return cuts[0];
75  return hltIterativeTracking ? cuts[1] : cuts[0];
77  return hltIterativeTracking ? cuts[2] : cuts[0];
79  return cuts[0];
80  default:
81  return hltIterativeTracking ? cuts.at(5):cuts[0];
82 
83  }
84  }
bool PFTrackAlgoTools::nonIterative ( const reco::TrackBase::TrackAlgorithm algo)

Definition at line 221 of file PFTrackAlgoTools.cc.

References reco::TrackBase::cosmics, reco::TrackBase::ctf, and reco::TrackBase::undefAlgorithm.

Referenced by PFDisplacedVertexFinder::fitVertexFromSeed().

221  {
222  switch (algo) {
226  return true;
227  default:
228  return false;
229 
230  }
231 
232 }
bool PFTrackAlgoTools::step45 ( const reco::TrackBase::TrackAlgorithm algo)
bool PFTrackAlgoTools::step5 ( const reco::TrackBase::TrackAlgorithm algo)