146 {
147
148
149
150
152
153 if ( fitresult == 0 ) return;
154
155
156 RecMdcTrack* recMdcTrack = new RecMdcTrack();
157 const TrkHitList* aList =
track().
hits();
158
160 double Bz = theField.
bFieldZ();
161
162 int hitId = 0;
163 int nHits = 0;
164 int nSt = 0;
165
166
167
168
169
170
171
172
173
174
175
176
177 nHits = aList->
nHit();
178
179
180
181
182
184 double chisq = fitresult->
chisq();
185 int nDof = fitresult->
nDof();
186
187 double fltLenPoca = 0.0;
188 TrkExchangePar helix = fitresult->
helix( fltLenPoca );
189
190
191 double phi0 = helix.
phi0();
192 double tanDip = helix.
tanDip();
193
194 double d0 = helix.
d0();
195
196
198
199 double helixPar[5];
200
201 helixPar[0] = -d0;
202
205 helixPar[1] = tphi0;
206
207 double pxy = fitresult->
pt();
208 if ( pxy == 0. ) helixPar[2] = 9999.;
209 else helixPar[2] =
q / fabs( pxy );
210 if ( pxy > 9999. ) helixPar[2] = 0.00001;
211
212 helixPar[3] = helix.
z0();
213
214 helixPar[4] = tanDip;
215
216
217 HepSymMatrix mS( helix.
params().num_row(), 0 );
218 mS[0][0] = -1.;
219 mS[1][1] = 1.;
220 mS[2][2] = -333.567 / Bz;
221 mS[3][3] = 1.;
222 mS[4][4] = 1.;
223 HepSymMatrix mVy = helix.
covariance().similarity( mS );
224 double errorMat[15];
225 int k = 0;
226 for ( int ie = 0; ie < 5; ie++ )
227 {
228 for ( int je = ie; je < 5; je++ )
229 {
230 errorMat[k] = mVy[ie][je];
231 k++;
232 }
233 }
234 double p, px, py, pz;
235 px = pxy * ( -
sin( helixPar[1] ) );
236 py = pxy *
cos( helixPar[1] );
237 pz = pxy * helixPar[4];
238 p = sqrt( pxy * pxy + pz * pz );
239
240 double theta = acos( pz / p );
241 double phi = atan2( py, px );
245 recMdcTrack->
setPxy( pxy );
246 recMdcTrack->
setPx( px );
247 recMdcTrack->
setPy( py );
248 recMdcTrack->
setPz( pz );
249 recMdcTrack->
setP( p );
251 recMdcTrack->
setPhi( phi );
253 recMdcTrack->
setX( poca.x() );
254 recMdcTrack->
setY( poca.y() );
255 recMdcTrack->
setZ( poca.z() );
256 recMdcTrack->
setR( sqrt( poca.x() * poca.x() + poca.y() * poca.y() ) );
259 recMdcTrack->
setVX0( 0. );
260 recMdcTrack->
setVY0( 0. );
261 recMdcTrack->
setVZ0( 0. );
266 recMdcTrack->
setStat( tkStat );
268
270 vector<int> vecHits;
271
272 int maxLayerId = -1;
273 int minLayerId = 43;
274 double fiTerm = 999.;
275 const MdcRecoHitOnTrack* fiTermHot = NULL;
277 for ( ; hot != aList->
end(); hot++ )
278 {
279 const MdcRecoHitOnTrack* recoHot;
280 recoHot = dynamic_cast<const MdcRecoHitOnTrack*>( &( *hot ) );
281
282 RecMdcHit* recMdcHit = new RecMdcHit;
283
284 recMdcHit->
setId( hitId );
285
286
287
288
289
290
291
292
293
294
295
296 double hotWireAmbig = recoHot->
wireAmbig();
297 double driftDist = fabs( recoHot->
drift() );
298 double sigma = recoHot->
hitRms();
299 double doca = fabs( recoHot->
dcaToWire() );
300 int flagLR = 2;
301 if ( hotWireAmbig == 1 )
302 {
303 flagLR = 0;
304 doca *= -1.;
305 }
306 else if ( hotWireAmbig == -1 )
307 {
308 flagLR = 1;
309 }
310 else if ( hotWireAmbig == 0 )
311 {
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 Hep3Vector dir;
342 double fltLen = recoHot->
fltLen();
349
351
354
355
356
357 if ( layerId >= maxLayerId )
358 {
359 maxLayerId = layerId;
360 fiTermHot = recoHot;
361 }
362 if ( layerId < minLayerId ) { minLayerId = layerId; }
363
365 else { recMdcHit->
setStat( 0 ); }
366
367 if ( recoHot->
layer()->
view() ) { ++nSt; }
368 hitList->push_back( recMdcHit );
369 SmartRef<RecMdcHit> refHit( recMdcHit );
370 hitRefVec.push_back( refHit );
372 ++hitId;
373 }
374
375 if ( fiTermHot != NULL )
376 { fiTerm = ( 1. / sqrt( 1. + tanDip * tanDip ) ) * fiTermHot->
fltLen() * helix.
omega(); }
378
383 trackList->push_back( recMdcTrack );
384}
HepGeom::Point3D< double > HepPoint3D
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
TrkHotList::hot_iterator hot_iterator
double resid(bool exclude=false) const
const TrkRep * getParentRep() const
TrkErrCode getFitStuff(HepVector &derivs, double &deltaChi) const
const MdcPatRec::BField & bField() const
virtual double arrivalTime(double fltL) const