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 15 of file TrajectoryCleanerBySharedHits.h.
Implements TrajectoryCleaner.
Definition at line 42 of file TrajectoryCleanerBySharedHits.cc.
46 auto &theRecHitMap = theMaps.theRecHitMap;
48 theRecHitMap.clear(10 * tc.size());
52 for (
auto const &it : tc) {
53 DEBUG_PRINT(
std::cout <<
" Processing trajectory " << it <<
" (" << it->foundHits() <<
" valid hits)"
55 auto const &pd = it->measurements();
56 for (
auto const &im : pd) {
57 auto theRecHit = &(*im.recHit());
58 if (theRecHit->isValid()) {
60 theRecHitMap.insert(theRecHit, it);
68 auto &theTrajMap = theMaps.theTrajMap;
69 for (
auto const &itt : tc) {
71 DEBUG_PRINT(
std::cout <<
" Processing trajectory " << itt <<
" (" << itt->foundHits() <<
" valid hits)"
75 for (
auto const &im : pd) {
76 auto theRecHit = &(*im.recHit());
77 if (theRecHit->isValid()) {
78 DEBUG_PRINT(
std::cout <<
" Searching for overlaps on hit " << theRecHit <<
" for trajectory " << itt
80 for (RecHitMap::value_iterator ivec = theRecHitMap.values(theRecHit); ivec.good(); ++ivec) {
82 if ((*ivec)->isValid()) {
101 if (!theTrajMap.empty() > 0) {
102 for (
auto const &imapp : theTrajMap) {
103 if (imapp.second > 0) {
107 (itt->direction() ==
alongMomentum) ? itt->firstMeasurement() : itt->lastMeasurement();
110 ? imapp.first->firstMeasurement()
111 : imapp.first->lastMeasurement();
118 int nhit1 = itt->foundHits();
119 int nhit2 = imapp.first->foundHits();
120 if ((imapp.second - innerHit) >= ((
min(nhit1, nhit2) - innerHit) *
theFraction)) {
122 auto score1 =
score(*itt);
123 auto score2 =
score(*imapp.first);
124 badtraj = (score1 > score2) ? imapp.first : itt;
References HLT_2018_cff::allowSharedFirstHit, alongMomentum, gather_cfg::cout, DEBUG_PRINT, TrackingRecHit::geographicalId(), TrackingRecHit::hit(), Trajectory::invalidate(), min(), rpcPointValidation_cfi::recHit, offlineSlimmedPrimaryVertices_cfi::score, TrackingRecHit::sharesInput(), TrackingRecHit::some, and OrderedSet::t.
Referenced by InOutConversionTrackFinder::tracks(), and OutInConversionTrackFinder::tracks().