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 void AliESDtrack::AddCalibObject(TObject * object){
238 // add calib object to the list
240 if (!fFriendTrack) fFriendTrack = new AliESDfriendTrack;
241 fFriendTrack->AddCalibObject(object);
244 TObject * AliESDtrack::GetCalibObject(Int_t index){
246 // return calib objct at given position
248 if (!fFriendTrack) return 0;
249 return fFriendTrack->GetCalibObject(index);
253 //_______________________________________________________________________
254 void AliESDtrack::MakeMiniESDtrack(){
255 // Resets everything except
256 // fFlags: Reconstruction status flags
257 // fLabel: Track label
258 // fID: Unique ID of the track
259 // fD: Impact parameter in XY-plane
260 // fZ: Impact parameter in Z
261 // fR[AliPID::kSPECIES]: combined "detector response probability"
262 // Running track parameters
263 // fRalpha: track rotation angle
264 // fRx: X-coordinate of the track reference plane
265 // fRp[5]: external track parameters
266 // fRc[15]: external cov. matrix of the track parameters
269 for (Int_t i=0;i<AliPID::kSPECIES;i++) fTrackTime[i] = 0;
272 // Reset track parameters constrained to the primary vertex
276 // Reset track parameters at the inner wall of TPC
279 // Reset track parameters at the inner wall of the TRD
282 // Reset ITS track related information
286 for (Int_t i=0;i<AliPID::kSPECIES;i++) fITSr[i]=0;
290 // Reset TPC related track information
298 for (Int_t i=0;i<AliPID::kSPECIES;i++) fTPCr[i]=0;
300 for (Int_t i=0;i<4;i++) fTPCPoints[i] = 0;
301 for (Int_t i=0; i<3;i++) fKinkIndexes[i] = 0;
302 for (Int_t i=0; i<3;i++) fV0Indexes[i] = 0;
304 // Reset TRD related track information
309 for (Int_t i=0;i<kNPlane;i++) {
310 for (Int_t j=0;j<kNSlice;j++) {
311 fTRDsignals[i][j] = 0;
315 for (Int_t i=0;i<AliPID::kSPECIES;i++) fTRDr[i] = 0;
320 // Reset TOF related track information
326 for (Int_t i=0;i<AliPID::kSPECIES;i++) fTOFr[i] = 0;
327 for (Int_t i=0;i<3;i++) fTOFLabel[i] = 0;
328 for (Int_t i=0;i<10;i++) fTOFInfo[i] = 0;
330 // Reset RICH related track information
335 for (Int_t i=0;i<AliPID::kSPECIES;i++) fRICHr[i] = 0;
341 delete fFriendTrack; fFriendTrack = 0;
342 delete fPoints; fPoints = 0;
344 //_______________________________________________________________________
345 Double_t AliESDtrack::GetMass() const {
346 // Returns the mass of the most probable particle type
349 for (Int_t i=0; i<AliPID::kSPECIES; i++) {
350 if (fR[i]>max) {k=i; max=fR[i];}
352 if (k==0) { // dE/dx "crossing points" in the TPC
354 if ((p>0.38)&&(p<0.48))
355 if (fR[0]<fR[3]*10.) return AliPID::ParticleMass(AliPID::kKaon);
356 if ((p>0.75)&&(p<0.85))
357 if (fR[0]<fR[4]*10.) return AliPID::ParticleMass(AliPID::kProton);
360 if (k==1) return AliPID::ParticleMass(AliPID::kMuon);
361 if (k==2||k==-1) return AliPID::ParticleMass(AliPID::kPion);
362 if (k==3) return AliPID::ParticleMass(AliPID::kKaon);
363 if (k==4) return AliPID::ParticleMass(AliPID::kProton);
364 AliWarning("Undefined mass !");
365 return AliPID::ParticleMass(AliPID::kPion);
368 //_______________________________________________________________________
369 Bool_t AliESDtrack::UpdateTrackParams(const AliKalmanTrack *t, ULong_t flags){
371 // This function updates track's running parameters
377 fLabel=t->GetLabel();
379 if (t->IsStartedTimeIntegral()) {
381 Double_t times[10];t->GetIntegratedTimes(times); SetIntegratedTimes(times);
382 SetIntegratedLength(t->GetIntegratedLength());
389 case kITSin: case kITSout: case kITSrefit:
390 index=fFriendTrack->GetITSindices();
391 for (Int_t i=0;i<AliESDfriendTrack::kMaxITScluster;i++)
392 index[i]=t->GetClusterIndex(i);
393 fITSncls=t->GetNumberOfClusters();
394 fITSchi2=t->GetChi2();
395 fITSsignal=t->GetPIDsignal();
396 fITSLabel = t->GetLabel();
397 fITSFakeRatio = t->GetFakeRatio();
400 case kTPCin: case kTPCrefit:
401 fTPCLabel = t->GetLabel();
402 if (!fIp) fIp=new AliExternalTrackParam(*t);
405 index=fFriendTrack->GetTPCindices();
406 if (flags & kTPCout){
407 if (!fOp) fOp=new AliExternalTrackParam(*t);
410 fTPCncls=t->GetNumberOfClusters();
411 fTPCchi2=t->GetChi2();
413 {//prevrow must be declared in separate namespace, otherwise compiler cries:
414 //"jump to case label crosses initialization of `Int_t prevrow'"
416 // for (Int_t i=0;i<fTPCncls;i++)
417 for (Int_t i=0;i<AliESDfriendTrack::kMaxTPCcluster;i++)
419 index[i]=t->GetClusterIndex(i);
420 Int_t idx = index[i];
424 // Piotr's Cluster Map for HBT
425 // ### please change accordingly if cluster array is changing
426 // to "New TPC Tracking" style (with gaps in array)
427 Int_t sect = (idx&0xff000000)>>24;
428 Int_t row = (idx&0x00ff0000)>>16;
429 if (sect > 18) row +=63; //if it is outer sector, add number of inner sectors
431 fTPCClusterMap.SetBitNumber(row,kTRUE);
433 //Fill the gap between previous row and this row with 0 bits
434 //In case ### pleas change it as well - just set bit 0 in case there
435 //is no associated clusters for current "i"
438 prevrow = row;//if previous bit was not assigned yet == this is the first one
441 { //we don't know the order (inner to outer or reverse)
442 //just to be save in case it is going to change
455 for (Int_t j = n+1; j < m; j++)
457 fTPCClusterMap.SetBitNumber(j,kFALSE);
461 // End Of Piotr's Cluster Map for HBT
464 fTPCsignal=t->GetPIDsignal();
467 case kTRDout: case kTRDin: case kTRDrefit:
468 index=fFriendTrack->GetTRDindices();
469 fTRDLabel = t->GetLabel();
470 fTRDncls=t->GetNumberOfClusters();
471 fTRDchi2=t->GetChi2();
472 for (Int_t i=0;i<fTRDncls;i++) index[i]=t->GetClusterIndex(i);
473 fTRDsignal=t->GetPIDsignal();
476 if (!fOp) fOp=new AliExternalTrackParam(*t);
478 fTRDncls0 = t->GetNumberOfClusters();
487 AliError("Wrong flag !");
494 //_______________________________________________________________________
495 void AliESDtrack::GetExternalParameters(Double_t &x, Double_t p[5]) const {
496 //---------------------------------------------------------------------
497 // This function returns external representation of the track parameters
498 //---------------------------------------------------------------------
500 for (Int_t i=0; i<5; i++) p[i]=GetParameter()[i];
503 //_______________________________________________________________________
504 void AliESDtrack::GetExternalCovariance(Double_t cov[15]) const {
505 //---------------------------------------------------------------------
506 // This function returns external representation of the cov. matrix
507 //---------------------------------------------------------------------
508 for (Int_t i=0; i<15; i++) cov[i]=AliExternalTrackParam::GetCovariance()[i];
511 //_______________________________________________________________________
512 Bool_t AliESDtrack::GetConstrainedExternalParameters
513 (Double_t &alpha, Double_t &x, Double_t p[5]) const {
514 //---------------------------------------------------------------------
515 // This function returns the constrained external track parameters
516 //---------------------------------------------------------------------
517 if (!fCp) return kFALSE;
518 alpha=fCp->GetAlpha();
520 for (Int_t i=0; i<5; i++) p[i]=fCp->GetParameter()[i];
524 //_______________________________________________________________________
526 AliESDtrack::GetConstrainedExternalCovariance(Double_t c[15]) const {
527 //---------------------------------------------------------------------
528 // This function returns the constrained external cov. matrix
529 //---------------------------------------------------------------------
530 if (!fCp) return kFALSE;
531 for (Int_t i=0; i<15; i++) c[i]=fCp->GetCovariance()[i];
536 AliESDtrack::GetInnerExternalParameters
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 TPC
541 //---------------------------------------------------------------------
542 if (!fIp) return kFALSE;
543 alpha=fIp->GetAlpha();
545 for (Int_t i=0; i<5; i++) p[i]=fIp->GetParameter()[i];
550 AliESDtrack::GetInnerExternalCovariance(Double_t cov[15]) const {
551 //---------------------------------------------------------------------
552 // This function returns external representation of the cov. matrix
553 // at the inner layer of TPC
554 //---------------------------------------------------------------------
555 if (!fIp) return kFALSE;
556 for (Int_t i=0; i<15; i++) cov[i]=fIp->GetCovariance()[i];
561 AliESDtrack::GetOuterExternalParameters
562 (Double_t &alpha, Double_t &x, Double_t p[5]) const {
563 //---------------------------------------------------------------------
564 // This function returns external representation of the track parameters
565 // at the inner layer of TRD
566 //---------------------------------------------------------------------
567 if (!fOp) return kFALSE;
568 alpha=fOp->GetAlpha();
570 for (Int_t i=0; i<5; i++) p[i]=fOp->GetParameter()[i];
575 AliESDtrack::GetOuterExternalCovariance(Double_t cov[15]) const {
576 //---------------------------------------------------------------------
577 // This function returns external representation of the cov. matrix
578 // at the inner layer of TRD
579 //---------------------------------------------------------------------
580 if (!fOp) return kFALSE;
581 for (Int_t i=0; i<15; i++) cov[i]=fOp->GetCovariance()[i];
585 Int_t AliESDtrack::GetNcls(Int_t idet) const
587 // Get number of clusters by subdetector index
610 Int_t AliESDtrack::GetClusters(Int_t idet, Int_t *idx) const
612 // Get cluster index array by subdetector index
617 ncls = GetITSclusters(idx);
620 ncls = GetTPCclusters(idx);
623 ncls = GetTRDclusters(idx);
626 if (fTOFindex != 0) {
627 idx[0] = GetTOFcluster();
637 //_______________________________________________________________________
638 void AliESDtrack::GetIntegratedTimes(Double_t *times) const {
639 // Returns the array with integrated times for each particle hypothesis
640 for (Int_t i=0; i<AliPID::kSPECIES; i++) times[i]=fTrackTime[i];
643 //_______________________________________________________________________
644 void AliESDtrack::SetIntegratedTimes(const Double_t *times) {
645 // Sets the array with integrated times for each particle hypotesis
646 for (Int_t i=0; i<AliPID::kSPECIES; i++) fTrackTime[i]=times[i];
649 //_______________________________________________________________________
650 void AliESDtrack::SetITSpid(const Double_t *p) {
651 // Sets values for the probability of each particle type (in ITS)
652 SetPIDValues(fITSr,p,AliPID::kSPECIES);
653 SetStatus(AliESDtrack::kITSpid);
656 //_______________________________________________________________________
657 void AliESDtrack::GetITSpid(Double_t *p) const {
658 // Gets the probability of each particle type (in ITS)
659 for (Int_t i=0; i<AliPID::kSPECIES; i++) p[i]=fITSr[i];
662 //_______________________________________________________________________
663 Int_t AliESDtrack::GetITSclusters(Int_t *idx) const {
664 //---------------------------------------------------------------------
665 // This function returns indices of the assgined ITS clusters
666 //---------------------------------------------------------------------
668 Int_t *index=fFriendTrack->GetITSindices();
669 for (Int_t i=0; i<AliESDfriendTrack::kMaxITScluster; i++) idx[i]=index[i];
674 //_______________________________________________________________________
675 Int_t AliESDtrack::GetTPCclusters(Int_t *idx) const {
676 //---------------------------------------------------------------------
677 // This function returns indices of the assgined ITS clusters
678 //---------------------------------------------------------------------
680 Int_t *index=fFriendTrack->GetTPCindices();
681 for (Int_t i=0; i<AliESDfriendTrack::kMaxTPCcluster; i++) idx[i]=index[i];
686 Float_t AliESDtrack::GetTPCdensity(Int_t row0, Int_t row1) const{
688 // GetDensity of the clusters on given region between row0 and row1
689 // Dead zone effect takin into acoount
694 Int_t *index=fFriendTrack->GetTPCindices();
695 for (Int_t i=row0;i<=row1;i++){
696 Int_t idx = index[i];
697 if (idx!=-1) good++; // track outside of dead zone
701 if (good>(row1-row0)*0.5) density = Float_t(found)/Float_t(good);
705 //_______________________________________________________________________
706 void AliESDtrack::SetTPCpid(const Double_t *p) {
707 // Sets values for the probability of each particle type (in TPC)
708 SetPIDValues(fTPCr,p,AliPID::kSPECIES);
709 SetStatus(AliESDtrack::kTPCpid);
712 //_______________________________________________________________________
713 void AliESDtrack::GetTPCpid(Double_t *p) const {
714 // Gets the probability of each particle type (in TPC)
715 for (Int_t i=0; i<AliPID::kSPECIES; i++) p[i]=fTPCr[i];
718 //_______________________________________________________________________
719 Int_t AliESDtrack::GetTRDclusters(Int_t *idx) const {
720 //---------------------------------------------------------------------
721 // This function returns indices of the assgined TRD clusters
722 //---------------------------------------------------------------------
724 Int_t *index=fFriendTrack->GetTRDindices();
725 for (Int_t i=0; i<AliESDfriendTrack::kMaxTRDcluster; i++) idx[i]=index[i];
730 //_______________________________________________________________________
731 void AliESDtrack::SetTRDpid(const Double_t *p) {
732 // Sets values for the probability of each particle type (in TRD)
733 SetPIDValues(fTRDr,p,AliPID::kSPECIES);
734 SetStatus(AliESDtrack::kTRDpid);
737 //_______________________________________________________________________
738 void AliESDtrack::GetTRDpid(Double_t *p) const {
739 // Gets the probability of each particle type (in TRD)
740 for (Int_t i=0; i<AliPID::kSPECIES; i++) p[i]=fTRDr[i];
743 //_______________________________________________________________________
744 void AliESDtrack::SetTRDpid(Int_t iSpecies, Float_t p)
746 // Sets the probability of particle type iSpecies to p (in TRD)
750 Float_t AliESDtrack::GetTRDpid(Int_t iSpecies) const
752 // Returns the probability of particle type iSpecies (in TRD)
753 return fTRDr[iSpecies];
756 //_______________________________________________________________________
757 void AliESDtrack::SetTOFpid(const Double_t *p) {
758 // Sets the probability of each particle type (in TOF)
759 SetPIDValues(fTOFr,p,AliPID::kSPECIES);
760 SetStatus(AliESDtrack::kTOFpid);
763 //_______________________________________________________________________
764 void AliESDtrack::SetTOFLabel(const Int_t *p) {
766 for (Int_t i=0; i<3; i++) fTOFLabel[i]=p[i];
769 //_______________________________________________________________________
770 void AliESDtrack::GetTOFpid(Double_t *p) const {
771 // Gets probabilities of each particle type (in TOF)
772 for (Int_t i=0; i<AliPID::kSPECIES; i++) p[i]=fTOFr[i];
775 //_______________________________________________________________________
776 void AliESDtrack::GetTOFLabel(Int_t *p) const {
778 for (Int_t i=0; i<3; i++) p[i]=fTOFLabel[i];
781 //_______________________________________________________________________
782 void AliESDtrack::GetTOFInfo(Float_t *info) const {
784 for (Int_t i=0; i<10; i++) info[i]=fTOFInfo[i];
787 //_______________________________________________________________________
788 void AliESDtrack::SetTOFInfo(Float_t*info) {
790 for (Int_t i=0; i<10; i++) fTOFInfo[i]=info[i];
795 //_______________________________________________________________________
796 void AliESDtrack::SetRICHpid(const Double_t *p) {
797 // Sets the probability of each particle type (in RICH)
798 SetPIDValues(fRICHr,p,AliPID::kSPECIES);
799 SetStatus(AliESDtrack::kRICHpid);
802 //_______________________________________________________________________
803 void AliESDtrack::GetRICHpid(Double_t *p) const {
804 // Gets probabilities of each particle type (in RICH)
805 for (Int_t i=0; i<AliPID::kSPECIES; i++) p[i]=fRICHr[i];
810 //_______________________________________________________________________
811 void AliESDtrack::SetESDpid(const Double_t *p) {
812 // Sets the probability of each particle type for the ESD track
813 SetPIDValues(fR,p,AliPID::kSPECIES);
814 SetStatus(AliESDtrack::kESDpid);
817 //_______________________________________________________________________
818 void AliESDtrack::GetESDpid(Double_t *p) const {
819 // Gets probability of each particle type for the ESD track
820 for (Int_t i=0; i<AliPID::kSPECIES; i++) p[i]=fR[i];
823 //_______________________________________________________________________
824 Bool_t AliESDtrack::RelateToVertex
825 (const AliESDVertex *vtx, Double_t b, Double_t maxd) {
827 // Try to relate this track to the vertex "vtx",
828 // if the (rough) transverse impact parameter is not bigger then "maxd".
829 // Magnetic field is "b" (kG).
831 // a) The track gets extapolated to the DCA to the vertex.
832 // b) The impact parameters and their covariance matrix are calculated.
833 // c) An attempt to constrain this track to the vertex is done.
835 // In the case of success, the returned value is kTRUE
836 // (otherwise, it's kFALSE)
838 Double_t alpha=GetAlpha();
839 Double_t sn=TMath::Sin(alpha), cs=TMath::Cos(alpha);
840 Double_t x=GetX(), y=GetParameter()[0], snp=GetParameter()[2];
841 Double_t xv= vtx->GetXv()*cs + vtx->GetYv()*sn;
842 Double_t yv=-vtx->GetXv()*sn + vtx->GetYv()*cs, zv=vtx->GetZv();
845 //Estimate the impact parameter neglecting the track curvature
846 Double_t d=TMath::Abs(x*snp - y*TMath::Sqrt(1.- snp*snp));
847 if (d > maxd) return kFALSE;
849 //Propagate to the DCA
850 Double_t crv=kB2C*b*GetParameter()[4];
851 if (TMath::Abs(b) < kAlmost0Field) crv=0.;
853 Double_t tgfv=-(crv*x - snp)/(crv*y + TMath::Sqrt(1.-snp*snp));
854 sn=tgfv/TMath::Sqrt(1.+ tgfv*tgfv);
855 if (TMath::Abs(tgfv)>0.) cs = sn/tgfv;
859 yv=-xv*sn + yv*cs; xv=x;
861 if (!Propagate(alpha+TMath::ASin(sn),xv,b)) return kFALSE;
863 fD = GetParameter()[0] - yv;
864 fZ = GetParameter()[1] - zv;
866 Double_t cov[6]; vtx->GetCovMatrix(cov);
867 fCdd = GetCovariance()[0] + cov[2]; // neglecting non-diagonals
868 fCdz = GetCovariance()[1]; // in the vertex's
869 fCzz = GetCovariance()[2] + cov[5]; // covariance matrix
872 Double_t p[2]={yv,zv}, c[3]={cov[2],0.,cov[5]};
873 Double_t chi2=GetPredictedChi2(p,c);
875 if (chi2>77.) return kFALSE;
877 AliExternalTrackParam tmp(*this);
878 if (!tmp.Update(p,c)) return kFALSE;
881 if (!fCp) fCp=new AliExternalTrackParam();
882 new (fCp) AliExternalTrackParam(tmp);
888 void AliESDtrack::SetTrackPointArray(AliTrackPointArray *points) {
890 //fFriendTrack->SetTrackPointArray(points);
892 const AliTrackPointArray *AliESDtrack::GetTrackPointArray() const {
894 //return fFriendTrack->GetTrackPointArray();
897 //_______________________________________________________________________
898 void AliESDtrack::Print(Option_t *) const {
899 // Prints info on the track
901 printf("ESD track info\n") ;
902 Double_t p[AliPID::kSPECIESN] ;
905 printf("From ITS: ") ;
907 for(index = 0 ; index < AliPID::kSPECIES; index++)
908 printf("%f, ", p[index]) ;
909 printf("\n signal = %f\n", GetITSsignal()) ;
912 printf("From TPC: ") ;
914 for(index = 0 ; index < AliPID::kSPECIES; index++)
915 printf("%f, ", p[index]) ;
916 printf("\n signal = %f\n", GetTPCsignal()) ;
919 printf("From TRD: ") ;
921 for(index = 0 ; index < AliPID::kSPECIES; index++)
922 printf("%f, ", p[index]) ;
923 printf("\n signal = %f\n", GetTRDsignal()) ;
926 printf("From TOF: ") ;
928 for(index = 0 ; index < AliPID::kSPECIES; index++)
929 printf("%f, ", p[index]) ;
930 printf("\n signal = %f\n", GetTOFsignal()) ;
932 if( IsOn(kRICHpid) ){
933 printf("From RICH: ") ;
935 for(index = 0 ; index < AliPID::kSPECIES; index++)
936 printf("%f, ", p[index]) ;
937 printf("\n signal = %f\n", GetRICHsignal()) ;