]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGLF/SPECTRA/Nuclei/B2/macros/DrawRatio.C
B2 analysis code
[u/mrichter/AliRoot.git] / PWGLF / SPECTRA / Nuclei / B2 / macros / DrawRatio.C
CommitLineData
2403d402 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
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 **************************************************************************/
15
16// Draw antiparticle/particle ratio
17// author: Eulogio Serradilla <eulogio.serradilla@cern.ch>
18
19#include <Riostream.h>
20#include <TROOT.h>
21#include <TFile.h>
22#include <TH1D.h>
23#include <TString.h>
24#include <TCanvas.h>
25
26#include "B2.h"
27
28void DrawRatio(const TString& inputFile="pt.root", const TString& tag="test", const TString& species="Deuteron")
29{
30//
31// Draw antiparticle/particle ratio
32//
33 Double_t xmin = 0;
34 Double_t xmax = 3.5;
35 Double_t ymin = 0.73;
36 Double_t ymax = 1.14;
37
38 TFile* finput = new TFile(inputFile.Data());
39 if (finput->IsZombie()) exit(1);
40
41 // antiparticle/particle ratio
42
43 TString ytitle = "Negative/Positive";
44 if(species=="Proton") ytitle = "#bar{p}/p";
45 else if(species=="Deuteron") ytitle = "#bar{d}/d";
46 else if(species=="Triton") ytitle = "#bar{t}/t";
47 else if(species=="He3") ytitle = "#bar{He3}/He3";
48 else if(species=="Alpha") ytitle = "#bar{#alpha}/#alpha";
49
50 TH1D* hRatioPt = (TH1D*)FindObj(finput, tag, Form("Anti%s%s_Ratio_Pt", species.Data(), species.Data()));
51
52 TCanvas* c0 = new TCanvas(Form("c0.Ratio%s",species.Data()), Form("Anti%s/%s ratio", species.Data(), species.Data()));
53 c0->cd();
54
55 hRatioPt->SetTitle("");
56 hRatioPt->SetAxisRange(xmin,xmax,"X");
57 hRatioPt->SetAxisRange(ymin,ymax,"Y");
58 hRatioPt->SetLineColor(kRed);
59 hRatioPt->SetMarkerStyle(kFullCircle);
60 hRatioPt->SetMarkerColor(kRed);
61 hRatioPt->SetYTitle(ytitle);
62 hRatioPt->DrawCopy();
63}