28 |
|
dout << "Info : The pt requirement is currently set to " << (const char*) passtrig << endl; |
29 |
|
dout << "Info : The mll requirement is currently set to " << (const char*) cutmass << endl; |
30 |
|
dout << "Info : The lepton requirement is currently set to " << (const char*) leptoncut << endl; |
31 |
+ |
dout << "Info : The weight applied to all MC is " << (const char*) cutWeight << endl; |
32 |
|
} |
33 |
|
|
34 |
|
|
86 |
|
|
87 |
|
void find_peaks(float &MCPeak,float &MCPeakError, float &DataPeak, float &DataPeakError, stringstream &result, bool doPUreweighting, stringstream &datajzb, stringstream &mcjzb) |
88 |
|
{ |
89 |
+ |
|
90 |
+ |
bool DoInvidualeemmPeaks=false; |
91 |
+ |
|
92 |
|
float mcpeak, datapeak; |
93 |
|
float mcpeakerr, datapeakerr; |
94 |
|
|
102 |
|
|
103 |
|
dout << "Finding global peak : " << endl; |
104 |
|
find_one_peak_combination(TCut(""),mcpeak,mcpeakerr, datapeak,datapeakerr,mcSigma, dataSigma,result,doPUreweighting,""); |
101 |
– |
dout << "Finding peak for electrons : " << endl; |
102 |
– |
find_one_peak_combination(TCut("id1==0"),mceepeak,mceepeakerr, dataeepeak,dataeepeakerr,mcSigma, dataSigma,result,doPUreweighting,"_ele"); |
103 |
– |
dout << "Finding peak for muons : " << endl; |
104 |
– |
find_one_peak_combination(TCut("id1==1"),mcmmpeak,mcmmpeakerr, datammpeak,datammpeakerr,mcSigma, dataSigma,result,doPUreweighting,"_mu"); |
105 |
– |
|
106 |
– |
datajzb << "(" << jzbvariabledata; |
107 |
– |
mcjzb << "(" << jzbvariablemc; |
108 |
– |
|
109 |
– |
if(dataeepeak>0) datajzb << "- (id1==id2)*(id1==0)*" << TMath::Abs(dataeepeak) << " "; |
110 |
– |
else datajzb << "+ (id1==id2)*(id1==0)*" << TMath::Abs(dataeepeak) << " "; |
111 |
– |
|
112 |
– |
if(datammpeak>0) datajzb << "- (id1==id2)*(id1==1)*" << TMath::Abs(datammpeak) << " "; |
113 |
– |
else datajzb << "+ (id1==id2)*(id1==1)*" << TMath::Abs(datammpeak) << " "; |
114 |
– |
|
115 |
– |
if(datapeak>0) datajzb << "- (id1!=id2)*" << TMath::Abs(datapeak) << " "; |
116 |
– |
else datajzb << "+ (id1!=id2)*" << TMath::Abs(datapeak) << " "; |
117 |
– |
|
118 |
– |
datajzb << ")"; |
105 |
|
|
106 |
< |
if(mceepeak>0) mcjzb << "- (id1==id2)*(id1==0)*" << TMath::Abs(mceepeak) << " "; |
107 |
< |
else mcjzb << "+ (id1==id2)*(id1==0)*" << TMath::Abs(mceepeak) << " "; |
108 |
< |
|
109 |
< |
if(mcmmpeak>0) mcjzb << "- (id1==id2)*(id1==1)*" << TMath::Abs(mcmmpeak) << " "; |
110 |
< |
else mcjzb << "+ (id1==id2)*(id1==1)*" << TMath::Abs(mcmmpeak) << " "; |
111 |
< |
|
112 |
< |
if(mcpeak>0) mcjzb << "- (id1!=id2)*" << TMath::Abs(mcpeak) << " "; |
113 |
< |
else mcjzb << "+ (id1!=id2)*" << TMath::Abs(mcpeak) << " "; |
106 |
> |
if(DoInvidualeemmPeaks) { |
107 |
> |
dout << "Finding peak for electrons : " << endl; |
108 |
> |
find_one_peak_combination(TCut("id1==0"),mceepeak,mceepeakerr, dataeepeak,dataeepeakerr,mcSigma, dataSigma,result,doPUreweighting,"_ele"); |
109 |
> |
dout << "Finding peak for muons : " << endl; |
110 |
> |
find_one_peak_combination(TCut("id1==1"),mcmmpeak,mcmmpeakerr, datammpeak,datammpeakerr,mcSigma, dataSigma,result,doPUreweighting,"_mu"); |
111 |
> |
|
112 |
> |
datajzb << "(" << jzbvariabledata; |
113 |
> |
mcjzb << "(" << jzbvariablemc; |
114 |
> |
|
115 |
> |
if(dataeepeak>0) datajzb << "- (id1==id2)*(id1==0)*" << TMath::Abs(dataeepeak) << " "; |
116 |
> |
else datajzb << "+ (id1==id2)*(id1==0)*" << TMath::Abs(dataeepeak) << " "; |
117 |
> |
|
118 |
> |
if(datammpeak>0) datajzb << "- (id1==id2)*(id1==1)*" << TMath::Abs(datammpeak) << " "; |
119 |
> |
else datajzb << "+ (id1==id2)*(id1==1)*" << TMath::Abs(datammpeak) << " "; |
120 |
> |
|
121 |
> |
if(datapeak>0) datajzb << "- (id1!=id2)*" << TMath::Abs(datapeak) << " "; |
122 |
> |
else datajzb << "+ (id1!=id2)*" << TMath::Abs(datapeak) << " "; |
123 |
> |
|
124 |
> |
datajzb << ")"; |
125 |
> |
|
126 |
> |
if(mceepeak>0) mcjzb << "- (id1==id2)*(id1==0)*" << TMath::Abs(mceepeak) << " "; |
127 |
> |
else mcjzb << "+ (id1==id2)*(id1==0)*" << TMath::Abs(mceepeak) << " "; |
128 |
> |
|
129 |
> |
if(mcmmpeak>0) mcjzb << "- (id1==id2)*(id1==1)*" << TMath::Abs(mcmmpeak) << " "; |
130 |
> |
else mcjzb << "+ (id1==id2)*(id1==1)*" << TMath::Abs(mcmmpeak) << " "; |
131 |
> |
|
132 |
> |
if(mcpeak>0) mcjzb << "- (id1!=id2)*" << TMath::Abs(mcpeak) << " "; |
133 |
> |
else mcjzb << "+ (id1!=id2)*" << TMath::Abs(mcpeak) << " "; |
134 |
> |
|
135 |
> |
mcjzb << ")"; |
136 |
> |
} else { |
137 |
> |
datajzb << "(" << jzbvariabledata; |
138 |
> |
mcjzb << "(" << jzbvariablemc; |
139 |
> |
|
140 |
> |
if(datapeak>0) datajzb << "- " << TMath::Abs(datapeak) << " "; |
141 |
> |
else datajzb << "+ " << TMath::Abs(datapeak) << " "; |
142 |
> |
|
143 |
> |
datajzb << ")"; |
144 |
> |
|
145 |
> |
if(mcpeak>0) mcjzb << "- " << TMath::Abs(mcpeak) << " "; |
146 |
> |
else mcjzb << "+ " << TMath::Abs(mcpeak) << " "; |
147 |
> |
|
148 |
> |
mcjzb << ")"; |
149 |
> |
} |
150 |
> |
|
151 |
|
|
129 |
– |
mcjzb << ")"; |
152 |
|
} |
153 |
|
|
154 |
|
void make_special_obs_pred_mll_plot(string mcjzb, float jzbthreshold) { |
170 |
|
smallerzeroS << "(" << mcjzb << "<-" << jzbthreshold << ")"; |
171 |
|
TCut smallerzero(smallerzeroS.str().c_str()); |
172 |
|
|
173 |
< |
TH1F *RcorrJZBeemm = allsamples.Draw("RcorrJZBeemm", "mll",nbins,min,max, "m_{ll} [GeV]", "events", cutmass&&cutOSSF&&cutnJets&&largerzero,data,luminosity); |
174 |
< |
THStack mcRcorrJZBeemm = allsamples.DrawStack("mcRcorrJZBeemm","mll",nbins,min,max, "m_{ll} [GeV}", "events", cutmass&&cutOSSF&&cutnJets&&largerzero,mc,luminosity); |
175 |
< |
TH1F *LcorrJZBeemm = allsamples.Draw("LcorrJZBeemm", "mll",nbins,min,max, "m_{ll} [GeV]", "events", cutmass&&cutOSSF&&cutnJets&&smallerzero,data,luminosity); |
176 |
< |
TH1F *RcorrJZBem = allsamples.Draw("RcorrJZBem", "mll",nbins,min,max, "m_{ll} [GeV]", "events", cutmass&&cutOSOF&&cutnJets&&largerzero,data,luminosity); |
177 |
< |
TH1F *LcorrJZBem = allsamples.Draw("LcorrJZBem", "mll",nbins,min,max, "m_{ll} [GeV]", "events", cutmass&&cutOSOF&&cutnJets&&smallerzero,data,luminosity); |
173 |
> |
TH1F *RcorrJZBeemm = allsamples.Draw("RcorrJZBeemm", "mll",nbins,min,max, "m_{ll} [GeV]", "events", cutmass&&cutOSSF&&cutnJets,data,luminosity); |
174 |
> |
THStack mcRcorrJZBeemm = allsamples.DrawStack("mcRcorrJZBeemm","mll",nbins,min,max, "m_{ll} [GeV}", "events", cutmass&&cutOSSF&&cutnJets,mc,luminosity); |
175 |
> |
TH1F *LcorrJZBeemm = allsamples.Draw("LcorrJZBeemm", "mll",nbins,min,max, "m_{ll} [GeV]", "events", cutmass&&cutOSSF&&cutnJets,data,luminosity); |
176 |
> |
TH1F *RcorrJZBem = allsamples.Draw("RcorrJZBem", "mll",nbins,min,max, "m_{ll} [GeV]", "events", cutmass&&cutOSOF&&cutnJets,data,luminosity); |
177 |
> |
TH1F *LcorrJZBem = allsamples.Draw("LcorrJZBem", "mll",nbins,min,max, "m_{ll} [GeV]", "events", cutmass&&cutOSOF&&cutnJets,data,luminosity); |
178 |
|
|
179 |
|
TH1F *RcorrJZBSBem; |
180 |
|
TH1F *LcorrJZBSBem; |
184 |
|
// TH1F *RcorrJZBeemmNoS; |
185 |
|
|
186 |
|
if(PlottingSetup::RestrictToMassPeak) { |
187 |
< |
RcorrJZBSBem = allsamples.Draw("RcorrJZBSBem", "mll",nbins,min,max, "JZB [GeV]", "events", sidebandcut&&cutOSOF&&cutnJets&&largerzero,data, luminosity); |
188 |
< |
LcorrJZBSBem = allsamples.Draw("LcorrJZBSBem", "mll",nbins,min,max, "JZB [GeV]", "events", sidebandcut&&cutOSOF&&cutnJets&&smallerzero,data, luminosity); |
189 |
< |
RcorrJZBSBeemm = allsamples.Draw("RcorrJZBSBeemm","mll",nbins,min,max, "JZB [GeV]", "events", sidebandcut&&cutOSSF&&cutnJets&&largerzero,data, luminosity); |
190 |
< |
LcorrJZBSBeemm = allsamples.Draw("LcorrJZBSBeemm","mll",nbins,min,max, "JZB [GeV]", "events", sidebandcut&&cutOSSF&&cutnJets&&smallerzero,data, luminosity); |
187 |
> |
RcorrJZBSBem = allsamples.Draw("RcorrJZBSBem", "mll",nbins,min,max, "JZB [GeV]", "events", sidebandcut&&cutOSOF&&cutnJets,data, luminosity); |
188 |
> |
LcorrJZBSBem = allsamples.Draw("LcorrJZBSBem", "mll",nbins,min,max, "JZB [GeV]", "events", sidebandcut&&cutOSOF&&cutnJets,data, luminosity); |
189 |
> |
RcorrJZBSBeemm = allsamples.Draw("RcorrJZBSBeemm","mll",nbins,min,max, "JZB [GeV]", "events", sidebandcut&&cutOSSF&&cutnJets,data, luminosity); |
190 |
> |
LcorrJZBSBeemm = allsamples.Draw("LcorrJZBSBeemm","mll",nbins,min,max, "JZB [GeV]", "events", sidebandcut&&cutOSSF&&cutnJets,data, luminosity); |
191 |
|
} |
192 |
|
|
193 |
|
TH1F *Bpred = (TH1F*)LcorrJZBeemm->Clone("Bpred"); |
949 |
|
float low=0; |
950 |
|
float hi=500; |
951 |
|
|
930 |
– |
stringstream largerzeroS; |
931 |
– |
largerzeroS << "("<<jzb<<">0)"; |
932 |
– |
TCut largerzero(largerzeroS.str().c_str()); |
933 |
– |
stringstream smallerzeroS; |
934 |
– |
smallerzeroS << "("<<jzb<<"<0)"; |
935 |
– |
TCut smallerzero(smallerzeroS.str().c_str()); |
936 |
– |
|
952 |
|
TH1F *blankback = new TH1F("blankback","blankback",int(high/10),0,high); |
953 |
< |
TH1F *RcorrJZBeemm = allsamples.Draw("RcorrJZBeemm",jzb.c_str(),nbins,low,hi, "JZB [GeV]", "events", cutmass&&cutOSSF&&cutnJets&&largerzero,is_data, luminosity,use_signal); |
954 |
< |
TH1F *LcorrJZBeemm = allsamples.Draw("LcorrJZBeemm",("-"+jzb).c_str(),nbins,low,hi, "JZB [GeV]", "events", cutmass&&cutOSSF&&cutnJets&&smallerzero,is_data, luminosity,use_signal); |
955 |
< |
TH1F *RcorrJZBem = allsamples.Draw("RcorrJZBem",jzb.c_str(),nbins,low,hi, "JZB [GeV]", "events", cutmass&&cutOSOF&&cutnJets&&largerzero,is_data, luminosity,use_signal); |
956 |
< |
TH1F *LcorrJZBem = allsamples.Draw("LcorrJZBem",("-"+jzb).c_str(),nbins,low,hi, "JZB [GeV]", "events", cutmass&&cutOSOF&&cutnJets&&smallerzero,is_data, luminosity,use_signal); |
953 |
> |
TH1F *RcorrJZBeemm = allsamples.Draw("RcorrJZBeemm",jzb.c_str(),nbins,low,hi, "JZB [GeV]", "events", cutmass&&cutOSSF&&cutnJets,is_data, luminosity,use_signal); |
954 |
> |
TH1F *LcorrJZBeemm = allsamples.Draw("LcorrJZBeemm",("-"+jzb).c_str(),nbins,low,hi, "JZB [GeV]", "events", cutmass&&cutOSSF&&cutnJets,is_data, luminosity,use_signal); |
955 |
> |
TH1F *RcorrJZBem = allsamples.Draw("RcorrJZBem",jzb.c_str(),nbins,low,hi, "JZB [GeV]", "events", cutmass&&cutOSOF&&cutnJets,is_data, luminosity,use_signal); |
956 |
> |
TH1F *LcorrJZBem = allsamples.Draw("LcorrJZBem",("-"+jzb).c_str(),nbins,low,hi, "JZB [GeV]", "events", cutmass&&cutOSOF&&cutnJets,is_data, luminosity,use_signal); |
957 |
|
|
958 |
|
blankback->GetXaxis()->SetTitle(RcorrJZBeemm->GetXaxis()->GetTitle()); |
959 |
|
blankback->GetYaxis()->SetTitle(RcorrJZBeemm->GetYaxis()->GetTitle()); |
970 |
|
|
971 |
|
//these are for the ratio |
972 |
|
|
973 |
< |
TH1F *JRcorrJZBeemm = allsamples.Draw("JRcorrJZBeemm",jzb.c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", cutmass&&cutOSSF&&cutnJets&&largerzero,is_data, luminosity,use_signal); |
974 |
< |
TH1F *JLcorrJZBeemm = allsamples.Draw("JLcorrJZBeemm",("-"+jzb).c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", cutmass&&cutOSSF&&cutnJets&&smallerzero,is_data, luminosity,use_signal); |
975 |
< |
TH1F *JRcorrJZBem = allsamples.Draw("JRcorrJZBem",jzb.c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", cutmass&&cutOSOF&&cutnJets&&largerzero,is_data, luminosity,use_signal); |
976 |
< |
TH1F *JLcorrJZBem = allsamples.Draw("JLcorrJZBem",("-"+jzb).c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", cutmass&&cutOSOF&&cutnJets&&smallerzero,is_data, luminosity,use_signal); |
973 |
> |
TH1F *JRcorrJZBeemm = allsamples.Draw("JRcorrJZBeemm",jzb.c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", cutmass&&cutOSSF&&cutnJets,is_data, luminosity,use_signal); |
974 |
> |
TH1F *JLcorrJZBeemm = allsamples.Draw("JLcorrJZBeemm",("-"+jzb).c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", cutmass&&cutOSSF&&cutnJets,is_data, luminosity,use_signal); |
975 |
> |
TH1F *JRcorrJZBem = allsamples.Draw("JRcorrJZBem",jzb.c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", cutmass&&cutOSOF&&cutnJets,is_data, luminosity,use_signal); |
976 |
> |
TH1F *JLcorrJZBem = allsamples.Draw("JLcorrJZBem",("-"+jzb).c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", cutmass&&cutOSOF&&cutnJets,is_data, luminosity,use_signal); |
977 |
|
|
978 |
|
TH1F *JRcorrJZBSBem; |
979 |
|
TH1F *JLcorrJZBSBem; |
980 |
|
TH1F *JRcorrJZBSBeemm; |
981 |
|
TH1F *JLcorrJZBSBeemm; |
982 |
|
|
983 |
< |
if(use_data==2 || overlay_signal) RcorrJZBeemmNoS = allsamples.Draw("RcorrJZBeemmNoS",jzb.c_str(),nbins,low,hi, "JZB [GeV]", "events", cutmass&&cutOSSF&&cutnJets&&largerzero,is_data, luminosity,false); |
983 |
> |
if(use_data==2 || overlay_signal) RcorrJZBeemmNoS = allsamples.Draw("RcorrJZBeemmNoS",jzb.c_str(),nbins,low,hi, "JZB [GeV]", "events", cutmass&&cutOSSF&&cutnJets,is_data, luminosity,false); |
984 |
|
|
985 |
|
|
986 |
|
if(PlottingSetup::RestrictToMassPeak) { |
987 |
< |
RcorrJZBSBem = allsamples.Draw("RcorrJZBSBem",jzb.c_str(),nbins,low,hi, "JZB [GeV]", "events", sidebandcut&&cutOSOF&&cutnJets&&largerzero,is_data, luminosity,use_signal); |
988 |
< |
LcorrJZBSBem = allsamples.Draw("LcorrJZBSBem",("-"+jzb).c_str(),nbins,low,hi, "JZB [GeV]", "events", sidebandcut&&cutOSOF&&cutnJets&&smallerzero,is_data, luminosity,use_signal); |
989 |
< |
RcorrJZBSBeemm = allsamples.Draw("RcorrJZBSBeemm",jzb.c_str(),nbins,low,hi, "JZB [GeV]", "events", sidebandcut&&cutOSSF&&cutnJets&&largerzero,is_data, luminosity,use_signal); |
990 |
< |
LcorrJZBSBeemm = allsamples.Draw("LcorrJZBSBeemm",("-"+jzb).c_str(),nbins,low,hi, "JZB [GeV]", "events", sidebandcut&&cutOSSF&&cutnJets&&smallerzero,is_data, luminosity,use_signal); |
987 |
> |
RcorrJZBSBem = allsamples.Draw("RcorrJZBSBem",jzb.c_str(),nbins,low,hi, "JZB [GeV]", "events", sidebandcut&&cutOSOF&&cutnJets,is_data, luminosity,use_signal); |
988 |
> |
LcorrJZBSBem = allsamples.Draw("LcorrJZBSBem",("-"+jzb).c_str(),nbins,low,hi, "JZB [GeV]", "events", sidebandcut&&cutOSOF&&cutnJets,is_data, luminosity,use_signal); |
989 |
> |
RcorrJZBSBeemm = allsamples.Draw("RcorrJZBSBeemm",jzb.c_str(),nbins,low,hi, "JZB [GeV]", "events", sidebandcut&&cutOSSF&&cutnJets,is_data, luminosity,use_signal); |
990 |
> |
LcorrJZBSBeemm = allsamples.Draw("LcorrJZBSBeemm",("-"+jzb).c_str(),nbins,low,hi, "JZB [GeV]", "events", sidebandcut&&cutOSSF&&cutnJets,is_data, luminosity,use_signal); |
991 |
|
|
992 |
|
//these are for the ratio |
993 |
< |
JRcorrJZBSBem = allsamples.Draw("JRcorrJZBSBem",jzb.c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", sidebandcut&&cutOSOF&&cutnJets&&largerzero,is_data, luminosity,use_signal); |
994 |
< |
JLcorrJZBSBem = allsamples.Draw("JLcorrJZBSBem",("-"+jzb).c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", sidebandcut&&cutOSOF&&cutnJets&&smallerzero,is_data, luminosity,use_signal); |
995 |
< |
JRcorrJZBSBeemm = allsamples.Draw("JRcorrJZBSBeemm",jzb.c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", sidebandcut&&cutOSSF&&cutnJets&&largerzero,is_data, luminosity,use_signal); |
996 |
< |
JLcorrJZBSBeemm = allsamples.Draw("JLcorrJZBSBeemm",("-"+jzb).c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", sidebandcut&&cutOSSF&&cutnJets&&smallerzero,is_data, luminosity,use_signal); |
993 |
> |
JRcorrJZBSBem = allsamples.Draw("JRcorrJZBSBem",jzb.c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", sidebandcut&&cutOSOF&&cutnJets,is_data, luminosity,use_signal); |
994 |
> |
JLcorrJZBSBem = allsamples.Draw("JLcorrJZBSBem",("-"+jzb).c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", sidebandcut&&cutOSOF&&cutnJets,is_data, luminosity,use_signal); |
995 |
> |
JRcorrJZBSBeemm = allsamples.Draw("JRcorrJZBSBeemm",jzb.c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", sidebandcut&&cutOSSF&&cutnJets,is_data, luminosity,use_signal); |
996 |
> |
JLcorrJZBSBeemm = allsamples.Draw("JLcorrJZBSBeemm",("-"+jzb).c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", sidebandcut&&cutOSSF&&cutnJets,is_data, luminosity,use_signal); |
997 |
|
} |
998 |
|
|
999 |
|
TH1F *lm4RcorrJZBeemm; |
1000 |
< |
if(overlay_signal || use_data == 2 || use_data == 1) lm4RcorrJZBeemm = allsamples.Draw("lm4RcorrJZBSBeemm",jzb.c_str(),nbins,low,hi, "JZB [GeV]", "events", cutmass&&cutOSSF&&cutnJets&&largerzero,is_data, luminosity,allsamples.FindSample("LM")); |
1000 |
> |
if(overlay_signal || use_data == 2 || use_data == 1) lm4RcorrJZBeemm = allsamples.Draw("lm4RcorrJZBSBeemm",jzb.c_str(),nbins,low,hi, "JZB [GeV]", "events", cutmass&&cutOSSF&&cutnJets,is_data, luminosity,allsamples.FindSample("LM")); |
1001 |
|
|
1002 |
|
flag_this_change(__FUNCTION__,__LINE__,true);//PlottingSetup::RestrictToMassPeak ---- prediction changed. |
1003 |
|
|
1158 |
|
speciallegBpred->AddEntry(RcorrJZBeemm,"Data","pl"); |
1159 |
|
speciallegBpred->AddEntry(Bpred,"Total background","l"); |
1160 |
|
speciallegBpred->AddEntry(jzbnegative,"JZB<0 (data)","f"); |
1161 |
< |
speciallegBpred->AddEntry(sidebandsemu,"Sidebands/e#mu (data)","f"); |
1161 |
> |
if(PlottingSetup::RestrictToMassPeak) speciallegBpred->AddEntry(sidebandsemu,"Sidebands/e#mu (data)","f"); |
1162 |
> |
else speciallegBpred->AddEntry(sidebandsemu,"e#mu (data)","f"); |
1163 |
|
// speciallegBpred->AddEntry(lm4RcorrJZBeemmC,"LM4","l"); |
1164 |
|
speciallegBpred->AddEntry(lm4RcorrJZBeemm,"LM4","l"); |
1165 |
|
speciallegBpred->Draw(); |
1166 |
|
save_with_ratio(JRcorrJZBeemm,JBpred,predcomppad,subdir+"Bpred_Data_____PredictionComposition",true,true,"data/pred",BpredSys); |
1167 |
|
|
1168 |
|
TCanvas *specialcanv = new TCanvas("specialcanv","specialcanv"); |
1169 |
< |
THStack kostack = allsamples.DrawStack("RcorrJZBeemm",jzb.c_str(),nbins,low,hi, "JZB [GeV]", "events", cutmass&&cutOSSF&&cutnJets,!is_data, luminosity,use_signal); |
1169 |
> |
specialcanv->SetLogy(1); |
1170 |
> |
// THStack kostack = allsamples.DrawStack("RcorrJZBeemm",jzb.c_str(),nbins,low,hi, "JZB [GeV]", "events", cutmass&&cutOSSF&&cutnJets,!is_data, luminosity,use_signal); |
1171 |
|
blankback->Draw(); |
1172 |
< |
kostack.Draw("same"); |
1172 |
> |
// kostack.Draw("same"); |
1173 |
> |
predcomposition.Draw(); |
1174 |
|
Bpred->Draw("hist,same"); |
1175 |
< |
analytical_function[0]->Draw("same"); analytical_function[1]->Draw("same");analytical_function[2]->Draw("same"); |
1175 |
> |
//analytical_function[0]->Draw("same"); analytical_function[1]->Draw("same");analytical_function[2]->Draw("same"); |
1176 |
|
RcorrJZBeemm->Draw("e1x0,same");//HAVE IT ON TOP! |
1177 |
|
legBpred->Draw(); |
1178 |
|
DrawPrelim(); |
1309 |
|
} |
1310 |
|
} |
1311 |
|
|
1312 |
+ |
TFile *f = new TFile("tester.root","RECREATE"); |
1313 |
+ |
RcorrJZBeemm->Write(); |
1314 |
+ |
Bpred->Write(); |
1315 |
+ |
f->Close(); |
1316 |
+ |
|
1317 |
|
delete RcorrJZBeemm; |
1318 |
|
delete LcorrJZBeemm; |
1319 |
|
delete RcorrJZBem; |
1326 |
|
|
1327 |
|
delete blankback; |
1328 |
|
|
1329 |
+ |
delete BpredSys; |
1330 |
|
if(PlottingSetup::RestrictToMassPeak) { |
1331 |
|
delete RcorrJZBSBem; |
1332 |
|
delete LcorrJZBSBem; |
2168 |
|
draw_ttbar_and_zjets_shape_for_one_configuration(mcjzb,datajzb,all_leptons,threejetswith30gev,true); |
2169 |
|
} |
2170 |
|
|
2171 |
< |
float find_one_correction_factor(string FindKeyword, TCut SpecialCut, string SaveAs) { |
2171 |
> |
float find_one_correction_factor(string FindKeyword, bool dodata, TCut SpecialCut, string SaveAs) { |
2172 |
|
TCanvas *cancorr = new TCanvas("cancorr","Canvas for Response Correction"); |
2173 |
|
cancorr->SetLogz(); |
2174 |
|
cancorr->SetRightMargin(0.13); |
2175 |
< |
TCut zptforresponsepresentation("pt<600"&&cutmass&&cutOSSF&&"((sumJetPt[1]/pt)<5.0)"&&SpecialCut); |
2175 |
> |
TCut zptforresponsepresentation("pt<600"&&cutmass&&cutOSSF&&"((sumJetPt[1]/pt)<5.0)"&&SpecialCut&&passtrig); |
2176 |
|
if(PlottingSetup::DoBTag) zptforresponsepresentation=zptforresponsepresentation&&PlottingSetup::bTagRequirement; |
2177 |
|
TH2F *niceresponseplotd = new TH2F("niceresponseplotd","",100,0,600,100,0,5); |
2178 |
|
vector<int> SampleIndices=allsamples.FindSample(FindKeyword); |
2179 |
|
for(int iSample=0;iSample<SampleIndices.size();iSample++) { |
2180 |
< |
dout << " Response correction : Using sample " << (allsamples.collection)[SampleIndices[iSample]].filename << endl; |
2180 |
> |
if((allsamples.collection)[SampleIndices[iSample]].is_data && !dodata) continue; |
2181 |
> |
if((allsamples.collection)[SampleIndices[iSample]].is_data ==false && dodata) continue; |
2182 |
> |
|
2183 |
> |
dout << " Response correction : Using sample " << (allsamples.collection)[SampleIndices[iSample]].filename << " for " << FindKeyword << endl; |
2184 |
|
(allsamples.collection)[SampleIndices[iSample]].events->Draw("sumJetPt[1]/pt:pt>>+niceresponseplotd",zptforresponsepresentation*cutWeight); |
2185 |
|
} |
2186 |
|
|
2215 |
|
|
2216 |
|
void find_correction_factors(string &jzbvardata,string &jzbvarmc) { |
2217 |
|
|
2218 |
+ |
dout << "Computing response corrections: " << endl; |
2219 |
|
//Step 1 : Get results |
2220 |
< |
float datacorrection=find_one_correction_factor("Data","","Data"); |
2221 |
< |
float mccorrection=find_one_correction_factor("DY","","MC"); |
2220 |
> |
float datacorrection=find_one_correction_factor("Data",true,"","Data"); |
2221 |
> |
float mccorrection=find_one_correction_factor("DY",false,"","MC"); |
2222 |
|
|
2223 |
< |
float dataEEcorrection=find_one_correction_factor("Data","id1==0","Data_ee"); |
2224 |
< |
float mcEEcorrection=find_one_correction_factor("DY","id1==0","MC_ee"); |
2223 |
> |
float dataEEcorrection=find_one_correction_factor("Data",true,"id1==0","Data_ee"); |
2224 |
> |
float mcEEcorrection=find_one_correction_factor("DY",false,"id1==0","MC_ee"); |
2225 |
|
|
2226 |
< |
float dataMMcorrection=find_one_correction_factor("Data","id1==1","Data_mm"); |
2227 |
< |
float mcMMcorrection=find_one_correction_factor("DY","id1==1","MC_mm"); |
2226 |
> |
float dataMMcorrection=find_one_correction_factor("Data",true,"id1==1","Data_mm"); |
2227 |
> |
float mcMMcorrection=find_one_correction_factor("DY",false,"id1==1","MC_mm"); |
2228 |
|
|
2229 |
|
cout << "Corrections : " << endl; |
2230 |
|
cout << " Data : " << datacorrection << endl; |
2232 |
|
cout << " MC : " << mccorrection << endl; |
2233 |
|
cout << " ee (" << mcEEcorrection << ") , mm (" << mcMMcorrection << ")" << endl; |
2234 |
|
|
2207 |
– |
cout << " result from new one for data: " << 0.937097 << endl; |
2208 |
– |
cout << " result from old one for data: " << 0.937097 << endl; |
2209 |
– |
cout << " result from new one for MC: " << 0.96848 << endl; |
2210 |
– |
cout << " result from old one for MC: " << 0.963502 << endl; |
2211 |
– |
|
2212 |
– |
|
2235 |
|
//Step 2: Processing the result and making it into something useful :-) |
2236 |
|
stringstream jzbvardatas; |
2237 |
|
jzbvardatas << "("; |
2244 |
|
|
2245 |
|
float averagecorrection=(dataMMcorrection+dataEEcorrection)/2.0; |
2246 |
|
|
2247 |
< |
if(averagecorrection>1) jzbvardatas<<"+((id1!=id2)*(jzb[1]-" << averagecorrection-1 << "*pt))"; |
2248 |
< |
if(averagecorrection<1) jzbvardatas<<"+((id1!=id2)*(jzb[1]-" << 1-averagecorrection << "*pt))"; |
2247 |
> |
if(datacorrection>=1) jzbvardatas<<"+((id1!=id2)*(jzb[1]-" << datacorrection-1 << "*pt))"; |
2248 |
> |
if(datacorrection<1) jzbvardatas<<"+((id1!=id2)*(jzb[1]+" << 1-datacorrection << "*pt))"; |
2249 |
|
|
2250 |
|
jzbvardatas << ")"; |
2251 |
|
jzbvardata=jzbvardatas.str(); |
2261 |
|
|
2262 |
|
float averagemccorrection=(mcMMcorrection+mcEEcorrection)/2.0; |
2263 |
|
|
2264 |
< |
if(averagemccorrection>1) jzbvarmcs<<"+((id1!=id2)*(jzb[1]-" << averagemccorrection-1 << "*pt))"; |
2265 |
< |
if(averagemccorrection<1) jzbvarmcs<<"+((id1!=id2)*(jzb[1]-" << 1-averagemccorrection << "*pt))"; |
2264 |
> |
if(mccorrection>=1) jzbvarmcs<<"+((id1!=id2)*(jzb[1]-" << mccorrection-1 << "*pt))"; |
2265 |
> |
if(mccorrection<1) jzbvarmcs<<"+((id1!=id2)*(jzb[1]+" << 1-mccorrection << "*pt))"; |
2266 |
|
|
2267 |
|
jzbvarmcs << ")"; |
2268 |
|
jzbvarmc=jzbvarmcs.str(); |
2364 |
|
//in the case of the on peak analysis, we compare the 3 control regions to the real value |
2365 |
|
//in the case of the OFF peak analysis, we compare our control region to the real value |
2366 |
|
TCut weightbackup=cutWeight; |
2367 |
< |
// cutWeight="1.0"; |
2367 |
> |
cutWeight="1.0"; |
2368 |
|
float simulatedlumi = luminosity; //in pb please - adjust to your likings |
2347 |
– |
|
2369 |
|
|
2370 |
|
TH1F *TZem = systsamples.Draw("TZem",mcjzb,binning,"JZB [GeV]","events",cutmass&&cutOSOF&&cutnJets,mc,simulatedlumi,systsamples.FindSample("TTJets")); |
2371 |
|
TH1F *nTZem = systsamples.Draw("nTZem","-"+mcjzb,binning,"JZB [GeV]","events",cutmass&&cutOSOF&&cutnJets,mc,simulatedlumi,systsamples.FindSample("TTJets")); |
2403 |
|
} |
2404 |
|
|
2405 |
|
vector<TH1F*> histos; |
2406 |
+ |
TZem->GetXaxis()->SetRangeUser(-100,binning[binning.size()-1]); |
2407 |
+ |
TZeemm->GetXaxis()->SetRangeUser(-100,binning[binning.size()-1]); |
2408 |
|
histos.push_back(TZem); |
2409 |
|
histos.push_back(TZeemm); |
2410 |
|
if(PlottingSetup::RestrictToMassPeak) { |
2411 |
+ |
TSeemm->GetXaxis()->SetRangeUser(-100,binning[binning.size()-1]); |
2412 |
+ |
TSem->GetXaxis()->SetRangeUser(-100,binning[binning.size()-1]); |
2413 |
|
histos.push_back(TSem); |
2414 |
|
histos.push_back(TSeemm); |
2415 |
|
} |
2536 |
|
tcan->SetLogy(0); |
2537 |
|
rightofzp->Divide(rightsfzp); |
2538 |
|
rightofzp->GetXaxis()->SetRangeUser(0.0,binning[binning.size()-1]); |
2539 |
< |
rightofzp->GetYaxis()->SetRangeUser(0.0,2.0); |
2539 |
> |
rightofzp->GetYaxis()->SetRangeUser(0.0,2.5); |
2540 |
|
rightofzp->GetYaxis()->SetTitle("#deltaJZB ratio"); |
2541 |
|
rightofzp->Draw(); |
2542 |
|
if(PlottingSetup::RestrictToMassPeak) { |
2596 |
|
|
2597 |
|
void ttbar_sidebands_comparison(string mcjzb, vector<float> jzb_binning) { |
2598 |
|
vector<float> nicer_binning; |
2599 |
< |
nicer_binning.push_back(-125); |
2599 |
> |
|
2600 |
> |
nicer_binning.push_back(-400); |
2601 |
> |
nicer_binning.push_back(-250); |
2602 |
> |
nicer_binning.push_back(-200); |
2603 |
> |
nicer_binning.push_back(-150); |
2604 |
> |
nicer_binning.push_back(-100); |
2605 |
> |
nicer_binning.push_back(-50); |
2606 |
> |
nicer_binning.push_back(-20); |
2607 |
> |
|
2608 |
> |
nicer_binning.push_back(0); |
2609 |
> |
nicer_binning.push_back(20); |
2610 |
> |
nicer_binning.push_back(50); |
2611 |
> |
nicer_binning.push_back(100); |
2612 |
> |
nicer_binning.push_back(150); |
2613 |
> |
nicer_binning.push_back(200); |
2614 |
> |
nicer_binning.push_back(250); |
2615 |
> |
nicer_binning.push_back(400); |
2616 |
> |
/* |
2617 |
|
nicer_binning.push_back(-100); |
2576 |
– |
nicer_binning.push_back(-75); |
2618 |
|
nicer_binning.push_back(-50); |
2619 |
|
nicer_binning.push_back(-25); |
2620 |
|
nicer_binning.push_back(0); |
2629 |
|
nicer_binning.push_back(230); |
2630 |
|
nicer_binning.push_back(280); |
2631 |
|
nicer_binning.push_back(400); |
2632 |
+ |
*/ |
2633 |
|
ttbar_sidebands_comparison(mcjzb,nicer_binning, "ttbar/"); |
2634 |
|
} |
2635 |
|
|
2651 |
|
|
2652 |
|
string mcjzb = mcjzbnoPU.str(); |
2653 |
|
dout << "The peak corrected JZB expression for MC without pileup is : " << mcjzb << endl; |
2612 |
– |
|
2613 |
– |
cutWeight="1.0"; |
2654 |
|
*/ |
2655 |
+ |
cutWeight="1.0"; |
2656 |
+ |
|
2657 |
|
string mcjzb = mcjzbWithPU; // this is with PURW, if you want without it you have to uncomment the part above (and comment out this line) |
2658 |
|
|
2659 |
|
vector<float> binning; |
2693 |
|
TH1F* hratio = (TH1F*)hJZBpos->Clone("hratio"); |
2694 |
|
hratio->Divide(hJZBneg); |
2695 |
|
|
2696 |
+ |
for(int i=1;i<=hJZBpos->GetNbinsX();i++) { |
2697 |
+ |
cout << "Positive: " << hJZBpos->GetBinContent(i) << " vs Negative : " << hJZBneg->GetBinContent(i) << endl; |
2698 |
+ |
} |
2699 |
+ |
|
2700 |
|
zcan->SetLogy(0); |
2701 |
|
hratio->GetYaxis()->SetRangeUser(0,2.5); |
2702 |
|
hratio->GetYaxis()->SetTitle("Observed/Predicted"); |