test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
SeedCleanerBySharedInput Class Reference

#include <SeedCleanerBySharedInput.h>

Inheritance diagram for SeedCleanerBySharedInput:
RedundantSeedCleaner

Public Member Functions

virtual void add (const Trajectory *traj)
 
virtual void done ()
 Tells the cleaner that the seeds are finished, and so it can clear any cache it has. More...
 
virtual bool good (const TrajectorySeed *seed)
 Returns true if the seed is not overlapping with another trajectory. More...
 
virtual void init (const std::vector< Trajectory > *vect)
 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.

RedundantSeedCleaner()
constructor
const std::vector< Trajectory > * trajectories

Member Function Documentation

virtual void SeedCleanerBySharedInput::add ( const Trajectory traj)
inlinevirtual

In this implementation, it does nothing

Implements RedundantSeedCleaner.

Definition at line 11 of file SeedCleanerBySharedInput.h.

Referenced by counter.Counter::register().

11 { }
virtual void SeedCleanerBySharedInput::done ( )
inlinevirtual

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 trajectories.

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

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, newFWLiteAna::found, plotBeamSpotDB::last, TrajectorySeed::recHits(), and trajectories.

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
virtual void SeedCleanerBySharedInput::init ( const std::vector< Trajectory > *  vect)
inlinevirtual

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().