//-----------------------------------------------------------------
// Implementation of the ESD track class
+// ESD = Event Summary Data
// This is the class to deal with during the phisical analysis of data
-//
-// Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
+// Origin: Iouri Belikov, CERN
+// e-mail: Jouri.Belikov@cern.ch
//-----------------------------------------------------------------
#include "TMath.h"
//_______________________________________________________________________
AliESDtrack::AliESDtrack() :
-fFlags(0),
+fFlags(0),
+fLabel(0),
+fTrackLength(0),
+fStopVertex(0),
+fRalpha(0),
+fRx(0),
+fITSchi2(0),
fITSncls(0),
-fTPCncls(0)
+fITSsignal(0),
+fVertexX(0),
+fVertexY(0),
+fVertexZ(0),
+fVertexPx(0),
+fVertexPy(0),
+fVertexPz(0),
+fVertex(kFALSE),
+fTPCchi2(0),
+fTPCncls(0),
+fTPCsignal(0),
+fTRDchi2(0),
+fTRDncls(0),
+fTRDsignal(0),
+fTOFchi2(0),
+fTOFindex(0),
+fTOFsignal(-1)
{
//
// The default ESD constructor
//
- for (Int_t i=0; i<kSPECIES; i++) fR[i]=0.;
+ for (Int_t i=0; i<kSPECIES; i++) {
+ fTrackTime[i]=0;
+ fR[i]=0;
+ fITSr[i]=0;
+ fTPCr[i]=0;
+ fTRDr[i]=0;
+ fTOFr[i]=0;
+ }
+ Int_t i;
+ for (i=0; i<5; i++) fRp[i]=0.;
+ for (i=0; i<15; i++) fRc[i]=0.;
+ for (i=0; i<6; i++) fITSindex[i]=0;
+ for (i=0; i<180; i++) fTPCindex[i]=0;
}
//_______________________________________________________________________
Float_t AliESDtrack::GetMass() const {
+ // Returns the mass of the most probable particle type
Float_t max=0.;
Int_t k=-1;
for (Int_t i=0; i<kSPECIES; i++) {
}
//_______________________________________________________________________
-Bool_t AliESDtrack::UpdateTrackParams(const AliKalmanTrack *t, ULong_t flags) {
+Bool_t AliESDtrack::UpdateTrackParams(AliKalmanTrack *t, ULong_t flags) {
//
// This function updates track's running parameters
//
switch (flags) {
- case kITSin: case kITSout: case kITSrefit:
+
+ case kITSin:
+ case kITSout:
+ case kITSrefit:
fITSncls=t->GetNumberOfClusters();
fITSchi2=t->GetChi2();
for (Int_t i=0;i<fITSncls;i++) fITSindex[i]=t->GetClusterIndex(i);
fITSsignal=t->GetPIDsignal();
break;
+
case kTPCin: case kTPCout: case kTPCrefit:
fTPCncls=t->GetNumberOfClusters();
fTPCchi2=t->GetChi2();
case kTRDin: case kTRDout: case kTRDrefit:
fTRDncls=t->GetNumberOfClusters();
fTRDchi2=t->GetChi2();
+ for (Int_t i=0;i<fTRDncls;i++) fTRDindex[i]=t->GetClusterIndex(i);
fTRDsignal=t->GetPIDsignal();
break;
default:
fRalpha=t->GetAlpha();
t->GetExternalParameters(fRx,fRp);
t->GetExternalCovariance(fRc);
+
+ if (flags == kITSin)
+ {
+ AliKalmanTrack *itstrack = t;
+ if (itstrack)
+ {
+ itstrack->PropagateTo(3.,0.0028,65.19);
+ itstrack->PropagateToVertex();
+
+ Double_t ralpha=t->GetAlpha();
+ Double_t rx; // X-coordinate of the track reference plane
+ Double_t rp[5]; // external track parameters
+ t->GetExternalParameters(rx,rp);
+
+ Double_t phi=TMath::ASin(rp[2]) + ralpha;
+ Double_t pt=1./TMath::Abs(rp[4]);
+ Double_t r=TMath::Sqrt(rx*rx + rp[0]*rp[0]);
+
+ fVertexX=r*TMath::Cos(phi);
+ fVertexY=r*TMath::Sin(phi);
+ fVertexZ=rp[1];
+
+ fVertexPx = pt*TMath::Cos(phi);
+ fVertexPy = pt*TMath::Sin(phi);
+ fVertexPz = pt*rp[3];
+ fVertex = kTRUE;
+ }
+ }
+
return kTRUE;
}
//---------------------------------------------------------------------
// This function returns the global track position
//---------------------------------------------------------------------
- Double_t phi=TMath::ASin(fRp[2]) + fRalpha;
+ Double_t phi=TMath::ATan2(fRp[0],fRx) + fRalpha;
Double_t r=TMath::Sqrt(fRx*fRx + fRp[0]*fRp[0]);
xyz[0]=r*TMath::Cos(phi); xyz[1]=r*TMath::Sin(phi); xyz[2]=fRp[1];
}
//_______________________________________________________________________
void AliESDtrack::GetIntegratedTimes(Double_t *times) const {
+ // Returns the array with integrated times for each particle hypothesis
for (Int_t i=0; i<kSPECIES; i++) times[i]=fTrackTime[i];
}
//_______________________________________________________________________
void AliESDtrack::SetIntegratedTimes(const Double_t *times) {
+ // Sets the array with integrated times for each particle hypotesis
for (Int_t i=0; i<kSPECIES; i++) fTrackTime[i]=times[i];
}
//_______________________________________________________________________
-void AliESDtrack::SetITSpid(const Double_t *p) {
+void AliESDtrack::SetITSpid(const Double_t *p) {
+ // Sets values for the probability of each particle type (in ITS)
for (Int_t i=0; i<kSPECIES; i++) fITSr[i]=p[i];
SetStatus(AliESDtrack::kITSpid);
}
//_______________________________________________________________________
void AliESDtrack::GetITSpid(Double_t *p) const {
+ // Gets the probability of each particle type (in ITS)
for (Int_t i=0; i<kSPECIES; i++) p[i]=fITSr[i];
}
}
//_______________________________________________________________________
-Int_t AliESDtrack::GetTPCclusters(UInt_t *idx) const {
+Int_t AliESDtrack::GetTPCclusters(Int_t *idx) const {
//---------------------------------------------------------------------
// This function returns indices of the assgined ITS clusters
//---------------------------------------------------------------------
- for (Int_t i=0; i<fTPCncls; i++) idx[i]=fTPCindex[i];
+ for (Int_t i=0; i<180; i++) idx[i]=fTPCindex[i]; // MI I prefer some constant
return fTPCncls;
}
//_______________________________________________________________________
void AliESDtrack::SetTPCpid(const Double_t *p) {
+ // Sets values for the probability of each particle type (in TPC)
for (Int_t i=0; i<kSPECIES; i++) fTPCr[i]=p[i];
SetStatus(AliESDtrack::kTPCpid);
}
//_______________________________________________________________________
void AliESDtrack::GetTPCpid(Double_t *p) const {
+ // Gets the probability of each particle type (in TPC)
for (Int_t i=0; i<kSPECIES; i++) p[i]=fTPCr[i];
}
+//_______________________________________________________________________
+Int_t AliESDtrack::GetTRDclusters(UInt_t *idx) const {
+ //---------------------------------------------------------------------
+ // This function returns indices of the assgined TRD clusters
+ //---------------------------------------------------------------------
+ for (Int_t i=0; i<90; i++) idx[i]=fTRDindex[i]; // MI I prefer some constant
+ return fTRDncls;
+}
+
//_______________________________________________________________________
void AliESDtrack::SetTRDpid(const Double_t *p) {
+ // Sets values for the probability of each particle type (in TRD)
for (Int_t i=0; i<kSPECIES; i++) fTRDr[i]=p[i];
SetStatus(AliESDtrack::kTRDpid);
}
//_______________________________________________________________________
void AliESDtrack::GetTRDpid(Double_t *p) const {
+ // Gets the probability of each particle type (in TRD)
for (Int_t i=0; i<kSPECIES; i++) p[i]=fTRDr[i];
}
//_______________________________________________________________________
void AliESDtrack::SetTRDpid(Int_t iSpecies, Float_t p)
{
+ // Sets the probability of particle type iSpecies to p (in TRD)
fTRDr[iSpecies] = p;
}
Float_t AliESDtrack::GetTRDpid(Int_t iSpecies) const
{
+ // Returns the probability of particle type iSpecies (in TRD)
return fTRDr[iSpecies];
}
//_______________________________________________________________________
void AliESDtrack::SetTOFpid(const Double_t *p) {
+ // Sets the probability of each particle type (in TOF)
for (Int_t i=0; i<kSPECIES; i++) fTOFr[i]=p[i];
SetStatus(AliESDtrack::kTOFpid);
}
//_______________________________________________________________________
void AliESDtrack::GetTOFpid(Double_t *p) const {
+ // Gets probabilities of each particle type (in TOF)
for (Int_t i=0; i<kSPECIES; i++) p[i]=fTOFr[i];
}
//_______________________________________________________________________
void AliESDtrack::SetESDpid(const Double_t *p) {
+ // Sets the probability of each particle type for the ESD track
for (Int_t i=0; i<kSPECIES; i++) fR[i]=p[i];
SetStatus(AliESDtrack::kESDpid);
}
//_______________________________________________________________________
void AliESDtrack::GetESDpid(Double_t *p) const {
+ // Gets probability of each particle type for the ESD track
for (Int_t i=0; i<kSPECIES; i++) p[i]=fR[i];
}
+void AliESDtrack::GetVertexXYZ(Double_t& x,Double_t& y, Double_t&z) const
+{
+//returns track position in DCA to vertex
+ x = fVertexX;
+ y = fVertexY;
+ z = fVertexZ;
+}
+void AliESDtrack::GetVertexPxPyPz(Double_t& px,Double_t& py, Double_t& pz) const
+{
+//returns track momentum in DCA to vertex
+ px = fVertexPx;
+ py = fVertexPy;
+ pz = fVertexPz;
+}