48 {
49
50
51
52
53
55
56
59 if ( eCluster > Para.
SmCut( 3 ) )
61 else
62 {
65 }
67
68 RecEmcShower aShower;
69 RecEmcHit aHit;
70 RecEmcFraction aFraction;
71 RecEmcHitMap::const_iterator ciHitMap;
72 if ( aMaxVec.size() == 0 )
73 {
74
75 }
76
77
78 else if ( aMaxVec.size() == 1 || aMaxVec.size() > 20 || aCluster.
getSecondMoment() <
cut )
79 {
82
86
87 double time = aCluster.
Find( aMaxVec[0] )->second.getTime();
89 {
90 for ( ciHitMap = aCluster.
Begin(); ciHitMap != aCluster.
End(); ++ciHitMap )
91 {
92 aHit = ciHitMap->second;
93
94
95 aFraction = aHit;
97 aShower.
Insert( aFraction );
98
99 }
100
107
108 aShowerMap[aMaxVec[0]] = aShower;
109 }
110 }
111
112
113 else if ( aMaxVec.size() > 1 && aMaxVec.size() <= 20 && aCluster.
getSecondMoment() >
cut )
114 {
115
116
117
118
119 RecEmcCluster tmpCluster = aCluster;
120 RecEmcHitMap::const_iterator ci_HitMap;
122 ;
123 RecEmcShower aShower;
125 RecEmcShowerMap::iterator i_ShowerMap, i2_ShowerMap;
126
127 RecEmcFraction aFrac;
128 unsigned int iterations = 0;
129 double centroidShift;
130 map<RecEmcID, HepPoint3D, less<RecEmcID>> showerCentroid;
131 map<RecEmcID, HepPoint3D, less<RecEmcID>>::const_iterator ci_showerCentroid;
132
133 IEmcRecGeoSvc* iGeoSvc;
134 ISvcLocator* svcLocator = Gaudi::svcLocator();
135 StatusCode sc = svcLocator->service( "EmcRecGeoSvc", iGeoSvc );
136 if ( sc != StatusCode::SUCCESS )
137 {
138
139 }
140
141
142 for ( ciMax = aMaxVec.begin(); ciMax != aMaxVec.end(); ++ciMax )
143 {
144
146 }
147 do {
148 centroidShift = 0.;
149 tmpShowerMap.clear();
150 for ( ciMax = aMaxVec.begin(); ciMax != aMaxVec.end(); ++ciMax )
151 {
152 double weightTotal = 0.,
weight = 0.;
153
156
157
158 for ( ci_HitMap = tmpCluster.
Begin(); ci_HitMap != tmpCluster.
End(); ++ci_HitMap )
159 {
160
161 aFrac = ci_HitMap->second;
162 double aDistance = 0;
164
165 bool isSeed = false;
166 for ( ciMax1 = aMaxVec.begin(); ciMax1 != aMaxVec.end(); ++ciMax1 )
167 {
168 HepPoint3D seedPoint( showerCentroid[*ciMax1] );
170
172 double theDistance;
174 {
175 isSeed = true;
176 theDistance = 0.;
177 }
178 else { theDistance = ( hitPoint - seedPoint ).mag(); }
179
180 if ( *ciMax1 == *ciMax )
181 {
182 aDistance = theDistance;
183 aESeed = theESeed;
184 }
185
186 weightTotal +=
188 }
189
191 weightTotal;
193
194
195
197 { aShower.
Insert( aFrac ); }
198
199 weightTotal = 0;
200 }
201
205 HepPoint3D oldCentroid( showerCentroid[*ciMax] );
206 centroidShift += ( newCentroid - oldCentroid ).mag();
208 showerCentroid[*ciMax] = newCentroid;
209 }
210
211 centroidShift /= (double)aMaxVec.size();
212 for ( ci_showerCentroid = showerCentroid.begin();
213 ci_showerCentroid != showerCentroid.end(); ci_showerCentroid++ )
214 {
215 showerCentroid[ci_showerCentroid->first] =
216 tmpShowerMap[ci_showerCentroid->first].position();
217 }
218 iterations++;
219
220 } while ( ( iterations < 8 ) && ( centroidShift > 0.01 ) );
221
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;
228
229 for ( i_ShowerMap = tmpShowerMap.begin(); i_ShowerMap != tmpShowerMap.end();
230 ++i_ShowerMap )
231 {
233 i_ShowerMap->second.ClusterId( aCluster.
getClusterId() );
234 i_ShowerMap->second.setStatus( 2 );
235 fShowerE->Energy( i_ShowerMap->second );
238
239
240 id = ( i_ShowerMap->second ).getShowerId();
243 distmin = 999999;
244 for ( i2_ShowerMap = tmpShowerMap.begin(); i2_ShowerMap != tmpShowerMap.end();
245 ++i2_ShowerMap )
246 {
247 id2 = ( i2_ShowerMap->second ).getShowerId();
250 if ( id != id2 )
251 {
252 dtht = tht > tht2 ? tht - tht2 : tht2 - tht;
256 dist = sqrt( double( dtht * dtht + dphi * dphi ) );
257 if ( dist < distmin )
258 {
259 distmin = dist;
260 nearest = id2;
261 if ( dtht > 6 ) dtht = 6;
262 if ( dphi > 6 ) dphi = 6;
263 thetagap = dtht;
264 phigap = dphi;
265 }
266 }
267 }
268
269 i_ShowerMap->second.NearestSeed( nearest );
270 i_ShowerMap->second.ThetaGap( thetagap );
271 i_ShowerMap->second.PhiGap( phigap );
272
273
275 i_ShowerMap->second.Find( i_ShowerMap->second.getShowerId() )->second.getTime();
278 {
279 i_ShowerMap->second.setTime(
time );
280 aShowerMap[i_ShowerMap->first] = i_ShowerMap->second;
281 }
282 }
283 tmpShowerMap.clear();
284 }
285}
HepGeom::Point3D< double > HepPoint3D
RecEmcIDVector::const_iterator ci_RecEmcIDVector
map< RecEmcID, RecEmcShower, less< RecEmcID > > RecEmcShowerMap
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
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
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)