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 "AliKalmanTrack.h"
29 #include "AliTrackPointArray.h"
33 void SetPIDValues(Float_t * dest, const Double_t * src, Int_t n) {
34 // This function copies "n" PID weights from "scr" to "dest"
35 // and normalizes their sum to 1 thus producing conditional probabilities.
36 // The negative weights are set to 0.
37 // In case all the weights are non-positive they are replaced by
38 // uniform probabilities
42 Float_t uniform = 1./(Float_t)n;
45 for (Int_t i=0; i<n; i++)
55 for (Int_t i=0; i<n; i++) dest[i] /= sum;
57 for (Int_t i=0; i<n; i++) dest[i] = uniform;
60 //_______________________________________________________________________
61 AliESDtrack::AliESDtrack() :
62 AliExternalTrackParam(),
68 fCdd(0),fCdz(0),fCzz(0),
82 fTPCClusterMap(159),//number of padrows
110 fFriendTrack(new AliESDfriendTrack())
113 // The default ESD constructor
116 for (i=0; i<AliPID::kSPECIES; i++) {
126 for (i=0; i<3; i++) { fKinkIndexes[i]=0;}
127 for (i=0; i<3; i++) { fV0Indexes[i]=-1;}
128 for (i=0;i<kNPlane;i++) {fTRDsignals[i]=0.; fTRDTimBin[i]=-1;}
129 for (i=0;i<4;i++) {fTPCPoints[i]=-1;}
130 for (i=0;i<3;i++) {fTOFLabel[i]=-1;}
131 for (i=0;i<10;i++) {fTOFInfo[i]=-1;}
134 //_______________________________________________________________________
135 AliESDtrack::AliESDtrack(const AliESDtrack& track):
136 AliExternalTrackParam(track),
137 fFlags(track.fFlags),
138 fLabel(track.fLabel),
140 fTrackLength(track.fTrackLength),
141 fD(track.fD),fZ(track.fZ),
142 fCdd(track.fCdd),fCdz(track.fCdz),fCzz(track.fCzz),
143 fStopVertex(track.fStopVertex),
145 fCchi2(track.fCchi2),
148 fITSchi2(track.fITSchi2),
149 fITSncls(track.fITSncls),
150 fITSsignal(track.fITSsignal),
151 fITSLabel(track.fITSLabel),
152 fITSFakeRatio(track.fITSFakeRatio),
153 fTPCchi2(track.fTPCchi2),
154 fTPCncls(track.fTPCncls),
155 fTPCnclsF(track.fTPCnclsF),
156 fTPCClusterMap(track.fTPCClusterMap),
157 fTPCsignal(track.fTPCsignal),
158 fTPCsignalN(track.fTPCsignalN),
159 fTPCsignalS(track.fTPCsignalS),
160 fTPCLabel(track.fTPCLabel),
161 fTRDchi2(track.fTRDchi2),
162 fTRDncls(track.fTRDncls),
163 fTRDncls0(track.fTRDncls0),
164 fTRDsignal(track.fTRDsignal),
165 fTRDLabel(track.fTRDLabel),
166 fTRDQuality(track.fTRDQuality),
167 fTRDBudget(track.fTRDBudget),
168 fTOFchi2(track.fTOFchi2),
169 fTOFindex(track.fTOFindex),
170 fTOFCalChannel(track.fTOFCalChannel),
171 fTOFsignal(track.fTOFsignal),
172 fTOFsignalToT(track.fTOFsignalToT),
173 fRICHchi2(track.fRICHchi2),
174 fRICHncls(track.fRICHncls),
175 fRICHindex(track.fRICHindex),
176 fRICHsignal(track.fRICHsignal),
177 fRICHtheta(track.fRICHtheta),
178 fRICHphi(track.fRICHphi),
179 fRICHdx(track.fRICHdx),
180 fRICHdy(track.fRICHdy),
181 fRICHmipX(track.fRICHmipX),
182 fRICHmipY(track.fRICHmipY),
184 fFriendTrack(new AliESDfriendTrack(*(track.fFriendTrack)))
189 for (Int_t i=0;i<AliPID::kSPECIES;i++) fTrackTime[i]=track.fTrackTime[i];
190 for (Int_t i=0;i<AliPID::kSPECIES;i++) fR[i]=track.fR[i];
192 for (Int_t i=0;i<AliPID::kSPECIES;i++) fITSr[i]=track.fITSr[i];
194 for (Int_t i=0;i<AliPID::kSPECIES;i++) fTPCr[i]=track.fTPCr[i];
195 for (Int_t i=0;i<4;i++) {fTPCPoints[i]=track.fTPCPoints[i];}
196 for (Int_t i=0; i<3;i++) { fKinkIndexes[i]=track.fKinkIndexes[i];}
197 for (Int_t i=0; i<3;i++) { fV0Indexes[i]=track.fV0Indexes[i];}
199 for (Int_t i=0;i<kNPlane;i++) {
200 fTRDsignals[i]=track.fTRDsignals[i];
201 fTRDTimBin[i]=track.fTRDTimBin[i];
203 for (Int_t i=0;i<AliPID::kSPECIES;i++) fTRDr[i]=track.fTRDr[i];
204 for (Int_t i=0;i<AliPID::kSPECIES;i++) fTOFr[i]=track.fTOFr[i];
205 for (Int_t i=0;i<3;i++) fTOFLabel[i]=track.fTOFLabel[i];
206 for (Int_t i=0;i<10;i++) fTOFInfo[i]=track.fTOFInfo[i];
207 for (Int_t i=0;i<AliPID::kSPECIES;i++) fRICHr[i]=track.fRICHr[i];
209 if (track.fCp) fCp=new AliExternalTrackParam(*track.fCp);
210 if (track.fIp) fIp=new AliExternalTrackParam(*track.fIp);
211 if (track.fOp) fOp=new AliExternalTrackParam(*track.fOp);
213 if (track.fPoints) fPoints=new AliTrackPointArray(*(track.fPoints));
216 //_______________________________________________________________________
217 AliESDtrack::~AliESDtrack(){
219 // This is destructor according Coding Conventrions
221 //printf("Delete track\n");
229 //_______________________________________________________________________
230 void AliESDtrack::MakeMiniESDtrack(){
231 // Resets everything except
232 // fFlags: Reconstruction status flags
233 // fLabel: Track label
234 // fID: Unique ID of the track
235 // fD: Impact parameter in XY-plane
236 // fZ: Impact parameter in Z
237 // fR[AliPID::kSPECIES]: combined "detector response probability"
238 // Running track parameters
239 // fRalpha: track rotation angle
240 // fRx: X-coordinate of the track reference plane
241 // fRp[5]: external track parameters
242 // fRc[15]: external cov. matrix of the track parameters
245 for (Int_t i=0;i<AliPID::kSPECIES;i++) fTrackTime[i] = 0;
248 // Reset track parameters constrained to the primary vertex
252 // Reset track parameters at the inner wall of TPC
255 // Reset track parameters at the inner wall of the TRD
258 // Reset ITS track related information
262 for (Int_t i=0;i<AliPID::kSPECIES;i++) fITSr[i]=0;
266 // Reset TPC related track information
274 for (Int_t i=0;i<AliPID::kSPECIES;i++) fTPCr[i]=0;
276 for (Int_t i=0;i<4;i++) fTPCPoints[i] = 0;
277 for (Int_t i=0; i<3;i++) fKinkIndexes[i] = 0;
278 for (Int_t i=0; i<3;i++) fV0Indexes[i] = 0;
280 // Reset TRD related track information
285 for (Int_t i=0;i<kNPlane;i++) {
289 for (Int_t i=0;i<AliPID::kSPECIES;i++) fTRDr[i] = 0;
294 // Reset TOF related track information
300 for (Int_t i=0;i<AliPID::kSPECIES;i++) fTOFr[i] = 0;
301 for (Int_t i=0;i<3;i++) fTOFLabel[i] = 0;
302 for (Int_t i=0;i<10;i++) fTOFInfo[i] = 0;
304 // Reset RICH related track information
309 for (Int_t i=0;i<AliPID::kSPECIES;i++) fRICHr[i] = 0;
315 delete fFriendTrack; fFriendTrack = 0;
316 delete fPoints; fPoints = 0;
318 //_______________________________________________________________________
319 Double_t AliESDtrack::GetMass() const {
320 // Returns the mass of the most probable particle type
323 for (Int_t i=0; i<AliPID::kSPECIES; i++) {
324 if (fR[i]>max) {k=i; max=fR[i];}
326 if (k==0) { // dE/dx "crossing points" in the TPC
328 if ((p>0.38)&&(p<0.48))
329 if (fR[0]<fR[3]*10.) return AliPID::ParticleMass(AliPID::kKaon);
330 if ((p>0.75)&&(p<0.85))
331 if (fR[0]<fR[4]*10.) return AliPID::ParticleMass(AliPID::kProton);
334 if (k==1) return AliPID::ParticleMass(AliPID::kMuon);
335 if (k==2||k==-1) return AliPID::ParticleMass(AliPID::kPion);
336 if (k==3) return AliPID::ParticleMass(AliPID::kKaon);
337 if (k==4) return AliPID::ParticleMass(AliPID::kProton);
338 AliWarning("Undefined mass !");
339 return AliPID::ParticleMass(AliPID::kPion);
342 //_______________________________________________________________________
343 Bool_t AliESDtrack::UpdateTrackParams(const AliKalmanTrack *t, ULong_t flags){
345 // This function updates track's running parameters
351 fLabel=t->GetLabel();
353 if (t->IsStartedTimeIntegral()) {
355 Double_t times[10];t->GetIntegratedTimes(times); SetIntegratedTimes(times);
356 SetIntegratedLength(t->GetIntegratedLength());
363 case kITSin: case kITSout: case kITSrefit:
364 index=fFriendTrack->GetITSindices();
365 for (Int_t i=0;i<AliESDfriendTrack::kMaxITScluster;i++)
366 index[i]=t->GetClusterIndex(i);
367 fITSncls=t->GetNumberOfClusters();
368 fITSchi2=t->GetChi2();
369 fITSsignal=t->GetPIDsignal();
370 fITSLabel = t->GetLabel();
371 fITSFakeRatio = t->GetFakeRatio();
374 case kTPCin: case kTPCrefit:
375 fTPCLabel = t->GetLabel();
376 if (!fIp) fIp=new AliExternalTrackParam(*t);
379 index=fFriendTrack->GetTPCindices();
380 if (flags & kTPCout){
381 if (!fOp) fOp=new AliExternalTrackParam(*t);
384 fTPCncls=t->GetNumberOfClusters();
385 fTPCchi2=t->GetChi2();
387 {//prevrow must be declared in separate namespace, otherwise compiler cries:
388 //"jump to case label crosses initialization of `Int_t prevrow'"
390 // for (Int_t i=0;i<fTPCncls;i++)
391 for (Int_t i=0;i<AliESDfriendTrack::kMaxTPCcluster;i++)
393 index[i]=t->GetClusterIndex(i);
394 Int_t idx = index[i];
398 // Piotr's Cluster Map for HBT
399 // ### please change accordingly if cluster array is changing
400 // to "New TPC Tracking" style (with gaps in array)
401 Int_t sect = (idx&0xff000000)>>24;
402 Int_t row = (idx&0x00ff0000)>>16;
403 if (sect > 18) row +=63; //if it is outer sector, add number of inner sectors
405 fTPCClusterMap.SetBitNumber(row,kTRUE);
407 //Fill the gap between previous row and this row with 0 bits
408 //In case ### pleas change it as well - just set bit 0 in case there
409 //is no associated clusters for current "i"
412 prevrow = row;//if previous bit was not assigned yet == this is the first one
415 { //we don't know the order (inner to outer or reverse)
416 //just to be save in case it is going to change
429 for (Int_t j = n+1; j < m; j++)
431 fTPCClusterMap.SetBitNumber(j,kFALSE);
435 // End Of Piotr's Cluster Map for HBT
438 fTPCsignal=t->GetPIDsignal();
441 case kTRDout: case kTRDin: case kTRDrefit:
442 index=fFriendTrack->GetTRDindices();
443 fTRDLabel = t->GetLabel();
444 fTRDncls=t->GetNumberOfClusters();
445 fTRDchi2=t->GetChi2();
446 for (Int_t i=0;i<fTRDncls;i++) index[i]=t->GetClusterIndex(i);
447 fTRDsignal=t->GetPIDsignal();
450 if (!fOp) fOp=new AliExternalTrackParam(*t);
452 fTRDncls0 = t->GetNumberOfClusters();
461 AliError("Wrong flag !");
468 //_______________________________________________________________________
469 void AliESDtrack::GetExternalParameters(Double_t &x, Double_t p[5]) const {
470 //---------------------------------------------------------------------
471 // This function returns external representation of the track parameters
472 //---------------------------------------------------------------------
474 for (Int_t i=0; i<5; i++) p[i]=GetParameter()[i];
477 //_______________________________________________________________________
478 void AliESDtrack::GetExternalCovariance(Double_t cov[15]) const {
479 //---------------------------------------------------------------------
480 // This function returns external representation of the cov. matrix
481 //---------------------------------------------------------------------
482 for (Int_t i=0; i<15; i++) cov[i]=AliExternalTrackParam::GetCovariance()[i];
485 //_______________________________________________________________________
486 Bool_t AliESDtrack::GetConstrainedExternalParameters
487 (Double_t &alpha, Double_t &x, Double_t p[5]) const {
488 //---------------------------------------------------------------------
489 // This function returns the constrained external track parameters
490 //---------------------------------------------------------------------
491 if (!fCp) return kFALSE;
492 alpha=fCp->GetAlpha();
494 for (Int_t i=0; i<5; i++) p[i]=fCp->GetParameter()[i];
498 //_______________________________________________________________________
500 AliESDtrack::GetConstrainedExternalCovariance(Double_t c[15]) const {
501 //---------------------------------------------------------------------
502 // This function returns the constrained external cov. matrix
503 //---------------------------------------------------------------------
504 if (!fCp) return kFALSE;
505 for (Int_t i=0; i<15; i++) c[i]=fCp->GetCovariance()[i];
510 AliESDtrack::GetInnerExternalParameters
511 (Double_t &alpha, Double_t &x, Double_t p[5]) const {
512 //---------------------------------------------------------------------
513 // This function returns external representation of the track parameters
514 // at the inner layer of TPC
515 //---------------------------------------------------------------------
516 if (!fIp) return kFALSE;
517 alpha=fIp->GetAlpha();
519 for (Int_t i=0; i<5; i++) p[i]=fIp->GetParameter()[i];
524 AliESDtrack::GetInnerExternalCovariance(Double_t cov[15]) const {
525 //---------------------------------------------------------------------
526 // This function returns external representation of the cov. matrix
527 // at the inner layer of TPC
528 //---------------------------------------------------------------------
529 if (!fIp) return kFALSE;
530 for (Int_t i=0; i<15; i++) cov[i]=fIp->GetCovariance()[i];
535 AliESDtrack::GetOuterExternalParameters
536 (Double_t &alpha, Double_t &x, Double_t p[5]) const {
537 //---------------------------------------------------------------------
538 // This function returns external representation of the track parameters
539 // at the inner layer of TRD
540 //---------------------------------------------------------------------
541 if (!fOp) return kFALSE;
542 alpha=fOp->GetAlpha();
544 for (Int_t i=0; i<5; i++) p[i]=fOp->GetParameter()[i];
549 AliESDtrack::GetOuterExternalCovariance(Double_t cov[15]) const {
550 //---------------------------------------------------------------------
551 // This function returns external representation of the cov. matrix
552 // at the inner layer of TRD
553 //---------------------------------------------------------------------
554 if (!fOp) return kFALSE;
555 for (Int_t i=0; i<15; i++) cov[i]=fOp->GetCovariance()[i];
559 Int_t AliESDtrack::GetNcls(Int_t idet) const
561 // Get number of clusters by subdetector index
584 Int_t AliESDtrack::GetClusters(Int_t idet, Int_t *idx) const
586 // Get cluster index array by subdetector index
591 ncls = GetITSclusters(idx);
594 ncls = GetTPCclusters(idx);
597 ncls = GetTRDclusters(idx);
600 if (fTOFindex != 0) {
601 idx[0] = GetTOFcluster();
611 //_______________________________________________________________________
612 void AliESDtrack::GetIntegratedTimes(Double_t *times) const {
613 // Returns the array with integrated times for each particle hypothesis
614 for (Int_t i=0; i<AliPID::kSPECIES; i++) times[i]=fTrackTime[i];
617 //_______________________________________________________________________
618 void AliESDtrack::SetIntegratedTimes(const Double_t *times) {
619 // Sets the array with integrated times for each particle hypotesis
620 for (Int_t i=0; i<AliPID::kSPECIES; i++) fTrackTime[i]=times[i];
623 //_______________________________________________________________________
624 void AliESDtrack::SetITSpid(const Double_t *p) {
625 // Sets values for the probability of each particle type (in ITS)
626 SetPIDValues(fITSr,p,AliPID::kSPECIES);
627 SetStatus(AliESDtrack::kITSpid);
630 //_______________________________________________________________________
631 void AliESDtrack::GetITSpid(Double_t *p) const {
632 // Gets the probability of each particle type (in ITS)
633 for (Int_t i=0; i<AliPID::kSPECIES; i++) p[i]=fITSr[i];
636 //_______________________________________________________________________
637 Int_t AliESDtrack::GetITSclusters(Int_t *idx) const {
638 //---------------------------------------------------------------------
639 // This function returns indices of the assgined ITS clusters
640 //---------------------------------------------------------------------
642 Int_t *index=fFriendTrack->GetITSindices();
643 for (Int_t i=0; i<AliESDfriendTrack::kMaxITScluster; i++) idx[i]=index[i];
648 //_______________________________________________________________________
649 Int_t AliESDtrack::GetTPCclusters(Int_t *idx) const {
650 //---------------------------------------------------------------------
651 // This function returns indices of the assgined ITS clusters
652 //---------------------------------------------------------------------
654 Int_t *index=fFriendTrack->GetTPCindices();
655 for (Int_t i=0; i<AliESDfriendTrack::kMaxTPCcluster; i++) idx[i]=index[i];
660 Float_t AliESDtrack::GetTPCdensity(Int_t row0, Int_t row1) const{
662 // GetDensity of the clusters on given region between row0 and row1
663 // Dead zone effect takin into acoount
668 Int_t *index=fFriendTrack->GetTPCindices();
669 for (Int_t i=row0;i<=row1;i++){
670 Int_t idx = index[i];
671 if (idx!=-1) good++; // track outside of dead zone
675 if (good>(row1-row0)*0.5) density = Float_t(found)/Float_t(good);
679 //_______________________________________________________________________
680 void AliESDtrack::SetTPCpid(const Double_t *p) {
681 // Sets values for the probability of each particle type (in TPC)
682 SetPIDValues(fTPCr,p,AliPID::kSPECIES);
683 SetStatus(AliESDtrack::kTPCpid);
686 //_______________________________________________________________________
687 void AliESDtrack::GetTPCpid(Double_t *p) const {
688 // Gets the probability of each particle type (in TPC)
689 for (Int_t i=0; i<AliPID::kSPECIES; i++) p[i]=fTPCr[i];
692 //_______________________________________________________________________
693 Int_t AliESDtrack::GetTRDclusters(Int_t *idx) const {
694 //---------------------------------------------------------------------
695 // This function returns indices of the assgined TRD clusters
696 //---------------------------------------------------------------------
698 Int_t *index=fFriendTrack->GetTRDindices();
699 for (Int_t i=0; i<AliESDfriendTrack::kMaxTRDcluster; i++) idx[i]=index[i];
704 //_______________________________________________________________________
705 void AliESDtrack::SetTRDpid(const Double_t *p) {
706 // Sets values for the probability of each particle type (in TRD)
707 SetPIDValues(fTRDr,p,AliPID::kSPECIES);
708 SetStatus(AliESDtrack::kTRDpid);
711 //_______________________________________________________________________
712 void AliESDtrack::GetTRDpid(Double_t *p) const {
713 // Gets the probability of each particle type (in TRD)
714 for (Int_t i=0; i<AliPID::kSPECIES; i++) p[i]=fTRDr[i];
717 //_______________________________________________________________________
718 void AliESDtrack::SetTRDpid(Int_t iSpecies, Float_t p)
720 // Sets the probability of particle type iSpecies to p (in TRD)
724 Float_t AliESDtrack::GetTRDpid(Int_t iSpecies) const
726 // Returns the probability of particle type iSpecies (in TRD)
727 return fTRDr[iSpecies];
730 //_______________________________________________________________________
731 void AliESDtrack::SetTOFpid(const Double_t *p) {
732 // Sets the probability of each particle type (in TOF)
733 SetPIDValues(fTOFr,p,AliPID::kSPECIES);
734 SetStatus(AliESDtrack::kTOFpid);
737 //_______________________________________________________________________
738 void AliESDtrack::SetTOFLabel(const Int_t *p) {
740 for (Int_t i=0; i<3; i++) fTOFLabel[i]=p[i];
743 //_______________________________________________________________________
744 void AliESDtrack::GetTOFpid(Double_t *p) const {
745 // Gets probabilities of each particle type (in TOF)
746 for (Int_t i=0; i<AliPID::kSPECIES; i++) p[i]=fTOFr[i];
749 //_______________________________________________________________________
750 void AliESDtrack::GetTOFLabel(Int_t *p) const {
752 for (Int_t i=0; i<3; i++) p[i]=fTOFLabel[i];
755 //_______________________________________________________________________
756 void AliESDtrack::GetTOFInfo(Float_t *info) const {
758 for (Int_t i=0; i<10; i++) info[i]=fTOFInfo[i];
761 //_______________________________________________________________________
762 void AliESDtrack::SetTOFInfo(Float_t*info) {
764 for (Int_t i=0; i<10; i++) fTOFInfo[i]=info[i];
769 //_______________________________________________________________________
770 void AliESDtrack::SetRICHpid(const Double_t *p) {
771 // Sets the probability of each particle type (in RICH)
772 SetPIDValues(fRICHr,p,AliPID::kSPECIES);
773 SetStatus(AliESDtrack::kRICHpid);
776 //_______________________________________________________________________
777 void AliESDtrack::GetRICHpid(Double_t *p) const {
778 // Gets probabilities of each particle type (in RICH)
779 for (Int_t i=0; i<AliPID::kSPECIES; i++) p[i]=fRICHr[i];
784 //_______________________________________________________________________
785 void AliESDtrack::SetESDpid(const Double_t *p) {
786 // Sets the probability of each particle type for the ESD track
787 SetPIDValues(fR,p,AliPID::kSPECIES);
788 SetStatus(AliESDtrack::kESDpid);
791 //_______________________________________________________________________
792 void AliESDtrack::GetESDpid(Double_t *p) const {
793 // Gets probability of each particle type for the ESD track
794 for (Int_t i=0; i<AliPID::kSPECIES; i++) p[i]=fR[i];
797 //_______________________________________________________________________
798 Bool_t AliESDtrack::RelateToVertex
799 (const AliESDVertex *vtx, Double_t b, Double_t maxd) {
801 // Try to relate this track to the vertex "vtx",
802 // if the (rough) transverse impact parameter is not bigger then "maxd".
803 // Magnetic field is "b" (kG).
805 // a) The track gets extapolated to the DCA to the vertex.
806 // b) The impact parameters and their covariance matrix are calculated.
807 // c) An attempt to constrain this track to the vertex is done.
809 // In the case of success, the returned value is kTRUE
810 // (otherwise, it's kFALSE)
812 Double_t alpha=GetAlpha();
813 Double_t sn=TMath::Sin(alpha), cs=TMath::Cos(alpha);
814 Double_t x=GetX(), y=GetParameter()[0], snp=GetParameter()[2];
815 Double_t xv= vtx->GetXv()*cs + vtx->GetYv()*sn;
816 Double_t yv=-vtx->GetXv()*sn + vtx->GetYv()*cs, zv=vtx->GetZv();
819 //Estimate the impact parameter neglecting the track curvature
820 Double_t d=TMath::Abs(x*snp - y*TMath::Sqrt(1.- snp*snp));
821 if (d > maxd) return kFALSE;
823 //Propagate to the DCA
824 Double_t crv=0.299792458e-3*b*GetParameter()[4];
825 Double_t tgfv=-(crv*x - snp)/(crv*y + TMath::Sqrt(1.-snp*snp));
826 sn=tgfv/TMath::Sqrt(1.+ tgfv*tgfv);
827 if (TMath::Abs(tgfv)>0.) cs = sn/tgfv;
831 yv=-xv*sn + yv*cs; xv=x;
833 if (!Propagate(alpha+TMath::ASin(sn),xv,b)) return kFALSE;
835 fD = GetParameter()[0] - yv;
836 fZ = GetParameter()[1] - zv;
838 Double_t cov[6]; vtx->GetCovMatrix(cov);
839 fCdd = GetCovariance()[0] + cov[2]; // neglecting non-diagonals
840 fCdz = GetCovariance()[1]; // in the vertex's
841 fCzz = GetCovariance()[2] + cov[5]; // covariance matrix
844 Double_t p[2]={yv,zv}, c[3]={cov[2],0.,cov[5]};
845 Double_t chi2=GetPredictedChi2(p,c);
847 if (chi2>77.) return kFALSE;
849 AliExternalTrackParam tmp(*this);
850 if (!tmp.Update(p,c)) return kFALSE;
853 if (!fCp) fCp=new AliExternalTrackParam();
854 new (fCp) AliExternalTrackParam(tmp);
860 void AliESDtrack::SetTrackPointArray(AliTrackPointArray *points) {
862 //fFriendTrack->SetTrackPointArray(points);
864 const AliTrackPointArray *AliESDtrack::GetTrackPointArray() const {
866 //return fFriendTrack->GetTrackPointArray();
869 //_______________________________________________________________________
870 void AliESDtrack::Print(Option_t *) const {
871 // Prints info on the track
873 printf("ESD track info\n") ;
874 Double_t p[AliPID::kSPECIESN] ;
877 printf("From ITS: ") ;
879 for(index = 0 ; index < AliPID::kSPECIES; index++)
880 printf("%f, ", p[index]) ;
881 printf("\n signal = %f\n", GetITSsignal()) ;
884 printf("From TPC: ") ;
886 for(index = 0 ; index < AliPID::kSPECIES; index++)
887 printf("%f, ", p[index]) ;
888 printf("\n signal = %f\n", GetTPCsignal()) ;
891 printf("From TRD: ") ;
893 for(index = 0 ; index < AliPID::kSPECIES; index++)
894 printf("%f, ", p[index]) ;
895 printf("\n signal = %f\n", GetTRDsignal()) ;
898 printf("From TOF: ") ;
900 for(index = 0 ; index < AliPID::kSPECIES; index++)
901 printf("%f, ", p[index]) ;
902 printf("\n signal = %f\n", GetTOFsignal()) ;
904 if( IsOn(kRICHpid) ){
905 printf("From RICH: ") ;
907 for(index = 0 ; index < AliPID::kSPECIES; index++)
908 printf("%f, ", p[index]) ;
909 printf("\n signal = %f\n", GetRICHsignal()) ;