59 if ( eCluster > Para.
SmCut( 3 ) )
71 RecEmcHitMap::const_iterator ciHitMap;
72 if ( aMaxVec.size() == 0 )
78 else if ( aMaxVec.size() == 1 || aMaxVec.size() > 20 || aCluster.
getSecondMoment() <
cut )
87 double time = aCluster.
Find( aMaxVec[0] )->second.getTime();
90 for ( ciHitMap = aCluster.
Begin(); ciHitMap != aCluster.
End(); ++ciHitMap )
92 aHit = ciHitMap->second;
97 aShower.
Insert( aFraction );
108 aShowerMap[aMaxVec[0]] = aShower;
113 else if ( aMaxVec.size() > 1 && aMaxVec.size() <= 20 && aCluster.
getSecondMoment() >
cut )
120 RecEmcHitMap::const_iterator ci_HitMap;
125 RecEmcShowerMap::iterator i_ShowerMap, i2_ShowerMap;
128 unsigned int iterations = 0;
129 double centroidShift;
134 ISvcLocator* svcLocator = Gaudi::svcLocator();
135 StatusCode sc = svcLocator->service(
"EmcRecGeoSvc", iGeoSvc );
136 if ( sc != StatusCode::SUCCESS )
142 for ( ciMax = aMaxVec.begin(); ciMax != aMaxVec.end(); ++ciMax )
149 tmpShowerMap.clear();
150 for ( ciMax = aMaxVec.begin(); ciMax != aMaxVec.end(); ++ciMax )
152 double weightTotal = 0.,
weight = 0.;
158 for ( ci_HitMap = tmpCluster.
Begin(); ci_HitMap != tmpCluster.
End(); ++ci_HitMap )
161 aFrac = ci_HitMap->second;
162 double aDistance = 0;
166 for ( ciMax1 = aMaxVec.begin(); ciMax1 != aMaxVec.end(); ++ciMax1 )
168 HepPoint3D seedPoint( showerCentroid[*ciMax1] );
178 else { theDistance = ( hitPoint - seedPoint ).mag(); }
180 if ( *ciMax1 == *ciMax )
182 aDistance = theDistance;
197 { aShower.
Insert( aFrac ); }
205 HepPoint3D oldCentroid( showerCentroid[*ciMax] );
206 centroidShift += ( newCentroid - oldCentroid ).mag();
208 showerCentroid[*ciMax] = newCentroid;
211 centroidShift /= (double)aMaxVec.size();
212 for ( ci_showerCentroid = showerCentroid.begin();
213 ci_showerCentroid != showerCentroid.end(); ci_showerCentroid++ )
215 showerCentroid[ci_showerCentroid->first] =
216 tmpShowerMap[ci_showerCentroid->first].position();
220 }
while ( ( iterations < 8 ) && ( centroidShift > 0.01 ) );
222 unsigned int tht, phi;
223 unsigned int tht2,
phi2;
224 unsigned int dtht, dphi;
225 unsigned int thetagap = 0, phigap = 0;
226 double distmin, dist;
229 for ( i_ShowerMap = tmpShowerMap.begin(); i_ShowerMap != tmpShowerMap.end();
233 i_ShowerMap->second.ClusterId( aCluster.
getClusterId() );
234 i_ShowerMap->second.setStatus( 2 );
235 fShowerE->Energy( i_ShowerMap->second );
240 id = ( i_ShowerMap->second ).getShowerId();
244 for ( i2_ShowerMap = tmpShowerMap.begin(); i2_ShowerMap != tmpShowerMap.end();
247 id2 = ( i2_ShowerMap->second ).getShowerId();
252 dtht = tht > tht2 ? tht - tht2 : tht2 - tht;
256 dist = sqrt(
double( dtht * dtht + dphi * dphi ) );
257 if ( dist < distmin )
261 if ( dtht > 6 ) dtht = 6;
262 if ( dphi > 6 ) dphi = 6;
269 i_ShowerMap->second.NearestSeed( nearest );
270 i_ShowerMap->second.ThetaGap( thetagap );
271 i_ShowerMap->second.PhiGap( phigap );
275 i_ShowerMap->second.Find( i_ShowerMap->second.getShowerId() )->second.getTime();
279 i_ShowerMap->second.setTime(
time );
280 aShowerMap[i_ShowerMap->first] = i_ShowerMap->second;
283 tmpShowerMap.clear();