X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=TPC%2FAliTPCseed.cxx;h=536f551639fb6dace0e39c43d84e47b0d14883e4;hb=11ebaeaac1bf31f4a49df9a607010af632422807;hp=3d802591f633af6103f7c0fea163737a1d4b8f27;hpb=81e97e0da7f50c2a0bc70f39a14d845607ba361a;p=u%2Fmrichter%2FAliRoot.git diff --git a/TPC/AliTPCseed.cxx b/TPC/AliTPCseed.cxx index 3d802591f63..536f551639f 100644 --- a/TPC/AliTPCseed.cxx +++ b/TPC/AliTPCseed.cxx @@ -23,57 +23,132 @@ //----------------------------------------------------------------- #include "TClonesArray.h" #include "AliTPCseed.h" +#include "AliTPCReconstructor.h" ClassImp(AliTPCseed) -AliTPCseed::AliTPCseed():AliTPCtrack(){ +AliTPCseed::AliTPCseed(): + AliTPCtrack(), + fEsd(0x0), + fClusterOwner(kFALSE), + fPoints(0x0), + fEPoints(0x0), + fRow(0), + fSector(-1), + fRelativeSector(-1), + fCurrentSigmaY2(1e10), + fCurrentSigmaZ2(1e10), + fErrorY2(1e10), + fErrorZ2(1e10), + fCurrentCluster(0x0), + fCurrentClusterIndex1(-1), + fInDead(kFALSE), + fIsSeeding(kFALSE), + fNoCluster(0), + fSort(0), + fBSigned(kFALSE), + fSeedType(0), + fSeed1(-1), + fSeed2(-1), + fMAngular(0), + fCircular(0) +{ // - fRow=0; - fRemoval =0; - for (Int_t i=0;i<200;i++) SetClusterIndex2(i,-3); + for (Int_t i=0;i<160;i++) SetClusterIndex2(i,-3); for (Int_t i=0;i<160;i++) fClusterPointer[i]=0; for (Int_t i=0;i<3;i++) fKinkIndexes[i]=0; - for (Int_t i=0;i<5;i++) fTPCr[i]=0.2; - fPoints = 0; - fEPoints = 0; - fNFoundable =0; - fNShared =0; - fRemoval = 0; - fSort =0; - fFirstPoint =0; - fNoCluster =0; - fBSigned = kFALSE; - fSeed1 =-1; - fSeed2 =-1; - fCurrentCluster =0; - fCurrentSigmaY2=0; - fCurrentSigmaZ2=0; - fCircular = 0; // not curling track + for (Int_t i=0;iUncheckedAt(i); @@ -239,7 +336,7 @@ void AliTPCseed::Reset(Bool_t all) SetNumberOfClusters(0); fNFoundable = 0; SetChi2(0); - ResetCovariance(); + ResetCovariance(10.); /* if (fTrackPoints){ for (Int_t i=0;i<8;i++){ @@ -265,14 +362,11 @@ void AliTPCseed::Modify(Double_t factor) //This function makes a track forget its history :) //------------------------------------------------------------------ if (factor<=0) { - ResetCovariance(); + ResetCovariance(10.); return; } - fC00*=factor; - fC10*=0; fC11*=factor; - fC20*=0; fC21*=0; fC22*=factor; - fC30*=0; fC31*=0; fC32*=0; fC33*=factor; - fC40*=0; fC41*=0; fC42*=0; fC43*=0; fC44*=factor; + ResetCovariance(factor); + SetNumberOfClusters(0); fNFoundable =0; SetChi2(0); @@ -294,25 +388,25 @@ Int_t AliTPCseed::GetProlongation(Double_t xk, Double_t &y, Double_t & z) const // doesn't change internal state of the track //----------------------------------------------------------------- - Double_t x1=fX, x2=x1+(xk-x1), dx=x2-x1; + Double_t x1=GetX(), x2=x1+(xk-x1), dx=x2-x1; - if (TMath::Abs(fP4*xk - fP2) >= 0.999) { + if (TMath::Abs(GetSnp()+GetC()*dx) >= AliTPCReconstructor::GetMaxSnpTrack()) { return 0; } // Double_t y1=fP0, z1=fP1; - Double_t c1=fP4*x1 - fP2, r1=sqrt(1.- c1*c1); - Double_t c2=fP4*x2 - fP2, r2=sqrt(1.- c2*c2); + Double_t c1=GetSnp(), r1=sqrt(1.- c1*c1); + Double_t c2=c1 + GetC()*dx, r2=sqrt(1.- c2*c2); - y = fP0; - z = fP1; + y = GetY(); + z = GetZ(); //y += dx*(c1+c2)/(r1+r2); //z += dx*(c1+c2)/(c1*r2 + c2*r1)*fP3; Double_t dy = dx*(c1+c2)/(r1+r2); Double_t dz = 0; // - Double_t delta = fP4*dx*(c1+c2)/(c1*r2 + c2*r1); + Double_t delta = GetC()*dx*(c1+c2)/(c1*r2 + c2*r1); /* if (TMath::Abs(delta)>0.0001){ dz = fP3*TMath::ASin(delta)/fP4; @@ -321,7 +415,7 @@ Int_t AliTPCseed::GetProlongation(Double_t xk, Double_t &y, Double_t & z) const } */ // dz = fP3*AliTPCFastMath::FastAsin(delta)/fP4; - dz = fP3*TMath::ASin(delta)/fP4; + dz = GetTgl()*TMath::ASin(delta)/GetC(); // y+=dy; z+=dz; @@ -332,29 +426,16 @@ Int_t AliTPCseed::GetProlongation(Double_t xk, Double_t &y, Double_t & z) const //_____________________________________________________________________________ -Double_t AliTPCseed::GetPredictedChi2(const AliTPCclusterMI *c) const +Double_t AliTPCseed::GetPredictedChi2(const AliCluster *c) const { //----------------------------------------------------------------- // This function calculates a predicted chi2 increment. //----------------------------------------------------------------- - //Double_t r00=c->GetSigmaY2(), r01=0., r11=c->GetSigmaZ2(); - Double_t r00=fErrorY2, r01=0., r11=fErrorZ2; - r00+=fC00; r01+=fC10; r11+=fC11; - - Double_t det=r00*r11 - r01*r01; - if (TMath::Abs(det) < 1.e-10) { - //Int_t n=GetNumberOfClusters(); - //if (n>4) cerr<GetY() - fP0, dz=c->GetZ() - fP1; - - return (dy*r00*dy + 2*r01*dy*dz + dz*r11*dz)/det; + Double_t p[2]={c->GetY(), c->GetZ()}; + Double_t cov[3]={fErrorY2, 0., fErrorZ2}; + return AliExternalTrackParam::GetPredictedChi2(p,cov); } - //_________________________________________________________________________________________ @@ -375,11 +456,11 @@ Int_t AliTPCseed::Compare(const TObject *o) const { } else { Float_t f2 =1; - f2 = 1-20*TMath::Sqrt(t->fC44)/(TMath::Abs(t->GetC())+0.0066); + f2 = 1-20*TMath::Sqrt(t->GetSigma1Pt2())/(TMath::Abs(t->Get1Pt())+0.0066); if (t->fBConstrain) f2=1.2; Float_t f1 =1; - f1 = 1-20*TMath::Sqrt(fC44)/(TMath::Abs(GetC())+0.0066); + f1 = 1-20*TMath::Sqrt(GetSigma1Pt2())/(TMath::Abs(Get1Pt())+0.0066); if (fBConstrain) f1=1.2; @@ -392,65 +473,28 @@ Int_t AliTPCseed::Compare(const TObject *o) const { //_____________________________________________________________________________ -Int_t AliTPCseed::Update(const AliTPCclusterMI *c, Double_t chisq, UInt_t /*index*/) { +Bool_t AliTPCseed::Update(const AliCluster *c, Double_t chisq, Int_t /*index*/) +{ //----------------------------------------------------------------- // This function associates a cluster with this track. //----------------------------------------------------------------- - Double_t r00=fErrorY2, r01=0., r11=fErrorZ2; - - r00+=fC00; r01+=fC10; r11+=fC11; - Double_t det=r00*r11 - r01*r01; - Double_t tmp=r00; r00=r11/det; r11=tmp/det; r01=-r01/det; - - Double_t k00=fC00*r00+fC10*r01, k01=fC00*r01+fC10*r11; - Double_t k10=fC10*r00+fC11*r01, k11=fC10*r01+fC11*r11; - Double_t k20=fC20*r00+fC21*r01, k21=fC20*r01+fC21*r11; - Double_t k30=fC30*r00+fC31*r01, k31=fC30*r01+fC31*r11; - Double_t k40=fC40*r00+fC41*r01, k41=fC40*r01+fC41*r11; - - Double_t dy=c->GetY() - fP0, dz=c->GetZ() - fP1; - Double_t cur=fP4 + k40*dy + k41*dz, eta=fP2 + k20*dy + k21*dz; - if (TMath::Abs(cur*fX-eta) >= 0.9) { - return 0; - } - - fP0 += k00*dy + k01*dz; - fP1 += k10*dy + k11*dz; - fP2 = eta; - fP3 += k30*dy + k31*dz; - fP4 = cur; - - Double_t c01=fC10, c02=fC20, c03=fC30, c04=fC40; - Double_t c12=fC21, c13=fC31, c14=fC41; - - fC00-=k00*fC00+k01*fC10; fC10-=k00*c01+k01*fC11; - fC20-=k00*c02+k01*c12; fC30-=k00*c03+k01*c13; - fC40-=k00*c04+k01*c14; - - fC11-=k10*c01+k11*fC11; - fC21-=k10*c02+k11*c12; fC31-=k10*c03+k11*c13; - fC41-=k10*c04+k11*c14; + Double_t p[2]={c->GetY(), c->GetZ()}; + Double_t cov[3]={fErrorY2, 0., fErrorZ2}; - fC22-=k20*c02+k21*c12; fC32-=k20*c03+k21*c13; - fC42-=k20*c04+k21*c14; - - fC33-=k30*c03+k31*c13; - fC43-=k40*c03+k41*c13; - - fC44-=k40*c04+k41*c14; + if (!AliExternalTrackParam::Update(p,cov)) return kFALSE; Int_t n=GetNumberOfClusters(); // fIndex[n]=index; SetNumberOfClusters(n+1); SetChi2(GetChi2()+chisq); - return 1; + return kTRUE; } //_____________________________________________________________________________ -void AliTPCseed::CookdEdx(Double_t low, Double_t up,Int_t i1, Int_t i2, Bool_t onlyused) { +Float_t AliTPCseed::CookdEdx(Double_t low, Double_t up,Int_t i1, Int_t i2, Bool_t onlyused) { //----------------------------------------------------------------- // This funtion calculates dE/dX within the "low" and "up" cuts. //----------------------------------------------------------------- @@ -660,7 +704,7 @@ void AliTPCseed::CookdEdx(Double_t low, Double_t up,Int_t i1, Int_t i2, Bool_t o } else{ SetdEdx(0); - return; + return 0; } // Float_t dedx1 =dedx; /* @@ -677,27 +721,7 @@ void AliTPCseed::CookdEdx(Double_t low, Double_t up,Int_t i1, Int_t i2, Bool_t o SetdEdx(dedx); - - //mi deDX - - - - //Very rough PID - Double_t p=TMath::Sqrt((1.+ GetTgl()*GetTgl())/(Get1Pt()*Get1Pt())); - - if (p<0.6) { - if (dedx < 39.+ 12./(p+0.25)/(p+0.25)) { SetMass(0.13957); return;} - if (dedx < 39.+ 12./p/p) { SetMass(0.49368); return;} - SetMass(0.93827); return; - } - - if (p<1.2) { - if (dedx < 39.+ 12./(p+0.25)/(p+0.25)) { SetMass(0.13957); return;} - SetMass(0.93827); return; - } - - SetMass(0.13957); return; - + return dedx; } Double_t AliTPCseed::Bethe(Double_t bg){ // @@ -725,7 +749,7 @@ void AliTPCseed::CookPID() Double_t sumr =0; for (Int_t j=0; jAliTPCReconstructor::GetMaxSnpTrack()) return 0.; //patch 01 jan 06 + Double_t c1=GetSnp(), r1=TMath::Sqrt(1.- c1*c1); + Double_t c2=c1+GetC()*(xk-GetX()); + if (TMath::Abs(c2)>AliTPCReconstructor::GetMaxSnpTrack()) return 0; + Double_t r2=TMath::Sqrt(1.- c2*c2); + return GetY() + (xk-GetX())*(c1+c2)/(r1+r2); +} +