14 struct EqualsBySharesInput {
20 struct HashByDetId : std::unary_function<const TransientTrackingRecHit *, std::size_t> {
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 (TrajectoryPointerContainer::iterator
52 it = tc.begin(); it != tc.end(); ++it) {
53 DEBUG_PRINT(
std::cout <<
" Processing trajectory " << *it <<
" (" << (*it)->foundHits() <<
" valid hits)" << std::endl);
55 for (Trajectory::DataContainer::const_iterator im = pd.begin();
56 im != pd.end(); im++) {
60 theRecHitMap.insert(theRecHit, *it);
68 auto & theTrajMap = theMaps.theTrajMap;
70 itt = tc.begin(); itt != tc.end(); ++itt) {
71 if((*itt)->isValid()){
72 DEBUG_PRINT(
std::cout <<
" Processing trajectory " << *itt <<
" (" << (*itt)->foundHits() <<
" valid hits)" << std::endl);
75 for (Trajectory::DataContainer::const_iterator im = pd.begin();
76 im != pd.end(); ++im) {
80 DEBUG_PRINT(
std::cout <<
" Searching for overlaps on hit " << theRecHit <<
" for trajectory " << *itt << std::endl);
81 for (RecHitMap::value_iterator ivec = theRecHitMap.values(theRecHit);
82 ivec.good(); ++ivec) {
84 if ((*ivec)->isValid()){
94 if(!theTrajMap.empty() > 0){
95 for(TrajMap::iterator imapp = theTrajMap.begin();
96 imapp != theTrajMap.end(); ++imapp){
97 if((*imapp).second > 0 ){
101 (*itt)->firstMeasurement() : (*itt)->lastMeasurement();
104 (*imapp).first->firstMeasurement() : (*imapp).first->lastMeasurement();
111 int nhit1 = (*itt)->foundHits();
112 int nhit2 = (*imapp).first->foundHits();
113 if( ((*imapp).second - innerHit) >= ( (
min(nhit1, nhit2)-innerHit) * theFraction) ){
115 double score1 = validHitBonus_*nhit1 - missingHitPenalty_*(*itt)->
lostHits() - (*itt)->chiSquared();
116 double score2 = validHitBonus_*nhit2 - missingHitPenalty_*(*imapp).first->lostHits() - (*imapp).first->chiSquared();
117 badtraj = (score1 > score2) ? (*imapp).first : *itt;
TrajectoryPointerContainer::iterator TrajectoryPointerIterator
tuple allowSharedFirstHit
virtual void clean(TrajectoryPointerContainer &) const
void invalidate()
Method to invalidate a trajectory. Useful during ambiguity resolution.
virtual bool sharesInput(const TrackingRecHit *other, SharedInputType what) const
std::vector< Trajectory * > TrajectoryPointerContainer
uint32_t rawId() const
get the raw id
std::vector< TrajectoryMeasurement > DataContainer
virtual TrackingRecHit const * hit() const
DetId geographicalId() const