AliESDtrack *t=event->GetTrack(i);
UInt_t status=t->GetStatus();
UInt_t flags=AliESDtrack::kTPCin|AliESDtrack::kITSin;
+
if ((status&AliESDtrack::kITSrefit)==0)
- if ((status&flags)!=status) continue;
- AliITStrackV2 *iotrack=new AliITStrackV2(*t);
+ if ((status&flags)!=status) continue;
+
+ AliITStrackV2 *iotrack=0;
+ iotrack=new AliITStrackV2(*t);
+ //if (t->GetConstrainedChi2()>=20) continue; // constrained
+ //else iotrack=new AliITStrackV2(*t,kTRUE); // track
+ if ((status&flags)==status) {
+ iotrack->PropagateTo(3.,0.0028,65.19);
+ iotrack->PropagateToVertex();
+ }
tarray.AddLast(iotrack);
}
delete event;
}
}
- track->PropagateTo(3.,0.0028,65.19);
- track->PropagateToVertex();
-
Double_t xv,par[5]; track->GetExternalParameters(xv,par);
Float_t phi=TMath::ASin(par[2]) + track->GetAlpha();
if (phi<-TMath::Pi()) phi+=2*TMath::Pi();
}
//____________________________________________________________________________
-AliITStrackV2::AliITStrackV2(AliESDtrack& t) throw (const Char_t *) :
+AliITStrackV2::AliITStrackV2(AliESDtrack& t,Bool_t c) throw (const Char_t *) :
AliKalmanTrack() {
//------------------------------------------------------------------
- //Conversion ESD track -> ITS track
+ // Conversion ESD track -> ITS track.
+ // If c==kTRUE, create the ITS track out of the constrained params.
//------------------------------------------------------------------
SetNumberOfClusters(t.GetITSclusters(fIndex));
SetLabel(t.GetLabel());
else if (fAlpha >= TMath::Pi()) fAlpha -= 2*TMath::Pi();
//Conversion of the track parameters
- Double_t x,p[5]; t.GetExternalParameters(x,p);
+ Double_t x,p[5];
+ if (c) t.GetConstrainedExternalParameters(x,p);
+ else t.GetExternalParameters(x,p);
fX=x; x=GetConvConst();
fP0=p[0];
fP1=p[1];
fP4=p[4]/x;
//Conversion of the covariance matrix
- Double_t c[15]; t.GetExternalCovariance(c);
-
- fC00=c[0 ];
- fC10=c[1 ]; fC11=c[2 ];
- fC20=c[3 ]; fC21=c[4 ]; fC22=c[5 ];
- fC30=c[6 ]; fC31=c[7 ]; fC32=c[8 ]; fC33=c[9 ];
- fC40=c[10]/x; fC41=c[11]/x; fC42=c[12]/x; fC43=c[13]/x; fC44=c[14]/x/x;
+ Double_t cv[15];
+ if (c) t.GetConstrainedExternalCovariance(cv);
+ else t.GetExternalCovariance(cv);
+ fC00=cv[0 ];
+ fC10=cv[1 ]; fC11=cv[2 ];
+ fC20=cv[3 ]; fC21=cv[4 ]; fC22=cv[5 ];
+ fC30=cv[6 ]; fC31=cv[7 ]; fC32=cv[8 ]; fC33=cv[9 ];
+ fC40=cv[10]/x; fC41=cv[11]/x; fC42=cv[12]/x; fC43=cv[13]/x; fC44=cv[14]/x/x;
if (t.GetStatus()&AliESDtrack::kTIME) {
StartTimeIntegral();
void AliITStrackV2::UpdateESDtrack(ULong_t flags) {
fESDtrack->UpdateTrackParams(this,flags);
}
+void AliITStrackV2::SetConstrainedESDtrack(Double_t chi2) {
+ fESDtrack->SetConstrainedTrackParams(this,chi2);
+}
//____________________________________________________________________________
AliITStrackV2::AliITStrackV2(const AliITStrackV2& t) : AliKalmanTrack(t) {
return 0;
}
+ if (chi2<0) return 1;
+
Int_t n=GetNumberOfClusters();
fIndex[n]=index;
SetNumberOfClusters(n+1);
public:
AliITStrackV2();
AliITStrackV2(const AliTPCtrack& t) throw (const Char_t *);
- AliITStrackV2(AliESDtrack& t) throw (const Char_t *);
+ AliITStrackV2(AliESDtrack& t,Bool_t c=kFALSE) throw (const Char_t *);
AliITStrackV2(const AliITStrackV2& t);
Int_t PropagateToVertex(Double_t d=0., Double_t x0=0.);
- Int_t PropagateToPrimVertex(Double_t x0,Double_t rho){return PropagateToVertex(rho,x0);}
Int_t Propagate(Double_t alpha, Double_t xr);
Int_t CorrectForMaterial(Double_t d, Double_t x0=21.82);
Int_t PropagateTo(Double_t xr, Double_t d, Double_t x0=21.82);
void ResetCovariance();
void ResetClusters() { SetChi2(0.); SetNumberOfClusters(0); }
void UpdateESDtrack(ULong_t flags);
+ void SetConstrainedESDtrack(Double_t chi2);
void *operator new(size_t /* s */,void *p) { return p; }
void *operator new(size_t s) { return ::operator new(s); }
Double_t GetZ() const {return fP1;}
Double_t GetSnp() const {return fP2;}
Double_t GetTgl() const {return fP3;}
+ Double_t GetC() const {return fP4;}
Double_t
Get1Pt() const { return (1e-9*TMath::Abs(fP4)/fP4 + fP4)*GetConvConst(); }
Double_t GetD(Double_t x=0, Double_t y=0) const;
fTrackToFollow.CookdEdx();
CookLabel(&fTrackToFollow,0.); //For comparison only
- if (fTrackToFollow.PropagateTo(3.,0.0028,65.19)) //The beam pipe
- if (fTrackToFollow.PropagateToVertex()) {
+ if (fTrackToFollow.PropagateTo(3.,0.0028,65.19)) {//The beam pipe
+ Double_t a=fTrackToFollow.GetAlpha();
+ Double_t cs=TMath::Cos(a),sn=TMath::Sin(a);
+ Double_t xv= GetX()*cs + GetY()*sn;
+ Double_t yv=-GetX()*sn + GetY()*cs;
+
+ Double_t c=fTrackToFollow.GetC(), snp=fTrackToFollow.GetSnp();
+ Double_t x=fTrackToFollow.GetX(), y=fTrackToFollow.GetY();
+ Double_t tgfv=-(c*(x-xv)-snp)/(c*(y-yv) + TMath::Sqrt(1.-snp*snp));
+ Double_t fv=TMath::ATan(tgfv);
+
+ cs=TMath::Cos(fv); sn=TMath::Sin(fv);
+ x = xv*cs + yv*sn;
+ yv=-xv*sn + yv*cs; xv=x;
+
+ if (fTrackToFollow.Propagate(fv+a,xv)) {
fTrackToFollow.UpdateESDtrack(AliESDtrack::kITSrefit);
UseClusters(&fTrackToFollow);
+ {
+ AliITSclusterV2 c; c.SetY(yv); c.SetZ(GetZ());
+ c.SetSigmaY2(GetSigmaY()*GetSigmaY());
+ c.SetSigmaZ2(GetSigmaZ()*GetSigmaZ());
+ Double_t chi2=fTrackToFollow.GetPredictedChi2(&c);
+ if (chi2<kMaxChi2)
+ if (fTrackToFollow.Update(&c,-chi2,0))
+ fTrackToFollow.SetConstrainedESDtrack(chi2);
+ }
ntrk++;
}
+ }
}
delete t;
}
fStopVertex(0),
fRalpha(0),
fRx(0),
+fCchi2(1e10),
fITSchi2(0),
fITSncls(0),
fITSsignal(0),
return kTRUE;
}
+//_______________________________________________________________________
+void
+AliESDtrack::SetConstrainedTrackParams(AliKalmanTrack *t, Double_t chi2) {
+ //
+ // This function sets the constrained track parameters
+ //
+ fCalpha=t->GetAlpha();
+ t->GetExternalParameters(fCx,fCp);
+ t->GetExternalCovariance(fCc);
+ fCchi2=chi2;
+}
+
+
//_______________________________________________________________________
void AliESDtrack::GetExternalParameters(Double_t &x, Double_t p[5]) const {
//---------------------------------------------------------------------
x=fRx;
for (Int_t i=0; i<5; i++) p[i]=fRp[i];
}
+//_______________________________________________________________________
+void AliESDtrack::GetExternalCovariance(Double_t c[15]) const {
+ //---------------------------------------------------------------------
+ // This function returns external representation of the cov. matrix
+ //---------------------------------------------------------------------
+ for (Int_t i=0; i<15; i++) c[i]=fRc[i];
+}
+
+
+//_______________________________________________________________________
+void
+AliESDtrack::GetConstrainedExternalParameters(Double_t &x, Double_t p[5])const{
+ //---------------------------------------------------------------------
+ // This function returns the constrained external track parameters
+ //---------------------------------------------------------------------
+ x=fCx;
+ for (Int_t i=0; i<5; i++) p[i]=fCp[i];
+}
+//_______________________________________________________________________
+void
+AliESDtrack::GetConstrainedExternalCovariance(Double_t c[15]) const {
+ //---------------------------------------------------------------------
+ // This function returns the constrained external cov. matrix
+ //---------------------------------------------------------------------
+ for (Int_t i=0; i<15; i++) c[i]=fCc[i];
+}
+
Double_t AliESDtrack::GetP() const {
//---------------------------------------------------------------------
return pt/TMath::Cos(lam);
}
+void AliESDtrack::GetConstrainedPxPyPz(Double_t *p) const {
+ //---------------------------------------------------------------------
+ // This function returns the constrained global track momentum components
+ //---------------------------------------------------------------------
+ Double_t phi=TMath::ASin(fCp[2]) + fCalpha;
+ Double_t pt=1./TMath::Abs(fCp[4]);
+ p[0]=pt*TMath::Cos(phi); p[1]=pt*TMath::Sin(phi); p[2]=pt*fCp[3];
+}
+void AliESDtrack::GetConstrainedXYZ(Double_t *xyz) const {
+ //---------------------------------------------------------------------
+ // This function returns the global track position
+ //---------------------------------------------------------------------
+ Double_t phi=TMath::ATan2(fCp[0],fCx) + fCalpha;
+ Double_t r=TMath::Sqrt(fCx*fCx + fCp[0]*fCp[0]);
+ xyz[0]=r*TMath::Cos(phi); xyz[1]=r*TMath::Sin(phi); xyz[2]=fCp[1];
+}
+
void AliESDtrack::GetPxPyPz(Double_t *p) const {
//---------------------------------------------------------------------
// This function returns the global track momentum components
Double_t pt=1./TMath::Abs(fRp[4]);
p[0]=pt*TMath::Cos(phi); p[1]=pt*TMath::Sin(phi); p[2]=pt*fRp[3];
}
-
void AliESDtrack::GetXYZ(Double_t *xyz) const {
//---------------------------------------------------------------------
// This function returns the global track position
xyz[0]=r*TMath::Cos(phi); xyz[1]=r*TMath::Sin(phi); xyz[2]=fRp[1];
}
+
void AliESDtrack::GetInnerPxPyPz(Double_t *p) const {
//---------------------------------------------------------------------
// This function returns the global track momentum components
xyz[0]=r*TMath::Cos(phi); xyz[1]=r*TMath::Sin(phi); xyz[2]=fOp[1];
}
-//_______________________________________________________________________
-void AliESDtrack::GetExternalCovariance(Double_t c[15]) const {
- //---------------------------------------------------------------------
- // This function returns external representation of the cov. matrix
- //---------------------------------------------------------------------
- for (Int_t i=0; i<15; i++) c[i]=fRc[i];
-}
-
//_______________________________________________________________________
void AliESDtrack::GetIntegratedTimes(Double_t *times) const {
// Returns the array with integrated times for each particle hypothesis
void GetXYZ(Double_t *r) const;
Int_t GetSign() const {return (fRp[4]<0) ? 1 : -1;}
+ void SetConstrainedTrackParams(AliKalmanTrack *t, Double_t chi2);
+
+ Double_t GetConstrainedAlpha() const {return fCalpha;}
+ Double_t GetConstrainedChi2() const {return fCchi2;}
+ void GetConstrainedExternalParameters(Double_t &x, Double_t p[5]) const;
+ void GetConstrainedExternalCovariance(Double_t cov[15]) const;
+
+ void GetConstrainedPxPyPz(Double_t *p) const;
+ void GetConstrainedXYZ(Double_t *r) const;
+
void GetInnerPxPyPz(Double_t *p) const;
void GetInnerXYZ(Double_t *r) const;
Double_t fRp[5]; // external track parameters
Double_t fRc[15]; // external cov. matrix of the track parameters
+//Track parameters constrained to the primary vertex
+ Double_t fCalpha,fCx,fCp[5],fCc[15];
+ Double_t fCchi2; //chi2 at the primary vertex
+
//Track parameters at the inner wall of the TPC
Double_t fIalpha,fIx,fIp[5],fIc[15];