]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Create summary postrcript file
authormarian <marian@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 12 Jun 2010 16:01:17 +0000 (16:01 +0000)
committermarian <marian@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 12 Jun 2010 16:01:17 +0000 (16:01 +0000)
(Marian)

TPC/CalibMacros/CalibCosmic.C

index 8dd08a1eccddcd252f2dd21bf1785fd8b916644d..a4ad97f506421c2e78e749776c4e0fd113522e79 100644 (file)
@@ -3,7 +3,11 @@ Draw result of perfomance test:
 
 aliroot -b -q  $ALICE_ROOT/TPC/scripts/loadTPCcalib.C $ALICE_ROOT/TPC/CalibMacros/CalibCosmic.C
 
-  //gROOT->Macro("~/NimStyle.C");
+  //gROOT->Macro("~/NimStyle.C"); 
+  gSystem->AddIncludePath("-I$ALICE_ROOT/STAT")
+  gSystem->AddIncludePath("-I$ALICE_ROOT/TPC")
+  gSystem->AddIncludePath("-I$ALICE_ROOT/TPC/macros")
+
   gSystem->Load("libANALYSIS");
   gSystem->Load("libTPCcalib");
   .L $ALICE_ROOT/TPC/CalibMacros/CalibCosmic.C
@@ -20,9 +24,47 @@ aliroot -b -q  $ALICE_ROOT/TPC/scripts/loadTPCcalib.C $ALICE_ROOT/TPC/CalibMacro
 
 */  
 
-AliTPCcalibCosmic * cosmic =0;
+#if !defined(__CINT__) || defined(__MAKECINT__)
+#include "THnSparse.h"
+#include "TLatex.h"
+#include "TCanvas.h"
+#include "TLegend.h"
+#include "TSystem.h"
+#include "TFile.h"
+#include "TChain.h"
+#include "TCut.h"
+#include "TH3.h"
+#include "TH2F.h"
+#include "TProfile3D.h"
+#include "TMath.h" 
+#include "TVectorD.h"
+#include "TMatrixD.h"
+#include "TTreeStream.h"
+#include "AliExternalTrackParam.h"
+#include "AliESDfriend.h"
+#include "AliTPCcalibCosmic.h"
+#include "TROOT.h"
+#include "TPostScript.h"
+#include "TStyle.h"
+#include "AliTrackerBase.h"
+#include "AliTPCExBEffective.h"
+#include "TEntryList.h"
+#include "TLegend.h"
+#endif
+
+
+class AliTPCcalibCosmic;
+AliTPCcalibCosmic * cosmicScan =0;
 TObjArray fitArr;
