CMS 3D CMS Logo

Public Member Functions | Private Attributes

RedundantSeedCleaner Class Reference

#include <RedundantSeedCleaner.h>

Inheritance diagram for RedundantSeedCleaner:
CachingSeedCleanerByHitPosition CachingSeedCleanerBySharedInput SeedCleanerByHitPosition SeedCleanerBySharedInput

List of all members.

Public Member Functions

virtual void add (const Trajectory *traj)=0
 Informs the cleaner that a new trajectory has been made, in case the cleaner keeps a local collection of those tracks (i.e. in a map)
void clean (const std::vector< TrajectorySeed > &, std::vector< TrajectorySeed > &)
 clean
void define (std::vector< TrajectorySeed > &)
 collection definition
virtual void done ()=0
 Tells the cleaner that the seeds are finished, and so it can clear any cache it has.
virtual bool good (const TrajectorySeed *seed)=0
 Returns true if the seed is not overlapping with another trajectory.
virtual void init (const std::vector< Trajectory > *vect)=0
 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.
 RedundantSeedCleaner ()
 constructor
 ~RedundantSeedCleaner ()
 destructor
virtual ~RedundantSeedCleaner ()

Private Attributes

std::vector< TrajectorySeedseedTriplets
std::string theCategory

Detailed Description

Description: RedundantSeedCleaner (TrackerSeedGenerator) duplicate removal from triplets pairs pixel seeds .

Author:
Alessandro Grelli, Jean-Roch Vlimant

Definition at line 22 of file RedundantSeedCleaner.h.


Constructor & Destructor Documentation

RedundantSeedCleaner::RedundantSeedCleaner ( ) [inline]

constructor

Definition at line 25 of file RedundantSeedCleaner.h.

                        {

  }
RedundantSeedCleaner::~RedundantSeedCleaner ( ) [inline]

destructor

Definition at line 29 of file RedundantSeedCleaner.h.

                         {
   }
virtual RedundantSeedCleaner::~RedundantSeedCleaner ( ) [inline, virtual]

Definition at line 9 of file RedundantSeedCleaner.h.

{}

Member Function Documentation

virtual void RedundantSeedCleaner::add ( const Trajectory traj) [pure virtual]

Informs the cleaner that a new trajectory has been made, in case the cleaner keeps a local collection of those tracks (i.e. in a map)

Implemented in CachingSeedCleanerByHitPosition, CachingSeedCleanerBySharedInput, SeedCleanerByHitPosition, and SeedCleanerBySharedInput.

Referenced by cms::CkfTrackCandidateMakerBase::produceBase(), OutInConversionTrackFinder::tracks(), and InOutConversionTrackFinder::tracks().

void RedundantSeedCleaner::clean ( const std::vector< TrajectorySeed > &  seedTr,
std::vector< TrajectorySeed > &  seed 
)

clean

Definition at line 49 of file RedundantSeedCleaner.cc.

References TrackingRecHit::all, LogDebug, query::result, and indexGen::s2.

{

    // loop over triplets
    std::vector<TrajectorySeed> result;

    std::vector<bool> maskPairs = std::vector<bool>(seed.size(),true);
    int iPair = 0;

    for(TrajectorySeedCollection::iterator s1 =seed.begin(); s1 != seed.end(); ++s1){
       //rechits from seed

       TrajectorySeed::range r1 = s1->recHits();

       for(TrajectorySeedCollection::const_iterator s2 = seedTr.begin(); s2 != seedTr.end(); ++s2){
          //empty
          if(s2->nHits()==0) continue ;

          TrajectorySeed::range r2 = s2->recHits();
          TrajectorySeed::const_iterator h2 = r2.first;

          //number of shared hits;
          int shared = 0;
 
          for(;h2 < r2.second;h2++){
            for(TrajectorySeed::const_iterator h1  = r1.first; h1 < r1.second;h1++){
               if(h2->sharesInput(&(*h1),TrackingRecHit::all)) shared++;
               if(s1->nHits()!=3) LogDebug(theCategory)<< shared<< " shared hits counter if 2 erease the seed.";
            }
          }
          
          if(shared ==2 && s1->nHits()!=3) {
             maskPairs[iPair] = false;
          }

       }//end triplets loop
       ++iPair;
     }// end pairs loop

     iPair = 0;
     //remove pairs in triplets
     for(TrajectorySeedCollection::iterator s1 = seed.begin(); s1 != seed.end(); ++s1){
        if (maskPairs[iPair]) result.push_back(*s1);
        ++iPair;
     }

     // cleaned collection
      seed.swap(result);
}
void RedundantSeedCleaner::define ( std::vector< TrajectorySeed > &  coll)

collection definition

Definition at line 29 of file RedundantSeedCleaner.cc.

References clean.

{

  std::vector<TrajectorySeed> triplets;
  
  //search for triplest
  for(TrajectorySeedCollection::iterator itr =coll.begin(); itr != coll.end(); ++itr){
      //fill vector of triplets
      if(itr->nHits()==3) triplets.push_back(*itr);
      
   }

  // clean from shared input
  if (!triplets.empty()) clean(triplets,coll);
}
virtual void RedundantSeedCleaner::done ( ) [pure virtual]
virtual bool RedundantSeedCleaner::good ( const TrajectorySeed seed) [pure virtual]
virtual void RedundantSeedCleaner::init ( const std::vector< Trajectory > *  vect) [pure 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.

Implemented in CachingSeedCleanerByHitPosition, CachingSeedCleanerBySharedInput, SeedCleanerByHitPosition, and SeedCleanerBySharedInput.

Referenced by cms::CkfTrackCandidateMakerBase::produceBase(), InOutConversionTrackFinder::tracks(), and OutInConversionTrackFinder::tracks().


Member Data Documentation

Definition at line 38 of file RedundantSeedCleaner.h.

std::string RedundantSeedCleaner::theCategory [private]

Definition at line 40 of file RedundantSeedCleaner.h.