//-------------------------------------------------------------------------
// Implementation of the ITS tracker class
-// It reads AliITSclusterV2 clusters and creates AliITStrackV2 tracks
+// It reads AliITSRecPoint clusters and creates AliITStrackV2 tracks
// and fills with them the ESD
// Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
// dEdx analysis by: Boris Batyunya, JINR, Boris.Batiounia@cern.ch
#include "AliITSgeom.h"
#include "AliITSRecPoint.h"
#include "AliESD.h"
-#include "AliITSclusterV2.h"
+#include "AliITSRecPoint.h"
#include "AliITStrackerV2.h"
ClassImp(AliITStrackerV2)
//--------------------------------------------------------------------
//This function loads ITS clusters
//--------------------------------------------------------------------
- TBranch *branch=cTree->GetBranch("Clusters");
+ TBranch *branch=cTree->GetBranch("ITSRecPoints");
if (!branch) {
Error("LoadClusters"," can't get the branch !\n");
return 1;
}
- TClonesArray dummy("AliITSclusterV2",10000), *clusters=&dummy;
+ TClonesArray dummy("AliITSRecPoint",10000), *clusters=&dummy;
branch->SetAddress(&clusters);
Int_t j=0;
if (!cTree->GetEvent(j)) continue;
Int_t ncl=clusters->GetEntriesFast();
while (ncl--) {
- AliITSclusterV2 *c=(AliITSclusterV2*)clusters->UncheckedAt(ncl);
+ AliITSRecPoint *c=(AliITSRecPoint*)clusters->UncheckedAt(ncl);
Int_t idx=c->GetDetectorIndex();
Double_t y=r*fgLayers[i].GetDetector(idx).GetPhi()+c->GetY();
if (y>circ) y-=circ; else if (y<0) y+=circ;
c->SetPhiR(y);
- fgLayers[i].InsertCluster(new AliITSclusterV2(*c));
+ fgLayers[i].InsertCluster(new AliITSRecPoint(*c));
}
clusters->Delete();
}
fTrackToFollow.ResetClusters();
//Refitting...
- if (RefitAt(3.7, &fTrackToFollow, t)) {
+ if (RefitAt(3.7, &fTrackToFollow, t, kTRUE)) {
fTrackToFollow.SetLabel(t->GetLabel());
fTrackToFollow.CookdEdx();
CookLabel(&fTrackToFollow,0.); //For comparison only
- 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);
- Float_t d=fTrackToFollow.GetD(GetX(),GetY());
- Float_t z=fTrackToFollow.GetZ()-GetZ();
- fTrackToFollow.GetESDtrack()->SetImpactParameters(d,z);
- 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++;
- }
+ if (fTrackToFollow.PropagateTo(3.,0.0028,65.19)) {//The beam pipe
+ AliESDtrack *esdTrack =fTrackToFollow.GetESDtrack();
+ esdTrack->UpdateTrackParams(&fTrackToFollow,AliESDtrack::kITSrefit);
+ Float_t r[3]={0.,0.,0.};
+ Double_t maxD=3.;
+ esdTrack->RelateToVertex(event->GetVertex(),GetBz(r),maxD);
+ ntrk++;
}
}
delete t;
dz=road*scz; dy=road*scy;
}
- const AliITSclusterV2 *c=0; Int_t ci=-1;
- const AliITSclusterV2 *cc=0; Int_t cci=-1;
+ const AliITSRecPoint *c=0; Int_t ci=-1;
+ const AliITSRecPoint *cc=0; Int_t cci=-1;
Double_t chi2=kMaxChi2;
while ((c=layer.GetNextCluster(ci))!=0) {
Int_t idet=c->GetDetectorIndex();
if (n>1) fRoad=2*fR*TMath::Sqrt(3.14/n);
}
-Int_t AliITStrackerV2::AliITSlayer::InsertCluster(AliITSclusterV2 *c) {
+Int_t AliITStrackerV2::AliITSlayer::InsertCluster(AliITSRecPoint *c) {
//--------------------------------------------------------------------
// This function inserts a cluster to this layer in increasing
// order of the cluster's fZ
//--------------------------------------------------------------------
Float_t circ=TMath::TwoPi()*fR;
Int_t sec=Int_t(kNsector*c->GetPhiR()/circ);
+ if (sec>=kNsector) {
+ ::Error("InsertCluster","Wrong sector !\n");
+ return 1;
+ }
Int_t &n=fN[sec];
if (n>=kMaxClusterPerSector) {
::Error("InsertCluster","Too many clusters !\n");
else {
Int_t i=FindClusterIndex(c->GetZ(),sec);
Int_t k=n-i+sec*kMaxClusterPerSector;
- memmove(fClusters+i+1 ,fClusters+i,k*sizeof(AliITSclusterV2*));
+ memmove(fClusters+i+1 ,fClusters+i,k*sizeof(AliITSRecPoint*));
fClusters[i]=c;
}
n++;
if (ymin>circ) ymin-=circ; else if (ymin<0) ymin+=circ;
if (ymax>circ) ymax-=circ; else if (ymax<0) ymax+=circ;
- Int_t i1=Int_t(kNsector*ymin/circ);
+ Int_t i1=Int_t(kNsector*ymin/circ); if (i1==kNsector) i1--;
if (fN[i1]!=0) {
Float_t ym = (ymax<ymin) ? ymax+circ : ymax;
Int_t i=FindClusterIndex(zmin,i1), imax=i1*kMaxClusterPerSector+fN[i1];
for (; i<imax; i++) {
- AliITSclusterV2 *c=fClusters[i];
+ AliITSRecPoint *c=fClusters[i];
if (c->IsUsed()) continue;
if (c->GetZ()>zmax) break;
if (c->GetPhiR()<=ymin) continue;
}
}
- Int_t i2=Int_t(kNsector*ymax/circ);
+ Int_t i2=Int_t(kNsector*ymax/circ); if (i2==kNsector) i2--;
if (i2==i1) return fNsel;
if (fN[i2]!=0) {
Float_t ym = (ymin>ymax) ? ymin-circ : ymin;
Int_t i=FindClusterIndex(zmin,i2), imax=i2*kMaxClusterPerSector+fN[i2];
for (; i<imax; i++) {
- AliITSclusterV2 *c=fClusters[i];
+ AliITSRecPoint *c=fClusters[i];
if (c->IsUsed()) continue;
if (c->GetZ()>zmax) break;
if (c->GetPhiR()<=ym) continue;
return fNsel;
}
-const AliITSclusterV2 *AliITStrackerV2::AliITSlayer::GetNextCluster(Int_t &ci){
+const AliITSRecPoint *AliITStrackerV2::AliITSlayer::GetNextCluster(Int_t &ci){
//--------------------------------------------------------------------
// This function returns clusters within the "window"
//--------------------------------------------------------------------
- AliITSclusterV2 *c=0;
+ AliITSRecPoint *c=0;
ci=-1;
if (fNsel) {
fNsel--;
return d/(xn*xn);
}
-Bool_t
-AliITStrackerV2::RefitAt(Double_t xx,AliITStrackV2 *t,const AliITStrackV2 *c) {
+Bool_t AliITStrackerV2::RefitAt(Double_t xx,AliITStrackV2 *t,
+ const AliITStrackV2 *c, Bool_t extra) {
//--------------------------------------------------------------------
// This function refits the track "t" at the position "x" using
// the clusters from "c"
+ // If "extra"==kTRUE,
+ // the clusters from overlapped modules get attached to "t"
//--------------------------------------------------------------------
Int_t index[kMaxLayer];
Int_t k;
}
t->SetDetectorIndex(idet);
- const AliITSclusterV2 *cl=0;
+ const AliITSRecPoint *cl=0;
Double_t maxchi2=kMaxChi2;
Int_t idx=index[i];
if (idx>0) {
- const AliITSclusterV2 *c=(AliITSclusterV2 *)GetCluster(idx);
+ const AliITSRecPoint *c=(AliITSRecPoint *)GetCluster(idx);
if (idet != c->GetDetectorIndex()) {
idet=c->GetDetectorIndex();
const AliITSdetector &det=layer.GetDetector(idet);
return kFALSE;
}
}
- /*
- if (cl==0)
- if (t->GetNumberOfClusters()>2) {
- Double_t dz=4*TMath::Sqrt(t->GetSigmaZ2()+kSigmaZ2[i]);
- Double_t dy=4*TMath::Sqrt(t->GetSigmaY2()+kSigmaY2[i]);
- Double_t zmin=t->GetZ() - dz;
- Double_t zmax=t->GetZ() + dz;
- Double_t ymin=t->GetY() + phi*r - dy;
- Double_t ymax=t->GetY() + phi*r + dy;
- layer.SelectClusters(zmin,zmax,ymin,ymax);
-
- const AliITSclusterV2 *c=0; Int_t ci=-1;
- while ((c=layer.GetNextCluster(ci))!=0) {
- if (idet != c->GetDetectorIndex()) continue;
- Double_t chi2=t->GetPredictedChi2(c);
- if (chi2<maxchi2) { cl=c; maxchi2=chi2; idx=ci; }
- }
- }
- */
+
if (cl) {
if (!t->Update(cl,maxchi2,idx)) {
return kFALSE;
t->CorrectForMaterial(-step*d,x0);
}
+ if (extra) { //search for extra clusters
+ AliITStrackV2 tmp(*t);
+ Double_t dz=4*TMath::Sqrt(tmp.GetSigmaZ2()+kSigmaZ2[i]);
+ if (dz < 0.5*TMath::Abs(tmp.GetTgl())) dz=0.5*TMath::Abs(tmp.GetTgl());
+ Double_t dy=4*TMath::Sqrt(t->GetSigmaY2()+kSigmaY2[i]);
+ if (dy < 0.5*TMath::Abs(tmp.GetSnp())) dy=0.5*TMath::Abs(tmp.GetSnp());
+ Double_t zmin=t->GetZ() - dz;
+ Double_t zmax=t->GetZ() + dz;
+ Double_t ymin=t->GetY() + phi*r - dy;
+ Double_t ymax=t->GetY() + phi*r + dy;
+ layer.SelectClusters(zmin,zmax,ymin,ymax);
+
+ const AliITSRecPoint *c=0; Int_t ci=-1,cci=-1;
+ Double_t maxchi2=1000.*kMaxChi2, tolerance=0.1;
+ while ((c=layer.GetNextCluster(ci))!=0) {
+ if (idet == c->GetDetectorIndex()) continue;
+
+ const AliITSdetector &det=layer.GetDetector(c->GetDetectorIndex());
+
+ if (!tmp.Propagate(det.GetPhi(),det.GetR())) continue;
+
+ if (TMath::Abs(tmp.GetZ() - c->GetZ()) > tolerance) continue;
+ if (TMath::Abs(tmp.GetY() - c->GetY()) > tolerance) continue;
+
+ Double_t chi2=tmp.GetPredictedChi2(c);
+ if (chi2<maxchi2) { maxchi2=chi2; cci=ci; }
+ }
+ if (cci>=0) t->SetExtraCluster(i,(i<<28)+cci);
+ }
+
// track time update [SR, GSI 17.02.2003]
if (t->IsStartedTimeIntegral() && step==1) {
Double_t newX, newY, newZ;
//--------------------------------------------------------------------
AliTracker::UseClusters(t,from);
- AliITSclusterV2 *c=(AliITSclusterV2 *)GetCluster(t->GetClusterIndex(0));
- if (c->GetSigmaZ2()>0.1) c->UnUse();
- c=(AliITSclusterV2 *)GetCluster(t->GetClusterIndex(1));
- if (c->GetSigmaZ2()>0.1) c->UnUse();
+ Int_t clusterIndex = t->GetClusterIndex(0);
+ AliITSRecPoint *c= 0x0;
+
+ if (clusterIndex>-1)
+ c = (AliITSRecPoint *)GetCluster(clusterIndex);
+ if (c && c->GetSigmaZ2()>0.1) c->UnUse();
+
+ c = 0x0;
+ clusterIndex = t->GetClusterIndex(1);
+ if (clusterIndex>-1)
+ c=(AliITSRecPoint *)GetCluster(clusterIndex);
+ if (c && c->GetSigmaZ2()>0.1) c->UnUse();
}