-Int_t colors[3]={1,3,4};
+Int_t colors[3]={1,2,4};
+TObjArray *picArray = new TObjArray();
+const char * chsign[3]={"all", "Positive","Negative"};
+void Init();
+void SetRangeAll(Int_t axis, Float_t xmin, Float_t xmax);
+void SetDefaultCut();
+void  MakeDefaultPlots();
+
+
 
 void CalibCosmic(){
   // init
@@ -35,8 +77,9 @@ void CalibCosmic(){
 void Init(){
   //
   //
-  TFile fcalib("CalibObjectsTrain1.root");
-  cosmic = ( AliTPCcalibCosmic *)fcalib.Get("cosmicTPC");
+  TH1::AddDirectory(0);
+  TFile fcalib("TPCCosmicObjects.root");
+  cosmicScan = ( AliTPCcalibCosmic *)fcalib.Get("cosmicTPC");
   TString axisName[9];
   axisName[0]  ="#Delta"; axisName[1]  ="N_{cl}";
   axisName[2]  ="DCA_{r}(cm)";
@@ -47,10 +90,10 @@ void Init(){
   {
   for (Int_t ivar=0;ivar<6;ivar++){
     for (Int_t ivar2=0;ivar2<9;ivar2++){      
-      cosmic->fHistoDelta[ivar]->GetAxis(ivar2)->SetName(axisName[ivar2].Data());
-      cosmic->fHistoDelta[ivar]->GetAxis(ivar2)->SetTitle(axisName[ivar2].Data());
-      cosmic->fHistoPull[ivar]->GetAxis(ivar2)->SetName(axisName[ivar2].Data());
-      cosmic->fHistoPull[ivar]->GetAxis(ivar2)->SetTitle(axisName[ivar2].Data());
+      cosmicScan->fHistoDelta[ivar]->GetAxis(ivar2)->SetName(axisName[ivar2].Data());
+      cosmicScan->fHistoDelta[ivar]->GetAxis(ivar2)->SetTitle(axisName[ivar2].Data());
+      cosmicScan->fHistoPull[ivar]->GetAxis(ivar2)->SetName(axisName[ivar2].Data());
+      cosmicScan->fHistoPull[ivar]->GetAxis(ivar2)->SetTitle(axisName[ivar2].Data());
     }
   }
   }
@@ -60,8 +103,8 @@ void SetRangeAll(Int_t axis, Float_t xmin, Float_t xmax){
 
   for (Int_t i=0;i<6;i++){
     //
-    cosmic->fHistoDelta[i]->GetAxis(axis)->SetRangeUser(xmin,xmax);
-    cosmic->fHistoPull[i]->GetAxis(axis)->SetRangeUser(xmin,xmax);
+    cosmicScan->fHistoDelta[i]->GetAxis(axis)->SetRangeUser(xmin,xmax);
+    cosmicScan->fHistoPull[i]->GetAxis(axis)->SetRangeUser(xmin,xmax);
   }
 }
 
@@ -70,32 +113,33 @@ void SetDefaultCut(){
   for (Int_t i=0;i<6;i++){
     //
     //cut on number of clusters
-    cosmic->fHistoDelta[i]->GetAxis(1)->SetRangeUser(120,200);
-    cosmic->fHistoPull[i]->GetAxis(1)->SetRangeUser(120,200);
+    cosmicScan->fHistoDelta[i]->GetAxis(1)->SetRangeUser(130,200);
+    cosmicScan->fHistoPull[i]->GetAxis(1)->SetRangeUser(130,200);
     //cut on DCA r
-    cosmic->fHistoDelta[i]->GetAxis(2)->SetRangeUser(0,15);
-    cosmic->fHistoPull[i]->GetAxis(2)->SetRangeUser(0,15);
+    cosmicScan->fHistoDelta[i]->GetAxis(2)->SetRangeUser(0,15);
+    cosmicScan->fHistoPull[i]->GetAxis(2)->SetRangeUser(0,15);
     //cut on z at
-    cosmic->fHistoDelta[i]->GetAxis(3)->SetRangeUser(20,200);
-    cosmic->fHistoPull[i]->GetAxis(3)->SetRangeUser(20,200);
+    cosmicScan->fHistoDelta[i]->GetAxis(3)->SetRangeUser(-20,20);
+    cosmicScan->fHistoPull[i]->GetAxis(3)->SetRangeUser(-20,20);
   }
-  cosmic->fHistoDelta[0]->GetAxis(0)->SetRangeUser(-1,1);
-  cosmic->fHistoDelta[1]->GetAxis(0)->SetRangeUser(-1,1);
+  cosmicScan->fHistoDelta[0]->GetAxis(0)->SetRangeUser(-1,1);
+  cosmicScan->fHistoDelta[1]->GetAxis(0)->SetRangeUser(-1,1);
+  cosmicScan->fHistoDelta[4]->GetAxis(0)->SetRangeUser(-0.1,0.1);
 }
 
 TH2 * GetDelta2D(Int_t type, Int_t var){
-  TH2 * his = cosmic->fHistoDelta[type]->Projection(0,var);
-  his->SetXTitle(cosmic->fHistoDelta[type]->GetAxis(var)->GetName());
-  his->SetYTitle(cosmic->fHistoDelta[type]->GetAxis(0)->GetName());
+  TH2 * his = cosmicScan->fHistoDelta[type]->Projection(0,var);
+  his->SetXTitle(cosmicScan->fHistoDelta[type]->GetAxis(var)->GetName());
+  his->SetYTitle(cosmicScan->fHistoDelta[type]->GetAxis(0)->GetName());
   return his;
 }
 
 
 TH1* GetFit2D(Int_t type, Int_t var, Bool_t resol){
   
-  TH2 * his = cosmic->fHistoDelta[type]->Projection(0,var);
-  his->SetXTitle(cosmic->fHistoDelta[type]->GetAxis(var)->GetName());
-  his->SetYTitle(cosmic->fHistoDelta[type]->GetAxis(0)->GetName());
+  TH2 * his = cosmicScan->fHistoDelta[type]->Projection(0,var);
+  his->SetXTitle(cosmicScan->fHistoDelta[type]->GetAxis(var)->GetName());
+  his->SetYTitle(cosmicScan->fHistoDelta[type]->GetAxis(0)->GetName());
   his->FitSlicesY(0,0,-1,0,"QNR",&fitArr);
   TH1 * hres = 0;
   if (resol) hres = (TH1*)(fitArr.At(2)->Clone());
@@ -109,23 +153,23 @@ TH1* GetFit2D(Int_t type, Int_t var, Bool_t resol){
 
 
 TH1 * GetDelta(Int_t type){
-  TH1 * his = cosmic->fHistoDelta[type]->Projection(0);
-  his->SetXTitle(cosmic->fHistoDelta[type]->GetAxis(0)->GetName());
+  TH1 * his = cosmicScan->fHistoDelta[type]->Projection(0);
+  his->SetXTitle(cosmicScan->fHistoDelta[type]->GetAxis(0)->GetName());
   return his;
 }
 
 TH2 * GetPull2D(Int_t type, Int_t var){
-  TH2 * his = cosmic->fHistoPull[type]->Projection(0,var);
-  his->SetXTitle(cosmic->fHistoPull[type]->GetAxis(var)->GetName());
-  his->SetYTitle(cosmic->fHistoPull[type]->GetAxis(0)->GetName());
+  TH2 * his = cosmicScan->fHistoPull[type]->Projection(0,var);
+  his->SetXTitle(cosmicScan->fHistoPull[type]->GetAxis(var)->GetName());
+  his->SetYTitle(cosmicScan->fHistoPull[type]->GetAxis(0)->GetName());
   return his;
 }
 
 TH1* GetPull2DSigma(Int_t type, Int_t var){
   
-  TH2 * his = cosmic->fHistoPull[type]->Projection(0,var);
-  his->SetXTitle(cosmic->fHistoPull[type]->GetAxis(var)->GetName());
-  his->SetYTitle(cosmic->fHistoPull[type]->GetAxis(0)->GetName());
+  TH2 * his = cosmicScan->fHistoPull[type]->Projection(0,var);
+  his->SetXTitle(cosmicScan->fHistoPull[type]->GetAxis(var)->GetName());
+  his->SetYTitle(cosmicScan->fHistoPull[type]->GetAxis(0)->GetName());
   his->FitSlicesY(0,0,-1,0,"QNR",&fitArr);
   TH1 * hres = (TH1*)(fitArr.At(2)->Clone());
   return hres;
@@ -134,13 +178,13 @@ TH1* GetPull2DSigma(Int_t type, Int_t var){
 
 
 TH1 * GetPull(Int_t type){
-  TH1 * his = cosmic->fHistoPull[type]->Projection(0);
-  his->SetXTitle(cosmic->fHistoPull[type]->GetAxis(0)->GetName());
+  TH1 * his = cosmicScan->fHistoPull[type]->Projection(0);
+  his->SetXTitle(cosmicScan->fHistoPull[type]->GetAxis(0)->GetName());
   return his;
 }
 
 
-void DrawResoldEdx(AliTPCcalibCosmic *cosmic){
+void DrawResoldEdx(){
   //
   //
   //
@@ -152,21 +196,21 @@ void DrawResoldEdx(AliTPCcalibCosmic *cosmic){
   TH1 * hResolTot[4];
   //  
   for (Int_t ipad=0;ipad<4;ipad++){
-    cosmic->fHistodEdxTot[ipad]->GetAxis(4)->SetRangeUser(-0.6,0.6);
-    cosmic->fHistodEdxMax[ipad]->GetAxis(4)->SetRangeUser(-0.6,0.6);
+    cosmicScan->fHistodEdxTot[ipad]->GetAxis(4)->SetRangeUser(-0.6,0.6);
+    cosmicScan->fHistodEdxMax[ipad]->GetAxis(4)->SetRangeUser(-0.6,0.6);
   }
-  cosmic->fHistodEdxTot[0]->GetAxis(1)->SetRangeUser(30,62);
-  cosmic->fHistodEdxTot[1]->GetAxis(1)->SetRangeUser(30,62);
-  cosmic->fHistodEdxTot[2]->GetAxis(1)->SetRangeUser(10,35);
-  cosmic->fHistodEdxTot[3]->GetAxis(1)->SetRangeUser(10,150);
-  cosmic->fHistodEdxMax[0]->GetAxis(1)->SetRangeUser(30,62);
-  cosmic->fHistodEdxMax[1]->GetAxis(1)->SetRangeUser(30,62);
-  cosmic->fHistodEdxMax[2]->GetAxis(1)->SetRangeUser(10,35);
-  cosmic->fHistodEdxMax[3]->GetAxis(1)->SetRangeUser(10,150);
+  cosmicScan->fHistodEdxTot[0]->GetAxis(1)->SetRangeUser(30,62);
+  cosmicScan->fHistodEdxTot[1]->GetAxis(1)->SetRangeUser(30,62);
+  cosmicScan->fHistodEdxTot[2]->GetAxis(1)->SetRangeUser(10,35);
+  cosmicScan->fHistodEdxTot[3]->GetAxis(1)->SetRangeUser(10,150);
+  cosmicScan->fHistodEdxMax[0]->GetAxis(1)->SetRangeUser(30,62);
+  cosmicScan->fHistodEdxMax[1]->GetAxis(1)->SetRangeUser(30,62);
+  cosmicScan->fHistodEdxMax[2]->GetAxis(1)->SetRangeUser(10,35);
+  cosmicScan->fHistodEdxMax[3]->GetAxis(1)->SetRangeUser(10,150);
   //
 
   for (Int_t ipad=0;ipad<4;ipad++){
-    htemp = cosmic->fHistodEdxTot[ipad]->Projection(0,1);
+    htemp = cosmicScan->fHistodEdxTot[ipad]->Projection(0,1);
     htemp->FitSlicesY(0,0,-1,0,"QNR",&arr);
     hResolTot[ipad] = (TH1*)(arr.At(2)->Clone());
     delete htemp;
@@ -174,7 +218,7 @@ void DrawResoldEdx(AliTPCcalibCosmic *cosmic){
     arr.Delete();
     hResolTot[ipad]->Scale(1./TMath::Sqrt(2.));
     //
-    htemp = cosmic->fHistodEdxMax[ipad]->Projection(0,1);
+    htemp = cosmicScan->fHistodEdxMax[ipad]->Projection(0,1);
     htemp->FitSlicesY(0,0,-1,0,"QNR",&arr);
     hResolMax[ipad] = (TH1*)(arr.At(2)->Clone());
     delete htemp;
@@ -207,13 +251,13 @@ void DrawStat(Int_t coord, TObjArray *array=0){
   //
   //
   //
-  TCanvas *cStat = new TCanvas(Form("Cosmic stat%d",coord), Form("CosmicStat%d",coord),800,600);
+  TCanvas *cStat = new TCanvas(Form("Cosmic stat%d",coord), Form("CosmicStat%d",coord),1000,800);
   Float_t mx0=0.2, mx1=0.05, my0=0.15, my1=0.1;
-  //pad->SetMargin(mx0,mx1,my0,my1);
+  cStat->SetMargin(mx0,mx1,my0,my1);
   cStat->Divide(3,3);
-  for (Int_t i=0; i<8; i++){
+  for (Int_t i=1; i<8; i++){
     cStat->cd(i+1);
-    cosmic->fHistoDelta[0]->Projection(i)->Draw();
+    cosmicScan->fHistoDelta[0]->Projection(i)->Draw();
   }
   if (array) array->AddLast(cStat);
 }
@@ -223,24 +267,33 @@ void SetStylePad(TVirtualPad *pad){
   pad->SetMargin(mx0,mx1,my0,my1);
   pad->SetTicks(1,1);
   pad->SetGrid(1,1); 
+  
 }
 
 void MakePlotPt(TObjArray * array){
   //
   //
-  TCanvas *cptRes = new TCanvas("TPCPtResol","TPCPtResol",600,500);
+  TCanvas *cptRes = new TCanvas("TPCPtResol","TPCPtResol",900,600);
   cptRes->Divide(2,1);
   SetStylePad(cptRes->cd(1));
-  SetStylePad(cptRes->cd(2));
+  SetStylePad(cptRes->cd(2)); 
+  cptRes->cd(1);
+  TLegend *legend = new TLegend(0.2,0.7,0.6,0.9,"");
+
   //
   TH1 * hisRes=0;
   TH1 * hisMean=0;
   for (Int_t i=0; i<3; i++){
-    if (i==0) cosmic->fHistoDelta[5]->GetAxis(6)->SetRangeUser(0,2);
-    if (i==1) cosmic->fHistoDelta[5]->GetAxis(6)->SetRangeUser(-2,0);
-    if (i==2) cosmic->fHistoDelta[5]->GetAxis(6)->SetRangeUser(-2,2);  
-    hisRes  = GetFit2D(5,7,kTRUE);
-    hisMean = GetFit2D(5,7,kFALSE);
+    if (i==0) cosmicScan->fHistoDelta[5]->GetAxis(6)->SetRangeUser(-1,1);  
+    if (i==1) cosmicScan->fHistoDelta[5]->GetAxis(6)->SetRangeUser(0.001,1);
+    if (i==2) cosmicScan->fHistoDelta[5]->GetAxis(6)->SetRangeUser(-1,-0.001);
+    hisRes  = (TH1*)GetFit2D(5,7,kTRUE)->Clone();
+    hisMean = (TH1*)GetFit2D(5,7,kFALSE)->Clone();
+    hisMean->SetName(Form("#Deltap_{t}/p_{t} %s",chsign[i]));
+    hisRes->SetName(Form("#sigma_{p_{t}}/p_{t} %s",chsign[i]));
+    hisMean->SetTitle(Form("#Delta_{p_{t}}/p_{t} %s",chsign[i]));
+    hisRes->SetTitle(Form("#sigma_{p_{t}}/p_{t} %s",chsign[i]));
+
     hisRes->SetMarkerStyle(20);
     hisMean->SetMarkerStyle(20);
     hisRes->SetMarkerColor(colors[i]);
@@ -251,19 +304,19 @@ void MakePlotPt(TObjArray * array){
     hisRes->SetMinimum(0);
     hisMean->SetMaximum(20);
     hisMean->SetMinimum(-20);
-    hisRes->SetName("Pt resol");
-    hisRes->SetName("p_{t} resolution");
     hisRes->SetYTitle("#sigma_{p_{t}}/p_{t} (%)");
     hisMean->SetYTitle("#Delta_{p_{t}}/p_{t} (%)");
-    hisRes->GetXaxis()->SetRangeUser(0,10);
-    hisMean->GetXaxis()->SetRangeUser(0,10);  
+    hisRes->GetXaxis()->SetRangeUser(0,50);
+    hisMean->GetXaxis()->SetRangeUser(0,50);  
     cptRes->cd(2); 
     hisRes->Draw("same");
     if (i==0) hisRes->Draw("");
     cptRes->cd(1);
     hisMean->Draw("same");
     if (i==0) hisMean->Draw("");
+    legend->AddEntry(hisMean);
   }
+  legend->Draw();
   if (array) array->AddLast(cptRes);
 }
 
@@ -271,43 +324,51 @@ void MakePlotPt(TObjArray * array){
 void MakePlotP4(TObjArray * array){
   //
   //
-  TCanvas *cptRes = new TCanvas("TPCP4Resol","TPCP4Resol",600,500);
+  TCanvas *cptRes = new TCanvas("TPCP4Resol","TPCP4Resol",900,600);
   cptRes->Divide(2,1);
   SetStylePad(cptRes->cd(1));
   SetStylePad(cptRes->cd(2));
+  cptRes->cd(1);
+  TLegend *legend = new TLegend(0.2,0.7,0.6,0.9,"");
+
   //
   TH1 * hisRes  =0;
-  TH1 * hisMeanP=0;
-  
+  TH1 * hisMean=0;
+
   for (Int_t i=0; i<3; i++){
-    if (i==0) cosmic->fHistoDelta[4]->GetAxis(6)->SetRangeUser(0,2);
-    if (i==1) cosmic->fHistoDelta[4]->GetAxis(6)->SetRangeUser(-2,0);
-    if (i==2) cosmic->fHistoDelta[4]->GetAxis(6)->SetRangeUser(-2,2);
-    hisRes  = GetFit2D(4,7,kTRUE);
-    hisMean = GetFit2D(4,7,kFALSE);
+    if (i==0) cosmicScan->fHistoDelta[4]->GetAxis(6)->SetRangeUser(-1,1);
+    if (i==1) cosmicScan->fHistoDelta[4]->GetAxis(6)->SetRangeUser(0.001,1);
+    if (i==2) cosmicScan->fHistoDelta[4]->GetAxis(6)->SetRangeUser(-1,-0.001);
+    hisRes  = (TH1*)GetFit2D(4,7,kTRUE)->Clone();
+    hisMean = (TH1*)GetFit2D(4,7,kFALSE)->Clone();
+    hisMean->SetName(Form("#Delta_{1/p_{t}} %s",chsign[i]));
+    hisRes->SetName(Form("#sigma_{1/p_{t}} %s",chsign[i]));
+    hisMean->SetTitle(Form("#Delta_{1/p_{t}} %s",chsign[i]));
+    hisRes->SetTitle(Form("#sigma_{1/p_{t}} %s",chsign[i]));
+
     hisRes->SetMarkerStyle(20+i);
     hisMean->SetMarkerStyle(20+i);
     hisMean->SetMarkerColor(colors[i]);
     hisRes->SetMarkerColor(colors[i]);
-    hisRes->SetMaximum(0.04);
+    hisRes->SetMaximum(0.02);
     hisRes->SetMinimum(-0.0);
     hisMean->SetMaximum(0.02);
     hisMean->SetMinimum(-0.02);
-    hisRes->SetName("C resol");
-    hisRes->SetName("C resolution");
-    hisRes->SetYTitle("#sigma_{C} (1/GeV)");
-    hisMean->SetYTitle("#Delta_{C} (1/GeV)");
+    hisRes->SetYTitle("#sigma_{1/pt} (1/GeV)");
+    hisMean->SetYTitle("#Delta_{1/pt} (1/GeV)");
     hisMean->SetXTitle("p_{t} (GeV)");
     hisRes->SetXTitle("p_{t} (GeV)");
-    hisRes->GetXaxis()->SetRangeUser(0,10);
-    hisMean->GetXaxis()->SetRangeUser(0,10);      
+    hisRes->GetXaxis()->SetRangeUser(0,50);
+    hisMean->GetXaxis()->SetRangeUser(0,50);      
     cptRes->cd(2); 
     hisRes->Draw("same");
     if (i==0) hisRes->Draw("");
     cptRes->cd(1);
     hisMean->Draw("same");
     if (i==0) hisMean->Draw("");
+    legend->AddEntry(hisMean);
   }
+  legend->Draw();
   if (array) array->AddLast(cptRes);
 }
 
@@ -319,19 +380,27 @@ void MakePlotP4(TObjArray * array){
 void MakePlotPosY(TObjArray * array){
   //
   //
-  TCanvas *cptRes = new TCanvas("TPCPosResolY","TPCPosResolY",600,500);
+  TCanvas *cptRes = new TCanvas("TPCPosResolY","TPCPosResolY",900,600);
   cptRes->Divide(2,1);
   SetStylePad(cptRes->cd(1));
   SetStylePad(cptRes->cd(2));
+  cptRes->cd(1);
+  TLegend *legend = new TLegend(0.2,0.7,0.6,0.9,"");
+
   //
   TH1 * hisRes=0;
   TH1 * hisMean=0;
   for (Int_t i=0; i<3; i++){
-    if (i==0) cosmic->fHistoDelta[0]->GetAxis(6)->SetRangeUser(0,2);
-    if (i==1) cosmic->fHistoDelta[0]->GetAxis(6)->SetRangeUser(-2,0);
-    if (i==2) cosmic->fHistoDelta[0]->GetAxis(6)->SetRangeUser(-2,2);
-    hisRes  = GetFit2D(0,7,kTRUE);
-    hisMean = GetFit2D(0,7,kFALSE);
+    if (i==1) cosmicScan->fHistoDelta[0]->GetAxis(6)->SetRangeUser(0.0001,1);
+    if (i==2) cosmicScan->fHistoDelta[0]->GetAxis(6)->SetRangeUser(-1,-0.0001);
+    if (i==0) cosmicScan->fHistoDelta[0]->GetAxis(6)->SetRangeUser(-1,1);
+    hisRes  = (TH1*)GetFit2D(0,7,kTRUE)->Clone();
+    hisMean = (TH1*)GetFit2D(0,7,kFALSE)->Clone();
+    hisMean->SetName(Form("#Delta_{r#phi} %s",chsign[i]));
+    hisRes->SetName(Form("#sigma_{r#phi} %s",chsign[i]));
+    hisMean->SetTitle(Form("#Delta_{r#phi} %s",chsign[i]));
+    hisRes->SetTitle(Form("#sigma_{r#phi} %s",chsign[i]));
+
     hisRes->SetMarkerStyle(20+i);
     hisMean->SetMarkerStyle(20+i);
     hisMean->SetMarkerColor(colors[i]);
@@ -346,35 +415,145 @@ void MakePlotPosY(TObjArray * array){
     hisRes->SetName("Y resolution");
     hisRes->SetYTitle("#sigma_{y} (cm)");
     hisMean->SetYTitle("#Delta_{y} (cm)");
-    hisRes->GetXaxis()->SetRangeUser(0,10);
-    hisMean->GetXaxis()->SetRangeUser(0,10);  
+    hisRes->GetXaxis()->SetRangeUser(0,50);
+    hisMean->GetXaxis()->SetRangeUser(0,50);  
+    cptRes->cd(2); 
+    hisRes->Draw("same");
+    if (i==0) hisRes->Draw("");
+    cptRes->cd(1);
+    hisMean->Draw("same");
+    if (i==0) hisMean->Draw("");
+    legend->AddEntry(hisMean);   
+  }
+  legend->Draw();
+  if (array) array->AddLast(cptRes);
+}
+
+void MakePlotSnp(TObjArray * array){
+  //
+  //
+  TCanvas *cptRes = new TCanvas("TPCSnp","TPCSnp",900,600);
+  cptRes->Divide(2,1);
+  SetStylePad(cptRes->cd(1));
+  SetStylePad(cptRes->cd(2));
+  cptRes->cd(1);
+  TLegend *legend = new TLegend(0.2,0.7,0.6,0.9,"");
+
+  //
+  TH1 * hisRes=0;
+  TH1 * hisMean=0;
+  for (Int_t i=0; i<3; i++){
+    if (i==1) cosmicScan->fHistoDelta[2]->GetAxis(6)->SetRangeUser(0.0001,1);
+    if (i==2) cosmicScan->fHistoDelta[2]->GetAxis(6)->SetRangeUser(-1,-0.0001);
+    if (i==0) cosmicScan->fHistoDelta[2]->GetAxis(6)->SetRangeUser(-1,1);
+    hisRes  = (TH1*)GetFit2D(2,7,kTRUE)->Clone();
+    hisMean = (TH1*)GetFit2D(2,7,kFALSE)->Clone();
+    hisMean->SetName(Form("#Delta_{#phi} %s",chsign[i]));
+    hisRes->SetName(Form("#sigma_{#phi} %s",chsign[i]));
+    hisMean->SetTitle(Form("#Delta_{#phi} %s",chsign[i]));
+    hisRes->SetTitle(Form("#sigma_{#phi} %s",chsign[i]));
+
+    hisRes->SetMarkerStyle(20+i);
+    hisMean->SetMarkerStyle(20+i);
+    hisMean->SetMarkerColor(colors[i]);
+    hisRes->SetMarkerColor(colors[i]);
+    
+    //
+    hisRes->SetMaximum(4);
+    hisRes->SetMinimum(4);
+    hisMean->SetMaximum(4);
+    hisMean->SetMinimum(-4);
+    hisRes->SetYTitle("#sigma_{#phi} (mrad)");
+    hisMean->SetYTitle("#Delta_{#phi} (mrad)");
+    hisRes->GetXaxis()->SetRangeUser(0,50);
+    hisMean->GetXaxis()->SetRangeUser(0,50);  
+    cptRes->cd(2); 
+    hisRes->Draw("same");
+    if (i==0) hisRes->Draw("");
+    cptRes->cd(1);
+    hisMean->Draw("same");
+    if (i==0) hisMean->Draw("");
+    legend->AddEntry(hisMean);   
+  }
+  legend->Draw();
+  if (array) array->AddLast(cptRes);
+}
+void MakePlotTgl(TObjArray * array){
+  //
+  //
+  TCanvas *cptRes = new TCanvas("TPCtgl","TPCtgl",900,600);
+  cptRes->Divide(2,1);
+  SetStylePad(cptRes->cd(1));
+  SetStylePad(cptRes->cd(2));
+  cptRes->cd(1);
+  TLegend *legend = new TLegend(0.2,0.7,0.6,0.9,"");
+
+  //
+  TH1 * hisRes=0;
+  TH1 * hisMean=0;
+  for (Int_t i=0; i<3; i++){
+    if (i==1) cosmicScan->fHistoDelta[3]->GetAxis(6)->SetRangeUser(0.0001,1);
+    if (i==2) cosmicScan->fHistoDelta[3]->GetAxis(6)->SetRangeUser(-1,-0.0001);
+    if (i==0) cosmicScan->fHistoDelta[3]->GetAxis(6)->SetRangeUser(-1,1);
+    hisRes  = (TH1*)GetFit2D(3,7,kTRUE)->Clone();
+    hisMean = (TH1*)GetFit2D(3,7,kFALSE)->Clone();
+    hisMean->SetName(Form("#Delta_{#theta} %s",chsign[i]));
+    hisRes->SetName(Form("#sigma_{#theta} %s",chsign[i]));
+    hisMean->SetTitle(Form("#Delta_{#theta} %s",chsign[i]));
+    hisRes->SetTitle(Form("#sigma_{#theta} %s",chsign[i]));
+
+    hisRes->SetMarkerStyle(20+i);
+    hisMean->SetMarkerStyle(20+i);
+    hisMean->SetMarkerColor(colors[i]);
+    hisRes->SetMarkerColor(colors[i]);
+    
+    //
+    hisRes->SetMaximum(4);
+    hisRes->SetMinimum(4);
+    hisMean->SetMaximum(4);
+    hisMean->SetMinimum(-4);
+    hisRes->SetYTitle("#sigma_{#theta} (mrad)");
+    hisMean->SetYTitle("#Delta_{#theta} (mrad)");
+    hisRes->GetXaxis()->SetRangeUser(0,50);
+    hisMean->GetXaxis()->SetRangeUser(0,50);  
     cptRes->cd(2); 
     hisRes->Draw("same");
     if (i==0) hisRes->Draw("");
     cptRes->cd(1);
     hisMean->Draw("same");
     if (i==0) hisMean->Draw("");
+    legend->AddEntry(hisMean);   
   }
+  legend->Draw();
   if (array) array->AddLast(cptRes);
 }
 
 void MakePlotPosZ(TObjArray * array){
   //
   //
-  TCanvas *cptRes = new TCanvas("TPCPosResolZ","TPCPosResolZ",600,500);
+  TCanvas *cptRes = new TCanvas("TPCPosResolZ","TPCPosResolZ",900,600);
   cptRes->Divide(2,1);
   SetStylePad(cptRes->cd(1));
   SetStylePad(cptRes->cd(2));
+  cptRes->cd(1);
+  TLegend *legend = new TLegend(0.2,0.7,0.6,0.9,"");
+
   //
   TH1 * hisRes=0;
   TH1 * hisMean=0;
   for (Int_t i=0; i<3; i++){
-    if (i==0) cosmic->fHistoDelta[1]->GetAxis(6)->SetRangeUser(0,2);
-    if (i==1) cosmic->fHistoDelta[1]->GetAxis(6)->SetRangeUser(-2,0);
-    if (i==2) cosmic->fHistoDelta[1]->GetAxis(6)->SetRangeUser(-2,2);
+    if (i==1) cosmicScan->fHistoDelta[1]->GetAxis(6)->SetRangeUser(0.001,1.);
+    if (i==2) cosmicScan->fHistoDelta[1]->GetAxis(6)->SetRangeUser(-1,-0.001);
+    if (i==0) cosmicScan->fHistoDelta[1]->GetAxis(6)->SetRangeUser(-1,1);
     
-    hisRes  = GetFit2D(1,7,kTRUE);
-    hisMean = GetFit2D(1,7,kFALSE);
+    hisRes  = (TH1*)GetFit2D(1,7,kTRUE)->Clone();
+    hisMean = (TH1*)GetFit2D(1,7,kFALSE)->Clone();   
+    hisMean->SetName(Form("#Delta_{z} %s",chsign[i]));
+    hisRes->SetName(Form("#sigma_{z} %s",chsign[i]));
+    hisMean->SetTitle(Form("#Delta_{z} %s",chsign[i]));
+    hisRes->SetTitle(Form("#sigma_{z} %s",chsign[i]));
+
+
     hisRes->SetMaximum(0.4);
     hisRes->SetMinimum(0.0);
     hisMean->SetMaximum(0.2);
@@ -388,15 +567,17 @@ void MakePlotPosZ(TObjArray * array){
     hisRes->SetName("Z resolution");
     hisRes->SetYTitle("#sigma_{z} (cm)");
     hisMean->SetYTitle("#Delta_{z} (cm)");
-    hisRes->GetXaxis()->SetRangeUser(0,10);
-    hisMean->GetXaxis()->SetRangeUser(0,10);  
+    hisRes->GetXaxis()->SetRangeUser(0,50);
+    hisMean->GetXaxis()->SetRangeUser(0,50);  
     cptRes->cd(2); 
     hisRes->Draw("same");
     if (i==0) hisRes->Draw();
     cptRes->cd(1);
     hisMean->Draw("same");
     if (i==0) hisMean->Draw();
+    legend->AddEntry(hisMean);
   }
+  legend->Draw();
   if (array) array->AddLast(cptRes);
 }
 
@@ -405,24 +586,28 @@ void  MakeDefaultPlots(){
   //
   //
   //
-  TObjArray *picArray = new TObjArray();
+  gStyle->SetOptStat(1100);
   DrawStat(0,picArray);
-  MakePlotPt(picArray);
+  gStyle->SetOptStat(0);
   MakePlotPosY(picArray);
   MakePlotPosZ(picArray);
+  MakePlotSnp(picArray);
+  MakePlotTgl(picArray);
   MakePlotP4(picArray);
+  MakePlotPt(picArray);
+  //
+
   TFile f("cosmicPlots.root","recreate");
   picArray->Write("CosmicPlots",TObject::kSingleKey);
   f.Close();
   TPostScript *ps=new TPostScript("cosmicPerformance.ps", 112);
+  ps->NewPage();
   for (Int_t ipad=0;ipad<picArray->GetEntries();ipad++){
-    TCanvas *c =dynamic_cast<TCanvas*> picArray->At(ipad);
+    TCanvas *c =dynamic_cast<TCanvas*> (picArray->At(ipad));
     if (c) {
-      c->SaveAs(Form("pic/cosmic/%s.gif",c->GetName()));
-      c->SaveAs(Form("pic/cosmic/%s.eps",c->GetName()));
-      ps->NewPage();
       c->Draw();
       c->Update();
+      ps->NewPage();
     }
   } 
   ps->Close();