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 21 of file RedundantSeedCleaner.h.

Constructor & Destructor Documentation

◆ RedundantSeedCleaner()

RedundantSeedCleaner::RedundantSeedCleaner ( )
inline

constructor

Definition at line 24 of file RedundantSeedCleaner.h.

24 {}

◆ ~RedundantSeedCleaner() [1/2]

RedundantSeedCleaner::~RedundantSeedCleaner ( )
inline

destructor

Definition at line 26 of file RedundantSeedCleaner.h.

26 {}

◆ ~RedundantSeedCleaner() [2/2]

virtual RedundantSeedCleaner::~RedundantSeedCleaner ( )
inlinevirtual

Definition at line 9 of file RedundantSeedCleaner.h.

9 {}

Member Function Documentation

◆ add()

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 counter.Counter::register(), InOutConversionTrackFinder::tracks(), and OutInConversionTrackFinder::tracks().

◆ clean()

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

clean

Definition at line 48 of file RedundantSeedCleaner.cc.

48  {
49  // loop over triplets
50  std::vector<TrajectorySeed> result;
51 
52  std::vector<bool> maskPairs = std::vector<bool>(seed.size(), true);
53  int iPair = 0;
54 
55  for (TrajectorySeedCollection::iterator s1 = seed.begin(); s1 != seed.end(); ++s1) {
56  //rechits from seed
57 
58  TrajectorySeed::range r1 = s1->recHits();
59 
60  for (TrajectorySeedCollection::const_iterator s2 = seedTr.begin(); s2 != seedTr.end(); ++s2) {
61  //empty
62  if (s2->nHits() == 0)
63  continue;
64 
65  TrajectorySeed::range r2 = s2->recHits();
67 
68  //number of shared hits;
69  int shared = 0;
70 
71  for (; h2 < r2.second; h2++) {
72  for (TrajectorySeed::const_iterator h1 = r1.first; h1 < r1.second; h1++) {
73  if (h2->sharesInput(&(*h1), TrackingRecHit::all))
74  shared++;
75  if (s1->nHits() != 3)
76  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])
92  result.push_back(*s1);
93  ++iPair;
94  }
95 
96  // cleaned collection
97  seed.swap(result);
98 }

References TrackingRecHit::all, LogDebug, diffTwoXMLs::r1, diffTwoXMLs::r2, mps_fire::result, indexGen::s2, and SurveyInfoScenario_cff::seed.

◆ define()

void RedundantSeedCleaner::define ( std::vector< TrajectorySeed > &  coll)

collection definition

Definition at line 29 of file RedundantSeedCleaner.cc.

29  {
30  std::vector<TrajectorySeed> triplets;
31 
32  //search for triplest
33  for (TrajectorySeedCollection::iterator itr = coll.begin(); itr != coll.end(); ++itr) {
34  //fill vector of triplets
35  if (itr->nHits() == 3)
36  triplets.push_back(*itr);
37  }
38 
39  // clean from shared input
40  if (!triplets.empty())
41  clean(triplets, coll);
42 }

References clean().

◆ done()

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 InOutConversionTrackFinder::tracks(), and OutInConversionTrackFinder::tracks().

◆ good()

virtual bool RedundantSeedCleaner::good ( const TrajectorySeed seed)
pure virtual

Returns true if the seed is not overlapping with another trajectory.

Implemented in CachingSeedCleanerBySharedInput.

Referenced by InOutConversionTrackFinder::tracks(), and OutInConversionTrackFinder::tracks().

◆ init()

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 InOutConversionTrackFinder::tracks(), and OutInConversionTrackFinder::tracks().

Member Data Documentation

◆ seedTriplets

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

Definition at line 33 of file RedundantSeedCleaner.h.

◆ theCategory

std::string RedundantSeedCleaner::theCategory
private

Definition at line 35 of file RedundantSeedCleaner.h.

TrajectorySeed::range
std::pair< const_iterator, const_iterator > range
Definition: TrajectorySeed.h:21
RedundantSeedCleaner::clean
void clean(const std::vector< TrajectorySeed > &, std::vector< TrajectorySeed > &)
clean
Definition: RedundantSeedCleaner.cc:48
TrajectorySeed::const_iterator
recHitContainer::const_iterator const_iterator
Definition: TrajectorySeed.h:20
indexGen.s2
s2
Definition: indexGen.py:107
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
TrackingRecHit::all
Definition: TrackingRecHit.h:59
diffTwoXMLs.r2
r2
Definition: diffTwoXMLs.py:73
itr
std::vector< std::pair< float, float > >::iterator itr
Definition: HGCDigitizer.cc:28
RedundantSeedCleaner::theCategory
std::string theCategory
Definition: RedundantSeedCleaner.h:35
diffTwoXMLs.r1
r1
Definition: diffTwoXMLs.py:53
mps_fire.result
result
Definition: mps_fire.py:303
SurveyInfoScenario_cff.seed
seed
Definition: SurveyInfoScenario_cff.py:295