12 using namespace reco ;
23 int gsfHitCounter1 = 0 ;
24 for(
auto const& elHit : e1.
gsfTrack()->recHits())
26 if (elHit->isValid())
break;
30 int gsfHitCounter2 = 0 ;
31 for(
auto const& elHit : e2.
gsfTrack()->recHits())
33 if (elHit->isValid())
break;
37 uint32_t gsfHit1 = e1.
gsfTrack()->hitPattern().getHitPattern(HitPattern::TRACK_HITS, gsfHitCounter1);
38 uint32_t gsfHit2 = e2.
gsfTrack()->hitPattern().getHitPattern(HitPattern::TRACK_HITS, gsfHitCounter2);
40 if (HitPattern::getSubStructure(gsfHit1) != HitPattern::getSubStructure(gsfHit2)){
41 return (HitPattern::getSubStructure(gsfHit1) < HitPattern::getSubStructure(gsfHit2));
42 }
else if (HitPattern::getLayer(gsfHit1) != HitPattern::getLayer(gsfHit2)){
43 return (HitPattern::getLayer(gsfHit1) < HitPattern::getLayer(gsfHit2));
52 HitPattern const& gsfHitPattern1 = gsfTrackRef1->hitPattern();
53 HitPattern const& gsfHitPattern2 = gsfTrackRef2->hitPattern();
55 unsigned int shared = 0;
57 int gsfHitCounter1 = 0;
59 elHitsIt1 != gsfTrackRef1->recHitsEnd(); elHitsIt1++, gsfHitCounter1++) {
60 if(!(*elHitsIt1)->isValid()){
65 uint32_t gsfHit = gsfHitPattern1.
getHitPattern(HitPattern::TRACK_HITS, gsfHitCounter1);
66 if(!(HitPattern::pixelHitFilter(gsfHit)
67 || HitPattern::stripTIBHitFilter(gsfHit)
68 || HitPattern::stripTOBHitFilter(gsfHit)
69 || HitPattern::stripTECHitFilter(gsfHit)
70 || HitPattern::stripTIDHitFilter(gsfHit))){
74 int gsfHitsCounter2 = 0;
76 gsfHitsIt2 != gsfTrackRef2->recHitsEnd(); gsfHitsIt2++, gsfHitsCounter2++) {
77 if(!(**gsfHitsIt2).isValid()){
81 uint32_t gsfHit2 = gsfHitPattern2.
getHitPattern(HitPattern::TRACK_HITS, gsfHitsCounter2);
82 if(!(HitPattern::pixelHitFilter(gsfHit2)
83 || HitPattern::stripTIBHitFilter(gsfHit2)
84 || HitPattern::stripTOBHitFilter(gsfHit2)
85 || HitPattern::stripTECHitFilter(gsfHit2)
86 || HitPattern::stripTIDHitFilter(gsfHit2))){
104 const HitPattern &gsfHitPattern1 = gsfTrackRef1->hitPattern();
105 const HitPattern &gsfHitPattern2 = gsfTrackRef2->hitPattern();
107 unsigned int shared = 0;
109 int gsfHitCounter1 = 0;
111 elHitsIt1 != gsfTrackRef1->recHitsEnd(); elHitsIt1++, gsfHitCounter1++) {
112 if(!((**elHitsIt1).isValid())){
117 uint32_t gsfHit = gsfHitPattern1.
getHitPattern(HitPattern::TRACK_HITS, gsfHitCounter1);
118 if(!(HitPattern::pixelHitFilter(gsfHit)
119 || HitPattern::stripTIBHitFilter(gsfHit)
120 || HitPattern::stripTOBHitFilter(gsfHit)
121 || HitPattern::stripTECHitFilter(gsfHit)
122 || HitPattern::stripTIDHitFilter(gsfHit)))
127 int gsfHitsCounter2 = 0;
129 gsfHitsIt2 != gsfTrackRef2->recHitsEnd(); gsfHitsIt2++, gsfHitsCounter2++) {
130 if(!((**gsfHitsIt2).isValid())){
135 uint32_t gsfHit2 = gsfHitPattern2.
getHitPattern(HitPattern::TRACK_HITS, gsfHitsCounter2);
136 if(!(HitPattern::pixelHitFilter(gsfHit2)
137 || HitPattern::stripTIBHitFilter(gsfHit2)
138 || HitPattern::stripTOBHitFilter(gsfHit2)
139 || HitPattern::stripTECHitFilter(gsfHit2)
140 || HitPattern::stripTIDHitFilter(gsfHit2) )
142 if ((**elHitsIt1).geographicalId() == (**gsfHitsIt2).geographicalId()) shared++;
163 if ( h1.first != h2.first )
continue;
168 if ((itt=barrelRecHits.
find(h1.first))!=barrelRecHits.
end())
169 fractionShared += itt->energy();
170 }
else if (h1.first.subdetId() ==
EcalEndcap) {
171 if ((itt=endcapRecHits.
find(h1.first))!=endcapRecHits.
end())
172 fractionShared += itt->energy();
187 double energyShared = 0;
190 energyShared +=
sharedEnergy(**icl1,**icl2,barrelRecHits,endcapRecHits );
GsfTrackRef gsfTrack() const override
reference to a GsfTrack
float eSuperClusterOverP() const
std::vector< EcalRecHit >::const_iterator const_iterator
const std::vector< std::pair< DetId, float > > & hitsAndFractions() const
Abs< T >::type abs(const T &t)
const_iterator end() const
iterator find(key_type k)
uint16_t getHitPattern(HitCategory category, int position) const