From f66ae545d94481115c3d8ac08f955221e53cc8e8 Mon Sep 17 00:00:00 2001 From: hristov Date: Fri, 5 Oct 2001 17:08:27 +0000 Subject: [PATCH] Update of ITS tracking version 1 (A.Badala) --- ITS/AliITSIOTrack.cxx | 8 +- ITS/AliITSIOTrack.h | 17 +-- ITS/AliITSTrackerV1.cxx | 313 +++++++++++++++++++--------------------- 3 files changed, 151 insertions(+), 187 deletions(-) diff --git a/ITS/AliITSIOTrack.cxx b/ITS/AliITSIOTrack.cxx index 63658be3157..0f799bf0c8d 100644 --- a/ITS/AliITSIOTrack.cxx +++ b/ITS/AliITSIOTrack.cxx @@ -18,12 +18,8 @@ AliITSIOTrack::AliITSIOTrack() { for (Int_t i=0;i<6;i++) {fIdModules[i]=fIdPoints[i]=-1; fIdPoints[i]=-1;} fStateVPhi=0.; fStateVZ=0.; fStateVD=0.; fStateVTgl=0.; fStateVC=0.; fRadius=0.; fCharge=0; - fC00=fC10=fC11=fC20=fC21=fC22=fC30=fC31=fC32=fC33=fC40=fC41=fC42=fC43=fC44=0.; -/////////////////////////////// - fCode=0; - fPxg=0.; - fPyg=0.; - fPzg=0.; + fC00=fC10=fC11=fC20=fC21=fC22=fC30=fC31=fC32=fC33=fC40=fC41=fC42=fC43=fC44=0.; + } diff --git a/ITS/AliITSIOTrack.h b/ITS/AliITSIOTrack.h index 182f3da8cec..1c6d3a7e3f7 100644 --- a/ITS/AliITSIOTrack.h +++ b/ITS/AliITSIOTrack.h @@ -37,11 +37,7 @@ class AliITSIOTrack : public TObject { Float_t GetPx() const {return fPx;} // gets the x momentum component at the found vertex Float_t GetPy() const {return fPy;} // gets the y momentum component at the found vertex Float_t GetPz() const {return fPz;} // gets the z momentum component at the found vertex - Int_t GetCode() const {return fCode;} // gets the PDG particle code - Float_t GetPxg() const {return fPxg;} // gets the x momentum component read from Geant - Float_t GetPyg() const {return fPyg;} // gets the y momentum component read from Geant - Float_t GetPzg() const {return fPzg;} // gets the z momentum component read from Geant - + void SetCovMatrix(Double_t C00, Double_t C10, Double_t C11, Double_t C20, Double_t C21, Double_t C22, Double_t C30, Double_t C31, Double_t C32, Double_t C33, Double_t C40, Double_t C41, Double_t C42, Double_t C43, Double_t C44); @@ -65,25 +61,18 @@ class AliITSIOTrack : public TObject { void SetPx(Float_t px) {fPx=px;} // sets the x momentum component at the found vertex void SetPy(Float_t py) {fPy=py;} // sets the y momentum component at the found vertex void SetPz(Float_t pz) {fPz=pz;} // sets the z momentum component at the found vertex - void SetCode(Int_t code) {fCode=code;} // sets the PDG particle code - void SetPxg(Float_t pxg) {fPxg=pxg;} // sets the x momentum component read from Geant - void SetPyg(Float_t pyg) {fPyg=pyg;} // sets the y momentum component read from Geant - void SetPzg(Float_t pzg) {fPzg=pzg;} // sets the z momentum component read from Geant - + private: Int_t fLab; // label of reconstructed track Int_t fTPCLab; // label of TPC track - Int_t fCode; // PDG particle code Float_t fX ; // x cohordinate of the found vertex Float_t fY ; // y cohordinate of the found vertex Float_t fZ ; // z cohordinate of the found vertex Float_t fPx; // x component of track momentum at the found vertex Float_t fPy; // y component of track momentum at the found vertex Float_t fPz; // z component of track momentum at the found vertex - Float_t fPxg; // x component of track momentum read from Geant - Float_t fPyg; // y component of track momentum read from Geant - Float_t fPzg; // z component of track momentum read from Geant + // Int_t fIdPoints[6]; // points assigned to the track (entry # in fRecPoints is given by module #) diff --git a/ITS/AliITSTrackerV1.cxx b/ITS/AliITSTrackerV1.cxx index ee3c388146d..b9afa9a0f9b 100644 --- a/ITS/AliITSTrackerV1.cxx +++ b/ITS/AliITSTrackerV1.cxx @@ -50,7 +50,7 @@ AliITSTrackerV1::AliITSTrackerV1(AliITS* IITTSS, Bool_t flag) { fITS = IITTSS; fPtref=0.; - fChi2max=0.; //aggiunto il 31-7-2001 + fChi2max=0.; fflagvert=flag; Int_t imax=200,jmax=450; frl = new AliITSRad(imax,jmax); @@ -188,7 +188,7 @@ AliITSTrackerV1::AliITSTrackerV1(const AliITSTrackerV1 &cobj) { *fITS = *cobj.fITS; *fresult = *cobj.fresult; fPtref = cobj.fPtref; - fChi2max = cobj.fChi2max; //aggiunto il 31-7-2001 + fChi2max = cobj.fChi2max; **fvettid = **cobj.fvettid; fflagvert = cobj.fflagvert; Int_t imax=200,jmax=450; @@ -256,7 +256,7 @@ AliITSTrackerV1 &AliITSTrackerV1::operator=(AliITSTrackerV1 obj) { *fITS = *obj.fITS; *fresult = *obj.fresult; fPtref = obj.fPtref; - fChi2max = obj.fChi2max; //aggiunto il 31-7-2001 + fChi2max = obj.fChi2max; **fvettid = **obj.fvettid; fflagvert = obj.fflagvert; Int_t imax=200,jmax=450; @@ -320,13 +320,6 @@ void AliITSTrackerV1::DoTracking(Int_t evNumber, Int_t minTr, Int_t maxTr, TFile printf("begin DoTracking - file %p\n",file); - /* commentato eliminazione good - struct GoodTrack { - Int_t lab,code; - Float_t px,py,pz,x,y,z,pxg,pyg,pzg,ptg; - Bool_t flag; - }; - */ gAlice->GetEvent(evNumber); //modificato per gestire hbt @@ -345,35 +338,15 @@ void AliITSTrackerV1::DoTracking(Int_t evNumber, Int_t minTr, Int_t maxTr, TFile tracker->LoadInnerSectors(); tracker->LoadOuterSectors(); - /* commentato per eliminazione good - GoodTrack gt[30000]; - Int_t ngood=0; - ifstream in("itsgood_tracks"); - - cerr<<"Reading itsgood tracks...\n"; - while (in>>gt[ngood].lab>>gt[ngood].code - >>gt[ngood].px >>gt[ngood].py>>gt[ngood].pz - >>gt[ngood].x >>gt[ngood].y >>gt[ngood].z - >>gt[ngood].pxg >>gt[ngood].pyg >>gt[ngood].pzg - >>gt[ngood].ptg >>gt[ngood].flag) { - ngood++; - cerr<IsOpen()) {cerr<<"Can't open AliTPCtracksSorted.root !\n"; return ;} TObjArray tracks(200000); - char tname[100]; //aggiunto per hbt - sprintf(tname,"TreeT_TPC_%d",evNumber); //aggiunto per hbt + char tname[100]; + sprintf(tname,"TreeT_TPC_%d",evNumber); - TTree *tracktree=(TTree*)tf->Get(tname); //modificato per hbt + TTree *tracktree=(TTree*)tf->Get(tname); if (!tracktree) {cerr<<"Can't get a tree with TPC tracks !\n";} TBranch *tbranch=tracktree->GetBranch("tracks"); Int_t nentr=(Int_t)tracktree->GetEntries(); @@ -394,40 +367,6 @@ void AliITSTrackerV1::DoTracking(Int_t evNumber, Int_t minTr, Int_t maxTr, TFile Int_t nt = tracks.GetEntriesFast(); cerr<<"Number of found tracks "<TreeR(); @@ -442,8 +381,8 @@ void AliITSTrackerV1::DoTracking(Int_t evNumber, Int_t minTr, Int_t maxTr, TFile for (mod=0; modResetRecPoints(); // nuova - gAlice->TreeR()->GetEvent(mod); //first entry in TreeR is empty + fITS->ResetRecPoints(); + gAlice->TreeR()->GetEvent(mod); numbpoints = frecPoints->GetEntries(); totalpoints+=numbpoints; np[mod] = numbpoints; @@ -465,33 +404,12 @@ void AliITSTrackerV1::DoTracking(Int_t evNumber, Int_t minTr, Int_t maxTr, TFile AliITSIOTrack *ioTrack=0; tracktree1.Branch("ITStracks","AliITSIOTrack",&ioTrack,32000,0); - // ofstream out ("AliITSTra.out"); //commentato eliminazione good - Int_t j; for (j=minTr; j<=maxTr; j++) { track=(AliTPCtrack*)tracks.UncheckedAt(j); -// Int_t flaglab=0; if (!track) continue; - /* commentato eliminazione good - ////// elimination of not good tracks //////////// - Int_t ilab=TMath::Abs(track->GetLabel()); - Int_t iii; - for (iii=0;iii1.0) fChi2max=40.; //aggiunto il 31-7-2001 + if(fPtref>1.0) fChi2max=40.; if(fPtref<=1.0) fChi2max=20.; if(fPtref<0.4 ) fChi2max=100.; if(fPtref<0.2 ) fChi2max=40.; @@ -577,14 +492,9 @@ void AliITSTrackerV1::DoTracking(Int_t evNumber, Int_t minTr, Int_t maxTr, TFile //if(fPtref<0.2 ) fChi2max=10.; //if(fPtref<0.1 ) fChi2max=5.; - /* - if(fPtref > 1.0 ) fChi2max=30.; - if(fPtref >= 0.6 && fPtref<=1.0) fChi2max=40.; - if(fPtref <= 0.6 && fPtref>0.2) fChi2max=40.; - if(fPtref <= 0.2 ) fChi2max=8.; - */ + //cout << "\n Pt = " << fPtref <<"\n"; //stampa - RecursiveTracking(list); // nuova ITS + RecursiveTracking(list); list->Delete(); delete list; @@ -648,7 +558,6 @@ void AliITSTrackerV1::DoTracking(Int_t evNumber, Int_t minTr, Int_t maxTr, TFile Double_t duepi=2.*TMath::Pi(); if(phivertex>duepi) phivertex-=duepi; if(phivertex<0.) phivertex+=duepi; - //Double_t dtot=TMath::Sqrt(dr*dr+dz*dz); ////////////////////////////////////////////////////////////////////////////////////////// @@ -704,8 +613,6 @@ void AliITSTrackerV1::DoTracking(Int_t evNumber, Int_t minTr, Int_t maxTr, TFile //cout<<" labITS = "<SetIdPoint(il,idpoint); ioTrack->SetIdModule(il,idmodule); } - /* commentato eliminazione good - //cout<<" +++++++++++++ pt e ptg = "<0) signC=1.; else signC=-1.; - - Double_t difphi = (phi - phig)*1000.; - dataOut(kkk)=difphi; kkk++; - dataOut(kkk)=dtot*1.e4; kkk++; - dataOut(kkk)=dr*1.e4; kkk++; - dataOut(kkk)=dz*1.e4; kkk++; - dataOut(kkk)=signC; kkk++; - Int_t r; - for (r=0; r<10; r++) { out<Print(); // stampa memoria } // end for (int j=minTr; j<=maxTr; j++) - - // out.close(); //commentato eliminazione good - - + static Bool_t first=kTRUE; static TFile *tfile; @@ -777,8 +655,8 @@ void AliITSTrackerV1::DoTracking(Int_t evNumber, Int_t minTr, Int_t maxTr, TFile printf("delete vectors\n"); if(np) delete [] np; if(fvettid) delete [] fvettid; - if(fresult) delete fresult; - + if(fresult) {delete fresult; fresult=0;} + } @@ -791,9 +669,28 @@ void AliITSTrackerV1::RecursiveTracking(TList *trackITSlist) { // The authors thank Mariana Bondila to have help them to resolve some problems. July-2000 //Rlayer[0]=4.; Rlayer[1]=7.; Rlayer[2]=14.9; Rlayer[3]=23.8; Rlayer[4]=39.1; Rlayer[5]=43.6; //vecchio + + ////////////////////// + Float_t sigmaphil[6], sigmazl[6]; + sigmaphil[0]=1.44e-6/(fAvrad[0]*fAvrad[0]); + sigmaphil[1]=1.44e-6/(fAvrad[1]*fAvrad[1]); + sigmaphil[2]=1.444e-5/(fAvrad[2]*fAvrad[2]); + sigmaphil[3]=1.444e-5/(fAvrad[3]*fAvrad[3]); + sigmaphil[4]=4e-6/(fAvrad[4]*fAvrad[4]); + sigmaphil[5]=4e-6/(fAvrad[5]*fAvrad[5]); + + sigmazl[0]=1e-2; + sigmazl[1]=1e-2; + sigmazl[2]=7.84e-4; + sigmazl[3]=7.84e-4; + sigmazl[4]=0.6889; + sigmazl[5]=0.6889; + /////////////////////////////////////////////////////////// + Int_t index; - AliITSgeom *g1 = fITS->GetITSgeom(); + AliITSgeom *g1 = fITS->GetITSgeom(); + AliITSRecPoint *recp; for(index =0; indexGetSize(); index++) { AliITSTrackV1 *trackITS = (AliITSTrackV1 *) trackITSlist->At(index); @@ -819,7 +716,7 @@ void AliITSTrackerV1::RecursiveTracking(TList *trackITSlist) { continue; } - if(trackITS->Getfnoclust()>=2) continue; //aggiunto il 30-7-2001 + if(trackITS->Getfnoclust()>=2) continue; Float_t numClustNow = trackITS->GetNumClust(); if(numClustNow) { chi2Now = trackITS->GetChi2(); @@ -827,15 +724,15 @@ void AliITSTrackerV1::RecursiveTracking(TList *trackITSlist) { if(numClustNowfresult->GetChi2()) continue; - //cout<<" chi2Now = "< 1.0 && chi2Now > 30.) continue; if((fPtref >= 0.6 && fPtref<=1.0) && chi2Now > 40.) continue; // if((fPtref <= 0.6 && fPtref>0.2)&& chi2Now > 40.) continue; // if(fPtref <= 0.2 && chi2Now > 8.) continue; - if((fPtref <= 0.6 && fPtref>0.2)&& chi2Now > 30.) continue; //modificato il 28-9 - if(fPtref <= 0.2 && chi2Now > 7.) continue; //modificato il 28-9 + if((fPtref <= 0.6 && fPtref>0.2)&& chi2Now > 30.) continue; + if(fPtref <= 0.2 && chi2Now > 7.) continue; ///////////////////////////// @@ -872,6 +769,7 @@ void AliITSTrackerV1::RecursiveTracking(TList *trackITSlist) { detp=detinters+1; detm=detinters-1; Int_t idetot=1; + /* toucLad(0)=ladinters; toucLad(1)=ladm; toucLad(2)=ladp; toucLad(3)=ladinters; toucLad(4)=ladm; toucLad(5)=ladp; toucLad(6)=ladinters; toucLad(7)=ladm; toucLad(8)=ladp; @@ -891,6 +789,79 @@ void AliITSTrackerV1::RecursiveTracking(TList *trackITSlist) { idetot=6; toucDet(3)=detp; toucDet(4)=detp; toucDet(5)=detp; } + */ + Float_t epsphi=5.0, epsz=5.0; + if(fPtref<0.2) {epsphi=3.; epsz=3.;} + //////////////////////////////////////////////////////////////////////////// +//// nuova definizione idetot e toucLad e toucDet to be transformed in a method +// these values could be modified + Float_t pigre=TMath::Pi(); + Float_t rangephi=5., rangez=5.; + if(layerfin==1 || layerfin ==2){ + rangephi=40.*epsphi*TMath::Sqrt(sigmaphil[layerfin-1]+(*trackITS).GetSigmaphi()); + rangez = 40.*epsz*TMath::Sqrt(sigmazl[layerfin-1]+(*trackITS).GetSigmaZ()); + } + if(layerfin==3 || layerfin ==4){ + //rangephi=30.*fepsphi*TMath::Sqrt(sigmaphil[layerfin-1]+(*trackITS).GetSigmaphi()); + //rangez = 40.*fepsz*TMath::Sqrt(sigmazl[layerfin-1]+(*trackITS).GetSigmaZ()); + rangephi=40.*epsphi*TMath::Sqrt(sigmaphil[layerfin-1]+(*trackITS).GetSigmaphi()); + rangez = 50.*epsz*TMath::Sqrt(sigmazl[layerfin-1]+(*trackITS).GetSigmaZ()); + } + if(layerfin==5 || layerfin ==6){ + rangephi=20.*epsphi*TMath::Sqrt(sigmaphil[layerfin-1]+(*trackITS).GetSigmaphi()); + rangez =5.*epsz*TMath::Sqrt(sigmazl[layerfin-1]+(*trackITS).GetSigmaZ()); + } + Float_t phinters, zinters; + phinters=(*trackITS).Getphi(); + zinters=(*trackITS).GetZ(); + Float_t distz; + Float_t phicm, phicp, distphim, distphip; + phicm=phinters; + if(phinters>fphimax[layerfin-1][ladm]) phicm=phinters-2*pigre; + distphim=TMath::Abs(phicm-fphimax[layerfin-1][ladm]); + phicp=phinters; + if(phinters>fphimin[layerfin-1][ladp]) phicp=phinters-2.*pigre; + distphip=TMath::Abs(phicp-fphimin[layerfin-1][ladp]); + Int_t flagzmin=0; + Int_t flagzmax=0; + idetot=1; + toucLad(0)=ladinters; toucDet(0)=detinters; + if(detm>0) distz=TMath::Abs(zinters-fzmax[layerfin-1][detm-1]); + if(detm>0 && rangez>=distz){ + flagzmin=1; + idetot++; toucLad(idetot-1)=ladinters; toucDet(idetot-1)=detm; + if(rangephi>=distphim){ + idetot++; toucLad(idetot-1)=ladm; toucDet(idetot-1)=detinters; + idetot++; toucLad(idetot-1)=ladm; toucDet(idetot-1)=detm; + } + if(rangephi>=distphip){ + idetot++; toucLad(idetot-1)=ladp; toucDet(idetot-1)=detinters; + idetot++; toucLad(idetot-1)=ladp; toucDet(idetot-1)=detm; + } + } //end detm>0.... + if(detp<=fNdet[layerfin-1]) distz=TMath::Abs(zinters-fzmin[layerfin-1][detp-1]); + if(detp<=fNdet[layerfin-1] && rangez>=distz){ + flagzmax=1; + idetot++; toucLad(idetot-1)=ladinters; toucDet(idetot-1)=detp; + if(rangephi>=distphim){ + idetot++; toucLad(idetot-1)=ladm; toucDet(idetot-1)=detp; + if(flagzmin == 0) {idetot++; toucLad(idetot-1)=ladm; toucDet(idetot-1)=detinters;} + } + if(rangephi>=distphip){ + idetot++; toucLad(idetot-1)=ladp; toucDet(idetot-1)=detp; + if(flagzmin == 0) {idetot++; toucLad(idetot-1)=ladp; toucDet(idetot-1)=detinters;} + } + } //end detm=distphim){idetot++; toucLad(idetot-1)=ladm; toucDet(idetot-1)=detinters;} + if(rangephi>=distphip){idetot++; toucLad(idetot-1)=ladp; toucDet(idetot-1)=detinters;} + } + +/////////////////////////////////////////////////////////////////////////////////////////////////// + + Int_t iriv; for (iriv=0; irivGetModuleIndex(lycur,toucLad(iriv),toucDet(iriv)); + Int_t indexmod; //mod ott + // AliITSRecPoint *recp; + indexmod = g1->GetModuleIndex(lycur,toucLad(iriv),toucDet(iriv)); + //mod ott fITS->ResetRecPoints(); - gAlice->TreeR()->GetEvent(index); - + gAlice->TreeR()->GetEvent(indexmod); Int_t npoints=frecPoints->GetEntries(); + /* mod ott Int_t *indlist=new Int_t[npoints+1]; Int_t counter=0; Int_t ind; @@ -924,7 +896,17 @@ void AliITSTrackerV1::RecursiveTracking(TList *trackITSlist) { if(indlist[ind] < 0) recp=0; else recp = (AliITSRecPoint*)frecPoints->UncheckedAt(indlist[ind]); - if((!recp) ) break; + if((!recp) ) break; + */ +/////////////////////////new + Int_t indnew; + for(indnew=0; indnewUncheckedAt(indnew); + else + continue; + +/////////////////////////////////////////////////////////////////////// TVector cluster(3),vecclust(9); vecclust(6)=vecclust(7)=vecclust(8)=-1.; Double_t sigma[2]; @@ -943,12 +925,13 @@ void AliITSTrackerV1::RecursiveTracking(TList *trackITSlist) { vecclust(2)=global[2]; - vecclust(3) = (float)recp->fTracks[0]; - vecclust(4) = (float)indlist[ind]; - vecclust(5) = (float)index; - vecclust(6) = (float)recp->fTracks[0]; - vecclust(7) = (float)recp->fTracks[1]; - vecclust(8) = (float)recp->fTracks[2]; + vecclust(3) = (Float_t)recp->fTracks[0]; + //vecclust(4) = (Float_t)indlist[ind]; + vecclust(4) = (Float_t)indnew; + vecclust(5) = (Float_t)indexmod; //mod ott + vecclust(6) = (Float_t)recp->fTracks[0]; + vecclust(7) = (Float_t)recp->fTracks[1]; + vecclust(8) = (Float_t)recp->fTracks[2]; sigma[0] = (Double_t) recp->GetSigmaX2(); sigma[1] = (Double_t) recp->GetSigmaZ2(); @@ -961,15 +944,11 @@ void AliITSTrackerV1::RecursiveTracking(TList *trackITSlist) { // cout<<" layer = "<Getalphaprov(); //provvisorio; - //if(cluster(1)<0.) cluster(1)+=2.*TMath::Pi(); //provvisorio - //cout<<" cluster(1) dopo = "<Continue(); // timer if(fflagvert){ - KalmanFilterVert(newTrack,cluster,sigmanew); //come prima - // KalmanFilterVert(newTrack,cluster,sigmanew,chi2pred); //modificata il 30-7-2001 //come prima in kalman filter + KalmanFilterVert(newTrack,cluster,sigmanew); + // KalmanFilterVert(newTrack,cluster,sigmanew,chi2pred); } else{ KalmanFilter(newTrack,cluster,sigmanew); @@ -1031,7 +1010,7 @@ void AliITSTrackerV1::RecursiveTracking(TList *trackITSlist) { } // end of for(;;) on rec points - delete [] indlist; + // delete [] indlist; //mod ott } // end of for on detectors @@ -1503,7 +1482,7 @@ void AliITSTrackerV1::KalmanFilterVert(AliITSTrackV1 *newTrack,TVector &cluster, //cout<<" chi2 kalman = "<SetChi2(newTrack->GetChi2()+chi2); - // newTrack->SetChi2(newTrack->GetChi2()+chi2pred); //aggiunta il 30-7-2001 + // newTrack->SetChi2(newTrack->GetChi2()+chi2pred); } -- 2.43.0