CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
RedundantSeedCleaner Class Referenceabstract

#include <RedundantSeedCleaner.h>

Inheritance diagram for RedundantSeedCleaner:
CachingSeedCleanerBySharedInput

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) More...
 
void clean (const std::vector< TrajectorySeed > &, std::vector< TrajectorySeed > &)
 clean More...
 
void define (std::vector< TrajectorySeed > &)
 collection definition More...
 
virtual void done ()=0
 Tells the cleaner that the seeds are finished, and so it can clear any cache it has. More...
 
virtual bool good (const TrajectorySeed *seed)=0
 Returns true if the seed is not overlapping with another trajectory. More...
 
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. More...
 
 RedundantSeedCleaner ()
 constructor More...
 
virtual ~RedundantSeedCleaner ()
 
 ~RedundantSeedCleaner ()
 destructor More...
 

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.

25  {
26 
27  }
RedundantSeedCleaner::~RedundantSeedCleaner ( )
inline

destructor

Definition at line 29 of file RedundantSeedCleaner.h.

References clean(), and define().

29  {
30  }
virtual RedundantSeedCleaner::~RedundantSeedCleaner ( )
inlinevirtual

Definition at line 9 of file RedundantSeedCleaner.h.

References add(), done(), good(), init(), and SurveyInfoScenario_cff::seed.

9 {}

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

Referenced by cms::CkfTrackCandidateMakerBase::produceBase(), counter.Counter::register(), InOutConversionTrackFinder::tracks(), OutInConversionTrackFinder::tracks(), and ~RedundantSeedCleaner().

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, diffTwoXMLs::r1, diffTwoXMLs::r2, mps_fire::result, and indexGen::s2.

Referenced by ~RedundantSeedCleaner().

50 {
51 
52  // loop over triplets
53  std::vector<TrajectorySeed> result;
54 
55  std::vector<bool> maskPairs = std::vector<bool>(seed.size(),true);
56  int iPair = 0;
57 
58  for(TrajectorySeedCollection::iterator s1 =seed.begin(); s1 != seed.end(); ++s1){
59  //rechits from seed
60 
61  TrajectorySeed::range r1 = s1->recHits();
62 
63  for(TrajectorySeedCollection::const_iterator s2 = seedTr.begin(); s2 != seedTr.end(); ++s2){
64  //empty
65  if(s2->nHits()==0) continue ;
66 
67  TrajectorySeed::range r2 = s2->recHits();
68  TrajectorySeed::const_iterator h2 = r2.first;
69 
70  //number of shared hits;
71  int shared = 0;
72 
73  for(;h2 < r2.second;h2++){
74  for(TrajectorySeed::const_iterator h1 = r1.first; h1 < r1.second;h1++){
75  if(h2->sharesInput(&(*h1),TrackingRecHit::all)) shared++;
76  if(s1->nHits()!=3) LogDebug(theCategory)<< shared<< " shared hits counter if 2 erease the seed.";
77  }
78  }
79 
80  if(shared ==2 && s1->nHits()!=3) {
81  maskPairs[iPair] = false;
82  }
83 
84  }//end triplets loop
85  ++iPair;
86  }// end pairs loop
87 
88  iPair = 0;
89  //remove pairs in triplets
90  for(TrajectorySeedCollection::iterator s1 = seed.begin(); s1 != seed.end(); ++s1){
91  if (maskPairs[iPair]) result.push_back(*s1);
92  ++iPair;
93  }
94 
95  // cleaned collection
96  seed.swap(result);
97 }
#define LogDebug(id)
recHitContainer::const_iterator const_iterator
std::pair< const_iterator, const_iterator > range
void RedundantSeedCleaner::define ( std::vector< TrajectorySeed > &  coll)

collection definition

Definition at line 29 of file RedundantSeedCleaner.cc.

References clean.

Referenced by ~RedundantSeedCleaner().

30 {
31 
32  std::vector<TrajectorySeed> triplets;
33 
34  //search for triplest
35  for(TrajectorySeedCollection::iterator itr =coll.begin(); itr != coll.end(); ++itr){
36  //fill vector of triplets
37  if(itr->nHits()==3) triplets.push_back(*itr);
38 
39  }
40 
41  // clean from shared input
42  if (!triplets.empty()) clean(triplets,coll);
43 }
JetCorrectorParametersCollection coll
Definition: classes.h:10
void clean(const std::vector< TrajectorySeed > &, std::vector< TrajectorySeed > &)
clean
virtual void RedundantSeedCleaner::done ( )
pure virtual

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

Implemented in CachingSeedCleanerBySharedInput.

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

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

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

Member Data Documentation

std::vector<TrajectorySeed> RedundantSeedCleaner::seedTriplets
private

Definition at line 38 of file RedundantSeedCleaner.h.

std::string RedundantSeedCleaner::theCategory
private

Definition at line 40 of file RedundantSeedCleaner.h.