forked from happydigit/ALICEISGOD
-
Notifications
You must be signed in to change notification settings - Fork 0
/
contours.C
137 lines (118 loc) · 4.23 KB
/
contours.C
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
#include <string.h>
#include <TStyle.h>
#include <TCanvas.h>
#include <TLatex.h>
#include <stdbool.h>
#include <iostream>
#include <TColor.h>
#include <TPaveStats.h>
#include <TROOT.h>
#include <TGraph.h>
#include <TGraphErrors.h>
#include <TArrow.h>
#include <TMath.h>
#include <TFile.h>
#include <TDirectoryFile.h>
#include <TF1.h>
#include <TLegend.h>
#include <TGraph.h>
#include <TMultiGraph.h>
#include <fstream>
#if defined(__GLIBCXX__)
#pragma link C++ class MyOtherClass;
#endif
using namespace std;
void contours()
{
// we import the file (ppbarContours.root) with the contours for p+pbar produced in Pb-Pb collisions
TFile *ppbarFile = new TFile("ppbarContours.root");
// we import the file (phiContours.root) with the contours for phi mesons produced in Pb-Pb collisions
TFile *phiFile = new TFile("phiContours.root");
// we define a canvas
TCanvas *T1 = new TCanvas("T1","Contours",200,200);
gStyle->SetPadBorderMode(0);
gStyle->SetFrameBorderMode(0);
gStyle->SetOptStat(0);
// il manque des options gstyle ou gpad
// we define a TGraph for each contour
TGraph *ppbar_1sigma[10];
TGraph *ppbar_2sigma[10];
TGraph *phi_1sigma[10];
TGraph *phi_2sigma[10];
// we define the multigraph that will contain all the contours
TMultiGraph *mg = new TMultiGraph();
mg->GetXaxis()->SetTitle("#LT #beta_{T} #GT");
mg->GetYaxis()->SetTitle("T_{kin}");
//------------------------------------------------------
//----------------- p+pbar -----------------------------
//------------------------------------------------------
// we explorate the ppbar file in order to get the 9 first pairs of contours it contains
char ppbar_1sigma_name = "ppbar_1sigma_contour_X";
char ppbar_2sigma_name = "ppbar_2sigma_contour_X";
for(int digit=1;digit<=9;digit++)
{
// we do it for the 1sigma contours
ppbar_1sigma_name[21] = digit+'0';
ppbar_1sigma[digit] = (TGraph*)ppbarFile->Get(ppbar_1sigma_name) ;
ppbar_1sigma[digit]->Draw();
mg->Add(ppbar_1sigma[digit]);
// we do it for the 2sigma contours
ppbar_2sigma_name[21] = digit+'0';
ppbar_2sigma[digit] = (TGraph*)ppbarFile->Get(ppbar_2sigma_name) ;
ppbar_2sigma[digit]->Draw();
mg->Add(ppbar_2sigma[digit]);
}
// we add the 10th pair of contours
ppbar_1sigma[10] = (TGraph*)ppbarFile->Get(ppbar_1sigma_contour_10) ;
ppbar_1sigma[10]->Draw();
mg->Add(ppbar_1sigma[10]);
ppbar_2sigma[10] = (TGraph*)ppbarFile->Get(ppbar_2sigma_contour_10) ;
ppbar_1sigma[10]->Draw();
mg->Add(ppbar_2sigma[10]);
//------------------------------------------------------
//----------------- phi mesons -----------------------------
//------------------------------------------------------
// we explorate the ppbar file in order to get the 8 pairs of contours it contains
char phi_1sigma_name = "phi_1sigma_contour_X";
char phi_2sigma_name = "phi_2sigma_contour_X";
for(int digit=1;digit<=8;digit++)
{
// we do it for the 1sigma contours
phi_1sigma_name[19] = digit+'0';
phi_1sigma[digit] = (TGraph*)phiFile->Get(phi_1sigma_name) ;
phi_1sigma[digit]->Draw();
mg->Add(phi_1sigma[digit]);
// we do it for the 2sigma contours
phi_2sigma_name[19] = digit+'0';
phi_2sigma[digit] = (TGraph*)phiFile->Get(phi_2sigma_name) ;
phi_2sigma[digit]->Draw();
mg->Add(phi_2sigma[digit]);
}
//------------------------------------------------------
//------------------------------------------------------
// we draw the multigraph
mg->Draw("A");
// change the axis limits
gpad->Modified();
mg->GetXaxis()->SetLimits(0.3,0.9); // we limit the x axis range
// then we limit the y axis range
mg->SetMinimum(0.05);
mg->SetMinimum(0.2);
// we add a legend
TLatex Tl;
Tl.SetNDC();
Tl.SetTextSize(0.020);
Tl.SetTextAlign(13); //align at top
Tl.SetTextFont(42);
// we indicate the centrality
latex.DrawLatex(0.2,0.8, "80-90%"); // top left of the plot
latex.DrawLatex(0.8,0.2, "0-5%"); // bottom right of the plot
// we indicate the color code
latex.DrawLatex(0.5,0.65, "Blast-wave fit to");
latex.DrawLatex(0.5,0.5, "#phi (?-? GeV/c) in dotted lines, p+#bar{p} (0.3-3 GeV/c) in full lines");
latex.DrawLatex(0.5,0.5, "#color[4]{1#sigma contour}"); // 4 is blue
latex.DrawLatex(0.5,0.5, "#color[2]{2#sigma contour}"); // 2 is blue
// we close the files
ppbarFile->Close();
phiFile->Close();
}