71 if(eCluster>Para.
SmCut(3)) {
81 RecEmcHitMap::const_iterator ciHitMap;
82 if(aMaxVec.size()==0) {
95 double time=aCluster.
Find(aMaxVec[0])->second.getTime();
97 for(ciHitMap=aCluster.
Begin();
98 ciHitMap!=aCluster.
End();
100 aHit=ciHitMap->second;
105 aShower.
Insert(aFraction);
116 aShowerMap[aMaxVec[0]]=aShower;
128 RecEmcHitMap::const_iterator ci_HitMap;
132 RecEmcShowerMap::iterator i_ShowerMap,i2_ShowerMap;
135 unsigned int iterations=0;
136 double centroidShift;
137 map<RecEmcID,HepPoint3D,less<RecEmcID> > showerCentroid;
138 map<RecEmcID,HepPoint3D,less<RecEmcID> >::const_iterator ci_showerCentroid;
141 ISvcLocator* svcLocator = Gaudi::svcLocator();
142 StatusCode sc = svcLocator->service(
"EmcRecGeoSvc",iGeoSvc);
143 if(sc!=StatusCode::SUCCESS) {
148 for(ciMax=aMaxVec.begin();
149 ciMax!=aMaxVec.end();
156 tmpShowerMap.clear();
157 for(ciMax=aMaxVec.begin();
158 ciMax!=aMaxVec.end();
160 double weightTotal=0.,
weight=0.;
166 for(ci_HitMap=tmpCluster.
Begin();
167 ci_HitMap!=tmpCluster.
End();
170 aFrac=ci_HitMap->second;
175 for(ciMax1=aMaxVec.begin();
176 ciMax1!=aMaxVec.end();
178 HepPoint3D seedPoint(showerCentroid[*ciMax1]);
187 theDistance=(hitPoint-seedPoint).mag();
190 if(*ciMax1==*ciMax) {
191 aDistance=theDistance;
213 HepPoint3D oldCentroid(showerCentroid[*ciMax]);
214 centroidShift+=(newCentroid-oldCentroid).mag();
216 showerCentroid[*ciMax]=newCentroid;
219 centroidShift/=(double)aMaxVec.size();
220 for(ci_showerCentroid=showerCentroid.begin();
221 ci_showerCentroid!=showerCentroid.end();
222 ci_showerCentroid++){
223 showerCentroid[ci_showerCentroid->first]
224 =tmpShowerMap[ci_showerCentroid->first].position();
229 while((iterations<8)&&(centroidShift>0.01));
231 unsigned int tht,phi;
232 unsigned int tht2,
phi2;
233 unsigned int dtht,dphi;
234 unsigned int thetagap=0,phigap=0;
238 for(i_ShowerMap=tmpShowerMap.begin();
239 i_ShowerMap!=tmpShowerMap.end();
243 i_ShowerMap->second.setStatus(2);
249 id=(i_ShowerMap->second).getShowerId();
253 for(i2_ShowerMap=tmpShowerMap.begin();
254 i2_ShowerMap!=tmpShowerMap.end();
256 id2=(i2_ShowerMap->second).getShowerId();
260 dtht=tht>tht2 ? tht-tht2 : tht2-tht;
263 dist=sqrt(
double(dtht*dtht+dphi*dphi));
275 i_ShowerMap->second.NearestSeed(nearest);
276 i_ShowerMap->second.ThetaGap(thetagap);
277 i_ShowerMap->second.PhiGap(phigap);
281 i_ShowerMap->second.Find(i_ShowerMap->second.getShowerId())->second.getTime();
284 i_ShowerMap->second.setTime(
time);
285 aShowerMap[i_ShowerMap->first]=i_ShowerMap->second;
288 tmpShowerMap.clear();