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 antiparticle/particle ratio
17 // author: Eulogio Serradilla <eulogio.serradilla@cern.ch>
19 #if !defined(__CINT__) || defined(__MAKECINT__)
29 void DrawRatio(const TString& inputFile="pt.root", const TString& tag="test", const TString& species="Deuteron")
32 // Draw antiparticle/particle ratio
39 gStyle->SetPadTickX(1);
40 gStyle->SetPadTickY(1);
41 gStyle->SetPadGridX(1);
42 gStyle->SetPadGridY(1);
43 gStyle->SetOptTitle(0);
44 gStyle->SetOptStat(0);
46 TFile* finput = new TFile(inputFile.Data());
47 if (finput->IsZombie()) exit(1);
49 // antiparticle/particle ratio
51 TString ytitle = "Negative/Positive";
52 if(species=="Proton") ytitle = "#bar{p} / p";
53 else if(species=="Deuteron") ytitle = "#bar{d} / d";
54 else if(species=="Triton") ytitle = "#bar{t} / t";
55 else if(species=="He3") ytitle = "{}^{3}#bar{He} / {}^{3}He";
56 else if(species=="Alpha") ytitle = "#bar{#alpha} / #alpha";
58 TH1D* hRatioPt = FindObj<TH1D>(finput, tag, Form("Anti%s%s_Ratio_Pt", species.Data(), species.Data()));
60 TCanvas* c0 = new TCanvas(Form("c0.Ratio%s",species.Data()), Form("Anti%s/%s ratio", species.Data(), species.Data()));
63 hRatioPt->SetTitle("");
64 hRatioPt->SetAxisRange(xmin,xmax,"X");
65 hRatioPt->SetAxisRange(ymin,ymax,"Y");
66 hRatioPt->SetLineColor(kRed);
67 hRatioPt->SetMarkerStyle(kFullCircle);
68 hRatioPt->SetMarkerColor(kRed);
69 hRatioPt->SetYTitle(ytitle);