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++) {
129 for (j=0;j<kNSlice;j++) {
130 fTRDsignals[i][j]=0.;
134 for (i=0;i<4;i++) {fTPCPoints[i]=-1;}
135 for (i=0;i<3;i++) {fTOFLabel[i]=-1;}
136 for (i=0;i<10;i++) {fTOFInfo[i]=-1;}
139 //_______________________________________________________________________
140 AliESDtrack::AliESDtrack(const AliESDtrack& track):
141 AliExternalTrackParam(track),
142 fFlags(track.fFlags),
143 fLabel(track.fLabel),
145 fTrackLength(track.fTrackLength),
146 fD(track.fD),fZ(track.fZ),
147 fCdd(track.fCdd),fCdz(track.fCdz),fCzz(track.fCzz),
148 fStopVertex(track.fStopVertex),
150 fCchi2(track.fCchi2),
153 fITSchi2(track.fITSchi2),
154 fITSncls(track.fITSncls),
155 fITSsignal(track.fITSsignal),
156 fITSLabel(track.fITSLabel),
157 fITSFakeRatio(track.fITSFakeRatio),
158 fTPCchi2(track.fTPCchi2),
159 fTPCncls(track.fTPCncls),
160 fTPCnclsF(track.fTPCnclsF),
161 fTPCClusterMap(track.fTPCClusterMap),
162 fTPCsignal(track.fTPCsignal),
163 fTPCsignalN(track.fTPCsignalN),
164 fTPCsignalS(track.fTPCsignalS),
165 fTPCLabel(track.fTPCLabel),
166 fTRDchi2(track.fTRDchi2),
167 fTRDncls(track.fTRDncls),
168 fTRDncls0(track.fTRDncls0),
169 fTRDsignal(track.fTRDsignal),
170 fTRDLabel(track.fTRDLabel),
171 fTRDQuality(track.fTRDQuality),
172 fTRDBudget(track.fTRDBudget),
173 fTOFchi2(track.fTOFchi2),
174 fTOFindex(track.fTOFindex),
175 fTOFCalChannel(track.fTOFCalChannel),
176 fTOFsignal(track.fTOFsignal),
177 fTOFsignalToT(track.fTOFsignalToT),
178 fRICHchi2(track.fRICHchi2),
179 fRICHncls(track.fRICHncls),
180 fRICHindex(track.fRICHindex),
181 fRICHsignal(track.fRICHsignal),
182 fRICHtheta(track.fRICHtheta),
183 fRICHphi(track.fRICHphi),
184 fRICHdx(track.fRICHdx),
185 fRICHdy(track.fRICHdy),
186 fRICHmipX(track.fRICHmipX),
187 fRICHmipY(track.fRICHmipY),
189 fFriendTrack(new AliESDfriendTrack(*(track.fFriendTrack)))
194 for (Int_t i=0;i<AliPID::kSPECIES;i++) fTrackTime[i]=track.fTrackTime[i];
195 for (Int_t i=0;i<AliPID::kSPECIES;i++) fR[i]=track.fR[i];
197 for (Int_t i=0;i<AliPID::kSPECIES;i++) fITSr[i]=track.fITSr[i];
199 for (Int_t i=0;i<AliPID::kSPECIES;i++) fTPCr[i]=track.fTPCr[i];
200 for (Int_t i=0;i<4;i++) {fTPCPoints[i]=track.fTPCPoints[i];}
201 for (Int_t i=0; i<3;i++) { fKinkIndexes[i]=track.fKinkIndexes[i];}
202 for (Int_t i=0; i<3;i++) { fV0Indexes[i]=track.fV0Indexes[i];}
204 for (Int_t i=0;i<kNPlane;i++) {
205 for (Int_t j=0;j<kNSlice;j++) {
206 fTRDsignals[i][j]=track.fTRDsignals[i][j];
208 fTRDTimBin[i]=track.fTRDTimBin[i];
210 for (Int_t i=0;i<AliPID::kSPECIES;i++) fTRDr[i]=track.fTRDr[i];
211 for (Int_t i=0;i<AliPID::kSPECIES;i++) fTOFr[i]=track.fTOFr[i];
212 for (Int_t i=0;i<3;i++) fTOFLabel[i]=track.fTOFLabel[i];
213 for (Int_t i=0;i<10;i++) fTOFInfo[i]=track.fTOFInfo[i];
214 for (Int_t i=0;i<AliPID::kSPECIES;i++) fRICHr[i]=track.fRICHr[i];
216 if (track.fCp) fCp=new AliExternalTrackParam(*track.fCp);
217 if (track.fIp) fIp=new AliExternalTrackParam(*track.fIp);
218 if (track.fOp) fOp=new AliExternalTrackParam(*track.fOp);
220 if (track.fPoints) fPoints=new AliTrackPointArray(*(track.fPoints));
223 //_______________________________________________________________________
224 AliESDtrack::~AliESDtrack(){
226 // This is destructor according Coding Conventrions
228 //printf("Delete track\n");
236 //_______________________________________________________________________
237 void AliESDtrack::MakeMiniESDtrack(){
238 // Resets everything except
239 // fFlags: Reconstruction status flags
240 // fLabel: Track label
241 // fID: Unique ID of the track
242 // fD: Impact parameter in XY-plane
243 // fZ: Impact parameter in Z
244 // fR[AliPID::kSPECIES]: combined "detector response probability"
245 // Running track parameters
246 // fRalpha: track rotation angle
247 // fRx: X-coordinate of the track reference plane
248 // fRp[5]: external track parameters
249 // fRc[15]: external cov. matrix of the track parameters
252 for (Int_t i=0;i<AliPID::kSPECIES;i++) fTrackTime[i] = 0;
255 // Reset track parameters constrained to the primary vertex
259 // Reset track parameters at the inner wall of TPC
262 // Reset track parameters at the inner wall of the TRD
265 // Reset ITS track related information
269 for (Int_t i=0;i<AliPID::kSPECIES;i++) fITSr[i]=0;
273 // Reset TPC related track information
281 for (Int_t i=0;i<AliPID::kSPECIES;i++) fTPCr[i]=0;
283 for (Int_t i=0;i<4;i++) fTPCPoints[i] = 0;
284 for (Int_t i=0; i<3;i++) fKinkIndexes[i] = 0;
285 for (Int_t i=0; i<3;i++) fV0Indexes[i] = 0;
287 // Reset TRD related track information
292 for (Int_t i=0;i<kNPlane;i++) {
293 for (Int_t j=0;j<kNSlice;j++) {
294 fTRDsignals[i][j] = 0;
298 for (Int_t i=0;i<AliPID::kSPECIES;i++) fTRDr[i] = 0;
303 // Reset TOF related track information
309 for (Int_t i=0;i<AliPID::kSPECIES;i++) fTOFr[i] = 0;
310 for (Int_t i=0;i<3;i++) fTOFLabel[i] = 0;
311 for (Int_t i=0;i<10;i++) fTOFInfo[i] = 0;
313 // Reset RICH related track information
318 for (Int_t i=0;i<AliPID::kSPECIES;i++) fRICHr[i] = 0;
324 delete fFriendTrack; fFriendTrack = 0;
325 delete fPoints; fPoints = 0;
327 //_______________________________________________________________________
328 Double_t AliESDtrack::GetMass() const {
329 // Returns the mass of the most probable particle type
332 for (Int_t i=0; i<AliPID::kSPECIES; i++) {
333 if (fR[i]>max) {k=i; max=fR[i];}
335 if (k==0) { // dE/dx "crossing points" in the TPC
337 if ((p>0.38)&&(p<0.48))
338 if (fR[0]<fR[3]*10.) return AliPID::ParticleMass(AliPID::kKaon);
339 if ((p>0.75)&&(p<0.85))
340 if (fR[0]<fR[4]*10.) return AliPID::ParticleMass(AliPID::kProton);
343 if (k==1) return AliPID::ParticleMass(AliPID::kMuon);
344 if (k==2||k==-1) return AliPID::ParticleMass(AliPID::kPion);
345 if (k==3) return AliPID::ParticleMass(AliPID::kKaon);
346 if (k==4) return AliPID::ParticleMass(AliPID::kProton);
347 AliWarning("Undefined mass !");
348 return AliPID::ParticleMass(AliPID::kPion);
351 //_______________________________________________________________________
352 Bool_t AliESDtrack::UpdateTrackParams(const AliKalmanTrack *t, ULong_t flags){
354 // This function updates track's running parameters
360 fLabel=t->GetLabel();
362 if (t->IsStartedTimeIntegral()) {
364 Double_t times[10];t->GetIntegratedTimes(times); SetIntegratedTimes(times);
365 SetIntegratedLength(t->GetIntegratedLength());
372 case kITSin: case kITSout: case kITSrefit:
373 index=fFriendTrack->GetITSindices();
374 for (Int_t i=0;i<AliESDfriendTrack::kMaxITScluster;i++)
375 index[i]=t->GetClusterIndex(i);
376 fITSncls=t->GetNumberOfClusters();
377 fITSchi2=t->GetChi2();
378 fITSsignal=t->GetPIDsignal();
379 fITSLabel = t->GetLabel();
380 fITSFakeRatio = t->GetFakeRatio();
383 case kTPCin: case kTPCrefit:
384 fTPCLabel = t->GetLabel();
385 if (!fIp) fIp=new AliExternalTrackParam(*t);
388 index=fFriendTrack->GetTPCindices();
389 if (flags & kTPCout){
390 if (!fOp) fOp=new AliExternalTrackParam(*t);
393 fTPCncls=t->GetNumberOfClusters();
394 fTPCchi2=t->GetChi2();
396 {//prevrow must be declared in separate namespace, otherwise compiler cries:
397 //"jump to case label crosses initialization of `Int_t prevrow'"
399 // for (Int_t i=0;i<fTPCncls;i++)
400 for (Int_t i=0;i<AliESDfriendTrack::kMaxTPCcluster;i++)
402 index[i]=t->GetClusterIndex(i);
403 Int_t idx = index[i];
407 // Piotr's Cluster Map for HBT
408 // ### please change accordingly if cluster array is changing
409 // to "New TPC Tracking" style (with gaps in array)
410 Int_t sect = (idx&0xff000000)>>24;
411 Int_t row = (idx&0x00ff0000)>>16;
412 if (sect > 18) row +=63; //if it is outer sector, add number of inner sectors
414 fTPCClusterMap.SetBitNumber(row,kTRUE);
416 //Fill the gap between previous row and this row with 0 bits
417 //In case ### pleas change it as well - just set bit 0 in case there
418 //is no associated clusters for current "i"
421 prevrow = row;//if previous bit was not assigned yet == this is the first one
424 { //we don't know the order (inner to outer or reverse)
425 //just to be save in case it is going to change
438 for (Int_t j = n+1; j < m; j++)
440 fTPCClusterMap.SetBitNumber(j,kFALSE);
444 // End Of Piotr's Cluster Map for HBT
447 fTPCsignal=t->GetPIDsignal();
450 case kTRDout: case kTRDin: case kTRDrefit:
451 index=fFriendTrack->GetTRDindices();
452 fTRDLabel = t->GetLabel();
453 fTRDncls=t->GetNumberOfClusters();
454 fTRDchi2=t->GetChi2();
455 for (Int_t i=0;i<fTRDncls;i++) index[i]=t->GetClusterIndex(i);
456 fTRDsignal=t->GetPIDsignal();
459 if (!fOp) fOp=new AliExternalTrackParam(*t);
461 fTRDncls0 = t->GetNumberOfClusters();
470 AliError("Wrong flag !");
477 //_______________________________________________________________________
478 void AliESDtrack::GetExternalParameters(Double_t &x, Double_t p[5]) const {
479 //---------------------------------------------------------------------
480 // This function returns external representation of the track parameters
481 //---------------------------------------------------------------------
483 for (Int_t i=0; i<5; i++) p[i]=GetParameter()[i];
486 //_______________________________________________________________________
487 void AliESDtrack::GetExternalCovariance(Double_t cov[15]) const {
488 //---------------------------------------------------------------------
489 // This function returns external representation of the cov. matrix
490 //---------------------------------------------------------------------
491 for (Int_t i=0; i<15; i++) cov[i]=AliExternalTrackParam::GetCovariance()[i];
494 //_______________________________________________________________________
495 Bool_t AliESDtrack::GetConstrainedExternalParameters
496 (Double_t &alpha, Double_t &x, Double_t p[5]) const {
497 //---------------------------------------------------------------------
498 // This function returns the constrained external track parameters
499 //---------------------------------------------------------------------
500 if (!fCp) return kFALSE;
501 alpha=fCp->GetAlpha();
503 for (Int_t i=0; i<5; i++) p[i]=fCp->GetParameter()[i];
507 //_______________________________________________________________________
509 AliESDtrack::GetConstrainedExternalCovariance(Double_t c[15]) const {
510 //---------------------------------------------------------------------
511 // This function returns the constrained external cov. matrix
512 //---------------------------------------------------------------------
513 if (!fCp) return kFALSE;
514 for (Int_t i=0; i<15; i++) c[i]=fCp->GetCovariance()[i];
519 AliESDtrack::GetInnerExternalParameters
520 (Double_t &alpha, Double_t &x, Double_t p[5]) const {
521 //---------------------------------------------------------------------
522 // This function returns external representation of the track parameters
523 // at the inner layer of TPC
524 //---------------------------------------------------------------------
525 if (!fIp) return kFALSE;
526 alpha=fIp->GetAlpha();
528 for (Int_t i=0; i<5; i++) p[i]=fIp->GetParameter()[i];
533 AliESDtrack::GetInnerExternalCovariance(Double_t cov[15]) const {
534 //---------------------------------------------------------------------
535 // This function returns external representation of the cov. matrix
536 // at the inner layer of TPC
537 //---------------------------------------------------------------------
538 if (!fIp) return kFALSE;
539 for (Int_t i=0; i<15; i++) cov[i]=fIp->GetCovariance()[i];
544 AliESDtrack::GetOuterExternalParameters
545 (Double_t &alpha, Double_t &x, Double_t p[5]) const {
546 //---------------------------------------------------------------------
547 // This function returns external representation of the track parameters
548 // at the inner layer of TRD
549 //---------------------------------------------------------------------
550 if (!fOp) return kFALSE;
551 alpha=fOp->GetAlpha();
553 for (Int_t i=0; i<5; i++) p[i]=fOp->GetParameter()[i];
558 AliESDtrack::GetOuterExternalCovariance(Double_t cov[15]) const {
559 //---------------------------------------------------------------------
560 // This function returns external representation of the cov. matrix
561 // at the inner layer of TRD
562 //---------------------------------------------------------------------
563 if (!fOp) return kFALSE;
564 for (Int_t i=0; i<15; i++) cov[i]=fOp->GetCovariance()[i];
568 Int_t AliESDtrack::GetNcls(Int_t idet) const
570 // Get number of clusters by subdetector index
593 Int_t AliESDtrack::GetClusters(Int_t idet, Int_t *idx) const
595 // Get cluster index array by subdetector index
600 ncls = GetITSclusters(idx);
603 ncls = GetTPCclusters(idx);
606 ncls = GetTRDclusters(idx);
609 if (fTOFindex != 0) {
610 idx[0] = GetTOFcluster();
620 //_______________________________________________________________________
621 void AliESDtrack::GetIntegratedTimes(Double_t *times) const {
622 // Returns the array with integrated times for each particle hypothesis
623 for (Int_t i=0; i<AliPID::kSPECIES; i++) times[i]=fTrackTime[i];
626 //_______________________________________________________________________
627 void AliESDtrack::SetIntegratedTimes(const Double_t *times) {
628 // Sets the array with integrated times for each particle hypotesis
629 for (Int_t i=0; i<AliPID::kSPECIES; i++) fTrackTime[i]=times[i];
632 //_______________________________________________________________________
633 void AliESDtrack::SetITSpid(const Double_t *p) {
634 // Sets values for the probability of each particle type (in ITS)
635 SetPIDValues(fITSr,p,AliPID::kSPECIES);
636 SetStatus(AliESDtrack::kITSpid);
639 //_______________________________________________________________________
640 void AliESDtrack::GetITSpid(Double_t *p) const {
641 // Gets the probability of each particle type (in ITS)
642 for (Int_t i=0; i<AliPID::kSPECIES; i++) p[i]=fITSr[i];
645 //_______________________________________________________________________
646 Int_t AliESDtrack::GetITSclusters(Int_t *idx) const {
647 //---------------------------------------------------------------------
648 // This function returns indices of the assgined ITS clusters
649 //---------------------------------------------------------------------
651 Int_t *index=fFriendTrack->GetITSindices();
652 for (Int_t i=0; i<AliESDfriendTrack::kMaxITScluster; i++) idx[i]=index[i];
657 //_______________________________________________________________________
658 Int_t AliESDtrack::GetTPCclusters(Int_t *idx) const {
659 //---------------------------------------------------------------------
660 // This function returns indices of the assgined ITS clusters
661 //---------------------------------------------------------------------
663 Int_t *index=fFriendTrack->GetTPCindices();
664 for (Int_t i=0; i<AliESDfriendTrack::kMaxTPCcluster; i++) idx[i]=index[i];
669 Float_t AliESDtrack::GetTPCdensity(Int_t row0, Int_t row1) const{
671 // GetDensity of the clusters on given region between row0 and row1
672 // Dead zone effect takin into acoount
677 Int_t *index=fFriendTrack->GetTPCindices();
678 for (Int_t i=row0;i<=row1;i++){
679 Int_t idx = index[i];
680 if (idx!=-1) good++; // track outside of dead zone
684 if (good>(row1-row0)*0.5) density = Float_t(found)/Float_t(good);
688 //_______________________________________________________________________
689 void AliESDtrack::SetTPCpid(const Double_t *p) {
690 // Sets values for the probability of each particle type (in TPC)
691 SetPIDValues(fTPCr,p,AliPID::kSPECIES);
692 SetStatus(AliESDtrack::kTPCpid);
695 //_______________________________________________________________________
696 void AliESDtrack::GetTPCpid(Double_t *p) const {
697 // Gets the probability of each particle type (in TPC)
698 for (Int_t i=0; i<AliPID::kSPECIES; i++) p[i]=fTPCr[i];
701 //_______________________________________________________________________
702 Int_t AliESDtrack::GetTRDclusters(Int_t *idx) const {
703 //---------------------------------------------------------------------
704 // This function returns indices of the assgined TRD clusters
705 //---------------------------------------------------------------------
707 Int_t *index=fFriendTrack->GetTRDindices();
708 for (Int_t i=0; i<AliESDfriendTrack::kMaxTRDcluster; i++) idx[i]=index[i];
713 //_______________________________________________________________________
714 void AliESDtrack::SetTRDpid(const Double_t *p) {
715 // Sets values for the probability of each particle type (in TRD)
716 SetPIDValues(fTRDr,p,AliPID::kSPECIES);
717 SetStatus(AliESDtrack::kTRDpid);
720 //_______________________________________________________________________
721 void AliESDtrack::GetTRDpid(Double_t *p) const {
722 // Gets the probability of each particle type (in TRD)
723 for (Int_t i=0; i<AliPID::kSPECIES; i++) p[i]=fTRDr[i];
726 //_______________________________________________________________________
727 void AliESDtrack::SetTRDpid(Int_t iSpecies, Float_t p)
729 // Sets the probability of particle type iSpecies to p (in TRD)
733 Float_t AliESDtrack::GetTRDpid(Int_t iSpecies) const
735 // Returns the probability of particle type iSpecies (in TRD)
736 return fTRDr[iSpecies];
739 //_______________________________________________________________________
740 void AliESDtrack::SetTOFpid(const Double_t *p) {
741 // Sets the probability of each particle type (in TOF)
742 SetPIDValues(fTOFr,p,AliPID::kSPECIES);
743 SetStatus(AliESDtrack::kTOFpid);
746 //_______________________________________________________________________
747 void AliESDtrack::SetTOFLabel(const Int_t *p) {
749 for (Int_t i=0; i<3; i++) fTOFLabel[i]=p[i];
752 //_______________________________________________________________________
753 void AliESDtrack::GetTOFpid(Double_t *p) const {
754 // Gets probabilities of each particle type (in TOF)
755 for (Int_t i=0; i<AliPID::kSPECIES; i++) p[i]=fTOFr[i];
758 //_______________________________________________________________________
759 void AliESDtrack::GetTOFLabel(Int_t *p) const {
761 for (Int_t i=0; i<3; i++) p[i]=fTOFLabel[i];
764 //_______________________________________________________________________
765 void AliESDtrack::GetTOFInfo(Float_t *info) const {
767 for (Int_t i=0; i<10; i++) info[i]=fTOFInfo[i];
770 //_______________________________________________________________________
771 void AliESDtrack::SetTOFInfo(Float_t*info) {
773 for (Int_t i=0; i<10; i++) fTOFInfo[i]=info[i];
778 //_______________________________________________________________________
779 void AliESDtrack::SetRICHpid(const Double_t *p) {
780 // Sets the probability of each particle type (in RICH)
781 SetPIDValues(fRICHr,p,AliPID::kSPECIES);
782 SetStatus(AliESDtrack::kRICHpid);
785 //_______________________________________________________________________
786 void AliESDtrack::GetRICHpid(Double_t *p) const {
787 // Gets probabilities of each particle type (in RICH)
788 for (Int_t i=0; i<AliPID::kSPECIES; i++) p[i]=fRICHr[i];
793 //_______________________________________________________________________
794 void AliESDtrack::SetESDpid(const Double_t *p) {
795 // Sets the probability of each particle type for the ESD track
796 SetPIDValues(fR,p,AliPID::kSPECIES);
797 SetStatus(AliESDtrack::kESDpid);
800 //_______________________________________________________________________
801 void AliESDtrack::GetESDpid(Double_t *p) const {
802 // Gets probability of each particle type for the ESD track
803 for (Int_t i=0; i<AliPID::kSPECIES; i++) p[i]=fR[i];
806 //_______________________________________________________________________
807 Bool_t AliESDtrack::RelateToVertex
808 (const AliESDVertex *vtx, Double_t b, Double_t maxd) {
810 // Try to relate this track to the vertex "vtx",
811 // if the (rough) transverse impact parameter is not bigger then "maxd".
812 // Magnetic field is "b" (kG).
814 // a) The track gets extapolated to the DCA to the vertex.
815 // b) The impact parameters and their covariance matrix are calculated.
816 // c) An attempt to constrain this track to the vertex is done.
818 // In the case of success, the returned value is kTRUE
819 // (otherwise, it's kFALSE)
821 Double_t alpha=GetAlpha();
822 Double_t sn=TMath::Sin(alpha), cs=TMath::Cos(alpha);
823 Double_t x=GetX(), y=GetParameter()[0], snp=GetParameter()[2];
824 Double_t xv= vtx->GetXv()*cs + vtx->GetYv()*sn;
825 Double_t yv=-vtx->GetXv()*sn + vtx->GetYv()*cs, zv=vtx->GetZv();
828 //Estimate the impact parameter neglecting the track curvature
829 Double_t d=TMath::Abs(x*snp - y*TMath::Sqrt(1.- snp*snp));
830 if (d > maxd) return kFALSE;
832 //Propagate to the DCA
833 Double_t crv=kB2C*b*GetParameter()[4];
834 if (TMath::Abs(b) < kAlmost0Field) crv=0.;
836 Double_t tgfv=-(crv*x - snp)/(crv*y + TMath::Sqrt(1.-snp*snp));
837 sn=tgfv/TMath::Sqrt(1.+ tgfv*tgfv);
838 if (TMath::Abs(tgfv)>0.) cs = sn/tgfv;
842 yv=-xv*sn + yv*cs; xv=x;
844 if (!Propagate(alpha+TMath::ASin(sn),xv,b)) return kFALSE;
846 fD = GetParameter()[0] - yv;
847 fZ = GetParameter()[1] - zv;
849 Double_t cov[6]; vtx->GetCovMatrix(cov);
850 fCdd = GetCovariance()[0] + cov[2]; // neglecting non-diagonals
851 fCdz = GetCovariance()[1]; // in the vertex's
852 fCzz = GetCovariance()[2] + cov[5]; // covariance matrix
855 Double_t p[2]={yv,zv}, c[3]={cov[2],0.,cov[5]};
856 Double_t chi2=GetPredictedChi2(p,c);
858 if (chi2>77.) return kFALSE;
860 AliExternalTrackParam tmp(*this);
861 if (!tmp.Update(p,c)) return kFALSE;
864 if (!fCp) fCp=new AliExternalTrackParam();
865 new (fCp) AliExternalTrackParam(tmp);
871 void AliESDtrack::SetTrackPointArray(AliTrackPointArray *points) {
873 //fFriendTrack->SetTrackPointArray(points);
875 const AliTrackPointArray *AliESDtrack::GetTrackPointArray() const {
877 //return fFriendTrack->GetTrackPointArray();
880 //_______________________________________________________________________
881 void AliESDtrack::Print(Option_t *) const {
882 // Prints info on the track
884 printf("ESD track info\n") ;
885 Double_t p[AliPID::kSPECIESN] ;
888 printf("From ITS: ") ;
890 for(index = 0 ; index < AliPID::kSPECIES; index++)
891 printf("%f, ", p[index]) ;
892 printf("\n signal = %f\n", GetITSsignal()) ;
895 printf("From TPC: ") ;
897 for(index = 0 ; index < AliPID::kSPECIES; index++)
898 printf("%f, ", p[index]) ;
899 printf("\n signal = %f\n", GetTPCsignal()) ;
902 printf("From TRD: ") ;
904 for(index = 0 ; index < AliPID::kSPECIES; index++)
905 printf("%f, ", p[index]) ;
906 printf("\n signal = %f\n", GetTRDsignal()) ;
909 printf("From TOF: ") ;
911 for(index = 0 ; index < AliPID::kSPECIES; index++)
912 printf("%f, ", p[index]) ;
913 printf("\n signal = %f\n", GetTOFsignal()) ;
915 if( IsOn(kRICHpid) ){
916 printf("From RICH: ") ;
918 for(index = 0 ; index < AliPID::kSPECIES; index++)
919 printf("%f, ", p[index]) ;
920 printf("\n signal = %f\n", GetRICHsignal()) ;