CMS 3D CMS Logo

SeedCleanerBySharedInput Class Reference

Copy of SeedCleanerByHitPosition. More...

#include <RecoTracker/CkfPattern/interface/SeedCleanerBySharedInput.h>

Inheritance diagram for SeedCleanerBySharedInput:

RedundantSeedCleaner

List of all members.

Public Member Functions

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

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.


Member Function Documentation

virtual void SeedCleanerBySharedInput::add ( const Trajectory traj  )  [inline, virtual]

In this implementation, it does nothing.

Implements RedundantSeedCleaner.

Definition at line 11 of file SeedCleanerBySharedInput.h.

00011 { }

virtual void SeedCleanerBySharedInput::done (  )  [inline, virtual]

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.

00016 { trajectories = 0; };

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, first, it, prof2calltree::last, range, TrajectorySeed::recHits(), tc, te, and trajectories.

00003                                                               {
00004     typedef TrajectorySeed::const_iterator SI;
00005     typedef Trajectory::RecHitContainer::const_iterator TI;
00006     TrajectorySeed::range range = seed->recHits();
00007     SI first = range.first, curr = range.first, last = range.second;
00008 //     for (std::vector<Trajectory>::const_iterator trj = trajectories->begin(),
00009 //             trjEnd =trajectories->end();
00010 //             trj != trjEnd; ++trj) {
00011 // Try reverse direction (possible gain in speed)
00012     for (std::vector<Trajectory>::const_reverse_iterator trj = trajectories->rbegin(),
00013             trjEnd =trajectories->rend();
00014             trj != trjEnd; ++trj) {
00015         Trajectory::RecHitContainer hits = trj->recHits();
00016         TI ts = hits.begin(), tc = ts, te = hits.end();
00017         for (curr = first; curr < last; ++curr) {
00018             bool found = false;
00019             for (TI it = tc; it != te; ++it) {
00020               if ( curr->sharesInput((**it).hit(),TrackingRecHit::all) ) {
00021                     tc = it; found = true; break;         
00022                 }
00023             }
00024             if (found == false) {
00025                 for (TI it = ts; it != tc; ++it) {
00026                   if ( curr->sharesInput((**it).hit(),TrackingRecHit::all) ) {
00027                         tc = it; found = true; break;         
00028                     }
00029                 }
00030                 if (found == false) break;
00031             }
00032         }
00033         if (curr == last)  return false;   
00034     }
00035     return true;
00036 }

virtual void SeedCleanerBySharedInput::init ( const std::vector< Trajectory > *  vect  )  [inline, virtual]

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.

00014 { trajectories = vect; }


Member Data Documentation

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

Definition at line 24 of file SeedCleanerBySharedInput.h.

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


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:31:15 2009 for CMSSW by  doxygen 1.5.4