143 {
144
145
146
147
149
150 if (fitresult == 0) return;
151
152
155
157 double Bz = theField.
bFieldZ();
158
159 int hitId = 0;
160 int nHits=0;
161 int nSt=0;
162
163
164
165
166
167
168
169
170
171
172
173
174 nHits = aList->
nHit();
175
176
177
178
179
181 double chisq = fitresult->
chisq();
182 int nDof = fitresult->
nDof();
183
184 double fltLenPoca = 0.0;
186
187 double phi0 = helix.
phi0();
188 double tanDip = helix.
tanDip();
189
190 double d0 = helix.
d0();
191
192
194
195 double helixPar[5];
196
197 helixPar[0] = -d0;
198
201 helixPar[1] = tphi0;
202
203 double pxy = fitresult->
pt();
204 if (pxy == 0.) helixPar[2] = 9999.;
205 else helixPar[2] =
q/fabs(pxy);
206 if(pxy>9999.) helixPar[2] = 0.00001;
207
208 helixPar[3] = helix.
z0();
209
210 helixPar[4] = tanDip;
211
212
213 HepSymMatrix mS(helix.
params().num_row(),0);
214 mS[0][0]=-1.;
215 mS[1][1]=1.;
216 mS[2][2]=-333.567/Bz;
217 mS[3][3]=1.;
218 mS[4][4]=1.;
219 HepSymMatrix mVy = helix.
covariance().similarity(mS);
220 double errorMat[15];
221 int k = 0;
222 for (int ie = 0 ; ie < 5 ; ie ++){
223 for (int je = ie ; je < 5 ; je ++) {
224 errorMat[k] = mVy[ie][je];
225 k++;
226 }
227 }
228 double p,px,py,pz;
229 px = pxy * (-
sin(helixPar[1]));
230 py = pxy *
cos(helixPar[1]);
231 pz = pxy * helixPar[4];
232 p = sqrt(pxy*pxy + pz*pz);
233
234 double theta = acos(pz/p);
235 double phi = atan2(py,px);
240 recMdcTrack->
setPx(px);
241 recMdcTrack->
setPy(py);
242 recMdcTrack->
setPz(pz);
243 recMdcTrack->
setP(p);
247 recMdcTrack->
setX(poca.x());
248 recMdcTrack->
setY(poca.y());
249 recMdcTrack->
setZ(poca.z());
250 recMdcTrack->
setR(sqrt(poca.x()*poca.x() + poca.y()*poca.y()));
262
264 vector<int> vecHits;
265
266 int maxLayerId = -1;
267 int minLayerId = 43;
268 double fiTerm = 999.;
271 for (;hot!=aList->
end();hot++){
274
276
277 recMdcHit->
setId(hitId);
278
279
280
281
282
283
284
285
286
287
288
289 double hotWireAmbig = recoHot->
wireAmbig();
290 double driftDist = fabs(recoHot->
drift());
291 double sigma = recoHot->
hitRms();
292 double doca = fabs(recoHot->
dcaToWire());
293 int flagLR=2;
294 if ( hotWireAmbig == 1){
295 flagLR = 0;
296 doca *= -1.;
297 }else if( hotWireAmbig == -1){
298 flagLR = 1;
299 }else if( hotWireAmbig == 0){
300 flagLR = 2;
301 }
307
310
311
312
313
314 double res=999.,rese=999.;
315 if (recoHot->
resid(res,rese,
false)){
316 }else{}
317 double deltaChi=0;
320
322
324
325
327
329 double fltLen = recoHot->
fltLen();
336
338
341
342
343 if (layerId >= maxLayerId){
344 maxLayerId = layerId;
345 fiTermHot = recoHot;
346 }
347 if (layerId < minLayerId){
348 minLayerId = layerId;
349 }
350
353 }else{
355 }
356
358 ++nSt;
359 }
360 hitList->push_back(recMdcHit);
361 SmartRef<RecMdcHit> refHit(recMdcHit);
362 hitRefVec.push_back(refHit);
364 ++hitId;
365 }
366
367 if (fiTermHot!=NULL){
368 fiTerm=(1./sqrt(1.+tanDip*tanDip))*fiTermHot->
fltLen()*helix.
omega();
369 }
371
376 trackList->push_back(recMdcTrack);
377}
double sin(const BesAngle a)
double cos(const BesAngle a)
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
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
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 setPivot(const HepPoint3D &pivot)
void setVecHits(HitRefVec vechits)
void setFiTerm(double fiterm)
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