13 struct EqualsBySharesInput {
22 std::hash<uint32_t>
hasher;
32 Maps() : theRecHitMap(128, 256, 1024) {}
33 RecHitMap theRecHitMap;
37 thread_local Maps theMaps;
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()) {
97 return validHitBonus_ *
t.foundHits() - missingHitPenalty_ *
t.lostHits() -
t.chiSquared();
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;
constexpr uint32_t rawId() const
get the raw id
void invalidate()
Method to invalidate a trajectory. Useful during ambiguity resolution.
virtual bool sharesInput(const TrackingRecHit *other, SharedInputType what) const
std::vector< Trajectory * > TrajectoryPointerContainer
void clean(TrajectoryPointerContainer &) const override
std::vector< TrajectoryMeasurement > DataContainer
virtual TrackingRecHit const * hit() const
DetId geographicalId() const
tuple allowSharedFirstHit