22 int gsfHitCounter1 = 0;
23 for (
auto const& elHit : e1.
gsfTrack()->recHits()) {
29 int gsfHitCounter2 = 0;
30 for (
auto const& elHit : e2.
gsfTrack()->recHits()) {
36 uint32_t gsfHit1 = e1.
gsfTrack()->hitPattern().getHitPattern(HitPattern::TRACK_HITS, gsfHitCounter1);
37 uint32_t gsfHit2 = e2.
gsfTrack()->hitPattern().getHitPattern(HitPattern::TRACK_HITS, gsfHitCounter2);
39 if (HitPattern::getSubStructure(gsfHit1) != HitPattern::getSubStructure(gsfHit2)) {
40 return (HitPattern::getSubStructure(gsfHit1) < HitPattern::getSubStructure(gsfHit2));
50 HitPattern const& gsfHitPattern1 = gsfTrackRef1->hitPattern();
51 HitPattern const& gsfHitPattern2 = gsfTrackRef2->hitPattern();
53 unsigned int shared = 0;
55 int gsfHitCounter1 = 0;
57 elHitsIt1++, gsfHitCounter1++) {
58 if (!(*elHitsIt1)->isValid()) {
63 uint32_t gsfHit = gsfHitPattern1.
getHitPattern(HitPattern::TRACK_HITS, gsfHitCounter1);
64 if (!(HitPattern::pixelHitFilter(gsfHit) || HitPattern::stripTIBHitFilter(gsfHit) ||
65 HitPattern::stripTOBHitFilter(gsfHit) || HitPattern::stripTECHitFilter(gsfHit) ||
66 HitPattern::stripTIDHitFilter(gsfHit))) {
70 int gsfHitsCounter2 = 0;
71 for (
trackingRecHit_iterator gsfHitsIt2 = gsfTrackRef2->recHitsBegin(); gsfHitsIt2 != gsfTrackRef2->recHitsEnd();
72 gsfHitsIt2++, gsfHitsCounter2++) {
73 if (!(**gsfHitsIt2).isValid()) {
77 uint32_t gsfHit2 = gsfHitPattern2.
getHitPattern(HitPattern::TRACK_HITS, gsfHitsCounter2);
78 if (!(HitPattern::pixelHitFilter(gsfHit2) || HitPattern::stripTIBHitFilter(gsfHit2) ||
79 HitPattern::stripTOBHitFilter(gsfHit2) || HitPattern::stripTECHitFilter(gsfHit2) ||
80 HitPattern::stripTIDHitFilter(gsfHit2))) {
97 const HitPattern& gsfHitPattern1 = gsfTrackRef1->hitPattern();
98 const HitPattern& gsfHitPattern2 = gsfTrackRef2->hitPattern();
100 unsigned int shared = 0;
102 int gsfHitCounter1 = 0;
103 for (
trackingRecHit_iterator elHitsIt1 = gsfTrackRef1->recHitsBegin(); elHitsIt1 != gsfTrackRef1->recHitsEnd();
104 elHitsIt1++, gsfHitCounter1++) {
105 if (!((**elHitsIt1).isValid())) {
110 uint32_t gsfHit = gsfHitPattern1.
getHitPattern(HitPattern::TRACK_HITS, gsfHitCounter1);
111 if (!(HitPattern::pixelHitFilter(gsfHit) || HitPattern::stripTIBHitFilter(gsfHit) ||
112 HitPattern::stripTOBHitFilter(gsfHit) || HitPattern::stripTECHitFilter(gsfHit) ||
113 HitPattern::stripTIDHitFilter(gsfHit))) {
117 int gsfHitsCounter2 = 0;
118 for (
trackingRecHit_iterator gsfHitsIt2 = gsfTrackRef2->recHitsBegin(); gsfHitsIt2 != gsfTrackRef2->recHitsEnd();
119 gsfHitsIt2++, gsfHitsCounter2++) {
120 if (!((**gsfHitsIt2).isValid())) {
125 uint32_t gsfHit2 = gsfHitPattern2.
getHitPattern(HitPattern::TRACK_HITS, gsfHitsCounter2);
126 if (!(HitPattern::pixelHitFilter(gsfHit2) || HitPattern::stripTIBHitFilter(gsfHit2) ||
127 HitPattern::stripTOBHitFilter(gsfHit2) || HitPattern::stripTECHitFilter(gsfHit2) ||
128 HitPattern::stripTIDHitFilter(gsfHit2)))
130 if ((**elHitsIt1).geographicalId() == (**gsfHitsIt2).geographicalId())
148 if (h1.first != h2.first)
154 if ((itt = barrelRecHits.
find(h1.first)) != barrelRecHits.
end())
155 fractionShared += itt->energy();
156 }
else if (h1.first.subdetId() ==
EcalEndcap) {
157 if ((itt = endcapRecHits.
find(h1.first)) != endcapRecHits.
end())
158 fractionShared += itt->energy();
171 double energyShared = 0;
174 energyShared +=
sharedEnergy(**icl1, **icl2, barrelRecHits, endcapRecHits);
float eSuperClusterOverP() const
std::vector< EcalRecHit >::const_iterator const_iterator
int sharedDets(reco::GsfTrackRef const &, reco::GsfTrackRef const &)
GsfTrackRef gsfTrack() const override
reference to a GsfTrack
bool isBetterElectron(reco::GsfElectron const &, reco::GsfElectron const &)
bool isInnermostElectron(reco::GsfElectron const &, reco::GsfElectron const &)
const std::vector< std::pair< DetId, float > > & hitsAndFractions() const
Abs< T >::type abs(const T &t)
constexpr uint8_t getLayer(uint32_t detId)
const_iterator end() const
float sharedEnergy(reco::CaloCluster const &clu1, reco::CaloCluster const &clu2, EcalRecHitCollection const &barrelRecHits, EcalRecHitCollection const &endcapRecHits)
iterator find(key_type k)
uint16_t getHitPattern(HitCategory category, int position) const
int sharedHits(reco::GsfTrackRef const &, reco::GsfTrackRef const &)