A concrete TrajectoryCleaner that considers two trajectories to be mutually exclusive if they share more than some fraction of their hits. The "best" trajectory of each set of mutually exclusive ones is kept, the others are eliminated. The goodness of a track is defined in terms of Chi^2, number of reconstructed hits, and number of lost hits.
Definition at line 16 of file TrajectoryCleanerBySharedHits.h.
Implements TrajectoryCleaner.
Definition at line 30 of file TrajectoryCleanerBySharedHits.cc.
References alongMomentum, gather_cfg::cout, DEBUG_PRINT, TrackingRecHit::geographicalId(), TransientTrackingRecHit::hit(), Trajectory::invalidate(), TrackingRecHit::isValid(), Trajectory::lostHits(), min, TrackingRecHit::sharesInput(), and TrackingRecHit::some.
Referenced by RoadSearchTrackCandidateMakerAlgorithm::PrepareTrackCandidates(), RoadSearchTrackCandidateMakerAlgorithm::run(), InOutConversionTrackFinder::tracks(), and OutInConversionTrackFinder::tracks().
32 if (tc.size() <= 1)
return;
40 static RecHitMap theRecHitMap(128,256,1024);
41 theRecHitMap.clear(10*tc.size());
45 for (TrajectoryPointerContainer::iterator
46 it = tc.begin(); it != tc.end(); ++it) {
47 DEBUG_PRINT(
std::cout <<
" Processing trajectory " << *it <<
" (" << (*it)->foundHits() <<
" valid hits)" << std::endl);
49 for (Trajectory::DataContainer::const_iterator im = pd.begin();
50 im != pd.end(); im++) {
54 theRecHitMap.insert(theRecHit, *it);
62 static TrajMap theTrajMap;
64 itt = tc.begin(); itt != tc.end(); ++itt) {
65 if((*itt)->isValid()){
66 DEBUG_PRINT(
std::cout <<
" Processing trajectory " << *itt <<
" (" << (*itt)->foundHits() <<
" valid hits)" << std::endl);
69 for (Trajectory::DataContainer::const_iterator im = pd.begin();
70 im != pd.end(); ++im) {
74 DEBUG_PRINT(
std::cout <<
" Searching for overlaps on hit " << theRecHit <<
" for trajectory " << *itt << std::endl);
75 for (RecHitMap::value_iterator ivec = theRecHitMap.values(theRecHit);
76 ivec.good(); ++ivec) {
78 if ((*ivec)->isValid()){
88 if(!theTrajMap.empty() > 0){
89 for(TrajMap::iterator imapp = theTrajMap.begin();
90 imapp != theTrajMap.end(); ++imapp){
91 if((*imapp).second > 0 ){
95 (*itt)->firstMeasurement() : (*itt)->lastMeasurement();
98 (*imapp).first->firstMeasurement() : (*imapp).first->lastMeasurement();
105 int nhit1 = (*itt)->foundHits();
106 int nhit2 = (*imapp).first->foundHits();
107 if( ((*imapp).second - innerHit) >= ( (
min(nhit1, nhit2)-innerHit) *
theFraction) ){
111 badtraj = (score1 > score2) ? (*imapp).first : *itt;
double missingHitPenalty_
TrajectoryPointerContainer::iterator TrajectoryPointerIterator
void invalidate()
Method to invalidate a trajectory. Useful during ambiguity resolution.
virtual bool sharesInput(const TrackingRecHit *other, SharedInputType what) const
virtual const TrackingRecHit * hit() const =0
std::vector< TrajectoryMeasurement > DataContainer
DetId geographicalId() const