1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
15 //-----------------------------------------------------------------
16 // Implementation of the ESD track class
17 // ESD = Event Summary Data
18 // This is the class to deal with during the phisics analysis of data
19 // Origin: Iouri Belikov, CERN
20 // e-mail: Jouri.Belikov@cern.ch
21 //-----------------------------------------------------------------
25 #include "AliESDVertex.h"
26 #include "AliESDtrack.h"
27 #include "AliESDfriendTrack.h"
28 #include "AliKalmanTrack.h"
30 #include "AliTrackPointArray.h"
34 void SetPIDValues(Float_t * dest, const Double_t * src, Int_t n) {
35 // This function copies "n" PID weights from "scr" to "dest"
36 // and normalizes their sum to 1 thus producing conditional probabilities.
37 // The negative weights are set to 0.
38 // In case all the weights are non-positive they are replaced by
39 // uniform probabilities
43 Float_t uniform = 1./(Float_t)n;
46 for (Int_t i=0; i<n; i++)
56 for (Int_t i=0; i<n; i++) dest[i] /= sum;
58 for (Int_t i=0; i<n; i++) dest[i] = uniform;
61 //_______________________________________________________________________
62 AliESDtrack::AliESDtrack() :
63 AliExternalTrackParam(),
69 fCdd(0),fCdz(0),fCzz(0),
83 fTPCClusterMap(159),//number of padrows
111 fFriendTrack(new AliESDfriendTrack())
114 // The default ESD constructor
117 for (i=0; i<AliPID::kSPECIES; i++) {
127 for (i=0; i<3; i++) { fKinkIndexes[i]=0;}
128 for (i=0; i<3; i++) { fV0Indexes[i]=-1;}
129 for (i=0;i<kNPlane;i++) {fTRDsignals[i]=0.; fTRDTimBin[i]=-1;}
130 for (i=0;i<4;i++) {fTPCPoints[i]=-1;}
131 for (i=0;i<3;i++) {fTOFLabel[i]=-1;}
132 for (i=0;i<10;i++) {fTOFInfo[i]=-1;}
135 //_______________________________________________________________________
136 AliESDtrack::AliESDtrack(const AliESDtrack& track):
137 AliExternalTrackParam(track),
138 fFlags(track.fFlags),
139 fLabel(track.fLabel),
141 fTrackLength(track.fTrackLength),
142 fD(track.fD),fZ(track.fZ),
143 fCdd(track.fCdd),fCdz(track.fCdz),fCzz(track.fCzz),
144 fStopVertex(track.fStopVertex),
146 fCchi2(track.fCchi2),
149 fITSchi2(track.fITSchi2),
150 fITSncls(track.fITSncls),
151 fITSsignal(track.fITSsignal),
152 fITSLabel(track.fITSLabel),
153 fITSFakeRatio(track.fITSFakeRatio),
154 fTPCchi2(track.fTPCchi2),
155 fTPCncls(track.fTPCncls),
156 fTPCnclsF(track.fTPCnclsF),
157 fTPCClusterMap(track.fTPCClusterMap),
158 fTPCsignal(track.fTPCsignal),
159 fTPCsignalN(track.fTPCsignalN),
160 fTPCsignalS(track.fTPCsignalS),
161 fTPCLabel(track.fTPCLabel),
162 fTRDchi2(track.fTRDchi2),
163 fTRDncls(track.fTRDncls),
164 fTRDncls0(track.fTRDncls0),
165 fTRDsignal(track.fTRDsignal),
166 fTRDLabel(track.fTRDLabel),
167 fTRDQuality(track.fTRDQuality),
168 fTRDBudget(track.fTRDBudget),
169 fTOFchi2(track.fTOFchi2),
170 fTOFindex(track.fTOFindex),
171 fTOFCalChannel(track.fTOFCalChannel),
172 fTOFsignal(track.fTOFsignal),
173 fTOFsignalToT(track.fTOFsignalToT),
174 fRICHchi2(track.fRICHchi2),
175 fRICHncls(track.fRICHncls),
176 fRICHindex(track.fRICHindex),
177 fRICHsignal(track.fRICHsignal),
178 fRICHtheta(track.fRICHtheta),
179 fRICHphi(track.fRICHphi),
180 fRICHdx(track.fRICHdx),
181 fRICHdy(track.fRICHdy),
182 fRICHmipX(track.fRICHmipX),
183 fRICHmipY(track.fRICHmipY),
185 fFriendTrack(new AliESDfriendTrack(*(track.fFriendTrack)))
190 for (Int_t i=0;i<AliPID::kSPECIES;i++) fTrackTime[i]=track.fTrackTime[i];
191 for (Int_t i=0;i<AliPID::kSPECIES;i++) fR[i]=track.fR[i];
193 for (Int_t i=0;i<AliPID::kSPECIES;i++) fITSr[i]=track.fITSr[i];
195 for (Int_t i=0;i<AliPID::kSPECIES;i++) fTPCr[i]=track.fTPCr[i];
196 for (Int_t i=0;i<4;i++) {fTPCPoints[i]=track.fTPCPoints[i];}
197 for (Int_t i=0; i<3;i++) { fKinkIndexes[i]=track.fKinkIndexes[i];}
198 for (Int_t i=0; i<3;i++) { fV0Indexes[i]=track.fV0Indexes[i];}
200 for (Int_t i=0;i<kNPlane;i++) {
201 fTRDsignals[i]=track.fTRDsignals[i];
202 fTRDTimBin[i]=track.fTRDTimBin[i];
204 for (Int_t i=0;i<AliPID::kSPECIES;i++) fTRDr[i]=track.fTRDr[i];
205 for (Int_t i=0;i<AliPID::kSPECIES;i++) fTOFr[i]=track.fTOFr[i];
206 for (Int_t i=0;i<3;i++) fTOFLabel[i]=track.fTOFLabel[i];
207 for (Int_t i=0;i<10;i++) fTOFInfo[i]=track.fTOFInfo[i];
208 for (Int_t i=0;i<AliPID::kSPECIES;i++) fRICHr[i]=track.fRICHr[i];
210 if (track.fCp) fCp=new AliExternalTrackParam(*track.fCp);
211 if (track.fIp) fIp=new AliExternalTrackParam(*track.fIp);
212 if (track.fOp) fOp=new AliExternalTrackParam(*track.fOp);
214 if (track.fPoints) fPoints=new AliTrackPointArray(*(track.fPoints));
217 //_______________________________________________________________________
218 AliESDtrack::~AliESDtrack(){
220 // This is destructor according Coding Conventrions
222 //printf("Delete track\n");
230 //_______________________________________________________________________
231 void AliESDtrack::MakeMiniESDtrack(){
232 // Resets everything except
233 // fFlags: Reconstruction status flags
234 // fLabel: Track label
235 // fID: Unique ID of the track
236 // fD: Impact parameter in XY-plane
237 // fZ: Impact parameter in Z
238 // fR[AliPID::kSPECIES]: combined "detector response probability"
239 // Running track parameters
240 // fRalpha: track rotation angle
241 // fRx: X-coordinate of the track reference plane
242 // fRp[5]: external track parameters
243 // fRc[15]: external cov. matrix of the track parameters
246 for (Int_t i=0;i<AliPID::kSPECIES;i++) fTrackTime[i] = 0;
249 // Reset track parameters constrained to the primary vertex
253 // Reset track parameters at the inner wall of TPC
256 // Reset track parameters at the inner wall of the TRD
259 // Reset ITS track related information
263 for (Int_t i=0;i<AliPID::kSPECIES;i++) fITSr[i]=0;
267 // Reset TPC related track information
275 for (Int_t i=0;i<AliPID::kSPECIES;i++) fTPCr[i]=0;
277 for (Int_t i=0;i<4;i++) fTPCPoints[i] = 0;
278 for (Int_t i=0; i<3;i++) fKinkIndexes[i] = 0;
279 for (Int_t i=0; i<3;i++) fV0Indexes[i] = 0;
281 // Reset TRD related track information
286 for (Int_t i=0;i<kNPlane;i++) {
290 for (Int_t i=0;i<AliPID::kSPECIES;i++) fTRDr[i] = 0;
295 // Reset TOF related track information
301 for (Int_t i=0;i<AliPID::kSPECIES;i++) fTOFr[i] = 0;
302 for (Int_t i=0;i<3;i++) fTOFLabel[i] = 0;
303 for (Int_t i=0;i<10;i++) fTOFInfo[i] = 0;
305 // Reset RICH related track information
310 for (Int_t i=0;i<AliPID::kSPECIES;i++) fRICHr[i] = 0;
316 delete fFriendTrack; fFriendTrack = 0;
317 delete fPoints; fPoints = 0;
319 //_______________________________________________________________________
320 Double_t AliESDtrack::GetMass() const {
321 // Returns the mass of the most probable particle type
324 for (Int_t i=0; i<AliPID::kSPECIES; i++) {
325 if (fR[i]>max) {k=i; max=fR[i];}
327 if (k==0) { // dE/dx "crossing points" in the TPC
329 if ((p>0.38)&&(p<0.48))
330 if (fR[0]<fR[3]*10.) return AliPID::ParticleMass(AliPID::kKaon);
331 if ((p>0.75)&&(p<0.85))
332 if (fR[0]<fR[4]*10.) return AliPID::ParticleMass(AliPID::kProton);
335 if (k==1) return AliPID::ParticleMass(AliPID::kMuon);
336 if (k==2||k==-1) return AliPID::ParticleMass(AliPID::kPion);
337 if (k==3) return AliPID::ParticleMass(AliPID::kKaon);
338 if (k==4) return AliPID::ParticleMass(AliPID::kProton);
339 AliWarning("Undefined mass !");
340 return AliPID::ParticleMass(AliPID::kPion);
343 //_______________________________________________________________________
344 Bool_t AliESDtrack::UpdateTrackParams(const AliKalmanTrack *t, ULong_t flags){
346 // This function updates track's running parameters
352 fLabel=t->GetLabel();
354 if (t->IsStartedTimeIntegral()) {
356 Double_t times[10];t->GetIntegratedTimes(times); SetIntegratedTimes(times);
357 SetIntegratedLength(t->GetIntegratedLength());
364 case kITSin: case kITSout: case kITSrefit:
365 index=fFriendTrack->GetITSindices();
366 for (Int_t i=0;i<AliESDfriendTrack::kMaxITScluster;i++)
367 index[i]=t->GetClusterIndex(i);
368 fITSncls=t->GetNumberOfClusters();
369 fITSchi2=t->GetChi2();
370 fITSsignal=t->GetPIDsignal();
371 fITSLabel = t->GetLabel();
372 fITSFakeRatio = t->GetFakeRatio();
375 case kTPCin: case kTPCrefit:
376 fTPCLabel = t->GetLabel();
377 if (!fIp) fIp=new AliExternalTrackParam(*t);
380 index=fFriendTrack->GetTPCindices();
381 if (flags & kTPCout){
382 if (!fOp) fOp=new AliExternalTrackParam(*t);
385 fTPCncls=t->GetNumberOfClusters();
386 fTPCchi2=t->GetChi2();
388 {//prevrow must be declared in separate namespace, otherwise compiler cries:
389 //"jump to case label crosses initialization of `Int_t prevrow'"
391 // for (Int_t i=0;i<fTPCncls;i++)
392 for (Int_t i=0;i<AliESDfriendTrack::kMaxTPCcluster;i++)
394 index[i]=t->GetClusterIndex(i);
395 Int_t idx = index[i];
399 // Piotr's Cluster Map for HBT
400 // ### please change accordingly if cluster array is changing
401 // to "New TPC Tracking" style (with gaps in array)
402 Int_t sect = (idx&0xff000000)>>24;
403 Int_t row = (idx&0x00ff0000)>>16;
404 if (sect > 18) row +=63; //if it is outer sector, add number of inner sectors
406 fTPCClusterMap.SetBitNumber(row,kTRUE);
408 //Fill the gap between previous row and this row with 0 bits
409 //In case ### pleas change it as well - just set bit 0 in case there
410 //is no associated clusters for current "i"
413 prevrow = row;//if previous bit was not assigned yet == this is the first one
416 { //we don't know the order (inner to outer or reverse)
417 //just to be save in case it is going to change
430 for (Int_t j = n+1; j < m; j++)
432 fTPCClusterMap.SetBitNumber(j,kFALSE);
436 // End Of Piotr's Cluster Map for HBT
439 fTPCsignal=t->GetPIDsignal();
442 case kTRDout: case kTRDin: case kTRDrefit:
443 index=fFriendTrack->GetTRDindices();
444 fTRDLabel = t->GetLabel();
445 fTRDncls=t->GetNumberOfClusters();
446 fTRDchi2=t->GetChi2();
447 for (Int_t i=0;i<fTRDncls;i++) index[i]=t->GetClusterIndex(i);
448 fTRDsignal=t->GetPIDsignal();
451 if (!fOp) fOp=new AliExternalTrackParam(*t);
453 fTRDncls0 = t->GetNumberOfClusters();
462 AliError("Wrong flag !");
469 //_______________________________________________________________________
470 void AliESDtrack::GetExternalParameters(Double_t &x, Double_t p[5]) const {
471 //---------------------------------------------------------------------
472 // This function returns external representation of the track parameters
473 //---------------------------------------------------------------------
475 for (Int_t i=0; i<5; i++) p[i]=GetParameter()[i];
478 //_______________________________________________________________________
479 void AliESDtrack::GetExternalCovariance(Double_t cov[15]) const {
480 //---------------------------------------------------------------------
481 // This function returns external representation of the cov. matrix
482 //---------------------------------------------------------------------
483 for (Int_t i=0; i<15; i++) cov[i]=AliExternalTrackParam::GetCovariance()[i];
486 //_______________________________________________________________________
487 Bool_t AliESDtrack::GetConstrainedExternalParameters
488 (Double_t &alpha, Double_t &x, Double_t p[5]) const {
489 //---------------------------------------------------------------------
490 // This function returns the constrained external track parameters
491 //---------------------------------------------------------------------
492 if (!fCp) return kFALSE;
493 alpha=fCp->GetAlpha();
495 for (Int_t i=0; i<5; i++) p[i]=fCp->GetParameter()[i];
499 //_______________________________________________________________________
501 AliESDtrack::GetConstrainedExternalCovariance(Double_t c[15]) const {
502 //---------------------------------------------------------------------
503 // This function returns the constrained external cov. matrix
504 //---------------------------------------------------------------------
505 if (!fCp) return kFALSE;
506 for (Int_t i=0; i<15; i++) c[i]=fCp->GetCovariance()[i];
511 AliESDtrack::GetInnerExternalParameters
512 (Double_t &alpha, Double_t &x, Double_t p[5]) const {
513 //---------------------------------------------------------------------
514 // This function returns external representation of the track parameters
515 // at the inner layer of TPC
516 //---------------------------------------------------------------------
517 if (!fIp) return kFALSE;
518 alpha=fIp->GetAlpha();
520 for (Int_t i=0; i<5; i++) p[i]=fIp->GetParameter()[i];
525 AliESDtrack::GetInnerExternalCovariance(Double_t cov[15]) const {
526 //---------------------------------------------------------------------
527 // This function returns external representation of the cov. matrix
528 // at the inner layer of TPC
529 //---------------------------------------------------------------------
530 if (!fIp) return kFALSE;
531 for (Int_t i=0; i<15; i++) cov[i]=fIp->GetCovariance()[i];
536 AliESDtrack::GetOuterExternalParameters
537 (Double_t &alpha, Double_t &x, Double_t p[5]) const {
538 //---------------------------------------------------------------------
539 // This function returns external representation of the track parameters
540 // at the inner layer of TRD
541 //---------------------------------------------------------------------
542 if (!fOp) return kFALSE;
543 alpha=fOp->GetAlpha();
545 for (Int_t i=0; i<5; i++) p[i]=fOp->GetParameter()[i];
550 AliESDtrack::GetOuterExternalCovariance(Double_t cov[15]) const {
551 //---------------------------------------------------------------------
552 // This function returns external representation of the cov. matrix
553 // at the inner layer of TRD
554 //---------------------------------------------------------------------
555 if (!fOp) return kFALSE;
556 for (Int_t i=0; i<15; i++) cov[i]=fOp->GetCovariance()[i];
560 Int_t AliESDtrack::GetNcls(Int_t idet) const
562 // Get number of clusters by subdetector index
585 Int_t AliESDtrack::GetClusters(Int_t idet, Int_t *idx) const
587 // Get cluster index array by subdetector index
592 ncls = GetITSclusters(idx);
595 ncls = GetTPCclusters(idx);
598 ncls = GetTRDclusters(idx);
601 if (fTOFindex != 0) {
602 idx[0] = GetTOFcluster();
612 //_______________________________________________________________________
613 void AliESDtrack::GetIntegratedTimes(Double_t *times) const {
614 // Returns the array with integrated times for each particle hypothesis
615 for (Int_t i=0; i<AliPID::kSPECIES; i++) times[i]=fTrackTime[i];
618 //_______________________________________________________________________
619 void AliESDtrack::SetIntegratedTimes(const Double_t *times) {
620 // Sets the array with integrated times for each particle hypotesis
621 for (Int_t i=0; i<AliPID::kSPECIES; i++) fTrackTime[i]=times[i];
624 //_______________________________________________________________________
625 void AliESDtrack::SetITSpid(const Double_t *p) {
626 // Sets values for the probability of each particle type (in ITS)
627 SetPIDValues(fITSr,p,AliPID::kSPECIES);
628 SetStatus(AliESDtrack::kITSpid);
631 //_______________________________________________________________________
632 void AliESDtrack::GetITSpid(Double_t *p) const {
633 // Gets the probability of each particle type (in ITS)
634 for (Int_t i=0; i<AliPID::kSPECIES; i++) p[i]=fITSr[i];
637 //_______________________________________________________________________
638 Int_t AliESDtrack::GetITSclusters(Int_t *idx) const {
639 //---------------------------------------------------------------------
640 // This function returns indices of the assgined ITS clusters
641 //---------------------------------------------------------------------
643 Int_t *index=fFriendTrack->GetITSindices();
644 for (Int_t i=0; i<AliESDfriendTrack::kMaxITScluster; i++) idx[i]=index[i];
649 //_______________________________________________________________________
650 Int_t AliESDtrack::GetTPCclusters(Int_t *idx) const {
651 //---------------------------------------------------------------------
652 // This function returns indices of the assgined ITS clusters
653 //---------------------------------------------------------------------
655 Int_t *index=fFriendTrack->GetTPCindices();
656 for (Int_t i=0; i<AliESDfriendTrack::kMaxTPCcluster; i++) idx[i]=index[i];
661 Float_t AliESDtrack::GetTPCdensity(Int_t row0, Int_t row1) const{
663 // GetDensity of the clusters on given region between row0 and row1
664 // Dead zone effect takin into acoount
669 Int_t *index=fFriendTrack->GetTPCindices();
670 for (Int_t i=row0;i<=row1;i++){
671 Int_t idx = index[i];
672 if (idx!=-1) good++; // track outside of dead zone
676 if (good>(row1-row0)*0.5) density = Float_t(found)/Float_t(good);
680 //_______________________________________________________________________
681 void AliESDtrack::SetTPCpid(const Double_t *p) {
682 // Sets values for the probability of each particle type (in TPC)
683 SetPIDValues(fTPCr,p,AliPID::kSPECIES);
684 SetStatus(AliESDtrack::kTPCpid);
687 //_______________________________________________________________________
688 void AliESDtrack::GetTPCpid(Double_t *p) const {
689 // Gets the probability of each particle type (in TPC)
690 for (Int_t i=0; i<AliPID::kSPECIES; i++) p[i]=fTPCr[i];
693 //_______________________________________________________________________
694 Int_t AliESDtrack::GetTRDclusters(Int_t *idx) const {
695 //---------------------------------------------------------------------
696 // This function returns indices of the assgined TRD clusters
697 //---------------------------------------------------------------------
699 Int_t *index=fFriendTrack->GetTRDindices();
700 for (Int_t i=0; i<AliESDfriendTrack::kMaxTRDcluster; i++) idx[i]=index[i];
705 //_______________________________________________________________________
706 void AliESDtrack::SetTRDpid(const Double_t *p) {
707 // Sets values for the probability of each particle type (in TRD)
708 SetPIDValues(fTRDr,p,AliPID::kSPECIES);
709 SetStatus(AliESDtrack::kTRDpid);
712 //_______________________________________________________________________
713 void AliESDtrack::GetTRDpid(Double_t *p) const {
714 // Gets the probability of each particle type (in TRD)
715 for (Int_t i=0; i<AliPID::kSPECIES; i++) p[i]=fTRDr[i];
718 //_______________________________________________________________________
719 void AliESDtrack::SetTRDpid(Int_t iSpecies, Float_t p)
721 // Sets the probability of particle type iSpecies to p (in TRD)
725 Float_t AliESDtrack::GetTRDpid(Int_t iSpecies) const
727 // Returns the probability of particle type iSpecies (in TRD)
728 return fTRDr[iSpecies];
731 //_______________________________________________________________________
732 void AliESDtrack::SetTOFpid(const Double_t *p) {
733 // Sets the probability of each particle type (in TOF)
734 SetPIDValues(fTOFr,p,AliPID::kSPECIES);
735 SetStatus(AliESDtrack::kTOFpid);
738 //_______________________________________________________________________
739 void AliESDtrack::SetTOFLabel(const Int_t *p) {
741 for (Int_t i=0; i<3; i++) fTOFLabel[i]=p[i];
744 //_______________________________________________________________________
745 void AliESDtrack::GetTOFpid(Double_t *p) const {
746 // Gets probabilities of each particle type (in TOF)
747 for (Int_t i=0; i<AliPID::kSPECIES; i++) p[i]=fTOFr[i];
750 //_______________________________________________________________________
751 void AliESDtrack::GetTOFLabel(Int_t *p) const {
753 for (Int_t i=0; i<3; i++) p[i]=fTOFLabel[i];
756 //_______________________________________________________________________
757 void AliESDtrack::GetTOFInfo(Float_t *info) const {
759 for (Int_t i=0; i<10; i++) info[i]=fTOFInfo[i];
762 //_______________________________________________________________________
763 void AliESDtrack::SetTOFInfo(Float_t*info) {
765 for (Int_t i=0; i<10; i++) fTOFInfo[i]=info[i];
770 //_______________________________________________________________________
771 void AliESDtrack::SetRICHpid(const Double_t *p) {
772 // Sets the probability of each particle type (in RICH)
773 SetPIDValues(fRICHr,p,AliPID::kSPECIES);
774 SetStatus(AliESDtrack::kRICHpid);
777 //_______________________________________________________________________
778 void AliESDtrack::GetRICHpid(Double_t *p) const {
779 // Gets probabilities of each particle type (in RICH)
780 for (Int_t i=0; i<AliPID::kSPECIES; i++) p[i]=fRICHr[i];
785 //_______________________________________________________________________
786 void AliESDtrack::SetESDpid(const Double_t *p) {
787 // Sets the probability of each particle type for the ESD track
788 SetPIDValues(fR,p,AliPID::kSPECIES);
789 SetStatus(AliESDtrack::kESDpid);
792 //_______________________________________________________________________
793 void AliESDtrack::GetESDpid(Double_t *p) const {
794 // Gets probability of each particle type for the ESD track
795 for (Int_t i=0; i<AliPID::kSPECIES; i++) p[i]=fR[i];
798 //_______________________________________________________________________
799 Bool_t AliESDtrack::RelateToVertex
800 (const AliESDVertex *vtx, Double_t b, Double_t maxd) {
802 // Try to relate this track to the vertex "vtx",
803 // if the (rough) transverse impact parameter is not bigger then "maxd".
804 // Magnetic field is "b" (kG).
806 // a) The track gets extapolated to the DCA to the vertex.
807 // b) The impact parameters and their covariance matrix are calculated.
808 // c) An attempt to constrain this track to the vertex is done.
810 // In the case of success, the returned value is kTRUE
811 // (otherwise, it's kFALSE)
813 Double_t alpha=GetAlpha();
814 Double_t sn=TMath::Sin(alpha), cs=TMath::Cos(alpha);
815 Double_t x=GetX(), y=GetParameter()[0], snp=GetParameter()[2];
816 Double_t xv= vtx->GetXv()*cs + vtx->GetYv()*sn;
817 Double_t yv=-vtx->GetXv()*sn + vtx->GetYv()*cs, zv=vtx->GetZv();
820 //Estimate the impact parameter neglecting the track curvature
821 Double_t d=TMath::Abs(x*snp - y*TMath::Sqrt(1.- snp*snp));
822 if (d > maxd) return kFALSE;
824 //Propagate to the DCA
825 Double_t crv=0.299792458e-3*b*GetParameter()[4];
826 Double_t tgfv=-(crv*x - snp)/(crv*y + TMath::Sqrt(1.-snp*snp));
827 sn=tgfv/TMath::Sqrt(1.+ tgfv*tgfv);
828 if (TMath::Abs(tgfv)>0.) cs = sn/tgfv;
832 yv=-xv*sn + yv*cs; xv=x;
834 if (!Propagate(alpha+TMath::ASin(sn),xv,b)) return kFALSE;
836 fD = GetParameter()[0] - yv;
837 fZ = GetParameter()[1] - zv;
839 Double_t cov[6]; vtx->GetCovMatrix(cov);
840 fCdd = GetCovariance()[0] + cov[2]; // neglecting non-diagonals
841 fCdz = GetCovariance()[1]; // in the vertex's
842 fCzz = GetCovariance()[2] + cov[5]; // covariance matrix
845 Double_t p[2]={yv,zv}, c[3]={cov[2],0.,cov[5]};
846 Double_t chi2=GetPredictedChi2(p,c);
848 if (chi2>77.) return kFALSE;
850 AliExternalTrackParam tmp(*this);
851 if (!tmp.Update(p,c)) return kFALSE;
854 if (!fCp) fCp=new AliExternalTrackParam();
855 new (fCp) AliExternalTrackParam(tmp);
861 void AliESDtrack::SetTrackPointArray(AliTrackPointArray *points) {
863 //fFriendTrack->SetTrackPointArray(points);
865 const AliTrackPointArray *AliESDtrack::GetTrackPointArray() const {
867 //return fFriendTrack->GetTrackPointArray();
870 //_______________________________________________________________________
871 void AliESDtrack::Print(Option_t *) const {
872 // Prints info on the track
874 printf("ESD track info\n") ;
875 Double_t p[AliPID::kSPECIESN] ;
878 printf("From ITS: ") ;
880 for(index = 0 ; index < AliPID::kSPECIES; index++)
881 printf("%f, ", p[index]) ;
882 printf("\n signal = %f\n", GetITSsignal()) ;
885 printf("From TPC: ") ;
887 for(index = 0 ; index < AliPID::kSPECIES; index++)
888 printf("%f, ", p[index]) ;
889 printf("\n signal = %f\n", GetTPCsignal()) ;
892 printf("From TRD: ") ;
894 for(index = 0 ; index < AliPID::kSPECIES; index++)
895 printf("%f, ", p[index]) ;
896 printf("\n signal = %f\n", GetTRDsignal()) ;
899 printf("From TOF: ") ;
901 for(index = 0 ; index < AliPID::kSPECIES; index++)
902 printf("%f, ", p[index]) ;
903 printf("\n signal = %f\n", GetTOFsignal()) ;
905 if( IsOn(kRICHpid) ){
906 printf("From RICH: ") ;
908 for(index = 0 ; index < AliPID::kSPECIES; index++)
909 printf("%f, ", p[index]) ;
910 printf("\n signal = %f\n", GetRICHsignal()) ;