X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=STEER%2FAliESDtrack.cxx;h=9ed7979abe2d6508930d1d2aa03b2daf7895d695;hb=a114d234f48de4e75951d163d647b8d2e3b737f7;hp=b2eb9dbc68ddfb19c9552ced932f2589db985778;hpb=aad8d4351811da9476e0d6d477ab0a76baa9b255;p=u%2Fmrichter%2FAliRoot.git diff --git a/STEER/AliESDtrack.cxx b/STEER/AliESDtrack.cxx index b2eb9dbc68d..9ed7979abe2 100644 --- a/STEER/AliESDtrack.cxx +++ b/STEER/AliESDtrack.cxx @@ -18,20 +18,117 @@ // This is the class to deal with during the phisics analysis of data // Origin: Iouri Belikov, CERN // e-mail: Jouri.Belikov@cern.ch +// +// +// +// What do you need to know before starting analysis +// (by Marian Ivanov: marian.ivanov@cern.ch) +// +// +// AliESDtrack: +// 1. What is the AliESDtrack +// 2. What informations do we store +// 3. How to use the information for analysis +// +// +// 1.AliESDtrack is the container of the information about the track/particle +// reconstructed during Barrel Tracking. +// The track information is propagated from one tracking detector to +// other using the functionality of AliESDtrack - Current parameters. +// +// No global fit model is used. +// Barrel tracking use Kalman filtering technique, it gives optimal local +// track parameters at given point under certian assumptions. +// +// Kalman filter take into account additional effect which are +// difficult to handle using global fit. +// Effects: +// a.) Multiple scattering +// b.) Energy loss +// c.) Non homogenous magnetic field +// +// In general case, following barrel detectors are contributing to +// the Kalman track information: +// a. TPC +// b. ITS +// c. TRD +// +// In general 3 reconstruction itteration are performed: +// 1. Find tracks - sequence TPC->ITS +// 2. PropagateBack - sequence ITS->TPC->TRD -> Outer PID detectors +// 3. Refit invward - sequence TRD->TPC->ITS +// The current tracks are updated after each detector (see bellow). +// In specical cases a track sanpshots are stored. +// +// +// For some type of analysis (+visualization) track local parameters at +// different position are neccesary. A snapshots during the track +// propagation are created. +// (See AliExternalTrackParam class for desctiption of variables and +// functionality) +// Snapshots: +// a. Current parameters - class itself (AliExternalTrackParam) +// Contributors: general case TRD->TPC->ITS +// Preferable usage: Decission - primary or secondary track +// NOTICE - By default the track parameters are stored at the DCA point +// to the primary vertex. optimal for primary tracks, +// far from optimal for secondary tracks. +// b. Constrained parameters - Kalman information updated with +// the Primary vertex information +// Contributors: general case TRD->TPC->ITS +// Preferable usage: Use only for tracks selected as primary +// NOTICE - not real constrain - taken as additional measurement +// with corresponding error +// Function: +// const AliExternalTrackParam *GetConstrainedParam() const {return fCp;} +// c. Inner parameters - Track parameters at inner wall of the TPC +// Contributors: general case TRD->TPC +// function: +// const AliExternalTrackParam *GetInnerParam() const { return fIp;} +// +// d. TPCinnerparam - contributors - TPC only +// Contributors: TPC +// Preferable usage: Requested for HBT study +// (smaller correlations as using also ITS information) +// NOTICE - the track parameters are propagated to the DCA to +// to primary vertex +// Optimal for primary, far from optimal for secondary tracks +// Function: +// const AliExternalTrackParam *GetTPCInnerParam() const {return fTPCInner;} +// +// e. Outer parameters - +// Contributors- general case - ITS-> TPC -> TRD +// The last point - Outer parameters radius is determined +// e.a) Local inclination angle bigger than threshold - +// Low momenta tracks +// e.a) Catastrofic energy losss in material +// e.b) Not further improvement (no space points) +// Usage: +// a.) Tracking: Starting parameter for Refit inward +// b.) Visualization +// c.) QA +// NOTICE: Should be not used for the physic analysis +// Function: +// const AliExternalTrackParam *GetOuterParam() const { return fOp;} +// //----------------------------------------------------------------- #include #include +#include #include "AliESDVertex.h" #include "AliESDtrack.h" +#include "AliESDEvent.h" #include "AliKalmanTrack.h" +#include "AliVTrack.h" #include "AliLog.h" #include "AliTrackPointArray.h" +#include "TPolyMarker3D.h" ClassImp(AliESDtrack) -void SetPIDValues(Float_t * dest, const Double_t * src, Int_t n) { +void SetPIDValues(Double_t * dest, const Double_t * src, Int_t n) { // This function copies "n" PID weights from "scr" to "dest" // and normalizes their sum to 1 thus producing conditional probabilities. // The negative weights are set to 0. @@ -61,141 +158,174 @@ void SetPIDValues(Float_t * dest, const Double_t * src, Int_t n) { //_______________________________________________________________________ AliESDtrack::AliESDtrack() : AliExternalTrackParam(), + fCp(0), + fIp(0), + fTPCInner(0), + fOp(0), + fHMPIDp(0), + fFriendTrack(new AliESDfriendTrack()), + fTPCClusterMap(159),//number of padrows + fTPCSharedMap(159),//number of padrows fFlags(0), - fLabel(0), fID(0), + fLabel(0), + fITSLabel(0), + fTPCLabel(0), + fTRDLabel(0), + fTOFCalChannel(-1), + fTOFindex(-1), + fHMPIDqn(0), + fHMPIDcluIdx(-1), + fCaloIndex(kEMCALNoMatch), + fHMPIDtrkTheta(0), + fHMPIDtrkPhi(0), + fHMPIDsignal(0), fTrackLength(0), + fdTPC(0),fzTPC(0), + fCddTPC(0),fCdzTPC(0),fCzzTPC(0), + fCchi2TPC(0), fD(0),fZ(0), fCdd(0),fCdz(0),fCzz(0), - fStopVertex(0), - fCp(0), - fCchi2(1e10), - fIp(0), - fTPCInner(0), - fOp(0), + fCchi2(0), fITSchi2(0), - fITSncls(0), - fITSClusterMap(0), - fITSsignal(0), - fITSLabel(0), fTPCchi2(0), - fTPCncls(0), - fTPCnclsF(0), - fTPCClusterMap(159),//number of padrows - fTPCSharedMap(159),//number of padrows + fTPCchi2Iter1(0), + fTRDchi2(0), + fTOFchi2(0), + fHMPIDchi2(0), + fGlobalChi2(0), + fITSsignal(0), fTPCsignal(0), - fTPCsignalN(0), fTPCsignalS(0), - fTPCLabel(0), - fTRDchi2(0), - fTRDncls(0), - fTRDncls0(0), fTRDsignal(0), - fTRDLabel(0), fTRDQuality(0), fTRDBudget(0), - fTOFchi2(0), - fTOFindex(0), - fTOFCalChannel(-1), - fTOFsignal(-1), - fTOFsignalToT(0), - fTOFsignalRaw(0), - fTOFsignalDz(0), - fHMPIDchi2(1e10), - fHMPIDqn(-1), - fHMPIDcluIdx(-1), - fHMPIDsignal(-1), - fHMPIDtrkTheta(-1), - fHMPIDtrkPhi(-1), - fHMPIDtrkX(-1), - fHMPIDtrkY(-1), - fHMPIDmipX(-1), - fHMPIDmipY(-1), - fEMCALindex(kEMCALNoMatch), - fFriendTrack(new AliESDfriendTrack()) + fTOFsignal(99999), + fTOFsignalToT(99999), + fTOFsignalRaw(99999), + fTOFsignalDz(999), + fTOFsignalDx(999), + fTOFdeltaBC(999), + fTOFl0l1(999), + fCaloDx(0), + fCaloDz(0), + fHMPIDtrkX(0), + fHMPIDtrkY(0), + fHMPIDmipX(0), + fHMPIDmipY(0), + fTPCncls(0), + fTPCnclsF(0), + fTPCsignalN(0), + fTPCnclsIter1(0), + fTPCnclsFIter1(0), + fITSncls(0), + fITSClusterMap(0), + fTRDncls(0), + fTRDncls0(0), + fTRDntracklets(0), + fTRDnSlices(0), + fTRDslices(0x0), + fVertexID(-2),// -2 means an orphan track + fESDEvent(0) { // // The default ESD constructor // - Int_t i, j; + Int_t i; for (i=0; iInheritsFrom("AliExternalTrackParam")) { + AliError("This is not a copy constructor. Use AliESDtrack(const AliESDtrack &) !"); + AliWarning("Calling the default constructor..."); + AliESDtrack(); + return; + } + + // Reset all the arrays + Int_t i; + for (i=0; iGetID()); + + // Set ITS cluster map + fITSClusterMap=track->GetITSClusterMap(); + + fITSncls=0; + for(i=0; i<6; i++) { + if(HasPointOnITSLayer(i)) fITSncls++; + } + + // Set TPC ncls + fTPCncls=track->GetTPCNcls(); + + + // Set the combined PID + const Double_t *pid = track->PID(); + if(pid){ + for (i=0; iGetLabel()); + // Set the status + SetStatus(track->GetStatus()); +} + +//_______________________________________________________________________ +AliESDtrack::AliESDtrack(TParticle * part) : + AliExternalTrackParam(), + fCp(0), + fIp(0), + fTPCInner(0), + fOp(0), + fHMPIDp(0), + fFriendTrack(0), fTPCClusterMap(159),//number of padrows fTPCSharedMap(159),//number of padrows - fTPCsignal(0), - fTPCsignalN(0), - fTPCsignalS(0), + fFlags(0), + fID(0), + fLabel(0), + fITSLabel(0), fTPCLabel(0), + fTRDLabel(0), + fTOFCalChannel(-1), + fTOFindex(-1), + fHMPIDqn(0), + fHMPIDcluIdx(-1), + fCaloIndex(kEMCALNoMatch), + fHMPIDtrkTheta(0), + fHMPIDtrkPhi(0), + fHMPIDsignal(0), + fTrackLength(0), + fdTPC(0),fzTPC(0), + fCddTPC(0),fCdzTPC(0),fCzzTPC(0), + fCchi2TPC(0), + fD(0),fZ(0), + fCdd(0),fCdz(0),fCzz(0), + fCchi2(0), + fITSchi2(0), + fTPCchi2(0), + fTPCchi2Iter1(0), fTRDchi2(0), - fTRDncls(0), - fTRDncls0(0), + fTOFchi2(0), + fHMPIDchi2(0), + fGlobalChi2(0), + fITSsignal(0), + fTPCsignal(0), + fTPCsignalS(0), fTRDsignal(0), - fTRDLabel(0), fTRDQuality(0), fTRDBudget(0), - fTOFchi2(0), - fTOFindex(0), - fTOFCalChannel(-1), - fTOFsignal(-1), - fTOFsignalToT(0), - fTOFsignalRaw(0), - fTOFsignalDz(0), - fHMPIDchi2(1e10), - fHMPIDqn(-1), - fHMPIDcluIdx(-1), - fHMPIDsignal(-1), - fHMPIDtrkTheta(-1), - fHMPIDtrkPhi(-1), - fHMPIDtrkX(-1), - fHMPIDtrkY(-1), - fHMPIDmipX(-1), - fHMPIDmipY(-1), - fEMCALindex(kEMCALNoMatch), - fFriendTrack(0) + fTOFsignal(99999), + fTOFsignalToT(99999), + fTOFsignalRaw(99999), + fTOFsignalDz(999), + fTOFsignalDx(999), + fTOFdeltaBC(999), + fTOFl0l1(999), + fCaloDx(0), + fCaloDz(0), + fHMPIDtrkX(0), + fHMPIDtrkY(0), + fHMPIDmipX(0), + fHMPIDmipY(0), + fTPCncls(0), + fTPCnclsF(0), + fTPCsignalN(0), + fTPCnclsIter1(0), + fTPCnclsFIter1(0), + fITSncls(0), + fITSClusterMap(0), + fTRDncls(0), + fTRDncls0(0), + fTRDntracklets(0), + fTRDnSlices(0), + fTRDslices(0x0), + fVertexID(-2), // -2 means an orphan track + fESDEvent(0) { // // ESD track from TParticle // // Reset all the arrays - Int_t i, j; + Int_t i; for (i=0; iGetUniqueID()); -} +} + +//_______________________________________________________________________ +AliESDtrack::~AliESDtrack(){ + // + // This is destructor according Coding Conventrions + // + //printf("Delete track\n"); + delete fIp; + delete fTPCInner; + delete fOp; + delete fHMPIDp; + delete fCp; + delete fFriendTrack; + if(fTRDnSlices) + delete[] fTRDslices; +} + +AliESDtrack &AliESDtrack::operator=(const AliESDtrack &source){ + + + if(&source == this) return *this; + AliExternalTrackParam::operator=(source); + + + if(source.fCp){ + // we have the trackparam: assign or copy construct + if(fCp)*fCp = *source.fCp; + else fCp = new AliExternalTrackParam(*source.fCp); + } + else{ + // no track param delete the old one + if(fCp)delete fCp; + fCp = 0; + } + + if(source.fIp){ + // we have the trackparam: assign or copy construct + if(fIp)*fIp = *source.fIp; + else fIp = new AliExternalTrackParam(*source.fIp); + } + else{ + // no track param delete the old one + if(fIp)delete fIp; + fIp = 0; + } + + + if(source.fTPCInner){ + // we have the trackparam: assign or copy construct + if(fTPCInner) *fTPCInner = *source.fTPCInner; + else fTPCInner = new AliExternalTrackParam(*source.fTPCInner); + } + else{ + // no track param delete the old one + if(fTPCInner)delete fTPCInner; + fTPCInner = 0; + } + + + if(source.fOp){ + // we have the trackparam: assign or copy construct + if(fOp) *fOp = *source.fOp; + else fOp = new AliExternalTrackParam(*source.fOp); + } + else{ + // no track param delete the old one + if(fOp)delete fOp; + fOp = 0; + } + + + if(source.fHMPIDp){ + // we have the trackparam: assign or copy construct + if(fHMPIDp) *fHMPIDp = *source.fHMPIDp; + else fHMPIDp = new AliExternalTrackParam(*source.fHMPIDp); + } + else{ + // no track param delete the old one + if(fHMPIDp)delete fHMPIDp; + fHMPIDp = 0; + } + + + // copy also the friend track + // use copy constructor + if(source.fFriendTrack){ + // we have the trackparam: assign or copy construct + delete fFriendTrack; fFriendTrack=new AliESDfriendTrack(*source.fFriendTrack); + } + else{ + // no track param delete the old one + delete fFriendTrack; fFriendTrack= 0; + } + + fTPCClusterMap = source.fTPCClusterMap; + fTPCSharedMap = source.fTPCSharedMap; + // the simple stuff + fFlags = source.fFlags; + fID = source.fID; + fLabel = source.fLabel; + fITSLabel = source.fITSLabel; + for(int i = 0; i< 12;++i){ + fITSModule[i] = source.fITSModule[i]; + } + fTPCLabel = source.fTPCLabel; + fTRDLabel = source.fTRDLabel; + for(int i = 0; i< 3;++i){ + fTOFLabel[i] = source.fTOFLabel[i]; + } + fTOFCalChannel = source.fTOFCalChannel; + fTOFindex = source.fTOFindex; + fHMPIDqn = source.fHMPIDqn; + fHMPIDcluIdx = source.fHMPIDcluIdx; + fCaloIndex = source.fCaloIndex; + + for(int i = 0; i< 3;++i){ + fKinkIndexes[i] = source.fKinkIndexes[i]; + fV0Indexes[i] = source.fV0Indexes[i]; + } + + for(int i = 0; i< AliPID::kSPECIES;++i){ + fR[i] = source.fR[i]; + fITSr[i] = source.fITSr[i]; + fTPCr[i] = source.fTPCr[i]; + fTRDr[i] = source.fTRDr[i]; + fTOFr[i] = source.fTOFr[i]; + fHMPIDr[i] = source.fHMPIDr[i]; + fTrackTime[i] = source.fTrackTime[i]; + } + + fHMPIDtrkTheta = source.fHMPIDtrkTheta; + fHMPIDtrkPhi = source.fHMPIDtrkPhi; + fHMPIDsignal = source.fHMPIDsignal; + + + fTrackLength = source. fTrackLength; + fdTPC = source.fdTPC; + fzTPC = source.fzTPC; + fCddTPC = source.fCddTPC; + fCdzTPC = source.fCdzTPC; + fCzzTPC = source.fCzzTPC; + fCchi2TPC = source.fCchi2TPC; + + fD = source.fD; + fZ = source.fZ; + fCdd = source.fCdd; + fCdz = source.fCdz; + fCzz = source.fCzz; + fCchi2 = source.fCchi2; + + fITSchi2 = source.fITSchi2; + fTPCchi2 = source.fTPCchi2; + fTPCchi2Iter1 = source.fTPCchi2Iter1; + fTRDchi2 = source.fTRDchi2; + fTOFchi2 = source.fTOFchi2; + fHMPIDchi2 = source.fHMPIDchi2; + + fGlobalChi2 = source.fGlobalChi2; + + fITSsignal = source.fITSsignal; + for (Int_t i=0;i<4;i++) {fITSdEdxSamples[i]=source.fITSdEdxSamples[i];} + fTPCsignal = source.fTPCsignal; + fTPCsignalS = source.fTPCsignalS; + for(int i = 0; i< 4;++i){ + fTPCPoints[i] = source.fTPCPoints[i]; + } + fTRDsignal = source.fTRDsignal; + + for(int i = 0;i < kTRDnPlanes;++i){ + fTRDTimBin[i] = source.fTRDTimBin[i]; + } + + if(fTRDnSlices) + delete[] fTRDslices; + fTRDslices=0; + fTRDnSlices=source.fTRDnSlices; + if (fTRDnSlices) { + fTRDslices=new Double32_t[fTRDnSlices]; + for(int j = 0;j < fTRDnSlices;++j) fTRDslices[j] = source.fTRDslices[j]; + } + + fTRDQuality = source.fTRDQuality; + fTRDBudget = source.fTRDBudget; + fTOFsignal = source.fTOFsignal; + fTOFsignalToT = source.fTOFsignalToT; + fTOFsignalRaw = source.fTOFsignalRaw; + fTOFsignalDz = source.fTOFsignalDz; + fTOFsignalDx = source.fTOFsignalDx; + fTOFdeltaBC = source.fTOFdeltaBC; + fTOFl0l1 = source.fTOFl0l1; + + for(int i = 0;i<10;++i){ + fTOFInfo[i] = source.fTOFInfo[i]; + } + + fHMPIDtrkX = source.fHMPIDtrkX; + fHMPIDtrkY = source.fHMPIDtrkY; + fHMPIDmipX = source.fHMPIDmipX; + fHMPIDmipY = source.fHMPIDmipY; + + fTPCncls = source.fTPCncls; + fTPCnclsF = source.fTPCnclsF; + fTPCsignalN = source.fTPCsignalN; + fTPCnclsIter1 = source.fTPCnclsIter1; + fTPCnclsFIter1 = source.fTPCnclsFIter1; + + fITSncls = source.fITSncls; + fITSClusterMap = source.fITSClusterMap; + fTRDncls = source.fTRDncls; + fTRDncls0 = source.fTRDncls0; + fTRDntracklets = source.fTRDntracklets; + fVertexID = source.fVertexID; + return *this; +} + + + +void AliESDtrack::Copy(TObject &obj) const { + + // this overwrites the virtual TOBject::Copy() + // to allow run time copying without casting + // in AliESDEvent + + if(this==&obj)return; + AliESDtrack *robj = dynamic_cast(&obj); + if(!robj)return; // not an AliESDtrack + *robj = *this; -//_______________________________________________________________________ -AliESDtrack::~AliESDtrack(){ - // - // This is destructor according Coding Conventrions - // - //printf("Delete track\n"); - delete fIp; - delete fTPCInner; - delete fOp; - delete fCp; - delete fFriendTrack; } + + void AliESDtrack::AddCalibObject(TObject * object){ // // add calib object to the list @@ -433,43 +937,126 @@ TObject * AliESDtrack::GetCalibObject(Int_t index){ } +Bool_t AliESDtrack::FillTPCOnlyTrack(AliESDtrack &track){ + + // Fills the information of the TPC-only first reconstruction pass + // into the passed ESDtrack object. For consistency fTPCInner is also filled + // again + + + + // For data produced before r26675 + // RelateToVertexTPC was not properly called during reco + // so you'll have to call it again, before FillTPCOnlyTrack + // Float_t p[2],cov[3]; + // track->GetImpactParametersTPC(p,cov); + // if(p[0]==0&&p[1]==0) // <- Default values + // track->RelateToVertexTPC(esd->GetPrimaryVertexTPC(),esd->GetMagneticField(),kVeryBig); + + + if(!fTPCInner)return kFALSE; + + // fill the TPC track params to the global track parameters + track.Set(fTPCInner->GetX(),fTPCInner->GetAlpha(),fTPCInner->GetParameter(),fTPCInner->GetCovariance()); + track.fD = fdTPC; + track.fZ = fzTPC; + track.fCdd = fCddTPC; + track.fCdz = fCdzTPC; + track.fCzz = fCzzTPC; + + // copy the TPCinner parameters + if(track.fTPCInner) *track.fTPCInner = *fTPCInner; + else track.fTPCInner = new AliExternalTrackParam(*fTPCInner); + track.fdTPC = fdTPC; + track.fzTPC = fzTPC; + track.fCddTPC = fCddTPC; + track.fCdzTPC = fCdzTPC; + track.fCzzTPC = fCzzTPC; + track.fCchi2TPC = fCchi2TPC; + + + // copy all other TPC specific parameters + + // replace label by TPC label + track.fLabel = fTPCLabel; + track.fTPCLabel = fTPCLabel; + + track.fTPCchi2 = fTPCchi2; + track.fTPCchi2Iter1 = fTPCchi2Iter1; + track.fTPCsignal = fTPCsignal; + track.fTPCsignalS = fTPCsignalS; + for(int i = 0;i<4;++i)track.fTPCPoints[i] = fTPCPoints[i]; + + track.fTPCncls = fTPCncls; + track.fTPCnclsF = fTPCnclsF; + track.fTPCsignalN = fTPCsignalN; + track.fTPCnclsIter1 = fTPCnclsIter1; + track.fTPCnclsFIter1 = fTPCnclsFIter1; + + // PID + for(int i=0;imax) {k=i; max=fR[i];} } if (k==0) { // dE/dx "crossing points" in the TPC @@ -549,6 +1154,16 @@ Double_t AliESDtrack::GetMass() const { return AliPID::ParticleMass(AliPID::kPion); } +//______________________________________________________________________________ +Double_t AliESDtrack::M() const +{ + // Returns the assumed mass + // (the pion mass, if the particle can't be identified properly). + + AliWarning("This is the ESD mass. Use it with care !"); + return GetMass(); +} + //______________________________________________________________________________ Double_t AliESDtrack::E() const { @@ -568,7 +1183,7 @@ Double_t AliESDtrack::Y() const Double_t e = E(); Double_t pz = Pz(); - if (e!=pz) { // energy was not equal to pz + if (e != TMath::Abs(pz)) { // energy was not equal to pz return 0.5*TMath::Log((e+pz)/(e-pz)); } else { // energy was equal to pz return -999.; @@ -580,7 +1195,6 @@ Bool_t AliESDtrack::UpdateTrackParams(const AliKalmanTrack *t, ULong_t flags){ // // This function updates track's running parameters // - Int_t *index=0; Bool_t rc=kTRUE; SetStatus(flags); @@ -593,32 +1207,55 @@ Bool_t AliESDtrack::UpdateTrackParams(const AliKalmanTrack *t, ULong_t flags){ } Set(t->GetX(),t->GetAlpha(),t->GetParameter(),t->GetCovariance()); + if (flags==kITSout) fFriendTrack->SetITSOut(*t); + if (flags==kTPCout) fFriendTrack->SetTPCOut(*t); + if (flags==kTRDrefit) fFriendTrack->SetTRDIn(*t); switch (flags) { case kITSin: case kITSout: case kITSrefit: + { + fITSClusterMap=0; fITSncls=t->GetNumberOfClusters(); - index=fFriendTrack->GetITSindices(); + Int_t* indexITS = new Int_t[AliESDfriendTrack::kMaxITScluster]; for (Int_t i=0;iGetClusterIndex(i); + indexITS[i]=t->GetClusterIndex(i); + if (i> 28; + Int_t l=(indexITS[i] & 0xf0000000) >> 28; SETBIT(fITSClusterMap,l); } } + fFriendTrack->SetITSIndices(indexITS,AliESDfriendTrack::kMaxITScluster); + delete [] indexITS; + fITSchi2=t->GetChi2(); fITSsignal=t->GetPIDsignal(); fITSLabel = t->GetLabel(); + // keep in fOp the parameters outside ITS for ITS stand-alone tracks + if (flags==kITSout) { + if (!fOp) fOp=new AliExternalTrackParam(*t); + else + fOp->Set(t->GetX(),t->GetAlpha(),t->GetParameter(),t->GetCovariance()); + } + } break; case kTPCin: case kTPCrefit: + { fTPCLabel = t->GetLabel(); - if (flags==kTPCin) fTPCInner=new AliExternalTrackParam(*t); + if (flags==kTPCin) { + fTPCInner=new AliExternalTrackParam(*t); + fTPCnclsIter1=t->GetNumberOfClusters(); + fTPCchi2Iter1=t->GetChi2(); + } if (!fIp) fIp=new AliExternalTrackParam(*t); else fIp->Set(t->GetX(),t->GetAlpha(),t->GetParameter(),t->GetCovariance()); + } case kTPCout: - index=fFriendTrack->GetTPCindices(); + { + Int_t* indexTPC = new Int_t[AliESDfriendTrack::kMaxTPCcluster]; if (flags & kTPCout){ if (!fOp) fOp=new AliExternalTrackParam(*t); else @@ -633,8 +1270,8 @@ Bool_t AliESDtrack::UpdateTrackParams(const AliKalmanTrack *t, ULong_t flags){ // for (Int_t i=0;iGetClusterIndex(i); - Int_t idx = index[i]; + indexTPC[i]=t->GetClusterIndex(i); + Int_t idx = indexTPC[i]; if (idx<0) continue; @@ -677,17 +1314,30 @@ Bool_t AliESDtrack::UpdateTrackParams(const AliKalmanTrack *t, ULong_t flags){ } // End Of Piotr's Cluster Map for HBT } + fFriendTrack->SetTPCIndices(indexTPC,AliESDfriendTrack::kMaxTPCcluster); + delete [] indexTPC; + } fTPCsignal=t->GetPIDsignal(); + } break; - case kTRDout: case kTRDin: case kTRDrefit: - index=fFriendTrack->GetTRDindices(); + case kTRDin: case kTRDrefit: + break; + case kTRDout: + { fTRDLabel = t->GetLabel(); - fTRDncls=t->GetNumberOfClusters(); - fTRDchi2=t->GetChi2(); - for (Int_t i=0;iGetClusterIndex(i); + fTRDchi2 = t->GetChi2(); + fTRDncls = t->GetNumberOfClusters(); + Int_t* indexTRD = new Int_t[AliESDfriendTrack::kMaxTRDcluster]; + for (Int_t i=0;iGetTrackletIndex(i); + fFriendTrack->SetTRDIndices(indexTRD,AliESDfriendTrack::kMaxTRDcluster); + delete [] indexTRD; + + fTRDsignal=t->GetPIDsignal(); + } break; case kTRDbackup: if (!fOp) fOp=new AliExternalTrackParam(*t); @@ -701,6 +1351,11 @@ Bool_t AliESDtrack::UpdateTrackParams(const AliKalmanTrack *t, ULong_t flags){ break; case kTRDStop: break; + case kHMPIDout: + if (!fHMPIDp) fHMPIDp=new AliExternalTrackParam(*t); + else + fHMPIDp->Set(t->GetX(),t->GetAlpha(),t->GetParameter(),t->GetCovariance()); + break; default: AliError("Wrong flag !"); return kFALSE; @@ -775,6 +1430,26 @@ AliESDtrack::GetInnerExternalCovariance(Double_t cov[15]) const { return kTRUE; } +void +AliESDtrack::SetOuterParam(const AliExternalTrackParam *p, ULong_t flags) { + // + // This is a direct setter for the outer track parameters + // + SetStatus(flags); + if (fOp) delete fOp; + fOp=new AliExternalTrackParam(*p); +} + +void +AliESDtrack::SetOuterHmpParam(const AliExternalTrackParam *p, ULong_t flags) { + // + // This is a direct setter for the outer track parameters + // + SetStatus(flags); + if (fHMPIDp) delete fHMPIDp; + fHMPIDp=new AliExternalTrackParam(*p); +} + Bool_t AliESDtrack::GetOuterExternalParameters (Double_t &alpha, Double_t &x, Double_t p[5]) const { @@ -789,6 +1464,20 @@ AliESDtrack::GetOuterExternalParameters return kTRUE; } +Bool_t +AliESDtrack::GetOuterHmpExternalParameters + (Double_t &alpha, Double_t &x, Double_t p[5]) const { + //--------------------------------------------------------------------- + // This function returns external representation of the track parameters + // at the inner layer of TRD + //--------------------------------------------------------------------- + if (!fHMPIDp) return kFALSE; + alpha=fHMPIDp->GetAlpha(); + x=fHMPIDp->GetX(); + for (Int_t i=0; i<5; i++) p[i]=fHMPIDp->GetParameter()[i]; + return kTRUE; +} + Bool_t AliESDtrack::GetOuterExternalCovariance(Double_t cov[15]) const { //--------------------------------------------------------------------- @@ -800,6 +1489,17 @@ AliESDtrack::GetOuterExternalCovariance(Double_t cov[15]) const { return kTRUE; } +Bool_t +AliESDtrack::GetOuterHmpExternalCovariance(Double_t cov[15]) const { + //--------------------------------------------------------------------- + // This function returns external representation of the cov. matrix + // at the inner layer of TRD + //--------------------------------------------------------------------- + if (!fHMPIDp) return kFALSE; + for (Int_t i=0; i<15; i++) cov[i]=fHMPIDp->GetCovariance()[i]; + return kTRUE; +} + Int_t AliESDtrack::GetNcls(Int_t idet) const { // Get number of clusters by subdetector index @@ -816,9 +1516,18 @@ Int_t AliESDtrack::GetNcls(Int_t idet) const ncls = fTRDncls; break; case 3: - if (fTOFindex != 0) + if (fTOFindex != -1) ncls = 1; break; + case 4: //PHOS + break; + case 5: //HMPID + if ((fHMPIDcluIdx >= 0) && (fHMPIDcluIdx < 7000000)) { + if ((fHMPIDcluIdx%1000000 != 9999) && (fHMPIDcluIdx%1000000 != 99999)) { + ncls = 1; + } + } + break; default: break; } @@ -841,11 +1550,23 @@ Int_t AliESDtrack::GetClusters(Int_t idet, Int_t *idx) const ncls = GetTRDclusters(idx); break; case 3: - if (fTOFindex != 0) { - idx[0] = GetTOFcluster(); + if (fTOFindex != -1) { + idx[0] = fTOFindex; ncls = 1; } break; + case 4: //PHOS + break; + case 5: + if ((fHMPIDcluIdx >= 0) && (fHMPIDcluIdx < 7000000)) { + if ((fHMPIDcluIdx%1000000 != 9999) && (fHMPIDcluIdx%1000000 != 99999)) { + idx[0] = GetHMPIDcluIdx(); + ncls = 1; + } + } + break; + case 6: //EMCAL + break; default: break; } @@ -878,30 +1599,101 @@ void AliESDtrack::GetITSpid(Double_t *p) const { } //_______________________________________________________________________ -Int_t AliESDtrack::GetITSclusters(Int_t *idx) const { +Char_t AliESDtrack::GetITSclusters(Int_t *idx) const { //--------------------------------------------------------------------- // This function returns indices of the assgined ITS clusters //--------------------------------------------------------------------- - if (idx!=0) { - Int_t *index=fFriendTrack->GetITSindices(); - for (Int_t i=0; iGetITSindices(); + for (Int_t i=0; i=fITSncls) && (i<6) ) idx[i]=-1; + else { + if (index) { + idx[i]=index[i]; + } + else idx[i]= -2; + } + } } return fITSncls; } //_______________________________________________________________________ -Int_t AliESDtrack::GetTPCclusters(Int_t *idx) const { +Bool_t AliESDtrack::GetITSModuleIndexInfo(Int_t ilayer,Int_t &idet,Int_t &status, + Float_t &xloc,Float_t &zloc) const { + //---------------------------------------------------------------------- + // This function encodes in the module number also the status of cluster association + // "status" can have the following values: + // 1 "found" (cluster is associated), + // 2 "dead" (module is dead from OCDB), + // 3 "skipped" (module or layer forced to be skipped), + // 4 "outinz" (track out of z acceptance), + // 5 "nocls" (no clusters in the road), + // 6 "norefit" (cluster rejected during refit), + // 7 "deadzspd" (holes in z in SPD) + // Also given are the coordinates of the crossing point of track and module + // (in the local module ref. system) + // WARNING: THIS METHOD HAS TO BE SYNCHRONIZED WITH AliITStrackV2::GetModuleIndexInfo()! + //---------------------------------------------------------------------- + + if(fITSModule[ilayer]==-1) { + idet = -1; + status=0; + xloc=-99.; zloc=-99.; + return kFALSE; + } + + Int_t module = fITSModule[ilayer]; + + idet = Int_t(module/1000000); + + module -= idet*1000000; + + status = Int_t(module/100000); + + module -= status*100000; + + Int_t signs = Int_t(module/10000); + + module-=signs*10000; + + Int_t xInt = Int_t(module/100); + module -= xInt*100; + + Int_t zInt = module; + + if(signs==1) { xInt*=1; zInt*=1; } + if(signs==2) { xInt*=1; zInt*=-1; } + if(signs==3) { xInt*=-1; zInt*=1; } + if(signs==4) { xInt*=-1; zInt*=-1; } + + xloc = 0.1*(Float_t)xInt; + zloc = 0.1*(Float_t)zInt; + + if(status==4) idet = -1; + + return kTRUE; +} + +//_______________________________________________________________________ +UShort_t AliESDtrack::GetTPCclusters(Int_t *idx) const { //--------------------------------------------------------------------- // This function returns indices of the assgined ITS clusters //--------------------------------------------------------------------- - if (idx!=0) { + if (idx) { Int_t *index=fFriendTrack->GetTPCindices(); - for (Int_t i=0; iGetTRDindices(); - for (Int_t i=0; iGetTRDindices(); + + if (index) { + for (Int_t i=0; i= AliESDtrack::kTRDnPlanes +// 2. The idx array store not only the index but also the layer of the tracklet. +// Therefore tracks with TRD gaps contain default values for indices [-1] + + if (!idx) return GetTRDntracklets(); + Int_t *index=fFriendTrack->GetTRDindices(); + Int_t n = 0; + for (Int_t i=0; i=0) n++; + idx[i]=index[i]; + } + else idx[i] = -2; + } + return n; +} + //_______________________________________________________________________ void AliESDtrack::SetTRDpid(const Double_t *p) { // Sets values for the probability of each particle type (in TRD) @@ -965,12 +1788,124 @@ void AliESDtrack::SetTRDpid(Int_t iSpecies, Float_t p) fTRDr[iSpecies] = p; } -Float_t AliESDtrack::GetTRDpid(Int_t iSpecies) const +Double_t AliESDtrack::GetTRDpid(Int_t iSpecies) const { // Returns the probability of particle type iSpecies (in TRD) return fTRDr[iSpecies]; } +//____________________________________________________ +Int_t AliESDtrack::GetNumberOfTRDslices() const +{ + // built in backward compatibility + Int_t idx = fTRDnSlices - (kTRDnPlanes<<1); + return idx<18 ? fTRDnSlices/kTRDnPlanes : idx/kTRDnPlanes; +} + +//____________________________________________________ +Double_t AliESDtrack::GetTRDmomentum(Int_t plane, Double_t *sp) const +{ +//Returns momentum estimation and optional its error (sp) +// in TRD layer "plane". + + if (!fTRDnSlices) { + AliDebug(2, "No TRD info allocated for this track."); + return -1.; + } + if ((plane<0) || (plane>=kTRDnPlanes)) { + AliWarning(Form("Request for TRD plane[%d] outside range.", plane)); + return -1.; + } + + Int_t idx = fTRDnSlices-(kTRDnPlanes<<1)+plane; + // Protection for backward compatibility + if(idx<(GetNumberOfTRDslices()*kTRDnPlanes)) return -1.; + + if(sp) (*sp) = fTRDslices[idx+kTRDnPlanes]; + return fTRDslices[idx]; +} + +//____________________________________________________ +Double_t AliESDtrack::GetTRDslice(Int_t plane, Int_t slice) const { + //Gets the charge from the slice of the plane + + if(!fTRDslices) { + //AliError("No TRD slices allocated for this track !"); + return -1.; + } + if ((plane<0) || (plane>=kTRDnPlanes)) { + AliError("Info for TRD plane not available !"); + return -1.; + } + Int_t ns=GetNumberOfTRDslices(); + if ((slice<-1) || (slice>=ns)) { + //AliError("Wrong TRD slice !"); + return -1.; + } + + if(slice>=0) return fTRDslices[plane*ns + slice]; + + // return average of the dEdx measurements + Double_t q=0.; Double32_t *s = &fTRDslices[plane*ns]; + for (Int_t i=0; i0.) q+=(*s); + return q/ns; +} + +//____________________________________________________ +void AliESDtrack::SetNumberOfTRDslices(Int_t n) { + //Sets the number of slices used for PID + if (fTRDnSlices) return; + + fTRDnSlices=n; + fTRDslices=new Double32_t[fTRDnSlices]; + + // set-up correctly the allocated memory + memset(fTRDslices, 0, n*sizeof(Double32_t)); + for (Int_t i=GetNumberOfTRDslices(); i--;) fTRDslices[i]=-1.; +} + +//____________________________________________________ +void AliESDtrack::SetTRDslice(Double_t q, Int_t plane, Int_t slice) { + //Sets the charge q in the slice of the plane + if(!fTRDslices) { + AliError("No TRD slices allocated for this track !"); + return; + } + if ((plane<0) || (plane>=kTRDnPlanes)) { + AliError("Info for TRD plane not allocated !"); + return; + } + Int_t ns=GetNumberOfTRDslices(); + if ((slice<0) || (slice>=ns)) { + AliError("Wrong TRD slice !"); + return; + } + Int_t n=plane*ns + slice; + fTRDslices[n]=q; +} + + +//____________________________________________________ +void AliESDtrack::SetTRDmomentum(Double_t p, Int_t plane, Double_t *sp) +{ + if(!fTRDslices) { + AliError("No TRD slices allocated for this track !"); + return; + } + if ((plane<0) || (plane>=kTRDnPlanes)) { + AliError("Info for TRD plane not allocated !"); + return; + } + + Int_t idx = fTRDnSlices-(kTRDnPlanes<<1)+plane; + // Protection for backward compatibility + if(idxPropagateToDCA(vtx, b, maxd, dz, cov)) return kFALSE; + + fdTPC = dz[0]; + fzTPC = dz[1]; + fCddTPC = cov[0]; + fCdzTPC = cov[1]; + fCzzTPC = cov[2]; + + Double_t covar[6]; vtx->GetCovMatrix(covar); + Double_t p[2]={GetParameter()[0]-dz[0],GetParameter()[1]-dz[1]}; + Double_t c[3]={covar[2],0.,covar[5]}; + + Double_t chi2=GetPredictedChi2(p,c); + if (chi2>kVeryBig) return kFALSE; + + fCchi2TPC=chi2; + + if (!cParam) return kTRUE; + + *cParam = *fTPCInner; + if (!cParam->Update(p,c)) return kFALSE; + + return kTRUE; +} + +//_______________________________________________________________________ +Bool_t AliESDtrack::RelateToVertexTPCBxByBz(const AliESDVertex *vtx, +Double_t b[3], Double_t maxd, AliExternalTrackParam *cParam) { + // + // Try to relate the TPC-only track parameters to the vertex "vtx", + // if the (rough) transverse impact parameter is not bigger then "maxd". + // + // All three components of the magnetic field ,"b[3]" (kG), + // are taken into account. + // + // a) The TPC-only paramters are extapolated to the DCA to the vertex. + // b) The impact parameters and their covariance matrix are calculated. + // c) An attempt to constrain the TPC-only params to the vertex is done. + // The constrained params are returned via "cParam". + // + // In the case of success, the returned value is kTRUE + // otherwise, it's kFALSE) + // + + if (!fTPCInner) return kFALSE; + if (!vtx) return kFALSE; + + Double_t dz[2],cov[3]; + if (!fTPCInner->PropagateToDCABxByBz(vtx, b, maxd, dz, cov)) return kFALSE; + + fdTPC = dz[0]; + fzTPC = dz[1]; + fCddTPC = cov[0]; + fCdzTPC = cov[1]; + fCzzTPC = cov[2]; + + Double_t covar[6]; vtx->GetCovMatrix(covar); + Double_t p[2]={GetParameter()[0]-dz[0],GetParameter()[1]-dz[1]}; + Double_t c[3]={covar[2],0.,covar[5]}; + + Double_t chi2=GetPredictedChi2(p,c); + if (chi2>kVeryBig) return kFALSE; + + fCchi2TPC=chi2; + + if (!cParam) return kTRUE; + + *cParam = *fTPCInner; + if (!cParam->Update(p,c)) return kFALSE; + + return kTRUE; +} + +//_______________________________________________________________________ +Bool_t AliESDtrack::RelateToVertex(const AliESDVertex *vtx, +Double_t b, Double_t maxd, AliExternalTrackParam *cParam) { // // Try to relate this track to the vertex "vtx", // if the (rough) transverse impact parameter is not bigger then "maxd". @@ -1049,64 +2078,101 @@ Bool_t AliESDtrack::RelateToVertex // a) The track gets extapolated to the DCA to the vertex. // b) The impact parameters and their covariance matrix are calculated. // c) An attempt to constrain this track to the vertex is done. + // The constrained params are returned via "cParam". // - // In the case of success, the returned value is kTRUE - // (otherwise, it's kFALSE) + // In the case of success, the returned value is kTRUE + // (otherwise, it's kFALSE) // if (!vtx) return kFALSE; - Double_t alpha=GetAlpha(); - Double_t sn=TMath::Sin(alpha), cs=TMath::Cos(alpha); - Double_t x=GetX(), y=GetParameter()[0], snp=GetParameter()[2]; - Double_t xv= vtx->GetXv()*cs + vtx->GetYv()*sn; - Double_t yv=-vtx->GetXv()*sn + vtx->GetYv()*cs, zv=vtx->GetZv(); - x-=xv; y-=yv; + Double_t dz[2],cov[3]; + if (!PropagateToDCA(vtx, b, maxd, dz, cov)) return kFALSE; + + fD = dz[0]; + fZ = dz[1]; + fCdd = cov[0]; + fCdz = cov[1]; + fCzz = cov[2]; + + Double_t covar[6]; vtx->GetCovMatrix(covar); + Double_t p[2]={GetParameter()[0]-dz[0],GetParameter()[1]-dz[1]}; + Double_t c[3]={covar[2],0.,covar[5]}; + + Double_t chi2=GetPredictedChi2(p,c); + if (chi2>kVeryBig) return kFALSE; + + fCchi2=chi2; + + + //--- Could now these lines be removed ? --- + delete fCp; + fCp=new AliExternalTrackParam(*this); - //Estimate the impact parameter neglecting the track curvature - Double_t d=TMath::Abs(x*snp - y*TMath::Sqrt(1.- snp*snp)); - if (d > maxd) return kFALSE; + if (!fCp->Update(p,c)) {delete fCp; fCp=0; return kFALSE;} + //---------------------------------------- - //Propagate to the DCA - Double_t crv=kB2C*b*GetParameter()[4]; - if (TMath::Abs(b) < kAlmost0Field) crv=0.; + fVertexID = vtx->GetID(); - Double_t tgfv=-(crv*x - snp)/(crv*y + TMath::Sqrt(1.-snp*snp)); - sn=tgfv/TMath::Sqrt(1.+ tgfv*tgfv); - if (TMath::Abs(tgfv)>0.) cs = sn/tgfv; - else cs=1.; + if (!cParam) return kTRUE; + + *cParam = *this; + if (!cParam->Update(p,c)) return kFALSE; + + return kTRUE; +} + +//_______________________________________________________________________ +Bool_t AliESDtrack::RelateToVertexBxByBz(const AliESDVertex *vtx, +Double_t b[3], Double_t maxd, AliExternalTrackParam *cParam) { + // + // Try to relate this track to the vertex "vtx", + // if the (rough) transverse impact parameter is not bigger then "maxd". + // Magnetic field is "b" (kG). + // + // a) The track gets extapolated to the DCA to the vertex. + // b) The impact parameters and their covariance matrix are calculated. + // c) An attempt to constrain this track to the vertex is done. + // The constrained params are returned via "cParam". + // + // In the case of success, the returned value is kTRUE + // (otherwise, it's kFALSE) + // - x = xv*cs + yv*sn; - yv=-xv*sn + yv*cs; xv=x; + if (!vtx) return kFALSE; - if (!Propagate(alpha+TMath::ASin(sn),xv,b)) return kFALSE; + Double_t dz[2],cov[3]; + if (!PropagateToDCABxByBz(vtx, b, maxd, dz, cov)) return kFALSE; - fD = GetParameter()[0] - yv; - fZ = GetParameter()[1] - zv; + fD = dz[0]; + fZ = dz[1]; + fCdd = cov[0]; + fCdz = cov[1]; + fCzz = cov[2]; - Double_t cov[6]; vtx->GetCovMatrix(cov); + Double_t covar[6]; vtx->GetCovMatrix(covar); + Double_t p[2]={GetParameter()[0]-dz[0],GetParameter()[1]-dz[1]}; + Double_t c[3]={covar[2],0.,covar[5]}; - //***** Improvements by A.Dainese - alpha=GetAlpha(); sn=TMath::Sin(alpha); cs=TMath::Cos(alpha); - Double_t s2ylocvtx = cov[0]*sn*sn + cov[2]*cs*cs - 2.*cov[1]*cs*sn; - fCdd = GetCovariance()[0] + s2ylocvtx; // neglecting correlations - fCdz = GetCovariance()[1]; // between (x,y) and z - fCzz = GetCovariance()[2] + cov[5]; // in vertex's covariance matrix - //***** + Double_t chi2=GetPredictedChi2(p,c); + if (chi2>kVeryBig) return kFALSE; - {//Try to constrain - Double_t p[2]={yv,zv}, c[3]={cov[2],0.,cov[5]}; - Double_t chi2=GetPredictedChi2(p,c); + fCchi2=chi2; - if (chi2>77.) return kFALSE; - AliExternalTrackParam tmp(*this); - if (!tmp.Update(p,c)) return kFALSE; + //--- Could now these lines be removed ? --- + delete fCp; + fCp=new AliExternalTrackParam(*this); - fCchi2=chi2; - if (!fCp) fCp=new AliExternalTrackParam(); - new (fCp) AliExternalTrackParam(tmp); - } + if (!fCp->Update(p,c)) {delete fCp; fCp=0; return kFALSE;} + //---------------------------------------- + + fVertexID = vtx->GetID(); + + if (!cParam) return kTRUE; + + *cParam = *this; + if (!cParam->Update(p,c)) return kFALSE; return kTRUE; } @@ -1114,7 +2180,7 @@ Bool_t AliESDtrack::RelateToVertex //_______________________________________________________________________ void AliESDtrack::Print(Option_t *) const { // Prints info on the track - + AliExternalTrackParam::Print(); printf("ESD track info\n") ; Double_t p[AliPID::kSPECIESN] ; Int_t index = 0 ; @@ -1137,7 +2203,7 @@ void AliESDtrack::Print(Option_t *) const { GetTRDpid(p) ; for(index = 0 ; index < AliPID::kSPECIES; index++) printf("%f, ", p[index]) ; - printf("\n signal = %f\n", GetTRDsignal()) ; + printf("\n signal = %f\n", GetTRDsignal()) ; } if( IsOn(kTOFpid) ){ printf("From TOF: ") ; @@ -1155,3 +2221,86 @@ void AliESDtrack::Print(Option_t *) const { } } + +// +// Draw functionality +// Origin: Marian Ivanov, Marian.Ivanov@cern.ch +// +void AliESDtrack::FillPolymarker(TPolyMarker3D *pol, Float_t magF, Float_t minR, Float_t maxR, Float_t stepR){ + // + // Fill points in the polymarker + // + TObjArray arrayRef; + arrayRef.AddLast(new AliExternalTrackParam(*this)); + if (fIp) arrayRef.AddLast(new AliExternalTrackParam(*fIp)); + if (fOp) arrayRef.AddLast(new AliExternalTrackParam(*fOp)); + if (fHMPIDp) arrayRef.AddLast(new AliExternalTrackParam(*fHMPIDp)); + // + Double_t mpos[3]={0,0,0}; + Int_t entries=arrayRef.GetEntries(); + for (Int_t i=0;iGetXYZ(pos); + mpos[0]+=pos[0]/entries; + mpos[1]+=pos[1]/entries; + mpos[2]+=pos[2]/entries; + } + // Rotate to the mean position + // + Float_t fi= TMath::ATan2(mpos[1],mpos[0]); + for (Int_t i=0;iRotate(fi); + if (!res) delete arrayRef.RemoveAt(i); + } + Int_t counter=0; + for (Double_t r=minR; rGetXYZAt(r,magF,point)){ + Double_t weight = 1./(10.+(r-param->GetX())*(r-param->GetX())); + sweight+=weight; + mlpos[0]+=point[0]*weight; + mlpos[1]+=point[1]*weight; + mlpos[2]+=point[2]*weight; + } + } + if (sweight>0){ + mlpos[0]/=sweight; + mlpos[1]/=sweight; + mlpos[2]/=sweight; + pol->SetPoint(counter,mlpos[0],mlpos[1], mlpos[2]); + printf("xyz\t%f\t%f\t%f\n",mlpos[0], mlpos[1],mlpos[2]); + counter++; + } + } +} + +//_______________________________________________________________________ +void AliESDtrack::SetITSdEdxSamples(const Double_t s[4]) { + // + // Store the dE/dx samples measured by the two SSD and two SDD layers. + // These samples are corrected for the track segment length. + // + for (Int_t i=0; i<4; i++) fITSdEdxSamples[i]=s[i]; +} + +//_______________________________________________________________________ +void AliESDtrack::GetITSdEdxSamples(Double_t *s) const { + // + // Get the dE/dx samples measured by the two SSD and two SDD layers. + // These samples are corrected for the track segment length. + // + for (Int_t i=0; i<4; i++) s[i]=fITSdEdxSamples[i]; +} + + +UShort_t AliESDtrack::GetTPCnclsS(Int_t i0,Int_t i1) const{ + // + // get number of shared clusters + // + return fTPCSharedMap.CountBits(i0)-fTPCSharedMap.CountBits(i1); +}