CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
FastTrajectoryCleaner.cc
Go to the documentation of this file.
3  edm::LogError("FastTrajectoryCleaner") << "not implemented for Trajectory";
4  assert(false);
5 }
6 
8  if (tc.size() <= 1)
9  return; // nothing to clean
10  float maxScore = -std::numeric_limits<float>::max();
11  TempTrajectory* bestTr = nullptr;
12  for (auto& it : tc) {
13  if (!it.isValid())
14  continue;
15  auto const& pd = it.measurements();
16  // count active degree of freedom
17  int dof = 0;
18  for (auto const& im : pd) {
19  if (dismissSeed_ & (im.estimate() == 0))
20  continue;
21  auto const& h = im.recHitR();
22  if (!h.isValid())
23  continue;
24  dof += h.dimension();
25  }
26  float score = validHitBonus_ * float(dof) - missingHitPenalty_ * it.lostHits() - it.chiSquared();
27  if (it.lastMeasurement().updatedState().globalMomentum().perp2() < 0.81f)
28  score -= 0.5f * validHitBonus_ * float(dof);
29  else if (it.dPhiCacheForLoopersReconstruction() == 0 && it.foundHits() > 8)
30  score += validHitBonus_ * float(dof); // extra bonus for long tracks
31  if (score >= maxScore) {
32  bestTr = &it;
33  maxScore = score;
34  }
35  }
36 
37  for (auto& it : tc) {
38  if ((&it) != bestTr)
39  it.invalidate();
40  }
41 }
42 
43 /*
44  auto score = [&](Trajectory const&t)->float {
45  // possible variant under study
46  // auto ns = t.foundHits()-t.trailingFoundHits();
47  //auto penalty = 0.8f*missingHitPenalty_;
48  // return validHitBonus_*(t.foundHits()-0.2f*t.cccBadHits()) - penalty*t.lostHits() - t.chiSquared();
49  // classical score
50  return validHitBonus_*t.foundHits() - missingHitPenalty_*t.lostHits() - t.chiSquared();
51  };
52 */
const DataContainer & measurements() const
Log< level::Error, false > LogError
assert(be >=bs)
TrajectoryCleaner::TempTrajectoryContainer TempTrajectoryContainer
void invalidate()
Method to invalidate a trajectory. Useful during ambiguity resolution.
TrajectoryCleaner::TrajectoryPointerContainer TrajectoryPointerContainer
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
void clean(TempTrajectoryContainer &) const override