70 float maxFracShared = 0;
75 const HitPattern& gsfHitPattern = gsfTrackRef->hitPattern();
78 TrackCollection::const_iterator ctfTkIter ;
79 for ( ctfTkIter = ctfTrackCollection->begin() , counter = 0 ;
80 ctfTkIter != ctfTrackCollection->end() ; ctfTkIter++, counter++ )
83 double dEta = gsfTrackRef->eta() - ctfTkIter->eta();
84 double dPhi = gsfTrackRef->phi() - ctfTkIter->phi();
85 double pi = acos(-1.);
89 if(
sqrt(dEta*dEta + dPhi*dPhi) > 0.3)
continue;
91 unsigned int shared = 0 ;
92 int gsfHitCounter = 0 ;
93 int numGsfInnerHits = 0 ;
94 int numCtfInnerHits = 0 ;
99 for ( elHitsIt = gsfTrackRef->recHitsBegin() ;
100 elHitsIt != gsfTrackRef->recHitsEnd() ;
101 elHitsIt++, gsfHitCounter++ )
103 if(!((**elHitsIt).isValid()))
107 uint32_t gsfHit = gsfHitPattern.
getHitPattern(HitPattern::TRACK_HITS, gsfHitCounter);
108 if (!(HitPattern::pixelHitFilter(gsfHit) ||
109 HitPattern::stripTIBHitFilter(gsfHit) ||
110 HitPattern::stripTIDHitFilter(gsfHit)))
115 int ctfHitsCounter = 0 ;
116 numCtfInnerHits = 0 ;
118 for ( ctfHitsIt = ctfTkIter->recHitsBegin() ;
119 ctfHitsIt != ctfTkIter->recHitsEnd() ;
120 ctfHitsIt++, ctfHitsCounter++ )
122 if(!((**ctfHitsIt).isValid()))
125 uint32_t ctfHit = ctfHitPattern.
getHitPattern(HitPattern::TRACK_HITS, ctfHitsCounter);
126 if(!(HitPattern::pixelHitFilter(ctfHit) ||
127 HitPattern::stripTIBHitFilter(ctfHit) ||
128 HitPattern::stripTIDHitFilter(ctfHit)))
143 if ((numGsfInnerHits==0)||(numCtfInnerHits==0))
146 if ( static_cast<float>(shared)/
std::min(numGsfInnerHits,numCtfInnerHits) > maxFracShared )
148 maxFracShared =
static_cast<float>(shared)/
std::min(numGsfInnerHits, numCtfInnerHits);
154 return make_pair(ctfTrackRef,maxFracShared) ;
std::vector< Track > TrackCollection
collection of Tracks
edm::Handle< reco::TrackCollection > ctfTracksH_
uint16_t hitPattern[ARRAY_LENGTH]
Abs< T >::type abs(const T &t)
T const * product() const
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
static std::atomic< unsigned int > counter
uint16_t getHitPattern(HitCategory category, int position) const