CMS 3D CMS Logo

SeedCleanerBySharedInput.cc
Go to the documentation of this file.
2 
5  typedef Trajectory::RecHitContainer::const_iterator TI;
6  TrajectorySeed::range range = seed->recHits();
7  SI first = range.first, curr = range.first, last = range.second;
8 // for (std::vector<Trajectory>::const_iterator trj = trajectories->begin(),
9 // trjEnd =trajectories->end();
10 // trj != trjEnd; ++trj) {
11 // Try reverse direction (possible gain in speed)
12  for (std::vector<Trajectory>::const_reverse_iterator trj = trajectories->rbegin(),
13  trjEnd =trajectories->rend();
14  trj != trjEnd; ++trj) {
15  Trajectory::RecHitContainer hits = trj->recHits();
16  TI ts = hits.begin(), tc = ts, te = hits.end();
17  for (curr = first; curr < last; ++curr) {
18  bool found = false;
19  for (TI it = tc; it != te; ++it) {
20  if ( curr->sharesInput((**it).hit(),TrackingRecHit::all) ) {
21  tc = it; found = true; break;
22  }
23  }
24  if (found == false) {
25  for (TI it = ts; it != tc; ++it) {
26  if ( curr->sharesInput((**it).hit(),TrackingRecHit::all) ) {
27  tc = it; found = true; break;
28  }
29  }
30  if (found == false) break;
31  }
32  }
33  if (curr == last) return false;
34  }
35  return true;
36 }
virtual bool good(const TrajectorySeed *seed)
Returns true if the seed is not overlapping with another trajectory.
recHitContainer::const_iterator const_iterator
std::pair< const_iterator, const_iterator > range
ConstRecHitContainer RecHitContainer
Definition: Trajectory.h:46
range recHits() const
const std::vector< Trajectory > * trajectories