-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathplotObsVsCorr.C
127 lines (96 loc) · 4.35 KB
/
plotObsVsCorr.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
// n = order of flow; 2 = elliptic; 3 = triangular; ...
void plotObsVsCorr(int n, int cent_min, int cent_max)
{
bool plotflattened = true;
char* realFName = Form("/home/palmerjh/CMSSW_5_3_20/STEGEff/RC_cent_%d-%d_v%d_STEG_run182798_hiGeneralAndPixelTracks_v0.root",cent_min,cent_max,n);
char* STEGFName = Form("/home/palmerjh/CMSSW_5_3_20/STEGEff/RC_v%d_dataFromSTEG.root",n);
// load Input File generated by STEG
TFile * realFile = new TFile(realFName);
TFile * STEGFile = new TFile(STEGFName);
// load file with STEG input functions
TFile * STEGFunctionFile = new TFile("/home/palmerjh/CMSSW_5_3_20/STEGEff/STEGFunctions.root");
// Get the graphs and histograms from the file
TGraph * STEGCorRU = &((*((TGraph*)STEGFile->Get(Form("v%d_Corrected_RU",n)))).Clone());
TGraph * STEGCorGU = &((*((TGraph*)STEGFile->Get(Form("v%d_Corrected_GU",n)))).Clone());
TGraph * STEGCorRF = &((*((TGraph*)STEGFile->Get(Form("v%d_Corrected_RF",n)))).Clone());
TGraph * STEGCorGF = &((*((TGraph*)STEGFile->Get(Form("v%d_Corrected_GF",n)))).Clone());
TGraph * STEGObsRU = &((*((TGraph*)STEGFile->Get(Form("v%d_Observed_RU",n)))).Clone());
TGraph * STEGObsGU = &((*((TGraph*)STEGFile->Get(Form("v%d_Observed_GU",n)))).Clone());
TGraph * STEGObsRF = &((*((TGraph*)STEGFile->Get(Form("v%d_Observed_RF",n)))).Clone());
TGraph * STEGObsGF = &((*((TGraph*)STEGFile->Get(Form("v%d_Observed_GF",n)))).Clone());
TGraph * realCorRU = &((*((TGraph*)realFile->Get(Form("v%d_Corrected_RU",n)))).Clone());
TGraph * realCorRF = &((*((TGraph*)realFile->Get(Form("v%d_Corrected_RF",n)))).Clone());
TGraph * realObsRU = &((*((TGraph*)realFile->Get(Form("v%d_Corrected_RU",n)))).Clone());
TGraph * realObsRF = &((*((TGraph*)realFile->Get(Form("v%d_Corrected_RF",n)))).Clone());
/*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",1000,1000);
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();
TF1 *VnvsPt = (TF1*) STEGFunctionFile->Get(Form("V%dvsPt",n));
VnvsPt->SetLineColor(kBlack);
VnvsPt->Draw("SAME");
STEGCorRU->SetMarkerStyle(29);
STEGCorRU->SetLineColor(kGreen);
STEGCorRU->SetMarkerColor(kGreen);
STEGCorRU->Draw("p");
STEGCorGU->SetMarkerStyle(33);
STEGCorGU->SetLineColor(kRed);
STEGCorGU->SetMarkerColor(kRed);
STEGCorGU->Draw("p");
STEGObsRU->SetMarkerStyle(30);
STEGObsRU->SetLineColor(kBlue);
STEGObsRU->SetMarkerColor(kBlue);
STEGObsRU->Draw("p");
STEGObsGU->SetMarkerStyle(33);
STEGObsGU->SetLineColor(6);
STEGObsGU->SetMarkerColor(6);
STEGObsGU->Draw("p");
//testCorrection->Draw("ap");
TLegend * leg = new TLegend(.7,.7,.9,.9);
leg->SetFillColor(0);
leg->AddEntry(STEGCorRU,Form("STEG_Reco_Unflattened_v_{%d}^{cor}\{EP+ & EP-\}",n),"lp");
leg->AddEntry(STEGCorGU,Form("STEG_Gen_Unflattened_v_{%d}^{cor}\{EP+ & EP-\}",n),"lp");
leg->AddEntry(STEGObsRU,Form("STEG_Reco_Unflattened_v_{%d}^{obs}\{EP+ & EP-\}",n),"lp");
leg->AddEntry(STEGObsGU,Form("STEG_Gen_Unflattened_v_{%d}^{obs}\{EP+ & EP-\}",n),"lp");
leg->AddEntry(VnvsPt,Form("STEG_Input_Function_v_{%d}",n),"lp");
leg->SetTextFont(63);
leg->SetTextSize(17);
leg->Draw();
//STEGFile->Close();
//realFile->Close();
//STEGFunctionFile->Close();
//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");
//}*/
}