CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
SeedCleanerBySharedInput Class Reference

#include <SeedCleanerBySharedInput.h>

Inheritance diagram for SeedCleanerBySharedInput:
RedundantSeedCleaner

Public Member Functions

void add (const Trajectory *traj) override
 
void done () override
 Tells the cleaner that the seeds are finished, and so it can clear any cache it has. More...
 
bool good (const TrajectorySeed *seed) override
 Returns true if the seed is not overlapping with another trajectory. More...
 
void init (const std::vector< Trajectory > *vect) override
 Provides the cleaner a pointer to the vector where trajectories are stored, in case it does not want to keep a local collection of trajectories. More...
 
 SeedCleanerBySharedInput ()
 
- Public Member Functions inherited from RedundantSeedCleaner
void clean (const std::vector< TrajectorySeed > &, std::vector< TrajectorySeed > &)
 clean More...
 
void define (std::vector< TrajectorySeed > &)
 collection definition More...
 
 RedundantSeedCleaner ()
 constructor More...
 
virtual ~RedundantSeedCleaner ()
 
 ~RedundantSeedCleaner ()
 destructor More...
 

Private Attributes

const std::vector< Trajectory > * trajectories
 

Detailed Description

Copy of SeedCleanerByHitPosition. Difference: uses sharedInput method of TrackingRecHit to determine equality.

Definition at line 8 of file SeedCleanerBySharedInput.h.

Constructor & Destructor Documentation

SeedCleanerBySharedInput::SeedCleanerBySharedInput ( )
inline

Definition at line 22 of file SeedCleanerBySharedInput.h.

22 : RedundantSeedCleaner(), trajectories(nullptr) {}
RedundantSeedCleaner()
constructor
const std::vector< Trajectory > * trajectories

Member Function Documentation

void SeedCleanerBySharedInput::add ( const Trajectory traj)
inlineoverridevirtual

In this implementation, it does nothing

Implements RedundantSeedCleaner.

Definition at line 11 of file SeedCleanerBySharedInput.h.

Referenced by counter.Counter::register().

11 { }
void SeedCleanerBySharedInput::done ( )
inlineoverridevirtual

Tells the cleaner that the seeds are finished, and so it can clear any cache it has.

Implements RedundantSeedCleaner.

Definition at line 16 of file SeedCleanerBySharedInput.h.

References good(), SurveyInfoScenario_cff::seed, and trajectories.

16 { trajectories = nullptr; };
const std::vector< Trajectory > * trajectories
bool SeedCleanerBySharedInput::good ( const TrajectorySeed seed)
overridevirtual

Returns true if the seed is not overlapping with another trajectory.

Implements RedundantSeedCleaner.

Definition at line 3 of file SeedCleanerBySharedInput.cc.

References TrackingRecHit::all, plotBeamSpotDB::first, runEdmFileComparison::found, hfClusterShapes_cfi::hits, plotBeamSpotDB::last, TrajectorySeed::recHits(), and trajectories.

Referenced by done().

3  {
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 }
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
void SeedCleanerBySharedInput::init ( const std::vector< Trajectory > *  vect)
inlineoverridevirtual

Provides the cleaner a pointer to the vector where trajectories are stored, in case it does not want to keep a local collection of trajectories.

Implements RedundantSeedCleaner.

Definition at line 14 of file SeedCleanerBySharedInput.h.

References trajectories.

14 { trajectories = vect; }
const std::vector< Trajectory > * trajectories

Member Data Documentation

const std::vector<Trajectory>* SeedCleanerBySharedInput::trajectories
private

Definition at line 24 of file SeedCleanerBySharedInput.h.

Referenced by done(), good(), and init().