44{
45
46
47
48
49
51
52
55 if(eCluster>Para.
SmCut(3)) {
57 } else {
59 }
61
65 RecEmcHitMap::const_iterator ciHitMap;
66 if(aMaxVec.size()==0) {
67
68 }
69
70
74
78
79 double time=aCluster.
Find(aMaxVec[0])->second.getTime();
81 for(ciHitMap=aCluster.
Begin();
82 ciHitMap!=aCluster.
End();
83 ++ciHitMap) {
84 aHit=ciHitMap->second;
85
86
87 aFraction=aHit;
90
91 }
92
99
100 aShowerMap[aMaxVec[0]]=aShower;
101 }
102 }
103
104
105
107
108
109
110
112 RecEmcHitMap::const_iterator ci_HitMap;
116 RecEmcShowerMap::iterator i_ShowerMap,i2_ShowerMap;
117
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;
123
125 ISvcLocator* svcLocator = Gaudi::svcLocator();
126 StatusCode sc = svcLocator->service("EmcRecGeoSvc",iGeoSvc);
127 if(sc!=StatusCode::SUCCESS) {
128
129 }
130
131
132 for(ciMax=aMaxVec.begin();
133 ciMax!=aMaxVec.end();
134 ++ciMax) {
135
137 }
138 do {
139 centroidShift=0.;
140 tmpShowerMap.clear();
141 for(ciMax=aMaxVec.begin();
142 ciMax!=aMaxVec.end();
143 ++ciMax) {
144 double weightTotal=0.,
weight=0.;
145
148
149
150 for(ci_HitMap=tmpCluster.
Begin();
151 ci_HitMap!=tmpCluster.
End();
152 ++ci_HitMap) {
153
154 aFrac=ci_HitMap->second;
155 double aDistance=0;
157
158 bool isSeed=false;
159 for(ciMax1=aMaxVec.begin();
160 ciMax1!=aMaxVec.end();
161 ++ciMax1) {
162 HepPoint3D seedPoint(showerCentroid[*ciMax1]);
164
166 double theDistance;
168 isSeed=true;
169 theDistance=0.;
170 } else {
171 theDistance=(hitPoint-seedPoint).mag();
172 }
173
174 if(*ciMax1==*ciMax) {
175 aDistance=theDistance;
176 aESeed=theESeed;
177 }
178
180 }
181
184
185
186
189 }
190
191 weightTotal=0;
192 }
193
197 HepPoint3D oldCentroid(showerCentroid[*ciMax]);
198 centroidShift+=(newCentroid-oldCentroid).mag();
200 showerCentroid[*ciMax]=newCentroid;
201 }
202
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();
209 }
210 iterations++;
211
212 }
213 while((iterations<8)&&(centroidShift>0.01));
214
215 unsigned int tht,phi;
216 unsigned int tht2,
phi2;
217 unsigned int dtht,dphi;
218 unsigned int thetagap=0,phigap=0;
219 double distmin,dist;
221
222 for(i_ShowerMap=tmpShowerMap.begin();
223 i_ShowerMap!=tmpShowerMap.end();
224 ++i_ShowerMap) {
227 i_ShowerMap->second.setStatus(2);
231
232
233 id=(i_ShowerMap->second).getShowerId();
236 distmin=999999;
237 for(i2_ShowerMap=tmpShowerMap.begin();
238 i2_ShowerMap!=tmpShowerMap.end();
239 ++i2_ShowerMap) {
240 id2=(i2_ShowerMap->second).getShowerId();
243 if(id!=id2) {
244 dtht=tht>tht2 ? tht-tht2 : tht2-tht;
247 dist=sqrt(double(dtht*dtht+dphi*dphi));
248 if(dist<distmin) {
249 distmin=dist;
250 nearest=id2;
251 if(dtht>6) dtht=6;
252 if(dphi>6) dphi=6;
253 thetagap=dtht;
254 phigap=dphi;
255 }
256 }
257 }
258
259 i_ShowerMap->second.NearestSeed(nearest);
260 i_ShowerMap->second.ThetaGap(thetagap);
261 i_ShowerMap->second.PhiGap(phigap);
262
263
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;
270 }
271 }
272 tmpShowerMap.clear();
273 }
274
275}
EvtComplex exp(const EvtComplex &c)
*********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 cut
*********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
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)