CMS 3D CMS Logo

Public Member Functions | Private Attributes

SeedCleanerBySharedInput Class Reference

#include <SeedCleanerBySharedInput.h>

Inheritance diagram for SeedCleanerBySharedInput:
RedundantSeedCleaner

List of all members.

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

{ }
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.

{ 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 cond::ecalcond::all, first, newFWLiteAna::found, prof2calltree::last, TrajectorySeed::recHits(), and trajectories.

                                                              {
    typedef TrajectorySeed::const_iterator SI;
    typedef Trajectory::RecHitContainer::const_iterator TI;
    TrajectorySeed::range range = seed->recHits();
    SI first = range.first, curr = range.first, last = range.second;
//     for (std::vector<Trajectory>::const_iterator trj = trajectories->begin(),
//             trjEnd =trajectories->end();
//             trj != trjEnd; ++trj) {
// Try reverse direction (possible gain in speed)
    for (std::vector<Trajectory>::const_reverse_iterator trj = trajectories->rbegin(),
            trjEnd =trajectories->rend();
            trj != trjEnd; ++trj) {
        Trajectory::RecHitContainer hits = trj->recHits();
        TI ts = hits.begin(), tc = ts, te = hits.end();
        for (curr = first; curr < last; ++curr) {
            bool found = false;
            for (TI it = tc; it != te; ++it) {
              if ( curr->sharesInput((**it).hit(),TrackingRecHit::all) ) {
                    tc = it; found = true; break;         
                }
            }
            if (found == false) {
                for (TI it = ts; it != tc; ++it) {
                  if ( curr->sharesInput((**it).hit(),TrackingRecHit::all) ) {
                        tc = it; found = true; break;         
                    }
                }
                if (found == false) break;
            }
        }
        if (curr == last)  return false;   
    }
    return true;
}
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.

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