1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
16 // Draw pt corrections for debugging
17 // author: Eulogio Serradilla <eulogio.serradilla@cern.ch>
19 #if !defined(__CINT__) || defined(__MAKECINT__)
30 void DrawPair(TH1* hX, TH1* hY, Double_t xmin, Double_t xmax, Double_t ymin, Double_t ymax, const TString& title="", const char* option="E", Int_t xMarker=kFullCircle, Int_t yMarker=kFullCircle, Int_t xColor=kBlue, Int_t yColor=kRed);
32 void DrawCorr(const TString& species="Deuteron", const TString& inputFile="corrections.root", const TString& tag="")
35 // Draw pt corrections for debugging
37 gStyle->SetPadTickX(1);
38 gStyle->SetPadTickY(1);
39 gStyle->SetPadGridX(1);
40 gStyle->SetPadGridY(1);
41 gStyle->SetOptTitle(0);
42 gStyle->SetOptStat(0);
47 const Int_t kNpart = 2;
49 TFile* finput = new TFile(inputFile.Data());
50 if (finput->IsZombie()) exit(1);
52 const TString kPrefix[] = {"", "Anti"};
54 // Reconstruction efficiency
56 TCanvas* c2 = new TCanvas(Form("%s.Efficiency",species.Data()), Form("Reconstruction Efficiency for (Anti)%ss",species.Data()));
59 TH1D* hEffTrigPt[kNpart];
60 TH1D* hEffVtxPt[kNpart];
61 TH1D* hEffAccPt[kNpart];
62 TH1D* hEffAccTrkPt[kNpart];
64 for(Int_t i=0; i<kNpart; ++i)
66 hEffTrigPt[i] = FindObj<TH1D>(finput, tag, kPrefix[i] + species + "_Eff_Trig_Pt");
67 hEffVtxPt[i] = FindObj<TH1D>(finput, tag, kPrefix[i] + species + "_Eff_Vtx_Pt");
68 hEffAccPt[i] = FindObj<TH1D>(finput, tag, kPrefix[i] + species + "_Eff_Acc_Pt");
69 hEffAccTrkPt[i] = FindObj<TH1D>(finput, tag, kPrefix[i] + species + "_Eff_AccTrk_Pt");
73 DrawPair(hEffTrigPt[0], hEffTrigPt[1], xmin, xmax, 0, 1.1);
76 DrawPair(hEffVtxPt[0], hEffVtxPt[1], xmin, xmax, 0, 1.1);
79 DrawPair(hEffAccPt[0], hEffAccPt[1], xmin, xmax, 0, 1.1);
82 DrawPair(hEffAccTrkPt[0], hEffAccTrkPt[1], xmin, xmax, 0, 1.1);
86 TCanvas* c3 = new TCanvas(Form("%s.Secondaries",species.Data()), Form("Fraction of secondaries for (Anti)%ss",species.Data()));
90 for(Int_t i=0; i<kNpart; ++i)
92 TH1D* hFracFdwnPt = FindObj<TH1D>(finput, tag, kPrefix[i] + species + "_Frac_Fdwn_Pt");
93 TH1D* hFracMatPt = FindObj<TH1D>(finput, tag, kPrefix[i] + species + "_Frac_Mat_Pt");
95 TF1* fncFracFdwnPt = FindObj<TF1>(finput, tag, kPrefix[i] + species + "_Frac_Fdwn_Fit_Pt");
96 TF1* fncFracMatPt = FindObj<TF1>(finput, tag, kPrefix[i] + species + "_Frac_Mat_Fit_Pt");
99 hFracFdwnPt->SetAxisRange(xmin, xmax, "X");
100 hFracFdwnPt->SetAxisRange(0., 0.6, "Y");
101 hFracFdwnPt->GetYaxis()->SetTitleOffset(1.4);
103 hFracFdwnPt->SetMarkerColor(kBlue);
104 hFracFdwnPt->SetLineColor(kBlue);
105 hFracFdwnPt->SetMarkerStyle(kFullCircle);
106 hFracFdwnPt->DrawCopy("E");
108 fncFracFdwnPt->SetLineColor(kRed);
109 fncFracFdwnPt->SetLineWidth(1);
110 fncFracFdwnPt->Draw("same");
113 hFracMatPt->SetAxisRange(xmin, xmax, "X");
114 hFracMatPt->SetAxisRange(0.,0.6, "Y");
115 hFracMatPt->GetYaxis()->SetTitleOffset(1.4);
117 hFracMatPt->SetMarkerColor(kBlue);
118 hFracMatPt->SetLineColor(kBlue);
119 hFracMatPt->SetMarkerStyle(kFullCircle);
120 hFracMatPt->DrawCopy("E");
122 fncFracMatPt->SetLineColor(kRed);
123 fncFracMatPt->SetLineWidth(1);
124 fncFracMatPt->Draw("same");
128 void DrawPair(TH1* hX, TH1* hY, Double_t xmin, Double_t xmax, Double_t ymin, Double_t ymax, const TString& title, const char* option, Int_t xMarker, Int_t yMarker, Int_t xColor, Int_t yColor)
131 // Draw a pair of histograms in the current pad
133 hX->SetTitle(title.Data());
134 hX->SetAxisRange(xmin, xmax, "X");
135 hX->SetAxisRange(ymin, ymax, "Y");
136 hX->SetMarkerColor(xColor);
137 hX->SetLineColor(xColor);
138 hX->SetMarkerStyle(xMarker);
140 hY->SetMarkerColor(yColor);
141 hY->SetLineColor(yColor);
142 hY->SetMarkerStyle(yMarker);
144 hX->DrawCopy(option);
145 hY->DrawCopy(Form("same%s",option));