18 |
|
char *legMCsigTitle = "W #rightarrow e #nu"; //"Signal"; |
19 |
|
TString dataset=""; |
20 |
|
TString overallTitle="CMS preliminary 2010"; |
21 |
< |
TString CMen="#sqrt{s}=7TeV, #int L = 130 nb^{-1}"; |
21 |
> |
TString CMen="#sqrt{s}=7TeV, #int L = 890 nb^{-1}"; |
22 |
|
TString cuts1=""; |
23 |
< |
TString cuts2=""; |
24 |
< |
double rebin=2.; |
23 |
> |
Tstring cuts2=""; |
24 |
> |
double rebin=1.; |
25 |
|
bool isptplot; |
26 |
+ |
|
27 |
+ |
bool normalizeToArea=false; |
28 |
+ |
|
29 |
|
//--------------------------------------------------------------------------- |
30 |
|
setTDRStyle(); |
31 |
|
gROOT->ForceStyle(); |
80 |
|
|
81 |
|
// } |
82 |
|
|
83 |
< |
islog=1; |
83 |
> |
|
84 |
> |
cout<<"here"<<endl; |
85 |
> |
|
86 |
> |
islog=0; |
87 |
|
// if(name.Index(eta)>-1||name.Index(phi)>-1||name.Index(hits)>-1 || name.Index(emf)>-1 || name.Index(CHF)>-1 || name.Index(NHF)>-1|| name.Index(NEF)>-1||name.Index(cons)>-1) islog=0; |
88 |
|
TH1D * h_data= data->Get(key->GetName()); |
89 |
|
TH1D * h_mc=mc->Get(key->GetName()); |
91 |
|
TH1D * h_ttbar=mcTTbar->Get(key->GetName()); |
92 |
|
TH1D * h_sig=mcSignal->Get(key->GetName()); |
93 |
|
// only for filled histos |
94 |
< |
// if( h_mc->GetEntries()!=0) { |
94 |
> |
if( h_mc->GetEntries()!=0) { |
95 |
> |
|
96 |
|
// |
97 |
|
|
98 |
|
|
99 |
< |
// cout<<"here"<<endl; |
99 |
> |
cout<<"here"<<endl; |
100 |
> |
} |
101 |
> |
// h_data->SetTitle(overallTitle); |
102 |
> |
// h_mc->SetTitle(overallTitle); |
103 |
> |
// h_other->SetTitle(overallTitle); |
104 |
> |
// h_ttbar->SetTitle(overallTitle); |
105 |
> |
// h_sig->SetTitle(overallTitle); |
106 |
> |
|
107 |
> |
|
108 |
|
|
94 |
– |
h_data->SetTitle(overallTitle); |
95 |
– |
h_mc->SetTitle(overallTitle); |
96 |
– |
h_other->SetTitle(overallTitle); |
97 |
– |
h_ttbar->SetTitle(overallTitle); |
98 |
– |
h_sig->SetTitle(overallTitle); |
109 |
|
// if(name.Index(pt)>-1) { |
110 |
|
// h_data->SetYTitle("Jets/GeV"); |
111 |
|
// h_mc->SetYTitle("Jets/GeV"); |
149 |
|
|
150 |
|
|
151 |
|
// h_mc->Scale(scalefactor); |
152 |
< |
// h_mc->Rebin(rebin); |
153 |
< |
// h_sig->Rebin(rebin); |
154 |
< |
// h_data->Rebin(rebin); |
152 |
> |
|
153 |
> |
|
154 |
> |
// h_mc->Rebin(rebin); |
155 |
> |
// h_sig->Rebin(rebin); |
156 |
> |
// h_data->Rebin(rebin); |
157 |
> |
|
158 |
|
// h_mc->SetMaximum(1.5*h_data->GetMaximum()); |
159 |
|
|
160 |
|
|
161 |
< |
h_mc->SetFillColor(colour); |
149 |
< |
h_mc->SetLineColor(1); |
161 |
> |
h_data->SetMarkerStyle(20); |
162 |
|
h_other->SetFillColor(8); |
163 |
|
h_other->SetLineColor(1); |
164 |
|
h_ttbar->SetFillColor(15); |
165 |
|
h_ttbar->SetLineColor(1); |
166 |
|
h_sig->SetFillColor(46); |
167 |
|
h_sig->SetLineColor(1); |
168 |
< |
h_data->SetMarkerStyle(20); |
168 |
> |
h_mc->SetFillColor(colour); |
169 |
> |
h_mc->SetLineColor(1); |
170 |
|
|
171 |
|
|
172 |
|
// h_data->SetTitle(overallTitle); |
178 |
|
|
179 |
|
|
180 |
|
//draw title |
181 |
< |
MoveStatsAndDraw(h_data , h_mc, h_other, h_ttbar, h_sig, legDataTitle, legMCTitle, legMCsigTitle, legMCotherTitle, legMCttbarTitle, overallTitle, CMen, islog, colour, false, cuts1, cuts2, isptplot); |
181 |
> |
MoveStatsAndDraw(h_data , h_mc, h_other, h_ttbar, h_sig, legDataTitle, legMCTitle, legMCsigTitle, legMCotherTitle, legMCttbarTitle, overallTitle, CMen, islog, colour, false, cuts1, cuts2, isptplot, normalizeToArea); |
182 |
|
|
183 |
|
char histname [256]; |
184 |
< |
sprintf (histname, "plotting/%s.gif", key->GetName()); |
184 |
> |
sprintf (histname, "plottingTest/%s.gif", key->GetName()); |
185 |
|
// cout<<key->GetName()<<endl; |
186 |
|
char test [256];//="s_El_ElCharge_"; |
187 |
|
// index++; |
229 |
|
|
230 |
|
|
231 |
|
//------------------------------------------------------------------------------------- |
232 |
< |
void MoveStatsAndDraw (TH1 *data, TH1 *mc, TH1 *other, TH1 *ttbar, TH1 *sig, char *dataTitle, char* mcTitle, char *mcSigTitle, char* otherTitle, char *ttbarTitle, char* firstline, char* secondline, int log, int col, bool stat, TString cut1, TString cut2, bool movepave){ |
232 |
> |
void MoveStatsAndDraw (TH1 *data, TH1 *mc, TH1 *other, TH1 *ttbar, TH1 *sig, char *dataTitle, char* mcTitle, char *mcSigTitle, char* otherTitle, char *ttbarTitle, char* firstline, char* secondline, int log, int col, bool stat, TString cut1, TString cut2, bool movepave, bool normalizeToArea){ |
233 |
|
|
234 |
|
c->SetLogy(log); |
235 |
|
|
236 |
+ |
if(normalizeToArea) { |
237 |
+ |
double S=sig->Integral(); |
238 |
+ |
double N=mc->Integral(); |
239 |
+ |
double f=1; |
240 |
+ |
if(N!=0) f = S/N; |
241 |
+ |
mc->Scale(f); |
242 |
+ |
other->Scale(f); |
243 |
+ |
ttbar->Scale(f); |
244 |
+ |
sig->Scale(f); |
245 |
+ |
} |
246 |
+ |
|
247 |
+ |
|
248 |
+ |
|
249 |
|
// maximumData; |
250 |
|
// double maximumMc; |
251 |
|
int maximumData=data->GetBinContent(data->GetMaximumBin()); |
256 |
|
|
257 |
|
// if(data->GetBinContent(data->GetMaximum())<mc->GetBinContent(mc->GetMaximum())) { |
258 |
|
if(maximumData<maximumMc) { |
259 |
< |
sig->SetMaximum(maximumMc * 1.6); |
259 |
> |
// sig->SetMaximum(maximumMc * 2.5); |
260 |
> |
mc->SetMaximum(maximumMc * 2.5); |
261 |
|
if(log==1) sig->SetMinimum(0.0001); |
262 |
|
if(log==0) sig->SetMinimum(0.); |
263 |
|
mc->Draw(""); |
267 |
|
data->Draw("pe1sames"); |
268 |
|
} |
269 |
|
else { |
270 |
< |
data->SetMaximum(maximumData * 1.6); |
270 |
> |
data->SetMaximum(maximumData * 2.5); |
271 |
|
if(log==1) data->SetMinimum(0.0001); |
272 |
|
if(log==0) data->SetMinimum(0.); |
273 |
|
data->Draw("pe1"); |