X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=ITS%2FAliITStrackerV2.cxx;h=9f40d657d23b0cc996b33039bd0ef5cdc0e6019d;hb=27a73a5da2f97b5c9761b25405188118cc86a85e;hp=be13f576463971c910c0c4de2f189b5980eb9984;hpb=81e97e0da7f50c2a0bc70f39a14d845607ba361a;p=u%2Fmrichter%2FAliRoot.git diff --git a/ITS/AliITStrackerV2.cxx b/ITS/AliITStrackerV2.cxx index be13f576463..9f40d657d23 100644 --- a/ITS/AliITStrackerV2.cxx +++ b/ITS/AliITStrackerV2.cxx @@ -15,7 +15,7 @@ //------------------------------------------------------------------------- // 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 @@ -30,7 +30,7 @@ #include "AliITSgeom.h" #include "AliITSRecPoint.h" #include "AliESD.h" -#include "AliITSclusterV2.h" +#include "AliITSRecPoint.h" #include "AliITStrackerV2.h" ClassImp(AliITStrackerV2) @@ -109,13 +109,13 @@ Int_t AliITStrackerV2::LoadClusters(TTree *cTree) { //-------------------------------------------------------------------- //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; @@ -130,14 +130,14 @@ Int_t AliITStrackerV2::LoadClusters(TTree *cTree) { 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(); } @@ -367,43 +367,18 @@ Int_t AliITStrackerV2::RefitInward(AliESD *event) { 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 (chi2UpdateTrackParams(&fTrackToFollow,AliESDtrack::kITSrefit); + Float_t r[3]={0.,0.,0.}; + Double_t maxD=3.; + esdTrack->RelateToVertex(event->GetVertex(),GetBz(r),maxD); + ntrk++; } } delete t; @@ -541,8 +516,8 @@ Int_t AliITStrackerV2::TakeNextProlongation() { 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(); @@ -663,7 +638,7 @@ void AliITStrackerV2::AliITSlayer::ResetRoad() { 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 @@ -683,7 +658,7 @@ Int_t AliITStrackerV2::AliITSlayer::InsertCluster(AliITSclusterV2 *c) { 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++; @@ -723,12 +698,12 @@ SelectClusters(Float_t zmin,Float_t zmax,Float_t ymin, Float_t ymax) { 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 = (ymaxIsUsed()) continue; if (c->GetZ()>zmax) break; if (c->GetPhiR()<=ymin) continue; @@ -737,14 +712,14 @@ SelectClusters(Float_t zmin,Float_t zmax,Float_t ymin, Float_t ymax) { } } - 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 (; iIsUsed()) continue; if (c->GetZ()>zmax) break; if (c->GetPhiR()<=ym) continue; @@ -756,11 +731,11 @@ SelectClusters(Float_t zmin,Float_t zmax,Float_t ymin, Float_t ymax) { 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--; @@ -925,11 +900,13 @@ Double_t AliITStrackerV2::GetEffectiveThickness(Double_t y,Double_t z) const 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; @@ -988,12 +965,12 @@ AliITStrackerV2::RefitAt(Double_t xx,AliITStrackV2 *t,const AliITStrackV2 *c) { } 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); @@ -1010,25 +987,7 @@ AliITStrackerV2::RefitAt(Double_t xx,AliITStrackV2 *t,const AliITStrackV2 *c) { 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 (chi2Update(cl,maxchi2,idx)) { return kFALSE; @@ -1042,6 +1001,36 @@ AliITStrackerV2::RefitAt(Double_t xx,AliITStrackV2 *t,const AliITStrackV2 *c) { 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=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; @@ -1064,9 +1053,17 @@ void AliITStrackerV2::UseClusters(const AliKalmanTrack *t, Int_t from) const { //-------------------------------------------------------------------- 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(); }