55 if(eCluster>Para.
SmCut(3)) {
65 RecEmcHitMap::const_iterator ciHitMap;
66 if(aMaxVec.size()==0) {
79 double time=aCluster.
Find(aMaxVec[0])->second.getTime();
81 for(ciHitMap=aCluster.
Begin();
82 ciHitMap!=aCluster.
End();
84 aHit=ciHitMap->second;
100 aShowerMap[aMaxVec[0]]=aShower;
112 RecEmcHitMap::const_iterator ci_HitMap;
116 RecEmcShowerMap::iterator i_ShowerMap,i2_ShowerMap;
119 unsigned int iterations=0;
120 double centroidShift;
121 map<RecEmcID,HepPoint3D,less<RecEmcID> > showerCentroid;
122 map<RecEmcID,HepPoint3D,less<RecEmcID> >::const_iterator ci_showerCentroid;
125 ISvcLocator* svcLocator = Gaudi::svcLocator();
126 StatusCode sc = svcLocator->service(
"EmcRecGeoSvc",iGeoSvc);
127 if(sc!=StatusCode::SUCCESS) {
132 for(ciMax=aMaxVec.begin();
133 ciMax!=aMaxVec.end();
140 tmpShowerMap.clear();
141 for(ciMax=aMaxVec.begin();
142 ciMax!=aMaxVec.end();
144 double weightTotal=0.,
weight=0.;
150 for(ci_HitMap=tmpCluster.
Begin();
151 ci_HitMap!=tmpCluster.
End();
154 aFrac=ci_HitMap->second;
159 for(ciMax1=aMaxVec.begin();
160 ciMax1!=aMaxVec.end();
162 HepPoint3D seedPoint(showerCentroid[*ciMax1]);
171 theDistance=(hitPoint-seedPoint).mag();
174 if(*ciMax1==*ciMax) {
175 aDistance=theDistance;
197 HepPoint3D oldCentroid(showerCentroid[*ciMax]);
198 centroidShift+=(newCentroid-oldCentroid).mag();
200 showerCentroid[*ciMax]=newCentroid;
203 centroidShift/=(double)aMaxVec.size();
204 for(ci_showerCentroid=showerCentroid.begin();
205 ci_showerCentroid!=showerCentroid.end();
206 ci_showerCentroid++){
207 showerCentroid[ci_showerCentroid->first]
208 =tmpShowerMap[ci_showerCentroid->first].position();
213 while((iterations<8)&&(centroidShift>0.01));
215 unsigned int tht,phi;
216 unsigned int tht2,
phi2;
217 unsigned int dtht,dphi;
218 unsigned int thetagap=0,phigap=0;
222 for(i_ShowerMap=tmpShowerMap.begin();
223 i_ShowerMap!=tmpShowerMap.end();
227 i_ShowerMap->second.setStatus(2);
233 id=(i_ShowerMap->second).getShowerId();
237 for(i2_ShowerMap=tmpShowerMap.begin();
238 i2_ShowerMap!=tmpShowerMap.end();
240 id2=(i2_ShowerMap->second).getShowerId();
244 dtht=tht>tht2 ? tht-tht2 : tht2-tht;
247 dist=sqrt(
double(dtht*dtht+dphi*dphi));
259 i_ShowerMap->second.NearestSeed(nearest);
260 i_ShowerMap->second.ThetaGap(thetagap);
261 i_ShowerMap->second.PhiGap(phigap);
265 i_ShowerMap->second.Find(i_ShowerMap->second.getShowerId())->second.getTime();
268 i_ShowerMap->second.setTime(
time);
269 aShowerMap[i_ShowerMap->first]=i_ShowerMap->second;
272 tmpShowerMap.clear();