60{
61
62
63
64
65
67
68
71 if(eCluster>Para.
SmCut(3)) {
73 } else {
75 }
77
81 RecEmcHitMap::const_iterator ciHitMap;
82 if(aMaxVec.size()==0) {
83
84 }
85
86
90
94
95 double time=aCluster.
Find(aMaxVec[0])->second.getTime();
97 for(ciHitMap=aCluster.
Begin();
98 ciHitMap!=aCluster.
End();
99 ++ciHitMap) {
100 aHit=ciHitMap->second;
101
102
103 aFraction=aHit;
105 aShower.
Insert(aFraction);
106
107 }
108
115
116 aShowerMap[aMaxVec[0]]=aShower;
117 }
118 }
119
120
121
123
124
125
126
128 RecEmcHitMap::const_iterator ci_HitMap;
132 RecEmcShowerMap::iterator i_ShowerMap,i2_ShowerMap;
133
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;
139
141 ISvcLocator* svcLocator = Gaudi::svcLocator();
142 StatusCode sc = svcLocator->service("EmcRecGeoSvc",iGeoSvc);
143 if(sc!=StatusCode::SUCCESS) {
144
145 }
146
147
148 for(ciMax=aMaxVec.begin();
149 ciMax!=aMaxVec.end();
150 ++ciMax) {
151
153 }
154 do {
155 centroidShift=0.;
156 tmpShowerMap.clear();
157 for(ciMax=aMaxVec.begin();
158 ciMax!=aMaxVec.end();
159 ++ciMax) {
160 double weightTotal=0.,
weight=0.;
161
164
165
166 for(ci_HitMap=tmpCluster.
Begin();
167 ci_HitMap!=tmpCluster.
End();
168 ++ci_HitMap) {
169
170 aFrac=ci_HitMap->second;
171 double aDistance=0;
173
174 bool isSeed=false;
175 for(ciMax1=aMaxVec.begin();
176 ciMax1!=aMaxVec.end();
177 ++ciMax1) {
178 HepPoint3D seedPoint(showerCentroid[*ciMax1]);
180
182 double theDistance;
184 isSeed=true;
185 theDistance=0.;
186 } else {
187 theDistance=(hitPoint-seedPoint).mag();
188 }
189
190 if(*ciMax1==*ciMax) {
191 aDistance=theDistance;
192 aESeed=theESeed;
193 }
194
196 }
197
200
201
202
205 }
206
207 weightTotal=0;
208 }
209
213 HepPoint3D oldCentroid(showerCentroid[*ciMax]);
214 centroidShift+=(newCentroid-oldCentroid).mag();
216 showerCentroid[*ciMax]=newCentroid;
217 }
218
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();
225 }
226 iterations++;
227
228 }
229 while((iterations<8)&&(centroidShift>0.01));
230
231 unsigned int tht,phi;
232 unsigned int tht2,
phi2;
233 unsigned int dtht,dphi;
234 unsigned int thetagap=0,phigap=0;
235 double distmin,dist;
237
238 for(i_ShowerMap=tmpShowerMap.begin();
239 i_ShowerMap!=tmpShowerMap.end();
240 ++i_ShowerMap) {
243 i_ShowerMap->second.setStatus(2);
247
248
249 id=(i_ShowerMap->second).getShowerId();
252 distmin=999999;
253 for(i2_ShowerMap=tmpShowerMap.begin();
254 i2_ShowerMap!=tmpShowerMap.end();
255 ++i2_ShowerMap) {
256 id2=(i2_ShowerMap->second).getShowerId();
259 if(id!=id2) {
260 dtht=tht>tht2 ? tht-tht2 : tht2-tht;
263 dist=sqrt(double(dtht*dtht+dphi*dphi));
264 if(dist<distmin) {
265 distmin=dist;
266 nearest=id2;
267 if(dtht>6) dtht=6;
268 if(dphi>6) dphi=6;
269 thetagap=dtht;
270 phigap=dphi;
271 }
272 }
273 }
274
275 i_ShowerMap->second.NearestSeed(nearest);
276 i_ShowerMap->second.ThetaGap(thetagap);
277 i_ShowerMap->second.PhiGap(phigap);
278
279
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;
286 }
287 }
288 tmpShowerMap.clear();
289 }
290
291}
*********Class see also m_nmax DOUBLE PRECISION m_MasPhot DOUBLE PRECISION m_phsu DOUBLE PRECISION m_Xenph DOUBLE PRECISION m_r2 DOUBLE PRECISION m_WtMass INTEGER m_nmax INTEGER m_Nevgen INTEGER m_IsFSR INTEGER m_MarTot *COMMON c_KarFin $ !Output file $ !Event serial number $ !alpha QED at Thomson limit $ !minimum energy at CMS for remooval $ !infrared dimensionless $ !dummy photon IR regulator $ !crude photon multiplicity enhancement factor *EVENT $ !MC crude volume of PhhSpace *Sfactors $ !YFS formfactor IR part only $ !YFS formfactor non IR finite part $ !mass weight
RecEmcIDVector::const_iterator ci_RecEmcIDVector
map< RecEmcID, RecEmcShower, less< RecEmcID > > RecEmcShowerMap
EvtComplex exp(const EvtComplex &c)
HepPoint3D position() const
void setTime(double time)
static unsigned int getPHI_BARREL_MAX()
static unsigned int theta_module(const Identifier &id)
static unsigned int phi_module(const Identifier &id)
double EThresholdCluster() const
double ElectronicsNoiseLevel() const
double LateralProfile() const
double MoliereRadius() const
double SmCut(int n) const
void Energy(RecEmcShower &aShower)
virtual void Position(RecEmcShower &aShower)=0
void CalculateMoment(RecEmcShower &aShower) const
virtual HepPoint3D GetCFrontCenter(const Identifier &id) const =0
RecEmcEnergy getEnergy() const
RecEmcID getClusterId() const
RecEmcHitMap::const_iterator Find(const RecEmcID &CellId) const
double getSecondMoment() const
RecEmcHitMap::const_iterator Begin() const
RecEmcHitMap::const_iterator End() const
void InsertShowerId(const RecEmcID id)
RecEmcFrac Fraction(const RecEmcFrac &Fraction)
RecEmcFrac getFraction() const
RecEmcEnergy getEnergy() const
RecEmcID getCellId() const
RecEmcID getShowerId() const
void ClusterId(const RecEmcID id)
RecEmcID ShowerId(RecEmcID id)
void Insert(const RecEmcFraction &aFraction)