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 differential yields
17 // author: Eulogio Serradilla <eulogio.serradilla@cern.ch>
19 #if !defined(__CINT__) || defined(__MAKECINT__)
24 #include <TGraphErrors.h>
29 void DrawSpectra(const TString& inputFile="spectra.root", const TString& tag="lhc10d", const TString& particle="Deuteron")
32 // Draw differential yields
34 gStyle->SetPadTickX(1);
35 gStyle->SetPadTickY(1);
36 gStyle->SetPadGridX(1);
37 gStyle->SetPadGridY(1);
38 gStyle->SetOptLogy(1);
40 TFile* finput = new TFile(inputFile.Data());
41 if (finput->IsZombie()) exit(1);
43 TCanvas* c0 = new TCanvas(Form("%s.Spectra", particle.Data()), Form("Spectra for %ss", particle.Data()));
50 TGraphErrors* grDYieldPt = FindObj<TGraphErrors>(finput, tag, particle + "_DiffYield_Pt");
52 grDYieldPt->SetMarkerStyle(kFullCircle);
53 grDYieldPt->SetMarkerColor(kRed);
54 grDYieldPt->SetLineColor(kRed);
55 grDYieldPt->GetXaxis()->SetTitle("#it{p}_{T} (GeV/#it{c})");
56 grDYieldPt->GetYaxis()->SetTitle("1/#it{N}_{ev} d^{2}#it{N}/(d#it{p}_{T}d#it{y}) (GeV^{-1}#it{c}^{2})");
57 grDYieldPt->GetYaxis()->SetTitleOffset(1.30);
58 grDYieldPt->Draw("zAP");
60 // invariant differential yield
64 TGraphErrors* grInvDYieldPt = FindObj<TGraphErrors>(finput, tag, particle + "_InvDiffYield_Pt");
66 grInvDYieldPt->SetMarkerStyle(kFullCircle);
67 grInvDYieldPt->SetMarkerColor(kRed);
68 grInvDYieldPt->SetLineColor(kRed);
69 grInvDYieldPt->GetXaxis()->SetTitle("#it{p}_{T} (GeV/#it{c})");
70 grInvDYieldPt->GetYaxis()->SetTitle("1/(2#pi#it{N}_{ev}) d^{2}#it{N}/(#it{p}_{T}d#it{p}_{T}d#it{y}) (GeV^{-2}#it{c}^{3})");
71 grInvDYieldPt->GetYaxis()->SetTitleOffset(1.30);
72 grInvDYieldPt->Draw("zAP");