- fix names and units of axes
authorkkanaki <kkanaki@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 13 Jan 2011 16:55:30 +0000 (16:55 +0000)
committerkkanaki <kkanaki@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 13 Jan 2011 16:55:30 +0000 (16:55 +0000)
HLT/QA/tasks/AliAnalysisTaskHLTCentralBarrel.cxx
HLT/QA/tasks/macros/drawTHnSparse.C

index 8903cb3..f0fae3e 100644 (file)
@@ -38,6 +38,7 @@
 #include "TString.h"
 #include "TText.h"
 #include "TTimeStamp.h"
+#include "TH1.h"
 
 ClassImp(AliAnalysisTaskHLTCentralBarrel)
 //_______________________________________________________________________________________________//
@@ -259,9 +260,9 @@ void AliAnalysisTaskHLTCentralBarrel::UserExec(Option_t *){
       Double_t trackHLT[] = {
                               TMath::Abs(esdTrackHLT->Pt())
                              ,esdTrackHLT->GetTPCNcls()    
-                             ,esdTrackHLT->Theta()         
+                             ,esdTrackHLT->Theta()
                              ,esdTrackHLT->Eta()           
-                             ,esdTrackHLT->Phi()           
+                             ,esdTrackHLT->Phi()
                              ,dca[0]                       
                              ,dca[1]                       
                              ,esdTrackHLT->Charge()        
@@ -311,9 +312,9 @@ THnSparseF* AliAnalysisTaskHLTCentralBarrel::CreateEventTHnSparse(const char* na
 //see header for documentation                     
   
   THnSparseF *thn = new THnSparseF(name,"",size,bins,min,max);
-  thn->GetAxis(0)->SetTitle("vertex x (cm)");
-  thn->GetAxis(1)->SetTitle("vertex y (cm)");
-  thn->GetAxis(2)->SetTitle("vertex z (cm)");
+  thn->GetAxis(0)->SetTitle("primary vertex x");
+  thn->GetAxis(1)->SetTitle("primary vertex y");
+  thn->GetAxis(2)->SetTitle("primary vertex z");
   thn->GetAxis(3)->SetTitle("number of contributors");
   thn->GetAxis(4)->SetTitle("track multiplicity");
   thn->GetAxis(5)->SetTitle("vertex status"); 
@@ -324,17 +325,17 @@ THnSparseF* AliAnalysisTaskHLTCentralBarrel::CreateTrackTHnSparse(const char* na
 //see header for documentation                     
   
   THnSparseF *thn = new THnSparseF(name,"",size,bins,min,max);
-  thn->GetAxis(0)->SetTitle("transverse momentum");
-  thn->GetAxis(1)->SetTitle("TPC clusters per track");
-  thn->GetAxis(2)->SetTitle("theta");
-  thn->GetAxis(3)->SetTitle("eta");
-  thn->GetAxis(4)->SetTitle("phi");
+  thn->GetAxis(0)->SetTitle("p_{T}");
+  thn->GetAxis(1)->SetTitle("TPC clusters/track");
+  thn->GetAxis(2)->SetTitle("#theta");
+  thn->GetAxis(3)->SetTitle("#eta");
+  thn->GetAxis(4)->SetTitle("#phi");
   thn->GetAxis(5)->SetTitle("DCAr");
   thn->GetAxis(6)->SetTitle("DCAz");
-  thn->GetAxis(7)->SetTitle("charge");
+  thn->GetAxis(7)->SetTitle("polarity");
   thn->GetAxis(8)->SetTitle("DCArSG");
   thn->GetAxis(9)->SetTitle("DCAzSG");
-  thn->GetAxis(10)->SetTitle("ITS clusters per track");  
+  thn->GetAxis(10)->SetTitle("ITS clusters/track");  
   return thn;
 }
 
index 4fb8f8a..ccb5226 100644 (file)
@@ -216,6 +216,20 @@ void plotAid(TCanvas* can, THnSparse* hOFF, THnSparse* hHLT, TText* hText, TH1D
       off = hOFF->Projection(i); 
       
       hlt->SetTitle(fix1DTitle(hHLT->Projection(i)->GetTitle())); 
+   
+      TString s = hlt->GetTitle();      
+      if(s.Contains("p_")){ 
+         s+=" (GeV/c)";
+        hlt->SetXTitle(s);     
+      }
+      else if(s.Contains("theta") || s.Contains("phi")){
+         s+=" (rad)"; 
+        hlt->SetXTitle(s);
+      }
+      else if(s.Contains("DCA")){
+         s+=" (cm)";
+        hlt->SetXTitle(s);
+      }
         
       defineYaxisMax(hlt, off);
       //off->SetLineColor(2);
@@ -252,6 +266,9 @@ void plot2D(TCanvas* can, THnSparse* h,
   can->cd(1);    
   TH2D *ht = h->Projection(1,0);
   ht->SetTitle(fix2DTitle(h->Projection(1)->GetTitle(), h->Projection(0)->GetTitle()));
+
+  TString s = fix1DTitle(h->Projection(0)->GetTitle())+" (GeV/c)";
+  ht->SetXTitle(s);
   ht->Draw("colz");
   
   can->cd(2);
@@ -262,31 +279,45 @@ void plot2D(TCanvas* can, THnSparse* h,
   can->cd(3);
   ht = h->Projection(1,5);
   ht->SetTitle(fix2DTitle(h->Projection(1)->GetTitle(), h->Projection(5)->GetTitle()));
+  TString s = fix1DTitle(h->Projection(5)->GetTitle())+" (cm)";
+  ht->SetXTitle(s);
   ht->Draw("colz");
   
   can->cd(4);
   ht = h->Projection(1,6);
   ht->SetTitle(fix2DTitle(h->Projection(1)->GetTitle(), h->Projection(6)->GetTitle()));
+  TString s = fix1DTitle(h->Projection(6)->GetTitle())+" (cm)";
+  ht->SetXTitle(s);
   ht->Draw("colz");
   
   can->cd(5);
   ht = h->Projection(6,0);
   ht->SetTitle(fix2DTitle(h->Projection(6)->GetTitle(), h->Projection(0)->GetTitle()));
+  TString s = fix1DTitle(h->Projection(0)->GetTitle())+" (GeV/c)";
+  ht->SetXTitle(s);
+  TString s = fix1DTitle(h->Projection(6)->GetTitle())+" (cm)";
+  ht->SetYTitle(s);
   ht->Draw("colz");
   
   can->cd(6);
   ht = h->Projection(6,3);
   ht->SetTitle(fix2DTitle(h->Projection(6)->GetTitle(), h->Projection(3)->GetTitle()));
+  TString s = fix1DTitle(h->Projection(6)->GetTitle())+" (cm)";
+  ht->SetYTitle(s);
   ht->Draw("colz");
   
   can->cd(7);
   ht = h->Projection(3,0);
   ht->SetTitle(fix2DTitle(h->Projection(3)->GetTitle(), h->Projection(0)->GetTitle()));
+  TString s = fix1DTitle(h->Projection(0)->GetTitle())+" (GeV/c)";
+  ht->SetXTitle(s);
   ht->Draw("colz");
   
   can->cd(8);
   ht = h->Projection(3,4);
   ht->SetTitle(fix2DTitle(h->Projection(3)->GetTitle(), h->Projection(4)->GetTitle()));
+  TString s = fix1DTitle(h->Projection(4)->GetTitle())+" (rad)";
+  ht->SetXTitle(s);
   ht->Draw("colz"); 
 }
 
@@ -295,7 +326,13 @@ void plotAid(TCanvas* can, THnSparse* hOFF, THnSparse* hHLT, TText* hText, TH1D
   for(int i=0; i<size; i++){         
       hlt = hHLT->Projection(i);
       off = hOFF->Projection(i); 
-      hlt->SetTitle(fix1DTitle(hHLT->Projection(i)->GetTitle()));
+      hlt->SetTitle(fix1DTitle(hHLT->Projection(i)->GetTitle()));      
+      TString s = hlt->GetTitle();      
+      if(s.Contains("primary")){ 
+         s+=" (cm)";
+        hlt->SetXTitle(s);     
+      }
+     
       defineYaxisMax(hlt, off);
       off->SetLineColor(2);