ROOT logo
/**************************************************************************
 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
 *                                                                        *
 * Author: The ALICE Off-line Project.                                    *
 * Contributors are mentioned in the code where appropriate.              *
 *                                                                        *
 * Permission to use, copy, modify and distribute this software and its   *
 * documentation strictly for non-commercial purposes is hereby granted   *
 * without fee, provided that the above copyright notice appears in all   *
 * copies and that both the copyright notice and this permission notice   *
 * appear in the supporting documentation. The authors make no claims     *
 * about the suitability of this software for any purpose. It is          *
 * provided "as is" without express or implied warranty.                  *
 **************************************************************************/

// Draw antiparticle/particle ratio
// author: Eulogio Serradilla <eulogio.serradilla@cern.ch>

#if !defined(__CINT__) || defined(__MAKECINT__)
#include <TStyle.h>
#include <TFile.h>
#include <TH1D.h>
#include <TString.h>
#include <TCanvas.h>
#endif

#include "B2.h"

void DrawRatio(const TString& inputFile="pt.root", const TString& tag="test", const TString& species="Deuteron")
{
//
// Draw antiparticle/particle ratio
//
	Double_t xmin = 0;
	Double_t xmax = 3.5;
	Double_t ymin = 0.73;
	Double_t ymax = 1.14;
	
	gStyle->SetPadTickX(1);
	gStyle->SetPadTickY(1);
	gStyle->SetPadGridX(1);
	gStyle->SetPadGridY(1);
	gStyle->SetOptTitle(0);
	gStyle->SetOptStat(0);
	
	TFile* finput = new TFile(inputFile.Data());
	if (finput->IsZombie()) exit(1);
	
	// antiparticle/particle ratio
	
	TString ytitle = "Negative/Positive";
	if(species=="Proton")        ytitle = "#bar{p} / p";
	else if(species=="Deuteron") ytitle = "#bar{d} / d";
	else if(species=="Triton")   ytitle = "#bar{t} / t";
	else if(species=="He3")      ytitle = "{}^{3}#bar{He} / {}^{3}He";
	else if(species=="Alpha")    ytitle = "#bar{#alpha} / #alpha";
	
	TH1D* hRatioPt = FindObj<TH1D>(finput, tag, Form("Anti%s%s_Ratio_Pt", species.Data(), species.Data()));
	
	TCanvas* c0 = new TCanvas(Form("c0.Ratio%s",species.Data()), Form("Anti%s/%s ratio", species.Data(), species.Data()));
	c0->cd();
	
	hRatioPt->SetTitle("");
	hRatioPt->SetAxisRange(xmin,xmax,"X");
	hRatioPt->SetAxisRange(ymin,ymax,"Y");
	hRatioPt->SetLineColor(kRed);
	hRatioPt->SetMarkerStyle(kFullCircle);
	hRatioPt->SetMarkerColor(kRed);
	hRatioPt->SetYTitle(ytitle);
	hRatioPt->DrawCopy();
}
 DrawRatio.C:1
 DrawRatio.C:2
 DrawRatio.C:3
 DrawRatio.C:4
 DrawRatio.C:5
 DrawRatio.C:6
 DrawRatio.C:7
 DrawRatio.C:8
 DrawRatio.C:9
 DrawRatio.C:10
 DrawRatio.C:11
 DrawRatio.C:12
 DrawRatio.C:13
 DrawRatio.C:14
 DrawRatio.C:15
 DrawRatio.C:16
 DrawRatio.C:17
 DrawRatio.C:18
 DrawRatio.C:19
 DrawRatio.C:20
 DrawRatio.C:21
 DrawRatio.C:22
 DrawRatio.C:23
 DrawRatio.C:24
 DrawRatio.C:25
 DrawRatio.C:26
 DrawRatio.C:27
 DrawRatio.C:28
 DrawRatio.C:29
 DrawRatio.C:30
 DrawRatio.C:31
 DrawRatio.C:32
 DrawRatio.C:33
 DrawRatio.C:34
 DrawRatio.C:35
 DrawRatio.C:36
 DrawRatio.C:37
 DrawRatio.C:38
 DrawRatio.C:39
 DrawRatio.C:40
 DrawRatio.C:41
 DrawRatio.C:42
 DrawRatio.C:43
 DrawRatio.C:44
 DrawRatio.C:45
 DrawRatio.C:46
 DrawRatio.C:47
 DrawRatio.C:48
 DrawRatio.C:49
 DrawRatio.C:50
 DrawRatio.C:51
 DrawRatio.C:52
 DrawRatio.C:53
 DrawRatio.C:54
 DrawRatio.C:55
 DrawRatio.C:56
 DrawRatio.C:57
 DrawRatio.C:58
 DrawRatio.C:59
 DrawRatio.C:60
 DrawRatio.C:61
 DrawRatio.C:62
 DrawRatio.C:63
 DrawRatio.C:64
 DrawRatio.C:65
 DrawRatio.C:66
 DrawRatio.C:67
 DrawRatio.C:68
 DrawRatio.C:69
 DrawRatio.C:70
 DrawRatio.C:71
 DrawRatio.C:72