CMS 3D CMS Logo

FastTrajectoryCleaner.cc
Go to the documentation of this file.
3 {
4  edm::LogError("FastTrajectoryCleaner") << "not implemented for Trajectory";
5  assert(false);
6 }
7 
9 {
10 
11  if (tc.size() <= 1) return; // nothing to clean
12  float maxScore= -std::numeric_limits<float>::max();
13  TempTrajectory * bestTr = nullptr;
14  for (auto & it : tc) {
15  if (!it.isValid()) continue;
16  auto const & pd = it.measurements();
17  // count active degree of freedom
18  int dof=0;
19  for (auto const & im : pd) {
20  if(dismissSeed_ & (im.estimate()==0)) continue;
21  auto const & h = im.recHitR();
22  if (!h.isValid()) continue;
23  dof+=h.dimension();
24  }
25  float score = validHitBonus_*float(dof) - missingHitPenalty_*it.lostHits() - it.chiSquared();
26  if ( it.lastMeasurement().updatedState().globalMomentum().perp2() < 0.81f ) score -= 0.5f*validHitBonus_*float(dof);
27  else if (it.dPhiCacheForLoopersReconstruction()==0 &&it.foundHits()>8) score+=validHitBonus_*float(dof); // extra bonus for long tracks
28  if (score>=maxScore) {
29  bestTr = &it;
30  maxScore = score;
31  }
32  }
33 
34  for (auto & it : tc) {
35  if ((&it)!=bestTr) it.invalidate();
36  }
37 
38 
39 }
40 
41 /*
42  auto score = [&](Trajectory const&t)->float {
43  // possible variant under study
44  // auto ns = t.foundHits()-t.trailingFoundHits();
45  //auto penalty = 0.8f*missingHitPenalty_;
46  // return validHitBonus_*(t.foundHits()-0.2f*t.cccBadHits()) - penalty*t.lostHits() - t.chiSquared();
47  // classical score
48  return validHitBonus_*t.foundHits() - missingHitPenalty_*t.lostHits() - t.chiSquared();
49  };
50 */
void clean(TempTrajectoryContainer &) const override
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
const DataContainer & measurements() const
TrajectoryCleaner::TempTrajectoryContainer TempTrajectoryContainer
double f[11][100]
TrajectoryCleaner::TrajectoryPointerContainer TrajectoryPointerContainer