]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGLF/SPECTRA/Nuclei/B2/macros/DrawSpectra.C
Merge branch 'feature-movesplit'
[u/mrichter/AliRoot.git] / PWGLF / SPECTRA / Nuclei / B2 / macros / DrawSpectra.C
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 differential yields
17 // author: Eulogio Serradilla <eulogio.serradilla@cern.ch>
18
19 #if !defined(__CINT__) || defined(__MAKECINT__)
20 #include <TStyle.h>
21 #include <TFile.h>
22 #include <TString.h>
23 #include <TCanvas.h>
24 #include <TGraphErrors.h>
25 #endif
26
27 #include "B2.h"
28
29 void DrawSpectra(const TString& inputFile="spectra.root", const TString& tag="lhc10d", const TString& particle="Deuteron")
30 {
31 //
32 // Draw differential yields
33 //
34         gStyle->SetPadTickX(1);
35         gStyle->SetPadTickY(1);
36         gStyle->SetPadGridX(1);
37         gStyle->SetPadGridY(1);
38         gStyle->SetOptLogy(1);
39         
40         TFile* finput = new TFile(inputFile.Data());
41         if (finput->IsZombie()) exit(1);
42         
43         TCanvas* c0 = new TCanvas(Form("%s.Spectra", particle.Data()), Form("Spectra for %ss", particle.Data()));
44         c0->Divide(2,1);
45         
46         // differential yield
47         
48         c0->cd(1);
49         
50         TGraphErrors* grDYieldPt = FindObj<TGraphErrors>(finput, tag, particle + "_DiffYield_Pt");
51         
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");
59         
60         // invariant differential yield
61         
62         c0->cd(2);
63         
64         TGraphErrors* grInvDYieldPt = FindObj<TGraphErrors>(finput, tag, particle + "_InvDiffYield_Pt");
65         
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");
73 }