2 // Original: AliHLTTrack.cxx,v 1.32 2005/06/14 10:55:21 cvetan
4 /**************************************************************************
5 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
7 * Authors: Anders Vestbo, Uli Frankenfeld *
8 * Matthias Richter <Matthias.Richter@ift.uib.no> *
9 * for The ALICE Off-line Project. *
11 * Permission to use, copy, modify and distribute this software and its *
12 * documentation strictly for non-commercial purposes is hereby granted *
13 * without fee, provided that the above copyright notice appears in all *
14 * copies and that both the copyright notice and this permission notice *
15 * appear in the supporting documentation. The authors make no claims *
16 * about the suitability of this software for any purpose. It is *
17 * provided "as is" without express or implied warranty. *
18 **************************************************************************/
20 /** @file AliHLTTPCTrack.cxx
21 @author Anders Vestbo, Uli Frankenfeld, maintained by Matthias Richter
23 @brief HLT TPC track implementation (conformal mapping) */
26 #include "AliHLTTPCLogging.h"
27 #include "AliHLTTPCTrack.h"
28 #include "AliHLTTPCTransform.h"
29 #include "AliHLTTPCVertex.h"
30 #include "AliHLTTPCSpacePointData.h"
36 ClassImp(AliHLTTPCTrack)
39 AliHLTTPCTrack::AliHLTTPCTrack()
83 memset(fHitNumbers,0,159*sizeof(UInt_t));
86 void AliHLTTPCTrack::Copy(AliHLTTPCTrack *tpt)
89 SetRowRange(tpt->GetFirstRow(),tpt->GetLastRow());
90 SetPhi0(tpt->GetPhi0());
91 SetKappa(tpt->GetKappa());
92 SetNHits(tpt->GetNHits());
93 SetFirstPoint(tpt->GetFirstPointX(),tpt->GetFirstPointY(),tpt->GetFirstPointZ());
94 SetLastPoint(tpt->GetLastPointX(),tpt->GetLastPointY(),tpt->GetLastPointZ());
96 SetPsi(tpt->GetPsi());
97 SetTgl(tpt->GetTgl());
98 SetPterr(tpt->GetPterr());
99 SetPsierr(tpt->GetPsierr());
100 SetTglerr(tpt->GetTglerr());
101 SetCharge(tpt->GetCharge());
102 SetHits(tpt->GetNHits(),(UInt_t *)tpt->GetHitNumbers());
104 SetMCid(tpt->GetMCid());
106 SetPID(tpt->GetPID());
107 SetSector(tpt->GetSector());
110 Int_t AliHLTTPCTrack::Compare(const AliHLTTPCTrack *track) const
113 if(track->GetNHits() < GetNHits()) return 1;
114 if(track->GetNHits() > GetNHits()) return -1;
118 AliHLTTPCTrack::~AliHLTTPCTrack()
123 Double_t AliHLTTPCTrack::GetP() const
125 // Returns total momentum.
126 return fabs(GetPt())*sqrt(1. + GetTgl()*GetTgl());
129 Double_t AliHLTTPCTrack::GetPseudoRapidity() const
131 return 0.5 * log((GetP() + GetPz()) / (GetP() - GetPz()));
135 Double_t AliHLTTPCTrack::GetEta() const
137 return GetPseudoRapidity();
141 Double_t AliHLTTPCTrack::GetRapidity() const
144 const Double_t kmpi = 0.13957;
145 return 0.5 * log((kmpi + GetPz()) / (kmpi - GetPz()));
148 void AliHLTTPCTrack::Rotate(Int_t slice,Bool_t tolocal)
150 //Rotate track to global parameters
151 //If flag tolocal is set, the track is rotated
152 //to local coordinates.
154 Float_t psi[1] = {GetPsi()};
156 AliHLTTPCTransform::Local2GlobalAngle(psi,slice);
158 AliHLTTPCTransform::Global2LocalAngle(psi,slice);
161 first[0] = GetFirstPointX();
162 first[1] = GetFirstPointY();
163 first[2] = GetFirstPointZ();
165 AliHLTTPCTransform::Local2Global(first,slice);
167 AliHLTTPCTransform::Global2LocHLT(first,slice);
168 //AliHLTTPCTransform::Global2Local(first,slice,kTRUE);
170 SetFirstPoint(first[0],first[1],first[2]);
172 last[0] = GetLastPointX();
173 last[1] = GetLastPointY();
174 last[2] = GetLastPointZ();
176 AliHLTTPCTransform::Local2Global(last,slice);
178 AliHLTTPCTransform::Global2LocHLT(last,slice);
179 //AliHLTTPCTransform::Global2Local(last,slice,kTRUE);
180 SetLastPoint(last[0],last[1],last[2]);
182 Float_t center[3] = {GetCenterX(),GetCenterY(),0};
184 AliHLTTPCTransform::Local2Global(center,slice);
186 AliHLTTPCTransform::Global2LocHLT(center,slice);
187 //AliHLTTPCTransform::Global2Local(center,slice,kTRUE);
188 SetCenterX(center[0]);
189 SetCenterY(center[1]);
191 SetPhi0(atan2(fFirstPoint[1],fFirstPoint[0]));
192 SetR0(sqrt(fFirstPoint[0]*fFirstPoint[0]+fFirstPoint[1]*fFirstPoint[1]));
200 void AliHLTTPCTrack::CalculateHelix()
202 // fit assigned clusters to helix
203 // #### -B0-CHANGE-START == JMT
204 // for straight line fit
205 if (AliHLTTPCTransform::GetBFieldValue() == 0.0 ){
206 fRadius = 999999; //just zero
208 SetPhi0(atan2(fFirstPoint[1],fFirstPoint[0]));
209 SetR0(sqrt(fFirstPoint[0]*fFirstPoint[0]+fFirstPoint[1]*fFirstPoint[1]));
213 // #### -B0-UNCHANGED-START == JMT
214 //Calculate Radius, CenterX and CenterY from Psi, X0, Y0
215 fRadius = fPt / (AliHLTTPCTransform::GetBFieldValue());
216 if(fRadius) fKappa = -fQ*1./fRadius;
217 else fRadius = 999999; //just zero
218 Double_t trackPhi0 = fPsi + fQ * AliHLTTPCTransform::PiHalf();
220 fCenterX = fFirstPoint[0] - fRadius * cos(trackPhi0);
221 fCenterY = fFirstPoint[1] - fRadius * sin(trackPhi0);
223 SetPhi0(atan2(fFirstPoint[1],fFirstPoint[0]));
224 SetR0(sqrt(fFirstPoint[0]*fFirstPoint[0]+fFirstPoint[1]*fFirstPoint[1]));
225 // #### -B0-UNCHANGED-END == JMT
227 // #### -B0-CHANGE-END == JMT
230 Double_t AliHLTTPCTrack::GetCrossingAngle(Int_t padrow,Int_t slice)
232 //Calculate the crossing angle between track and given padrow.
233 //Take the dot product of the tangent vector of the track, and
234 //vector perpendicular to the padrow.
235 //In order to do this, we need the tangent vector to the track at the
236 //point. This is done by rotating the radius vector by 90 degrees;
237 //rotation matrix: ( 0 1 )
240 Float_t angle=0;//Angle perpendicular to the padrow in local coordinates
241 if(slice>=0)//Global coordinates
243 AliHLTTPCTransform::Local2GlobalAngle(&angle,slice);
244 if(!CalculateReferencePoint(angle,AliHLTTPCTransform::Row2X(padrow)))
245 cerr<<"AliHLTTPCTrack::GetCrossingAngle : Track does not cross line in slice "<<slice<<" row "<<padrow<<endl;
247 else //should be in local coordinates
250 GetCrossingPoint(padrow,xyz);
258 tangent[0] = (fPoint[1] - GetCenterY())/GetRadius();
259 tangent[1] = -1.*(fPoint[0] - GetCenterX())/GetRadius();
261 Double_t perppadrow[2] = {cos(angle),sin(angle)};
262 Double_t cosbeta = fabs(tangent[0]*perppadrow[0] + tangent[1]*perppadrow[1]);
263 if(cosbeta > 1) cosbeta=1;
264 return acos(cosbeta);
267 Bool_t AliHLTTPCTrack::GetCrossingPoint(Int_t padrow,Float_t *xyz)
269 //Assumes the track is given in local coordinates
272 cerr<<"GetCrossingPoint: Track is given on global coordinates"<<endl;
276 Double_t xHit = AliHLTTPCTransform::Row2X(padrow);
278 // BEGINN ############################################## MODIFIY JMT
279 //if (xHit < xyz[0]){
280 // LOG(AliHLTTPCLog::kError,"AliHLTTPCTRACK::GetCrossingPoint","")<< "Track doesn't cross padrow "
281 // << padrow <<"(x=" << xHit << "). Smallest x=" << xyz[0] << ENDLOG;
284 // END ################################################# MODIFIY JMT
286 // #### -B0-CHANGE-START == JMT
287 // for straight line fit
288 if (AliHLTTPCTransform::GetBFieldValue() == 0.0 ){
290 Double_t yHit = GetFirstPointY() + (Double_t) tan( GetPsi() ) * (xHit - GetFirstPointX());
292 Double_t s = (xHit - GetFirstPointX())*(xHit - GetFirstPointX()) + (yHit - GetFirstPointY())*(yHit - GetFirstPointY());
294 Double_t zHit = GetFirstPointZ() + s * GetTgl();
302 // #### -B0-UNCHANGED-START == JMT
304 Double_t aa = (xHit - GetCenterX())*(xHit - GetCenterX());
305 Double_t r2 = GetRadius()*GetRadius();
309 Double_t aa2 = sqrt(r2 - aa);
310 Double_t y1 = GetCenterY() + aa2;
311 Double_t y2 = GetCenterY() - aa2;
313 if(fabs(y2) < fabs(y1)) xyz[1] = y2;
315 Double_t yHit = xyz[1];
316 Double_t angle1 = atan2((yHit - GetCenterY()),(xHit - GetCenterX()));
317 if(angle1 < 0) angle1 += 2.*AliHLTTPCTransform::Pi();
318 Double_t angle2 = atan2((GetFirstPointY() - GetCenterY()),(GetFirstPointX() - GetCenterX()));
319 if(angle2 < 0) angle2 += AliHLTTPCTransform::TwoPi();
321 Double_t diffangle = angle1 - angle2;
322 diffangle = fmod(diffangle,AliHLTTPCTransform::TwoPi());
323 if((GetCharge()*diffangle) > 0) diffangle = diffangle - GetCharge()*AliHLTTPCTransform::TwoPi();
325 Double_t stot = fabs(diffangle)*GetRadius();
327 Double_t zHit = GetFirstPointZ() + stot*GetTgl();
330 // #### -B0-UNCHANGED-END == JMT
332 // #### -B0-CHANGE-END == JMT
337 Bool_t AliHLTTPCTrack::CalculateReferencePoint(Double_t angle,Double_t radius)
339 // Global coordinate: crossing point with y = ax+ b;
340 // a=tan(angle-AliHLTTPCTransform::PiHalf());
342 const Double_t krr=radius; //position of reference plane
343 const Double_t kxr = cos(angle) * krr;
344 const Double_t kyr = sin(angle) * krr;
346 Double_t a = tan(angle-AliHLTTPCTransform::PiHalf());
347 Double_t b = kyr - a * kxr;
349 Double_t pp=(fCenterX+a*fCenterY-a*b)/(1+pow(a,2));
350 Double_t qq=(pow(fCenterX,2)+pow(fCenterY,2)-2*fCenterY*b+pow(b,2)-pow(fRadius,2))/(1+pow(a,2));
352 Double_t racine = pp*pp-qq;
353 if(racine<0) return IsPoint(kFALSE); //no Point
355 Double_t rootRacine = sqrt(racine);
356 Double_t x0 = pp+rootRacine;
357 Double_t x1 = pp-rootRacine;
358 Double_t y0 = a*x0 + b;
359 Double_t y1 = a*x1 + b;
361 Double_t diff0 = sqrt(pow(x0-kxr,2)+pow(y0-kyr,2));
362 Double_t diff1 = sqrt(pow(x1-kxr,2)+pow(y1-kyr,2));
373 Double_t pointPhi0 = atan2(fPoint[1]-fCenterY,fPoint[0]-fCenterX);
374 Double_t trackPhi0 = atan2(fFirstPoint[1]-fCenterY,fFirstPoint[0]-fCenterX);
375 if(fabs(trackPhi0-pointPhi0)>AliHLTTPCTransform::Pi()){
376 if(trackPhi0<pointPhi0) trackPhi0 += AliHLTTPCTransform::TwoPi();
377 else pointPhi0 += AliHLTTPCTransform::TwoPi();
379 Double_t stot = -fQ * (pointPhi0-trackPhi0) * fRadius ;
380 fPoint[2] = fFirstPoint[2] + stot * fTanl;
382 fPointPsi = pointPhi0 - fQ * AliHLTTPCTransform::PiHalf();
383 if(fPointPsi<0.) fPointPsi+= AliHLTTPCTransform::TwoPi();
384 fPointPsi = fmod(fPointPsi, AliHLTTPCTransform::TwoPi());
386 return IsPoint(kTRUE);
389 Bool_t AliHLTTPCTrack::CalculateEdgePoint(Double_t angle)
391 // Global coordinate: crossing point with y = ax; a=tan(angle);
393 Double_t rmin=AliHLTTPCTransform::Row2X(AliHLTTPCTransform::GetFirstRow(-1)); //min Radius of TPC
394 Double_t rmax=AliHLTTPCTransform::Row2X(AliHLTTPCTransform::GetLastRow(-1)); //max Radius of TPC
396 Double_t a = tan(angle);
397 Double_t pp=(fCenterX+a*fCenterY)/(1+pow(a,2));
398 Double_t qq=(pow(fCenterX,2)+pow(fCenterY,2)-pow(fRadius,2))/(1+pow(a,2));
399 Double_t racine = pp*pp-qq;
400 if(racine<0) return IsPoint(kFALSE); //no Point
401 Double_t rootRacine = sqrt(racine);
402 Double_t x0 = pp+rootRacine;
403 Double_t x1 = pp-rootRacine;
407 Double_t r0 = sqrt(pow(x0,2)+pow(y0,2));
408 Double_t r1 = sqrt(pow(x1,2)+pow(y1,2));
409 //find the right crossing point:
410 //inside the TPC modules
414 if(r0>rmin&&r0<rmax){
415 Double_t da=atan2(y0,x0);
416 if(da<0) da+=AliHLTTPCTransform::TwoPi();
417 if(fabs(da-angle)<0.5)
420 if(r1>rmin&&r1<rmax){
421 Double_t da=atan2(y1,x1);
422 if(da<0) da+=AliHLTTPCTransform::TwoPi();
423 if(fabs(da-angle)<0.5)
426 if(!(ok0||ok1)) return IsPoint(kFALSE); //no Point
429 Double_t diff0 = sqrt(pow(fFirstPoint[0]-x0,2)+pow(fFirstPoint[1]-y0,2));
430 Double_t diff1 = sqrt(pow(fFirstPoint[0]-x1,2)+pow(fFirstPoint[1]-y1,2));
431 if(diff0<diff1) ok1 = kFALSE; //use ok0
432 else ok0 = kFALSE; //use ok1
434 if(ok0){fPoint[0]=x0; fPoint[1]=y0;}
435 else {fPoint[0]=x1; fPoint[1]=y1;}
437 Double_t pointPhi0 = atan2(fPoint[1]-fCenterY,fPoint[0]-fCenterX);
438 Double_t trackPhi0 = atan2(fFirstPoint[1]-fCenterY,fFirstPoint[0]-fCenterX);
439 if(fabs(trackPhi0-pointPhi0)>AliHLTTPCTransform::Pi()){
440 if(trackPhi0<pointPhi0) trackPhi0 += AliHLTTPCTransform::TwoPi();
441 else pointPhi0 += AliHLTTPCTransform::TwoPi();
443 Double_t stot = -fQ * (pointPhi0-trackPhi0) * fRadius ;
444 fPoint[2] = fFirstPoint[2] + stot * fTanl;
446 fPointPsi = pointPhi0 - fQ * AliHLTTPCTransform::PiHalf();
447 if(fPointPsi<0.) fPointPsi+= AliHLTTPCTransform::TwoPi();
448 fPointPsi = fmod(fPointPsi, AliHLTTPCTransform::TwoPi());
450 return IsPoint(kTRUE);
453 Bool_t AliHLTTPCTrack::CalculatePoint(Double_t xplane)
455 // Local coordinate: crossing point with x plane
457 Double_t racine = pow(fRadius,2)-pow(xplane-fCenterX,2);
458 if(racine<0) return IsPoint(kFALSE);
459 Double_t rootRacine = sqrt(racine);
461 Double_t y0 = fCenterY + rootRacine;
462 Double_t y1 = fCenterY - rootRacine;
463 //Double_t diff0 = sqrt(pow(fFirstPoint[0]-xplane)+pow(fFirstPoint[1]-y0));
464 //Double_t diff1 = sqrt(pow(fFirstPoint[0]-xplane)+pow(fFirstPoint[1]-y1));
465 Double_t diff0 = fabs(y0-fFirstPoint[1]);
466 Double_t diff1 = fabs(y1-fFirstPoint[1]);
469 if(diff0<diff1) fPoint[1]=y0;
472 Double_t pointPhi0 = atan2(fPoint[1]-fCenterY,fPoint[0]-fCenterX);
473 Double_t trackPhi0 = atan2(fFirstPoint[1]-fCenterY,fFirstPoint[0]-fCenterX);
474 if(fabs(trackPhi0-pointPhi0)>AliHLTTPCTransform::Pi()){
475 if(trackPhi0<pointPhi0) trackPhi0 += AliHLTTPCTransform::TwoPi();
476 else pointPhi0 += AliHLTTPCTransform::TwoPi();
478 Double_t stot = -fQ * (pointPhi0-trackPhi0) * fRadius ;
479 fPoint[2] = fFirstPoint[2] + stot * fTanl;
481 fPointPsi = pointPhi0 - fQ * AliHLTTPCTransform::PiHalf();
482 if(fPointPsi<0.) fPointPsi+= AliHLTTPCTransform::TwoPi();
483 fPointPsi = fmod(fPointPsi, AliHLTTPCTransform::TwoPi());
485 return IsPoint(kTRUE);
488 void AliHLTTPCTrack::UpdateToFirstPoint()
490 //Update track parameters to the innermost point on the track.
491 //This means that the parameters of the track will be given in the point
492 //of closest approach to the first innermost point, i.e. the point
493 //lying on the track fit (and not the coordinates of the innermost point itself).
494 //This function assumes that fFirstPoint is already set to the coordinates of the innermost
497 //During the helix-fit, the first point on the track is set to the coordinates
498 //of the innermost assigned cluster. This may be ok, if you just want a fast
499 //estimate of the "global" track parameters; such as the momentum etc.
500 //However, if you later on want to do more precise local calculations, such
501 //as impact parameter, residuals etc, you need to give the track parameters
502 //according to the actual fit.
503 // #### -B0-CHANGE-START == JMT
504 // for straight line fit
505 if (AliHLTTPCTransform::GetBFieldValue() == 0.0 ){
506 Double_t xc = GetCenterX() - GetFirstPointX();
507 Double_t yc = GetCenterY() - GetFirstPointY();
509 Double_t xn = (Double_t) sin( GetPsi() );
510 Double_t yn = -1. * (Double_t) cos( GetPsi() );
512 Double_t d = xc*xn + yc*yn;
514 Double_t distx = d * xn;
515 Double_t disty = d * yn;
519 point[0] = distx + GetFirstPointX();
520 point[1] = disty + GetFirstPointY();
522 //Update the track parameters
523 SetR0(sqrt(point[0]*point[0]+point[1]*point[1]));
524 SetPhi0(atan2(point[1],point[0]));
525 SetFirstPoint(point[0],point[1],GetZ0());
529 // #### -B0-UNCHANGED-START == JMT
530 Double_t xc = GetCenterX() - GetFirstPointX();
531 Double_t yc = GetCenterY() - GetFirstPointY();
533 Double_t distx1 = xc*(1 + GetRadius()/sqrt(xc*xc + yc*yc));
534 Double_t disty1 = yc*(1 + GetRadius()/sqrt(xc*xc + yc*yc));
535 Double_t distance1 = sqrt(distx1*distx1 + disty1*disty1);
537 Double_t distx2 = xc*(1 - GetRadius()/sqrt(xc*xc + yc*yc));
538 Double_t disty2 = yc*(1 - GetRadius()/sqrt(xc*xc + yc*yc));
539 Double_t distance2 = sqrt(distx2*distx2 + disty2*disty2);
541 //Choose the closest:
543 if(distance1 < distance2)
545 point[0] = distx1 + GetFirstPointX();
546 point[1] = disty1 + GetFirstPointY();
550 point[0] = distx2 + GetFirstPointX();
551 point[1] = disty2 + GetFirstPointY();
554 Double_t pointpsi = atan2(point[1]-GetCenterY(),point[0]-GetCenterX());
555 pointpsi -= GetCharge()*AliHLTTPCTransform::PiHalf();
556 if(pointpsi < 0) pointpsi += AliHLTTPCTransform::TwoPi();
558 //Update the track parameters
559 SetR0(sqrt(point[0]*point[0]+point[1]*point[1]));
560 SetPhi0(atan2(point[1],point[0]));
561 SetFirstPoint(point[0],point[1],GetZ0());
563 // #### -B0-UNCHANGED-END == JMT
565 // #### -B0-CHANGE-END == JMT
568 void AliHLTTPCTrack::GetClosestPoint(AliHLTTPCVertex *vertex,Double_t &closestX,Double_t &closestY,Double_t &closestZ)
570 //Calculate the point of closest approach to the vertex
571 //This function calculates the minimum distance from the helix to the vertex, and choose
572 //the corresponding point lying on the helix as the point of closest approach.
574 Double_t xc = GetCenterX() - vertex->GetX();
575 Double_t yc = GetCenterY() - vertex->GetY();
577 Double_t distx1 = xc*(1 + GetRadius()/sqrt(xc*xc + yc*yc));
578 Double_t disty1 = yc*(1 + GetRadius()/sqrt(xc*xc + yc*yc));
579 Double_t distance1 = sqrt(distx1*distx1 + disty1*disty1);
581 Double_t distx2 = xc*(1 - GetRadius()/sqrt(xc*xc + yc*yc));
582 Double_t disty2 = yc*(1 - GetRadius()/sqrt(xc*xc + yc*yc));
583 Double_t distance2 = sqrt(distx2*distx2 + disty2*disty2);
585 //Choose the closest:
586 if(distance1 < distance2)
588 closestX = distx1 + vertex->GetX();
589 closestY = disty1 + vertex->GetY();
593 closestX = distx2 + vertex->GetX();
594 closestY = disty2 + vertex->GetY();
597 //Get the z coordinate:
598 Double_t angle1 = atan2((closestY-GetCenterY()),(closestX-GetCenterX()));
599 if(angle1 < 0) angle1 = angle1 + AliHLTTPCTransform::TwoPi();
601 Double_t angle2 = atan2((GetFirstPointY()-GetCenterY()),(GetFirstPointX()-GetCenterX()));
602 if(angle2 < 0) angle2 = angle2 + AliHLTTPCTransform::TwoPi();
604 Double_t diffAngle = angle1 - angle2;
605 diffAngle = fmod(diffAngle,AliHLTTPCTransform::TwoPi());
607 if((GetCharge()*diffAngle) < 0) diffAngle = diffAngle + GetCharge()*AliHLTTPCTransform::TwoPi();
608 Double_t stot = fabs(diffAngle)*GetRadius();
609 closestZ = GetFirstPointZ() - stot*GetTgl();
612 void AliHLTTPCTrack::Print() const
614 //print out parameters of track
615 // BEGINN ############################################## MODIFIY JMT
618 LOG(AliHLTTPCLog::kInformational,"AliHLTTPCTrack::Print","Print values")
619 <<"NH="<<fNHits<<" "<<fMCid<<" K="<<fKappa<<" R="<<fRadius<<" Cx="<<fCenterX<<" Cy="<<fCenterY<<" MVT="
620 <<fFromMainVertex<<" Row0="<<fRowRange[0]<<" Row1="<<fRowRange[1]<<" Sector="<<fSector<<" Q="<<fQ<<" TgLam="
621 <<fTanl<<" psi="<<fPsi<<" pt="<<fPt<<" L="<<fLength<<" "<<fPterr<<" "<<fPsierr<<" "<<fZ0err<<" "
622 <<fTanlerr<<" phi0="<<fPhi0<<" R0="<<fR0<<" Z0="<<fZ0<<" X0="<<fFirstPoint[0]<<" Y0="<<fFirstPoint[1]<<" Z0="
623 <<fFirstPoint[2]<<" XL="<<fLastPoint[0]<<" YL="<<fLastPoint[1]<<" ZL="<<fLastPoint[2]<<" "
624 <<fPoint[0]<<" "<<fPoint[1]<<" "<<fPoint[2]<<" "<<fPointPsi<<" "<<fIsPoint<<" local="
625 <<fIsLocal<<" "<<fPID<<ENDLOG;
630 LOG(AliHLTTPCLog::kInformational,"AliHLTTPCTrack::Print","Print values")
631 <<fNHits<<" "<<fMCid<<" "<<fKappa<<" "<<fRadius<<" "<<fCenterX<<" "<<fCenterY<<" "
632 <<fFromMainVertex<<" "<<fRowRange[0]<<" "<<fRowRange[1]<<" "<<fSector<<" "<<fQ<<" "
633 <<fTanl<<" "<<fPsi<<" "<<fPt<<" "<<fLength<<" "<<fPterr<<" "<<fPsierr<<" "<<fZ0err<<" "
634 <<fTanlerr<<" "<<fPhi0<<" "<<fR0<<" "<<fZ0<<" "<<fFirstPoint[0]<<" "<<fFirstPoint[1]<<" "
635 <<fFirstPoint[2]<<" "<<fLastPoint[0]<<" "<<fLastPoint[1]<<" "<<fLastPoint[2]<<" "
636 <<fPoint[0]<<" "<<fPoint[1]<<" "<<fPoint[2]<<" "<<fPointPsi<<" "<<fIsPoint<<" "
637 <<fIsLocal<<" "<<fPID<<ENDLOG;
640 // END ################################################# MODIFIY JMT
643 int AliHLTTPCTrack::Convert2AliKalmanTrack()
645 // The method has been copied from AliHLTHoughKalmanTrack and adapted
646 // to the TPC conformal mapping track parametrization
649 // sector A00 starts at 3 o'clock, sectors are counted counterclockwise
650 // median of sector 00 is at 10 degrees, median of sector A04 at 90
653 alpha = fmod((2*GetSector()+1)*(TMath::Pi()/18),2*TMath::Pi());
654 if (alpha < -TMath::Pi()) alpha += 2*TMath::Pi();
655 else if (alpha >= TMath::Pi()) alpha -= 2*TMath::Pi();
666 Double_t xhit = GetFirstPointX();
668 xx[0] = GetFirstPointY();
669 xx[1] = GetFirstPointZ();
670 xx[2] = TMath::Sin(GetPsi());
673 //cout << "xhit=" << xhit << " y=" << xx[0] << " z=" << xx[1] << endl;
674 //cout << "alpha=" << alpha << endl;
676 // the Set function was not available in earlier versions, check required in
678 #ifdef EXTERNALTRACKPARAM_V1
679 #warning track conversion to ESD format needs AliRoot version > v4-05-04
680 //TODO (Feb 07): make this a real warning when logging system is adapted
681 //HLTWarning("track conversion to ESD format needs AliRoot version > v4-05-04");
683 Set(xhit,alpha,xx,cov);