-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathplotData.C
87 lines (67 loc) · 2.38 KB
/
plotData.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
// n = order of flow; 2 = elliptic; 3 = triangular; ...
void plotData(int n, bool isRealData, int cent_min, int cent_max)
{
bool plotHist = true;
const char fname[] = isRealData ? Form("cent_%d-%d_v%d_STEG_run182798_hiGeneralAndPixelTracks_v0.root",cent_min,cent_max,n) : Form("v%d_dataFromSTEG.root",n);
const char* filename = fname;
// load Input File generated by STEG
TFile * f = new TFile(filename);
// Get the graphs and histograms from the file
TGraph * obs = f->Get(Form("v%d_Observed",n));
TGraph * cor = f->Get(Form("v%d_Corrected",n));
TH1F * phiA = f->Get("phiA");
TH1F * phiB = f->Get("phiB");
TH1F * phiC = f->Get("phiC");
TH1F * planeAFlat = f->Get("planeAFlat");
TH1F * planeBFlat = f->Get("planeBFlat");
TH1F * planeCFlat = f->Get("planeCFlat");
TH1F * planeAUnflat = f->Get("planeAUnflat");
TH1F * planeBUnflat = f->Get("planeBUnflat");
TH1F * planeCUnflat = f->Get("planeCUnflat");
//f.Close();
TCanvas * cVn = new TCanvas("cVn","cVn",600,600);
cVn->cd();
TH1F * hDum = new TH1F("hDum",Form(";p_{T} [GeV/c];v_{%d}",n),10,0,10);
hDum->SetMinimum(-0.05);
hDum->SetMaximum(0.2);
hDum->GetYaxis()->CenterTitle();
hDum->GetXaxis()->CenterTitle();
hDum->Draw();
obs->SetMarkerStyle(20);
obs->SetLineColor(kGreen);
obs->SetMarkerColor(kGreen);
obs->Draw("p");
cor->SetMarkerStyle(20);
cor->SetLineColor(kRed);
cor->SetMarkerColor(kRed);
cor->Draw("p");
//testCorrection->Draw("ap");
TLegend * leg = new TLegend(.7,.7,.9,.9);
leg->SetFillColor(0);
leg->AddEntry(obs,Form("v_{%d}^{obs}\{EP+ & EP-\}",n),"lp");
leg->AddEntry(cor,Form("v_{%d}\{EP+ & EP-\}",n),"lp");
leg->Draw();
//if (plotHist) {
TCanvas * cPhi = new TCanvas("cPhi","cPhi",600,600);
cPhi->cd();
cout << "cd okay" << endl;
phiA->Draw();
cout << "A okay" << endl;
phiB->Draw("same");
cout << "B okay" << endl;
phiC->Draw("same");
cout << "C okay" << endl;
TCanvas * cPlaneA = new TCanvas("cPlaneA","cPlaneA",600,600);
cPlaneA->cd();
planeAFlat->Draw();
planeAUnflat->Draw("same");
TCanvas * cPlaneB = new TCanvas("cPlaneB","cPlaneB",600,600);
cPlaneB->cd();
planeBFlat->Draw();
planeBUnflat->Draw("same");
TCanvas * cPlaneC = new TCanvas("cPlaneC","cPlaneC",600,600);
cPlaneC->cd();
planeCFlat->Draw();
planeCUnflat->Draw("same");
//}
}