11 using namespace reco ;
20 float maxFracShared = 0;
25 const HitPattern& gsfHitPattern = gsfTrackRef->hitPattern();
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()))
63 int ctfHitsCounter = 0 ;
65 for (
auto ctfHitsIt = ctfTkIter->recHitsBegin() ;
66 ctfHitsIt != ctfTkIter->recHitsEnd() ;
67 ctfHitsIt++, ctfHitsCounter++ )
69 if(!((**ctfHitsIt).isValid()))
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) ;
static bool pixelHitFilter(uint16_t pattern)
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
static bool stripTIBHitFilter(uint16_t pattern)
uint16_t getHitPattern(HitCategory category, int position) const
static bool stripTIDHitFilter(uint16_t pattern)