#include "AliESDVertex.h"
#include "AliESDtrack.h"
+#include "AliESDEvent.h"
#include "AliKalmanTrack.h"
#include "AliVTrack.h"
#include "AliLog.h"
fTOFsignalToT(0),
fTOFsignalRaw(0),
fTOFsignalDz(0),
+ fTOFsignalDx(0),
fHMPIDtrkX(0),
fHMPIDtrkY(0),
fHMPIDmipX(0),
fTRDntracklets(0),
fTRDnSlices(0),
fTRDslices(0x0),
- fVertexID(-2) // -2 means an orphan track
+ fVertexID(-2),// -2 means an orphan track
+ fESDEvent(0)
{
//
// The default ESD constructor
fTOFsignalToT(track.fTOFsignalToT),
fTOFsignalRaw(track.fTOFsignalRaw),
fTOFsignalDz(track.fTOFsignalDz),
+ fTOFsignalDx(track.fTOFsignalDx),
fHMPIDtrkX(track.fHMPIDtrkX),
fHMPIDtrkY(track.fHMPIDtrkY),
fHMPIDmipX(track.fHMPIDmipX),
fTRDntracklets(track.fTRDntracklets),
fTRDnSlices(track.fTRDnSlices),
fTRDslices(0x0),
- fVertexID(track.fVertexID)
+ fVertexID(track.fVertexID),
+ fESDEvent(track.fESDEvent)
{
//
//copy constructor
fTOFsignalToT(0),
fTOFsignalRaw(0),
fTOFsignalDz(0),
+ fTOFsignalDx(0),
fHMPIDtrkX(0),
fHMPIDtrkY(0),
fHMPIDmipX(0),
fTRDntracklets(0),
fTRDnSlices(0),
fTRDslices(0x0),
- fVertexID(-2) // -2 means an orphan track
+ fVertexID(-2), // -2 means an orphan track
+ fESDEvent(0)
{
//
// ESD track from AliVTrack.
fTOFsignalToT(0),
fTOFsignalRaw(0),
fTOFsignalDz(0),
+ fTOFsignalDx(0),
fHMPIDtrkX(0),
fHMPIDtrkY(0),
fHMPIDmipX(0),
fTRDntracklets(0),
fTRDnSlices(0),
fTRDslices(0x0),
- fVertexID(-2) // -2 means an orphan track
+ fVertexID(-2), // -2 means an orphan track
+ fESDEvent(0)
{
//
// ESD track from TParticle
if(source.fHMPIDp){
// we have the trackparam: assign or copy construct
- if(fOp) *fHMPIDp = *source.fHMPIDp;
+ if(fHMPIDp) *fHMPIDp = *source.fHMPIDp;
else fHMPIDp = new AliExternalTrackParam(*source.fHMPIDp);
}
else{
fTOFsignalToT = source.fTOFsignalToT;
fTOFsignalRaw = source.fTOFsignalRaw;
fTOFsignalDz = source.fTOFsignalDz;
+ fTOFsignalDx = source.fTOFsignalDx;
for(int i = 0;i<10;++i){
fTOFInfo[i] = source.fTOFInfo[i];
fTOFsignalToT = 0;
fTOFsignalRaw = 0;
fTOFsignalDz = 0;
+ fTOFsignalDx = 0;
for (Int_t i=0;i<AliPID::kSPECIES;i++) fTOFr[i] = 0;
for (Int_t i=0;i<3;i++) fTOFLabel[i] = 0;
for (Int_t i=0;i<10;i++) fTOFInfo[i] = 0;
//_______________________________________________________________________
UChar_t AliESDtrack::GetTRDtracklets(Int_t *idx) const {
- //---------------------------------------------------------------------
- // This function returns indices of the assigned TRD tracklets
- //---------------------------------------------------------------------
- if (idx!=0) {
- Int_t *index=fFriendTrack->GetTRDindices();
- for (Int_t i=0; i<6/*AliESDfriendTrack::kMaxTRDcluster*/; i++) idx[i]=index[i];
+//
+// This function returns the number of TRD tracklets used in tracking
+// and it fills the indices of these tracklets in the array "idx" as they
+// are registered in the TRD track list.
+//
+// Caution :
+// 1. The idx array has to be allocated with a size >= 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(), n(0);
+ for (Int_t i=0; i<kTRDnPlanes; i++){
+ if(index[i]>=0) n++;
+ idx[i]=index[i];
}
- return fTRDncls;
+ return n;
}
//_______________________________________________________________________
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) {
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)
+ //
+
+ if (!vtx) return kFALSE;
+
+ Double_t dz[2],cov[3];
+ if (!PropagateToDCABxByBz(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);
+
+ 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;
+}
+
//_______________________________________________________________________
void AliESDtrack::Print(Option_t *) const {
// Prints info on the track