19 float maxFracShared = 0;
23 float gsfEta = gsfTrackRef->eta();
24 float gsfPhi = gsfTrackRef->phi();
25 const HitPattern& gsfHitPattern = gsfTrackRef->hitPattern();
30 for (
auto ctfTkIter = ctfTrackCollection->begin(); ctfTkIter != ctfTrackCollection->end(); ctfTkIter++,
counter++) {
36 unsigned int shared = 0;
37 int gsfHitCounter = 0;
38 int numGsfInnerHits = 0;
39 int numCtfInnerHits = 0;
43 for (
auto elHitsIt = gsfTrackRef->recHitsBegin(); elHitsIt != gsfTrackRef->recHitsEnd();
44 elHitsIt++, gsfHitCounter++) {
45 if (!((**elHitsIt).isValid()))
59 int ctfHitsCounter = 0;
61 for (
auto ctfHitsIt = ctfTkIter->recHitsBegin(); ctfHitsIt != ctfTkIter->recHitsEnd();
62 ctfHitsIt++, ctfHitsCounter++) {
63 if (!((**ctfHitsIt).isValid()))
85 if ((numGsfInnerHits == 0) || (numCtfInnerHits == 0)) {
89 if (static_cast<float>(shared) /
std::min(numGsfInnerHits, numCtfInnerHits) > maxFracShared) {
90 maxFracShared =
static_cast<float>(shared) /
std::min(numGsfInnerHits, numCtfInnerHits);
96 return {ctfTrackRef, maxFracShared};
std::pair< reco::TrackRef, float > getClosestCtfToGsf(reco::GsfTrackRef const &, edm::Handle< reco::TrackCollection > const &ctfTracksH, edm::soa::EtaPhiTableView trackEtaPhiTable)
static bool pixelHitFilter(uint16_t pattern)
T const * product() const
std::vector< Track > TrackCollection
collection of Tracks
ALPAKA_FN_ACC static ALPAKA_FN_INLINE float dR2(Position4 pos1, Position4 pos2)
uint16_t hitPattern[ARRAY_LENGTH]
uint16_t getHitPattern(HitCategory category, int position) const
edm::soa::ViewFromTable_t< EtaPhiTable > EtaPhiTableView
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
static bool stripTIBHitFilter(uint16_t pattern)
static bool stripTIDHitFilter(uint16_t pattern)