14 struct EqualsBySharesInput {
22 boost::hash<uint32_t> hasher;
31 Maps() : theRecHitMap(128,256,1024){}
32 RecHitMap theRecHitMap;
36 thread_local
Maps theMaps;
43 if (tc.size() <= 1)
return;
45 auto & theRecHitMap = theMaps.theRecHitMap;
47 theRecHitMap.clear(10*tc.size());
51 for (
auto const & it : tc) {
52 DEBUG_PRINT(
std::cout <<
" Processing trajectory " << it <<
" (" << it->foundHits() <<
" valid hits)" << std::endl);
53 auto const & pd = it->measurements();
54 for (
auto const & im : pd) {
55 auto theRecHit = &(*im.recHit());
56 if (theRecHit->isValid()) {
58 theRecHitMap.insert(theRecHit, it);
66 auto & theTrajMap = theMaps.theTrajMap;
67 for (
auto const & itt : tc) {
69 DEBUG_PRINT(
std::cout <<
" Processing trajectory " << itt <<
" (" << itt->foundHits() <<
" valid hits)" << std::endl);
72 for (
auto const & im : pd) {
73 auto theRecHit = &(*im.recHit());
74 if (theRecHit->isValid()) {
75 DEBUG_PRINT(
std::cout <<
" Searching for overlaps on hit " << theRecHit <<
" for trajectory " << itt << std::endl);
76 for (RecHitMap::value_iterator ivec = theRecHitMap.values(theRecHit);
77 ivec.good(); ++ivec) {
79 if ((*ivec)->isValid()){
94 return validHitBonus_*
t.foundHits() - missingHitPenalty_*
t.lostHits() -
t.chiSquared();
98 if(!theTrajMap.empty() > 0){
99 for(
auto const & imapp : theTrajMap) {
100 if(imapp.second > 0 ){
104 itt->firstMeasurement() : itt->lastMeasurement();
107 imapp.first->firstMeasurement() : imapp.first->lastMeasurement();
114 int nhit1 = itt->foundHits();
115 int nhit2 = imapp.first->foundHits();
116 if( (imapp.second - innerHit) >= ( (
min(nhit1, nhit2)-innerHit) * theFraction) ){
118 auto score1 =
score(*itt);
119 auto score2 =
score(*imapp.first);
120 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
std::vector< TrajectoryMeasurement > DataContainer
void clean(TrajectoryPointerContainer &) const override
virtual TrackingRecHit const * hit() const
DetId geographicalId() const