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 |
> |
islog=0; |
84 |
|
// 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; |
85 |
|
TH1D * h_data= data->Get(key->GetName()); |
86 |
|
TH1D * h_mc=mc->Get(key->GetName()); |
142 |
|
|
143 |
|
|
144 |
|
// h_mc->Scale(scalefactor); |
145 |
< |
// h_mc->Rebin(rebin); |
146 |
< |
// h_sig->Rebin(rebin); |
147 |
< |
// h_data->Rebin(rebin); |
145 |
> |
h_mc->Rebin(rebin); |
146 |
> |
h_sig->Rebin(rebin); |
147 |
> |
h_data->Rebin(rebin); |
148 |
> |
|
149 |
|
// h_mc->SetMaximum(1.5*h_data->GetMaximum()); |
150 |
|
|
151 |
|
|
169 |
|
|
170 |
|
|
171 |
|
//draw title |
172 |
< |
MoveStatsAndDraw(h_data , h_mc, h_other, h_ttbar, h_sig, legDataTitle, legMCTitle, legMCsigTitle, legMCotherTitle, legMCttbarTitle, overallTitle, CMen, islog, colour, false, cuts1, cuts2, isptplot); |
172 |
> |
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); |
173 |
|
|
174 |
|
char histname [256]; |
175 |
|
sprintf (histname, "plotting/%s.gif", key->GetName()); |
220 |
|
|
221 |
|
|
222 |
|
//------------------------------------------------------------------------------------- |
223 |
< |
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){ |
223 |
> |
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){ |
224 |
|
|
225 |
|
c->SetLogy(log); |
226 |
|
|
227 |
+ |
if(normalizeToArea) { |
228 |
+ |
double S=sig->Integral(); |
229 |
+ |
double N=mc->Integral(); |
230 |
+ |
double f=1; |
231 |
+ |
if(N!=0) f = S/N; |
232 |
+ |
mc->Scale(f); |
233 |
+ |
other->Scale(f); |
234 |
+ |
ttbar->Scale(f); |
235 |
+ |
sig->Scale(f); |
236 |
+ |
} |
237 |
+ |
|
238 |
+ |
|
239 |
+ |
|
240 |
|
// maximumData; |
241 |
|
// double maximumMc; |
242 |
|
int maximumData=data->GetBinContent(data->GetMaximumBin()); |
247 |
|
|
248 |
|
// if(data->GetBinContent(data->GetMaximum())<mc->GetBinContent(mc->GetMaximum())) { |
249 |
|
if(maximumData<maximumMc) { |
250 |
< |
sig->SetMaximum(maximumMc * 1.6); |
250 |
> |
// sig->SetMaximum(maximumMc * 2.5); |
251 |
> |
mc->SetMaximum(maximumMc * 2.5); |
252 |
|
if(log==1) sig->SetMinimum(0.0001); |
253 |
|
if(log==0) sig->SetMinimum(0.); |
254 |
|
mc->Draw(""); |
258 |
|
data->Draw("pe1sames"); |
259 |
|
} |
260 |
|
else { |
261 |
< |
data->SetMaximum(maximumData * 1.6); |
261 |
> |
data->SetMaximum(maximumData * 2.5); |
262 |
|
if(log==1) data->SetMinimum(0.0001); |
263 |
|
if(log==0) data->SetMinimum(0.); |
264 |
|
data->Draw("pe1"); |