25 using namespace reco ;
27 namespace EgAmbiguityTools
40 int gsfHitCounter1 = 0 ;
43 ( elHitsIt1 = e1->gsfTrack()->recHitsBegin() ;
44 elHitsIt1 != e1->gsfTrack()->recHitsEnd() ;
45 elHitsIt1++, gsfHitCounter1++ )
46 {
if (((**elHitsIt1).isValid())) break ; }
48 int gsfHitCounter2 = 0 ;
51 ( elHitsIt2 = e2->gsfTrack()->recHitsBegin() ;
52 elHitsIt2 != e2->gsfTrack()->recHitsEnd() ;
53 elHitsIt2++, gsfHitCounter2++ )
54 {
if (((**elHitsIt2).isValid())) break ; }
56 uint32_t gsfHit1 = gsfHitPattern1.
getHitPattern(gsfHitCounter1) ;
57 uint32_t gsfHit2 = gsfHitPattern2.
getHitPattern(gsfHitCounter2) ;
61 {
return (gsfHitPattern1.
getLayer(gsfHit1)<gsfHitPattern2.
getLayer(gsfHit2)) ; }
69 const HitPattern & gsfHitPattern1 = gsfTrackRef1->hitPattern() ;
70 const HitPattern & gsfHitPattern2 = gsfTrackRef2->hitPattern() ;
72 unsigned int shared = 0;
74 int gsfHitCounter1 = 0;
76 elHitsIt1 != gsfTrackRef1->recHitsEnd(); elHitsIt1++, gsfHitCounter1++) {
77 if(!((**elHitsIt1).isValid()))
80 uint32_t gsfHit = gsfHitPattern1.
getHitPattern(gsfHitCounter1);
87 int gsfHitsCounter2 = 0;
89 gsfHitsIt2 != gsfTrackRef2->recHitsEnd(); gsfHitsIt2++, gsfHitsCounter2++) {
90 if(!((**gsfHitsIt2).isValid()))
93 uint32_t gsfHit2 = gsfHitPattern2.
getHitPattern(gsfHitsCounter2);
117 const HitPattern& gsfHitPattern1 = gsfTrackRef1->hitPattern();
118 const HitPattern& gsfHitPattern2 = gsfTrackRef2->hitPattern();
120 unsigned int shared = 0;
122 int gsfHitCounter1 = 0;
124 elHitsIt1 != gsfTrackRef1->recHitsEnd(); elHitsIt1++, gsfHitCounter1++) {
125 if(!((**elHitsIt1).isValid()))
128 uint32_t gsfHit = gsfHitPattern1.
getHitPattern(gsfHitCounter1);
135 int gsfHitsCounter2 = 0;
137 gsfHitsIt2 != gsfTrackRef2->recHitsEnd(); gsfHitsIt2++, gsfHitsCounter2++) {
138 if(!((**gsfHitsIt2).isValid()))
141 uint32_t gsfHit2 = gsfHitPattern2.
getHitPattern(gsfHitsCounter2);
148 if ((**elHitsIt1).geographicalId() == (**gsfHitsIt2).geographicalId()) shared++;
162 double fractionShared = 0;
166 std::vector< std::pair<DetId, float> >::iterator ih1;
167 std::vector< std::pair<DetId, float> >::iterator ih2;
169 for(ih1 = v_id1.begin();ih1 != v_id1.end(); ih1++) {
171 for(ih2 = v_id2.begin();ih2 != v_id2.end(); ih2++) {
173 if ( (*ih1).first != (*ih2).first )
continue;
178 if ((itt=barrelRecHits->find((*ih1).first))!=barrelRecHits->end())
179 fractionShared += itt->energy();
180 }
else if ((*ih1).first.subdetId() ==
EcalEndcap) {
181 if ((itt=endcapRecHits->find((*ih1).first))!=endcapRecHits->end())
182 fractionShared += itt->energy();
189 return fractionShared;
197 double energyShared = 0;
200 energyShared +=
sharedEnergy(&(**icl1),&(**icl2),barrelRecHits,endcapRecHits );
static uint32_t getLayer(uint32_t pattern)
float eSuperClusterOverP() const
std::vector< EcalRecHit >::const_iterator const_iterator
const std::vector< std::pair< DetId, float > > & hitsAndFractions() const
static bool stripTECHitFilter(uint32_t pattern)
static bool stripTIDHitFilter(uint32_t pattern)
static bool pixelHitFilter(uint32_t pattern)
Abs< T >::type abs(const T &t)
static uint32_t getSubStructure(uint32_t pattern)
static bool stripTOBHitFilter(uint32_t pattern)
uint32_t getHitPattern(int position) const
static bool stripTIBHitFilter(uint32_t pattern)