CMS 3D CMS Logo

Namespaces | Functions
PFTrackAlgoTools Namespace Reference

Namespaces

 cms
 
 edm
 

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 5 of file PFTrackAlgoTools.cc.

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

5  {
6  switch (algo) {
15  return cuts[0];
18  return cuts[1];
20  return cuts[2];
22  return cuts[3];
24  return cuts[4];
27  return cuts.at(5);
31  return cuts[0];
33  return hltIterativeTracking ? cuts[1] : cuts[0];
35  return hltIterativeTracking ? cuts[2] : cuts[0];
37  return cuts[0];
38  default:
39  return hltIterativeTracking ? cuts.at(5):cuts[0];
40 
41  }
42  }
double PFTrackAlgoTools::errorScale ( const reco::TrackBase::TrackAlgorithm algo,
const std::vector< double > &  errorScale 
)

Definition at line 87 of file PFTrackAlgoTools.cc.

Referenced by PFAlgo::processBlock().

87  {
88  switch (algo) {
108  return 1.0;
110  return errorScale[0];
112  return errorScale[1];
113  default:
114  return 1E9;
115  }
116  }
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.

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)
bool PFTrackAlgoTools::isFifthStep ( const reco::TrackBase::TrackAlgorithm algo)

Definition at line 169 of file PFTrackAlgoTools.cc.

References reco::TrackBase::ctf, reco::TrackBase::duplicateMerge, reco::TrackBase::highPtTripletStep, reco::TrackBase::initialStep, and reco::TrackBase::lowPtQuadStep.

Referenced by PFElecTkProducer::produce().

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

Definition at line 119 of file PFTrackAlgoTools.cc.

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

119  {
120 
121 
122  switch (algo) {
142  return true;
143  default:
144  return false;
145  }
146 
147 }
bool PFTrackAlgoTools::isGoodForEGMPrimary ( const reco::TrackBase::TrackAlgorithm algo)
unsigned int PFTrackAlgoTools::nHitCut ( const reco::TrackBase::TrackAlgorithm algo,
const std::vector< unsigned int > &  cuts,
bool  hltIterativeTracking = true 
)

Definition at line 46 of file PFTrackAlgoTools.cc.

46  {
47  switch (algo) {
56  return cuts[0];
59  return cuts[1];
61  return cuts[2];
63  return cuts[3];
65  return cuts[4];
68  return cuts.at(5);
72  return cuts[0];
74  return hltIterativeTracking ? cuts[1] : cuts[0];
76  return hltIterativeTracking ? cuts[2] : cuts[0];
78  return cuts[0];
79  default:
80  return hltIterativeTracking ? cuts.at(5):cuts[0];
81 
82  }
83  }
bool PFTrackAlgoTools::nonIterative ( const reco::TrackBase::TrackAlgorithm algo)

Definition at line 220 of file PFTrackAlgoTools.cc.

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

Referenced by PFDisplacedVertexFinder::fitVertexFromSeed().

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