Updated version to work with the current version of the TPC tracking (R.Barbera)
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 31 May 2001 11:57:24 +0000 (11:57 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 31 May 2001 11:57:24 +0000 (11:57 +0000)
ITS/AliITStrack.cxx
ITS/ITStracking.C
ITS/TPCtracks.C

index 15c18b4..0719582 100644 (file)
@@ -446,13 +446,20 @@ void AliITStrack::AddEL(AliITSRad *rl, Double_t signdE, Bool_t flagtot, Double_t
 //  add energy loss
 
   TVector s(6);  
-  //s(0)=0.0026+0.00283; s(1)=0.018; s(2)=0.0094; s(3)=0.0095; s(4)=0.0091; s(5)=0.0087;
+  s(0)=0.0026+0.00283; s(1)=0.018; s(2)=0.0094; s(3)=0.0095; s(4)=0.0091; s(5)=0.0087;
   //0.00277 is added in the first layer to take into account the energy loss in the beam pipe
 
   //for(int k=0; k<6; k++) cout<<s(k)<<" "; cout<<"\n";
-  
+  for(int k=0; k<6; k++) s(k)=s(k)*1.6;
   
   Double_t phi=fX0;
+  
+  if(phi<0.174 ) s(5)=s(5)+0.012; 
+   if(phi>6.1 ) s(5)=s(5)+0.012; // to take into account rail 
+   if(phi>2.96 && phi<3.31 ) s(5)=s(5)+0.012;   
+  
+   
   Double_t tgl=fX3;
   Double_t theta=((TMath::Pi())/2.)-TMath::ATan(tgl);
   //phi*=180./TMath::Pi();
@@ -471,7 +478,7 @@ void AliITStrack::AddEL(AliITSRad *rl, Double_t signdE, Bool_t flagtot, Double_t
   if(i>=imax) i=imax-1;
   if(j<0) j=0;
   if(j>=jmax) j=jmax-1;
-  
+  /*
   s(0) = 0.0028/TMath::Sin(theta)+( rl->GetRadMatrix1() )(i,j);   // 0.0028 takes into account the beam pipe
   s(1) = ( rl->GetRadMatrix2() )(i,j);
   s(2) = ( rl->GetRadMatrix3() )(i,j);
@@ -479,6 +486,9 @@ void AliITStrack::AddEL(AliITSRad *rl, Double_t signdE, Bool_t flagtot, Double_t
   s(4) = ( rl->GetRadMatrix5() )(i,j);
   s(5) = ( rl->GetRadMatrix6() )(i,j);
   
+
+  */  
+  
   //for(int k=0; k<6; k++) cout<<s(k)<<" "; getchar();
     
   //if(phi>60) {cout<<" phi = "<<phi<<"\n"; getchar();}
@@ -508,6 +518,7 @@ void AliITStrack::AddEL(AliITSRad *rl, Double_t signdE, Bool_t flagtot, Double_t
   if(fX4 < 0.) sign=-1.; 
   pt=sign*p/sqcl; 
   Double_t CC=(0.299792458*0.2)/(pt*100.);
+  //Double_t CC=(0.299792458*0.5)/(pt*100.);
   fX4=CC;
   
 }
@@ -540,11 +551,16 @@ void AliITStrack::AddMS(AliITSRad *rl) {
    
   TVector s(6);
 
-  //s(0)=0.0026+0.00283; s(1)=0.018; s(2)=0.0094; s(3)=0.0095; s(4)=0.0091; s(5)=0.0087;
+  s(0)=0.0026+0.00283; s(1)=0.018; s(2)=0.0094; s(3)=0.0095; s(4)=0.0091; s(5)=0.0087;
 //0.00277 is added in the first layer to take into account the energy loss in the beam pipe 
 
-
+  for(int k=0; k<6; k++) s(k)=s(k)*1.6;
+  
   Double_t phi=fX0;
+ if(phi<0.174 ) s(5)=s(5)+0.012; //aggiunta provvisoria
+  if(phi>6.1 ) s(5)=s(5)+0.012; //aggiunta provvisoria  
+   if(phi>2.96 && phi< 3.31) s(5)=s(5)+0.012; //aggiunta provvisoria 
+      
   Double_t tgl=fX3;
   Double_t theta=((TMath::Pi())/2.)-TMath::ATan(tgl);
   Double_t rad40=(TMath::Pi())*40./180.;      // rivedere
@@ -559,14 +575,14 @@ void AliITStrack::AddMS(AliITSRad *rl) {
   if(i>=imax) i=imax-1;
   if(j<0) j=0;
   if(j>=jmax) j=jmax-1;
-  
+  /*
   s(0) = 0.0028/TMath::Sin(theta)+( rl->GetRadMatrix1() )(i,j);   // 0.0028 takes into account the beam pipe
   s(1) = ( rl->GetRadMatrix2() )(i,j);
   s(2) = ( rl->GetRadMatrix3() )(i,j);
   s(3) = ( rl->GetRadMatrix4() )(i,j);
   s(4) = ( rl->GetRadMatrix5() )(i,j);
   s(5) = ( rl->GetRadMatrix6() )(i,j);
-      
+   */   
   Double_t mass=0.1396;
   Int_t layer=(Int_t)GetLayer();
   
index 7616c7a..e256e97 100644 (file)
@@ -1,6 +1,6 @@
 #include "iostream.h"
 
-void ITStracking(Int_t evNumber1=0,Int_t evNumber2=0,int min_t, int max_t,Bool_t flagvert=1) {
+void ITStracking(Int_t evNumber1=0,Int_t evNumber2=0,int min_t=-1, int max_t=0,Bool_t flagvert=1) {
 
   const char *filename="galice.root";
   
index b305efc..88ababb 100644 (file)
@@ -1,5 +1,6 @@
 #ifndef __CINT__
   #include "alles.h"
+ #include "AliTPCtracker.h"  
 #endif
 
 struct GoodTrack {
@@ -16,13 +17,14 @@ Int_t TPCtracks() {
   Int_t i;
    gBenchmark->Start("AliTPCComparison");
   //to run alone 
-// AliKalmanTrack::SetConvConst(100/0.299792458/0.2/gAlice->Field()->Factor());   
+ AliKalmanTrack::SetConvConst(100/0.299792458/0.2/gAlice->Field()->Factor());   
 
    TFile *cf=TFile::Open("AliTPCclusters.root");
    if (!cf->IsOpen()) {cerr<<"Can't open AliTPCclusters.root !\n"; return 1;}
    AliTPCParam *digp= (AliTPCParam*)cf->Get("75x40_100x60");
    if (!digp) { cerr<<"TPC parameters have not been found !\n"; return 2; }
-
+   AliTPCtracker *tracker = new AliTPCtracker(digp);
+/*   
 // Load clusters
    AliTPCClustersArray *ca=new AliTPCClustersArray;
    ca->Setup(digp);
@@ -30,12 +32,18 @@ Int_t TPCtracks() {
    ca->ConnectTree("Segment Tree");
    Int_t nentr=Int_t(ca->GetTree()->GetEntries());
    for (i=0; i<nentr; i++) ca->LoadEntry(i);
-
+*/
+// Load clusters
+   tracker->LoadInnerSectors();
+   tracker->LoadOuterSectors();
+   
 // Load tracks
    TFile *tf=TFile::Open("AliTPCtracks.root");
    if (!tf->IsOpen()) {cerr<<"Can't open AliTPCtracks.root !\n"; return 3;}
    TObjArray tarray(2000);
-   TTree *tracktree=(TTree*)tf->Get("TreeT");
+  // TTree *tracktree=(TTree*)tf->Get("TreeT");
+   TTree *tracktree=(TTree*)tf->Get("TPCf");
+   if (!tracktree) {cerr<<"Can't get a tree with TPC tracks !\n"; return 4;}   
    TBranch *tbranch=tracktree->GetBranch("tracks");
    nentr=(Int_t)tracktree->GetEntries();
    
@@ -44,12 +52,16 @@ Int_t TPCtracks() {
        iotrack=new AliTPCtrack;
        tbranch->SetAddress(&iotrack);
        tracktree->GetEvent(i);
-       iotrack->CookLabel(ca);
+       //iotrack->CookLabel(ca);
+       tracker->CookLabel(iotrack,0.1);       
        tarray.AddLast(iotrack);
-   }   
+   }
+   
+   delete tracker; 
+        
    tf->Close();
 
-   delete ca;
+   //delete ca;
    cf->Close();
 
 /////////////////////////////////////////////////////////////////////////
@@ -88,7 +100,8 @@ Int_t TPCtracks() {
       cerr<<"Preparing tracks for matching with the ITS...\n";
       tarray.Sort();
       tf=TFile::Open("AliTPCtracks.root","recreate");
-      tracktree=new TTree("TreeT","Tree with TPC tracks");
+     // tracktree=new TTree("TreeT","Tree with TPC tracks");
+     tracktree=new TTree("TPCf","Tree with TPC tracks");
       tracktree->Branch("tracks","AliTPCtrack",&iotrack,32000,0);
       for (i=0; i<nentr; i++) {
           iotrack=(AliTPCtrack*)tarray.UncheckedAt(i);
@@ -108,14 +121,26 @@ Int_t TPCtracks() {
    TH1F *hmpt=new TH1F("hmpt","Relative Pt resolution (pt>4GeV/c)",30,-60,60); 
    hmpt->SetFillColor(6);
 
+   AliTPCtrack *trk=(AliTPCtrack*)tarray.UncheckedAt(0);
+   Double_t pmin=0.1*(100/0.299792458/0.2/trk->GetConvConst());
+   Double_t pmax=6.0+pmin;   
+   /*
    TH1F *hgood=new TH1F("hgood","Good tracks",30,0.1,6.1);    
    TH1F *hfound=new TH1F("hfound","Found tracks",30,0.1,6.1);
    TH1F *hfake=new TH1F("hfake","Fake tracks",30,0.1,6.1);
    TH1F *hg=new TH1F("hg","",30,0.1,6.1); //efficiency for good tracks
    hg->SetLineColor(4); hg->SetLineWidth(2);
-   TH1F *hf=new TH1F("hf","Efficiency for fake tracks",30,0.1,6.1);
+   TH1F *hf=new TH1F("hf","Efficiency for fake tracks",30,0.1,6.1);   
    hf->SetFillColor(1); hf->SetFillStyle(3013); hf->SetLineWidth(2);
-
+   */
+   TH1F *hgood=new TH1F("hgood","Good tracks",30,pmin,pmax);    
+   TH1F *hfound=new TH1F("hfound","Found tracks",30,pmin,pmax);
+   TH1F *hfake=new TH1F("hfake","Fake tracks",30,pmin,pmax);
+   TH1F *hg=new TH1F("hg","",30,pmin,pmax); //efficiency for good tracks
+   hg->SetLineColor(4); hg->SetLineWidth(2);
+   TH1F *hf=new TH1F("hf","Efficiency for fake tracks",30,pmin,pmax);
+   hf->SetFillColor(1); hf->SetFillStyle(3013); hf->SetLineWidth(2);
+      
    TH1F *he =new TH1F("he","dE/dX for pions with 0.4<p<0.5 GeV/c",50,0.,100.);
    TH2F *hep=new TH2F("hep","dE/dX vs momentum",50,0.,2.,50,0.,200.);
    hep->SetMarkerStyle(8);
@@ -135,6 +160,7 @@ Int_t TPCtracks() {
       Float_t ptg=
       TMath::Sqrt(gt[ngood].px*gt[ngood].px + gt[ngood].py*gt[ngood].py);
 
+      if (ptg<pmin) continue;
       hgood->Fill(ptg);
 
       AliTPCtrack *track=0;
@@ -266,12 +292,17 @@ Int_t TPCtracks() {
    hg->SetYTitle("Tracking efficiency");
    hg->SetXTitle("Pt (GeV/c)");
    hg->Draw();
-
+   /*
    TLine *line1 = new TLine(0,1.0,7,1.0); line1->SetLineStyle(4);
    line1->Draw("same");
    TLine *line2 = new TLine(0,0.9,7,0.9); line2->SetLineStyle(4);
    line2->Draw("same");
-
+    */
+   TLine *line1 = new TLine(pmin,1.0,pmax,1.0); line1->SetLineStyle(4);
+   line1->Draw("same");
+   TLine *line2 = new TLine(pmin,0.9,pmax,0.9); line2->SetLineStyle(4);
+   line2->Draw("same"); 
+      
    hf->SetFillColor(1);
    hf->SetFillStyle(3013);
    hf->SetLineColor(2);
@@ -390,7 +421,8 @@ Int_t good_tracks(GoodTrack *gt, Int_t max) {
           digp->AdjustSectorRow(digits->GetID(),sec,row);
           cerr<<sec<<' '<<row<<"                                     \r";
           digits->First();
-          while (digits->Next()) {
+         // while (digits->Next()) {
+          do { //Many thanks to J.Chudoba who noticed this      
               Int_t it=digits->CurrentRow(), ip=digits->CurrentColumn();
               Short_t dig = digits->GetDigit(it,ip);
               Int_t idx0=digits->GetTrackID(it,ip,0); 
@@ -399,7 +431,7 @@ Int_t good_tracks(GoodTrack *gt, Int_t max) {
               if (idx0>=0 && dig>=zero) count[idx0]+=1;
               if (idx1>=0 && dig>=zero) count[idx1]+=1;
               if (idx2>=0 && dig>=zero) count[idx2]+=1;
-          }
+          } while (digits->Next());
           for (Int_t j=0; j<np; j++) {
               if (count[j]>1) {
                  if (sec>=digp->GetNInnerSector())
@@ -468,7 +500,7 @@ Int_t good_tracks(GoodTrack *gt, Int_t max) {
    }
    delete[] good;
 
-   //delete gAlice; gAlice=0;
+   delete gAlice; gAlice=0;
 
    file->Close();
    gBenchmark->Stop("AliTPCComparison");