20 float maxFracShared = 0;
28 for (
auto ctfTkIter = ctfTrackCollection->begin();
29 ctfTkIter != ctfTrackCollection->end() ; ctfTkIter++, counter++ )
32 double dEta = gsfTrackRef->eta() - ctfTkIter->eta();
33 double dPhi = gsfTrackRef->phi() - ctfTkIter->phi();
34 double pi = acos(-1.);
38 if(
sqrt(dEta*dEta + dPhi*dPhi) > 0.3)
continue;
40 unsigned int shared = 0 ;
41 int gsfHitCounter = 0 ;
42 int numGsfInnerHits = 0 ;
43 int numCtfInnerHits = 0 ;
47 for (
auto elHitsIt = gsfTrackRef->recHitsBegin() ;
48 elHitsIt != gsfTrackRef->recHitsEnd() ;
49 elHitsIt++, gsfHitCounter++ )
51 if(!((**elHitsIt).isValid()))
55 uint32_t gsfHit = gsfHitPattern.
getHitPattern(HitPattern::TRACK_HITS, gsfHitCounter);
56 if (!(HitPattern::pixelHitFilter(gsfHit) ||
57 HitPattern::stripTIBHitFilter(gsfHit) ||
58 HitPattern::stripTIDHitFilter(gsfHit)))
63 int ctfHitsCounter = 0 ;
65 for (
auto ctfHitsIt = ctfTkIter->recHitsBegin() ;
66 ctfHitsIt != ctfTkIter->recHitsEnd() ;
67 ctfHitsIt++, ctfHitsCounter++ )
69 if(!((**ctfHitsIt).isValid()))
72 uint32_t ctfHit = ctfHitPattern.
getHitPattern(HitPattern::TRACK_HITS, ctfHitsCounter);
73 if(!(HitPattern::pixelHitFilter(ctfHit) ||
74 HitPattern::stripTIBHitFilter(ctfHit) ||
75 HitPattern::stripTIDHitFilter(ctfHit)))
90 if ((numGsfInnerHits==0)||(numCtfInnerHits==0))
93 if ( static_cast<float>(shared)/
std::min(numGsfInnerHits,numCtfInnerHits) > maxFracShared )
95 maxFracShared =
static_cast<float>(shared)/
std::min(numGsfInnerHits, numCtfInnerHits);
96 ctfTrackRef =
TrackRef(ctfTracksH,counter);
101 return make_pair(ctfTrackRef,maxFracShared) ;
std::vector< Track > TrackCollection
collection of Tracks
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
uint16_t getHitPattern(HitCategory category, int position) const