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  for (TrajectorySeedCollection::const_iterator s2 = seedTr.begin(); s2 != seedTr.end(); ++s2) {
59  //empty
60  if (s2->nHits() == 0)
61  continue;
62 
63  //number of shared hits;
64  int shared = 0;
65 
66  for (auto const& h2 : s2->recHits()) {
67  for (auto const& h1 : s1->recHits()) {
68  if (h2.sharesInput(&h1, TrackingRecHit::all))
69  shared++;
70  if (s1->nHits() != 3)
71  LogDebug(theCategory) << shared << " shared hits counter if 2 erease the seed.";
72  }
73  }
74 
75  if (shared == 2 && s1->nHits() != 3) {
76  maskPairs[iPair] = false;
77  }
78 
79  } //end triplets loop
80  ++iPair;
81  } // end pairs loop
82 
83  iPair = 0;
84  //remove pairs in triplets
85  for (TrajectorySeedCollection::iterator s1 = seed.begin(); s1 != seed.end(); ++s1) {
86  if (maskPairs[iPair])
87  result.push_back(*s1);
88  ++iPair;
89  }
90 
91  // cleaned collection
92  seed.swap(result);
93 }

References TrackingRecHit::all, LogDebug, mps_fire::result, indexGen::s2, and fileCollector::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.

RedundantSeedCleaner::clean
void clean(const std::vector< TrajectorySeed > &, std::vector< TrajectorySeed > &)
clean
Definition: RedundantSeedCleaner.cc:48
indexGen.s2
s2
Definition: indexGen.py:107
fileCollector.seed
seed
Definition: fileCollector.py:127
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
TrackingRecHit::all
Definition: TrackingRecHit.h:59
RedundantSeedCleaner::theCategory
std::string theCategory
Definition: RedundantSeedCleaner.h:35
mps_fire.result
result
Definition: mps_fire.py:311