19 float maxFracShared = 0;
24 const HitPattern& gsfHitPattern = gsfTrackRef->hitPattern();
27 for (
auto ctfTkIter = ctfTrackCollection->begin(); ctfTkIter != ctfTrackCollection->end(); ctfTkIter++, counter++) {
28 double dEta = gsfTrackRef->eta() - ctfTkIter->eta();
29 double dPhi = gsfTrackRef->phi() - ctfTkIter->phi();
30 double pi = acos(-1.);
35 if (
sqrt(dEta * dEta + dPhi * dPhi) > 0.3)
38 unsigned int shared = 0;
39 int gsfHitCounter = 0;
40 int numGsfInnerHits = 0;
41 int numCtfInnerHits = 0;
45 for (
auto elHitsIt = gsfTrackRef->recHitsBegin(); elHitsIt != gsfTrackRef->recHitsEnd();
46 elHitsIt++, gsfHitCounter++) {
47 if (!((**elHitsIt).isValid()))
61 int ctfHitsCounter = 0;
63 for (
auto ctfHitsIt = ctfTkIter->recHitsBegin(); ctfHitsIt != ctfTkIter->recHitsEnd();
64 ctfHitsIt++, ctfHitsCounter++) {
65 if (!((**ctfHitsIt).isValid()))
87 if ((numGsfInnerHits == 0) || (numCtfInnerHits == 0)) {
91 if (static_cast<float>(shared) /
std::min(numGsfInnerHits, numCtfInnerHits) > maxFracShared) {
92 maxFracShared =
static_cast<float>(shared) /
std::min(numGsfInnerHits, numCtfInnerHits);
93 ctfTrackRef =
TrackRef(ctfTracksH, counter);
98 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)
std::pair< reco::TrackRef, float > getClosestCtfToGsf(reco::GsfTrackRef const &, edm::Handle< reco::TrackCollection > const &ctfTracksH)
uint16_t getHitPattern(HitCategory category, int position) const
static bool stripTIDHitFilter(uint16_t pattern)