152 {
153
154
155
156
158
159 if (fitresult == 0) return;
160
161
164
166 double Bz = theField.
bFieldZ();
167
168 int hitId = 0;
169 int nHits=0;
170 int nSt=0;
171
172
173
174
175
176
177
178
179
180
181
182
183 nHits = aList->
nHit();
184
185
186
187
188
190 double chisq = fitresult->
chisq();
191 int nDof = fitresult->
nDof();
192
193 double fltLenPoca = 0.0;
195
196 double phi0 = helix.
phi0();
197 double tanDip = helix.
tanDip();
198
199 double d0 = helix.
d0();
200
201
203
204 double helixPar[5];
205
206 helixPar[0] = -d0;
207
210 helixPar[1] = tphi0;
211
212 double pxy = fitresult->
pt();
213 if (pxy == 0.) helixPar[2] = 9999.;
214 else helixPar[2] =
q/fabs(pxy);
215 if(pxy>9999.) helixPar[2] = 0.00001;
216
217 helixPar[3] = helix.
z0();
218
219 helixPar[4] = tanDip;
220
221
222 HepSymMatrix mS(helix.
params().num_row(),0);
223 mS[0][0]=-1.;
224 mS[1][1]=1.;
225 mS[2][2]=-333.567/Bz;
226 mS[3][3]=1.;
227 mS[4][4]=1.;
228 HepSymMatrix mVy = helix.
covariance().similarity(mS);
229 double errorMat[15];
230 int k = 0;
231 for (int ie = 0 ; ie < 5 ; ie ++){
232 for (int je = ie ; je < 5 ; je ++) {
233 errorMat[k] = mVy[ie][je];
234 k++;
235 }
236 }
237 double p,px,py,pz;
238 px = pxy * (-
sin(helixPar[1]));
239 py = pxy *
cos(helixPar[1]);
240 pz = pxy * helixPar[4];
241 p = sqrt(pxy*pxy + pz*pz);
242
243 double theta = acos(pz/p);
244 double phi = atan2(py,px);
249 recMdcTrack->
setPx(px);
250 recMdcTrack->
setPy(py);
251 recMdcTrack->
setPz(pz);
252 recMdcTrack->
setP(p);
256 recMdcTrack->
setX(poca.x());
257 recMdcTrack->
setY(poca.y());
258 recMdcTrack->
setZ(poca.z());
259 recMdcTrack->
setR(sqrt(poca.x()*poca.x() + poca.y()*poca.y()));
270
273 vector<int> vecHits;
274 map<int,int> clusterFitStat;
275
276 int maxLayerId = -1;
277 int minLayerId = 43;
278 double fiTerm = 999.;
281 for (;hot!=aList->
end();hot++){
282
286
288
289 recMdcHit->
setId(hitId);
290
291
292
293
294
295
296
297
298
299
300
301 double hotWireAmbig = recoHot->
wireAmbig();
302 double driftDist = fabs(recoHot->
drift());
303 double sigma = recoHot->
hitRms();
304 double doca = fabs(recoHot->
dcaToWire());
305 int flagLR=2;
306 if ( hotWireAmbig == 1){
307 flagLR = 0;
308 doca *= -1.;
309 }else if( hotWireAmbig == -1){
310 flagLR = 1;
311 }else if( hotWireAmbig == 0){
312 flagLR = 2;
313 }
319
322
323
324
325
326 double res=999.,rese=999.;
327 if (recoHot->
resid(res,rese,
false)){
328 }else{}
329 double deltaChi=0;
332
334
336
337
339
341 double fltLen = recoHot->
fltLen();
348
350
353
354
355 if (layerId >= maxLayerId){
356 maxLayerId = layerId;
357 fiTermHot = recoHot;
358 }
359 if (layerId < minLayerId){
360 minLayerId = layerId;
361 }
362
365 }else{
367 }
368
370 ++nSt;
371 }
372 hitList->push_back(recMdcHit);
373 SmartRef<RecMdcHit> refHit(recMdcHit);
374 hitRefVec.push_back(refHit);
376 ++hitId;
382 clusterFitStat[clusterid] = stat;
383
384
385 clusterRefVec.push_back(recCgemCluster);
386 }
387 }
388 std::sort(clusterRefVec.begin(),clusterRefVec.end(),
sortCluster);
389
390 if (fiTermHot!=NULL){
391 fiTerm=(1./sqrt(1.+tanDip*tanDip))*fiTermHot->
fltLen()*helix.
omega();
392 }
394
397
398
402
403
406 trackList->push_back(recMdcTrack);
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451}
bool sortCluster(const RecCgemCluster *clusterA, const RecCgemCluster *clusterB)
double sin(const BesAngle a)
double cos(const BesAngle a)
SmartRefVector< RecCgemCluster > ClusterRefVec
SmartRefVector< RecMdcHit > HitRefVec
****INTEGER imax DOUBLE PRECISION m_pi *DOUBLE PRECISION m_amfin DOUBLE PRECISION m_Chfin DOUBLE PRECISION m_Xenph DOUBLE PRECISION m_sinw2 DOUBLE PRECISION m_GFermi DOUBLE PRECISION m_MfinMin DOUBLE PRECISION m_ta2 INTEGER m_out INTEGER m_KeyFSR INTEGER m_KeyQCD *COMMON c_Semalib $ !copy of input $ !CMS energy $ !beam mass $ !final mass $ !beam charge $ !final charge $ !smallest final mass $ !Z mass $ !Z width $ !EW mixing angle $ !Gmu Fermi $ alphaQED at q
const RecCgemCluster * baseHit() const
void setFirstLayer(const int id)
void setPxy(const double pxy)
void setTrackId(const int trackId)
void setPy(const double py)
void setZ(const double z)
void setNster(const int ns)
void setX(const double x)
void setError(double err[15])
void setNdof(const int ndof)
void setTheta(const double theta)
void setStat(const int stat)
void setP(const double p)
void setHelix(double helix[5])
void setPoca(double poca[3])
void setR(const double r)
void setCharge(const int charge)
void setLastLayer(const int id)
void setY(const double y)
void setChi2(const double chi)
void setPhi(const double phi)
void setPz(const double pz)
void setPx(const double px)
value_type get_value() const
double entranceAngle() const
const MdcLayer * layer() const
const MdcDigi * digi() const
unsigned layernumber() const
unsigned wirenumber() const
unsigned adcIndex() const
double driftTime(double tof, double z) const
unsigned tdcIndex() const
const MdcHit * mdcHit() const
virtual Identifier identify() const
int getclusterid(void) const
void setMdcId(Identifier mdcid)
void setErrDriftDistRight(double erddr)
void setFltLen(double fltLen)
void setErrDriftDistLeft(double erddl)
void setDriftDistLeft(double ddl)
void setDoca(double doca)
void setChisqAdd(double pChisq)
void setZhit(double zhit)
void setDriftT(double driftT)
void setDriftDistRight(double ddr)
void setEntra(double entra)
void setVecClusters(ClusterRefVec vecclusters)
void setPivot(const HepPoint3D &pivot)
void setVecHits(HitRefVec vechits)
void setFiTerm(double fiterm)
void setNcluster(int ncluster)
virtual void getInfo(double fltLen, HepPoint3D &pos, Hep3Vector &direction) const =0
virtual double pt(double fltL=0.) const =0
virtual double chisq() const =0
virtual int charge() const =0
virtual int nDof() const =0
virtual const TrkDifTraj & traj() const =0
virtual HepPoint3D position(double fltL) const =0
const HepVector & params() const
const HepSymMatrix & covariance() const
hot_iterator begin() const
double resid(bool exclude=false) const
const TrkRep * getParentRep() const
TrkErrCode getFitStuff(HepVector &derivs, double &deltaChi) const
const BField & bField() const
virtual double arrivalTime(double fltL) const