-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathSystInfo.C
More file actions
executable file
·152 lines (112 loc) · 3.51 KB
/
Copy pathSystInfo.C
File metadata and controls
executable file
·152 lines (112 loc) · 3.51 KB
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
138
139
140
141
142
143
144
145
146
147
148
149
150
#include <vector>
#include <stdio.h>
#include <stdlib.h>
#include <TFile.h>
#include <TMath.h>
#include <iostream>
#include <TGraphErrors.h>
#include <TGraphAsymmErrors.h>
// define the generator's information across different ctau models
void SystInfo() {
TString hfolder = "TCuts_GMSB_L180/" ;
TString fileName = "TCuts_GMSB_L180/GMSB180_2J_250" ;
TString plotname0 = "Syst_nJets.png" ;
TString plotname1 = "Syst_met1.png" ;
TString plotname2 = "Syst_met2.png" ;
string hName0 = "h_nJets" ;
string hName1 = "h_met1" ;
string hName2 = "h_met2" ;
/*
double nGen[7] = { 50112, 50112, 50112, 50112, 50112, 46944, 50112 } ;
TString names[7] = { "250", "500","1000", "2000", "3000", "4000", "6000" } ;
int color[7] = { 1, 2, 4, 5, 6, 7, 8 } ;
const int nModel = 7;
*/
TString names[3] = { "Scale-Up", "Nominal", "Scale-Down" } ;
int color[3] = { 2, 1, 4 } ;
TFile* hfile[3] ;
TH1D* h_nJets[3] ;
TH1D* h_met1[3] ;
TH1D* h_met2[3] ;
hfile[0] = TFile::Open( fileName+"_syst3.root" );
hfile[1] = TFile::Open( fileName+".root" );
hfile[2] = TFile::Open( fileName+"_syst4.root" );
for ( int i=0 ; i< 3 ; i++ ) {
h_nJets[i] = (TH1D *) hfile[i]->Get( hName0.c_str() ) ;
h_met1[i] = (TH1D *) hfile[i]->Get( hName1.c_str() ) ;
h_met2[i] = (TH1D *) hfile[i]->Get( hName2.c_str() ) ;
}
gStyle->SetOptStat("");
// Plots
TCanvas* c0 = new TCanvas("c0","", 800, 700);
c0->SetFillColor(10);
c0->SetFillColor(10);
gPad->SetGridx();
//gPad->SetGridy();
c0->SetLeftMargin(0.15);
c0->SetRightMargin(0.12);
c0->SetTopMargin(0.1);
c0->SetBottomMargin(0.12);
c0->cd();
//gStyle->SetOptStat(kTRUE);
//gStyle->SetOptFit(111);
c0->SetLogy();
TLegend* leg1 = new TLegend(.70, .65, .95, .90 );
leg1->Clear();
char legStr[100] ;
// Plot0
leg1->Clear() ;
c0->SetLogy(0);
for ( int i=0; i< 3; i++ ) {
h_nJets[i]->SetLineColor( color[i] ) ;
double n2j = h_nJets[i]->Integral(3,10) ;
sprintf( legStr, ": %.0f ", n2j ) ;
leg1->AddEntry( h_nJets[i], names[i]+legStr , "L");
if ( i ==0 ) {
c0->cd();
h_nJets[i]->Draw();
} else {
h_nJets[i]->Draw("sames");
}
}
leg1->Draw("sames") ;
c0->Update();
c0->Print( hfolder + plotname0 );
// Plot1
leg1->Clear() ;
c0->SetLogy(0);
for ( int i=0; i< 3; i++ ) {
h_met1[i]->SetLineColor( color[i] ) ;
double n60 = h_met1[i]->Integral(7,51) ;
sprintf( legStr, ": %.0f ", n60 ) ;
leg1->AddEntry( h_met1[i], names[i]+legStr , "L");
if ( i ==0 ) {
c0->cd();
h_met1[i]->Draw();
} else {
h_met1[i]->Draw("sames");
}
}
leg1->Draw("sames") ;
c0->Update();
c0->Print( hfolder + plotname1 );
// Plot2
leg1->Clear() ;
c0->SetLogy(0);
for ( int i=0; i< 3; i++ ) {
h_met2[i]->SetLineColor( color[i] ) ;
double n60 = h_met2[i]->Integral(7,51) ;
sprintf( legStr, ": %.0f ", n60 ) ;
leg1->AddEntry( h_met2[i], names[i]+legStr , "L");
if ( i ==0 ) {
c0->cd();
h_met2[i]->Draw();
} else {
h_met2[i]->Draw("sames");
}
}
leg1->Draw("sames") ;
c0->Update();
c0->Print( hfolder + plotname2 );
delete c0 ;
}