1 |
+ |
/**** |
2 |
+ |
|
3 |
+ |
Off peak status (RestrictToMassPeak) : |
4 |
+ |
|
5 |
+ |
x Necessary adaptations identified |
6 |
+ |
x Started working on necessary adaptations |
7 |
+ |
x Necessary adaptations implemented |
8 |
+ |
x Necessary adaptations tested |
9 |
+ |
|
10 |
+ |
DONE! |
11 |
+ |
|
12 |
+ |
|
13 |
+ |
****/ |
14 |
|
#include <iostream> |
15 |
|
#include <vector> |
16 |
|
#include <sys/stat.h> |
28 |
|
#include <TF1.h> |
29 |
|
#include <TSQLResult.h> |
30 |
|
#include <TProfile.h> |
31 |
+ |
#include <TSystem.h> |
32 |
+ |
#include "LimitDroplet.C" |
33 |
|
|
34 |
|
//#include "TTbar_stuff.C" |
35 |
|
using namespace std; |
183 |
|
|
184 |
|
} |
185 |
|
|
186 |
< |
vector<float> compute_one_upper_limit(float mceff,float mcefferr, int ibin, string mcjzb, bool doobserved=false) { |
187 |
< |
float sigma95=0.0,sigma95A=0.0; |
188 |
< |
int nuisancemodel=1; |
189 |
< |
dout << "Now calling : CL95(" << luminosity << "," << lumiuncert*luminosity << "," << mceff << "," << mcefferr << "," << Npred[ibin] << "," << Nprederr[ibin] << "," << Nobs[ibin] << "," << false << "," << nuisancemodel<< ") " << endl; |
190 |
< |
sigma95 = CL95(luminosity, lumiuncert*luminosity, mceff, mcefferr, Npred[ibin], Nprederr[ibin], Nobs[ibin], false, nuisancemodel); |
191 |
< |
if(doobserved) { |
192 |
< |
dout << "Now calling : CLA(" << luminosity << "," << lumiuncert*luminosity << "," << mceff << "," << mcefferr << "," << Npred[ibin] << "," << Nprederr[ibin] << "," << nuisancemodel<< ") " << endl; |
193 |
< |
sigma95A = CLA(luminosity, lumiuncert*luminosity, mceff, mcefferr, Npred[ibin], Nprederr[ibin], nuisancemodel); |
194 |
< |
} |
186 |
> |
vector<float> compute_one_upper_limit(float mceff,float mcefferr, int ibin, string mcjzb, string plotfilename, bool doexpected) { |
187 |
> |
float sigma95=-9.9,sigma95A=-9.9; |
188 |
> |
/* |
189 |
> |
USAGE OF ROOSTATS_CL95 |
190 |
> |
" Double_t limit = roostats_cl95(ilum, slum, eff, seff, bck, sbck, n, gauss = false, nuisanceModel, method, plotFileName, seed); \n" |
191 |
> |
" LimitResult expected_limit = roostats_clm(ilum, slum, eff, seff, bck, sbck, ntoys, nuisanceModel, method, seed); \n" |
192 |
> |
" Double_t average_limit = roostats_cla(ilum, slum, eff, seff, bck, sbck, nuisanceModel, method, seed); \n" |
193 |
> |
" \n" |
194 |
> |
" |
195 |
> |
" Double_t obs_limit = limit.GetObservedLimit(); \n" |
196 |
> |
" Double_t exp_limit = limit.GetExpectedLimit(); \n" |
197 |
> |
" Double_t exp_up = limit.GetOneSigmaHighRange(); \n" |
198 |
> |
" Double_t exp_down = limit.GetOneSigmaLowRange(); \n" |
199 |
> |
" Double_t exp_2up = limit.GetTwoSigmaHighRange(); \n" |
200 |
> |
" Double_t exp_2down = limit.GetTwoSigmaLowRange(); \n" |
201 |
> |
*/ |
202 |
> |
if(mceff<=0) { |
203 |
> |
write_warning(__FUNCTION__,"Cannot compute upper limit in this configuration as the efficiency is negative:"); |
204 |
> |
dout << "mc efficiency=" << mceff << " +/- " << mcefferr; |
205 |
> |
vector<float> sigmas; |
206 |
> |
sigmas.push_back(-1); |
207 |
> |
sigmas.push_back(-1); |
208 |
> |
return sigmas; |
209 |
> |
} else { |
210 |
> |
int nlimittoysused=1; |
211 |
> |
|
212 |
> |
///------------------------------------------ < NEW > ---------------------------------------------------------- |
213 |
> |
|
214 |
> |
int secondssince1970=time(NULL); |
215 |
> |
stringstream repname; |
216 |
> |
repname << PlottingSetup::cbafbasedir << "/exchange/report_" << secondssince1970 << "_"<<plotfilename<< "__"<< ".txt"; |
217 |
> |
|
218 |
> |
/* - report filename [1] |
219 |
> |
- luminosity [2] |
220 |
> |
- lumi uncert [3] |
221 |
> |
- MC efficiency [4] |
222 |
> |
- MC efficiency error [5] |
223 |
> |
- Npred [6] |
224 |
> |
- Nprederr [7] |
225 |
> |
- Nobs [8] |
226 |
> |
- JZB cut [9] |
227 |
> |
- plot name [10]*/ |
228 |
> |
|
229 |
> |
dout << "Calling limit capsule instead of calling : CL95(" << luminosity << "," << lumiuncert*luminosity << "," << mceff << "," << mcefferr << "," << Npred[ibin] << "," << Nprederr[ibin] << "," << Nobs[ibin] << "," << false << "," << nuisancemodel<< ") " << endl; |
230 |
> |
|
231 |
> |
stringstream command; |
232 |
> |
command << PlottingSetup::cbafbasedir << "/DistributedModelCalculations/Limits/TimedLimitCapsule.exec " << repname.str() << " " << luminosity << " " << luminosity*lumiuncert << " " << mceff << " " << mcefferr << " " << Npred[ibin] << " " << Nprederr[ibin] << " " << Nobs[ibin] << " " << -1 << " " << PlottingSetup::basedirectory << "/" << plotfilename << " " << doexpected; |
233 |
> |
dout << command.str() << endl; |
234 |
> |
|
235 |
> |
int retval = 256; |
236 |
> |
int attempts=0; |
237 |
> |
while(!(retval==0||attempts>=3)) {//try up to 3 times |
238 |
> |
attempts++; |
239 |
> |
dout << "Starting limit calculation (LimitCapsule) now : Attempt " << attempts << endl; |
240 |
> |
retval=gSystem->Exec(command.str().c_str()); |
241 |
> |
} |
242 |
> |
|
243 |
> |
LimitDroplet limres; |
244 |
> |
limres.readDroplet(repname.str()); |
245 |
> |
dout << limres << endl; |
246 |
> |
remove(repname.str().c_str()); |
247 |
> |
sigma95=limres.observed; |
248 |
> |
|
249 |
> |
|
250 |
> |
///------------------------------------------ < /NEW > ---------------------------------------------------------- |
251 |
|
vector<float> sigmas; |
252 |
|
sigmas.push_back(sigma95); |
253 |
< |
sigmas.push_back(sigma95A); |
253 |
> |
if(doexpected) { |
254 |
> |
sigmas.push_back(limres.expected); |
255 |
> |
sigmas.push_back(limres.upper68); |
256 |
> |
sigmas.push_back(limres.lower68); |
257 |
> |
sigmas.push_back(limres.upper95); |
258 |
> |
sigmas.push_back(limres.lower95); |
259 |
> |
} |
260 |
> |
|
261 |
|
return sigmas; |
262 |
+ |
|
263 |
+ |
|
264 |
+ |
}//end of mc efficiency is ok |
265 |
|
} |
266 |
|
|
267 |
< |
void compute_upper_limits_from_counting_experiment(vector<vector<float> > uncertainties,vector<float> jzbcuts, string mcjzb, bool doobserved) { |
267 |
> |
void compute_upper_limits_from_counting_experiment(vector<vector<float> > uncertainties,vector<float> jzbcuts, string mcjzb, bool doexpected) { |
268 |
|
dout << "Doing counting experiment ... " << endl; |
269 |
|
vector<vector<string> > limits; |
270 |
|
vector<vector<float> > vlimits; |
282 |
|
float staterr=uncertainties[isample*jzbcuts.size()+ibin][2]; |
283 |
|
float systerr=uncertainties[isample*jzbcuts.size()+ibin][3]; |
284 |
|
float toterr =uncertainties[isample*jzbcuts.size()+ibin][4]; |
285 |
< |
float observed,null,result; |
205 |
< |
fill_result_histos(observed, null,null,null,null,null,null,null,mcjzb,JZBcutat,(int)5,result,(signalsamples.FindSample(signalsamples.collection[isample].filename)),signalsamples); |
206 |
< |
observed-=result;//this is the actual excess we see! |
207 |
< |
float expected=observed/luminosity; |
285 |
> |
float observed,observederr,null,result; |
286 |
|
|
287 |
+ |
// fill_result_histos(observed,observederr, null,null,null,null,null,null,null,mcjzb,JZBcutat,14000,(int)5,result,(signalsamples.FindSample(signalsamples.collection[isample].filename)),signalsamples); |
288 |
+ |
// observed-=result;//this is the actual excess we see! |
289 |
+ |
// float expected=observed/luminosity; |
290 |
+ |
string plotfilename=(string)(TString(signalsamples.collection[isample].samplename)+TString("___JZB_geq_")+TString(any2string(JZBcutat))+TString(".png")); |
291 |
|
dout << "Sample: " << signalsamples.collection[isample].samplename << ", JZB>"<<JZBcutat<< " : " << mceff << " +/- " << staterr << " (stat) +/- " << systerr << " (syst) --> toterr = " << toterr << endl; |
292 |
< |
vector<float> sigmas = compute_one_upper_limit(mceff,toterr,ibin,mcjzb,doobserved); |
292 |
> |
vector<float> sigmas = compute_one_upper_limit(mceff,toterr,ibin,mcjzb,plotfilename,doexpected); |
293 |
|
|
294 |
< |
if(doobserved) { |
295 |
< |
rows.push_back(any2string(sigmas[0])+";"+any2string(sigmas[1])+";"+"("+any2string(expected)+")"); |
294 |
> |
if(doexpected) { |
295 |
> |
// rows.push_back(any2string(sigmas[0])+";"+any2string(sigmas[1])+";"+"("+any2string(expected)+")"); |
296 |
> |
rows.push_back(any2string(sigmas[0])+";"+any2string(sigmas[1])+";"+"("+any2string(signalsamples.collection[isample].xs)+")"); |
297 |
|
vrows.push_back(sigmas[0]); |
298 |
|
vrows.push_back(sigmas[1]); |
299 |
< |
vrows.push_back(expected); |
299 |
> |
// vrows.push_back(expected); |
300 |
> |
vrows.push_back(signalsamples.collection[isample].xs); |
301 |
|
} |
302 |
|
else { |
303 |
< |
rows.push_back(any2string(sigmas[0])+"("+any2string(expected)+")"); |
303 |
> |
// rows.push_back(any2string(sigmas[0])+"("+any2string(expected)+")"); |
304 |
> |
rows.push_back(any2string(sigmas[0])); |
305 |
|
vrows.push_back(sigmas[0]); |
306 |
< |
vrows.push_back(expected); |
306 |
> |
vrows.push_back(signalsamples.collection[isample].xs); |
307 |
> |
// vrows.push_back(expected); |
308 |
|
} |
309 |
|
}//end of bin loop |
310 |
|
limits.push_back(rows); |
311 |
|
vlimits.push_back(vrows); |
312 |
|
}//end of sample loop |
313 |
< |
dout << endl << endl << "PAS table 3: " << endl << endl; |
313 |
> |
dout << endl << endl << endl << "_________________________________________________________________________________________________" << endl << endl; |
314 |
> |
dout << endl << endl << "PAS table 3: (notation: limit [95%CL])" << endl << endl; |
315 |
|
dout << "\t"; |
316 |
|
for (int irow=0;irow<jzbcuts.size();irow++) { |
317 |
|
dout << jzbcuts[irow] << "\t"; |
319 |
|
dout << endl; |
320 |
|
for(int irow=0;irow<limits.size();irow++) { |
321 |
|
for(int ientry=0;ientry<limits[irow].size();ientry++) { |
322 |
< |
dout << limits[irow][ientry] << "\t"; |
322 |
> |
if (limits[irow][ientry]>0) dout << limits[irow][ientry] << "\t"; |
323 |
> |
else dout << " (N/A) \t"; |
324 |
|
} |
325 |
|
dout << endl; |
326 |
|
} |
327 |
|
|
328 |
< |
if(!doobserved) { |
329 |
< |
dout << endl << endl << "LIMITS: " << endl; |
330 |
< |
dout << "\t"; |
328 |
> |
if(!doexpected) { |
329 |
> |
dout << endl << endl << "LIMITS: (Tex)" << endl; |
330 |
> |
tout << "\\begin{table}[hbtp]" << endl; |
331 |
> |
tout << "\\renewcommand{\\arraystretch}{1.3}" << endl; |
332 |
> |
tout << "\\begin{center}" << endl; |
333 |
> |
tout << "\\caption{Observed upper limits on the cross section of different LM benchmark points " << (ConsiderSignalContaminationForLimits?" (accounting for signal contamination)":" (not accounting for signal contamination)") << "}\\label{tab:lmresults}" << endl; |
334 |
> |
tout << "" << endl; |
335 |
> |
tout << "\\begin{tabular}{ | l | "; |
336 |
> |
for (int irow=0;irow<jzbcuts.size();irow++) tout << " l |"; |
337 |
> |
tout << "} " << endl << " \\hline " << endl << "& \t "; |
338 |
|
for (int irow=0;irow<jzbcuts.size();irow++) { |
339 |
< |
dout << jzbcuts[irow] << "\t"; |
339 |
> |
tout << "JZB $>$ " << jzbcuts[irow] << " GeV & \t "; |
340 |
|
} |
341 |
< |
dout << endl; |
341 |
> |
tout << " \\\\ \\hline " << endl; |
342 |
|
for(int irow=0;irow<limits.size();irow++) { |
343 |
< |
dout << limits[irow][0] << "\t"; |
343 |
> |
tout << limits[irow][0] << " \t"; |
344 |
|
for(int ientry=0;ientry<jzbcuts.size();ientry++) { |
345 |
< |
dout << Round(vlimits[irow][2*ientry] / vlimits[irow][2*ientry+1],3)<< "\t"; |
345 |
> |
if(vlimits[irow][2*ientry]>0) tout << " & " << Round(vlimits[irow][2*ientry],2) << " \t (" << Round(vlimits[irow][2*ientry] / vlimits[irow][2*ientry+1],3)<< "x \\sigma ) \t"; |
346 |
> |
else tout << " & ( N / A ) \t"; |
347 |
> |
// dout << Round(vlimits[irow][2*ientry],3) << " / " << Round(vlimits[irow][2*ientry+1],3)<< "\t"; |
348 |
|
} |
349 |
< |
dout << endl; |
349 |
> |
tout << " \\\\ \\hline " << endl; |
350 |
|
} |
351 |
+ |
tout << "\\end{tabular}" << endl; |
352 |
+ |
tout << " \\end{tabular}"<< endl; |
353 |
+ |
tout << "\\end{center}"<< endl; |
354 |
+ |
tout << "\\end{table} "<< endl; |
355 |
+ |
|
356 |
|
}//do observed |
357 |
|
|
358 |
|
dout << endl << endl << "Final selection efficiencies with total statistical and systematic errors, and corresponding observed and expected upper limits (UL) on ($\\sigma\\times$ BR $\\times$ acceptance) for the LM4 and LM8 scenarios, in the different regions. The last column contains the predicted ($\\sigma \\times $BR$\\times$ acceptance) at NLO obtained from Monte Carlo simulation." << endl; |
359 |
< |
dout << "Scenario \t Efficiency [%] \t Upper limits [pb] \t Prediction [pb]" << endl; |
359 |
> |
dout << "Scenario \t Efficiency [%] \t Upper limits [pb] \t \\sigma [pb]" << endl; |
360 |
|
for(int icut=0;icut<jzbcuts.size();icut++) { |
361 |
< |
dout << "Region with JZB>" << jzbcuts[icut] << endl; |
361 |
> |
dout << "Region with JZB>" << jzbcuts[icut] << (ConsiderSignalContaminationForLimits?" (accounting for signal contamination)":" (not accounting for signal contamination)") << endl; |
362 |
|
for(int isample=0;isample<signalsamples.collection.size();isample++) { |
363 |
< |
dout << limits[icut][0] << "\t" << Round(100*uncertainties[isample*jzbcuts.size()+icut][1],1) << "+/-" << Round(100*uncertainties[isample*jzbcuts.size()+icut][2],1) << " (stat) +/- " << Round(100*uncertainties[isample*jzbcuts.size()+icut][3],1) << " (syst) \t" << Round((vlimits[isample][2*icut]),3) << "\t" << Round(vlimits[isample][2*icut+1],3) << endl; |
363 |
> |
dout << limits[isample][0] << "\t" << Round(100*uncertainties[isample*jzbcuts.size()+icut][1],3) << "+/-" << Round(100*uncertainties[isample*jzbcuts.size()+icut][2],3) << " (stat) +/- " << Round(100*uncertainties[isample*jzbcuts.size()+icut][3],3) << " (syst) \t" << Round((vlimits[isample][2*icut]),3) << "\t" << Round(vlimits[isample][2*icut+1],3) << endl; |
364 |
|
} |
365 |
|
dout << endl; |
366 |
|
} |
265 |
– |
|
266 |
– |
write_warning("compute_upper_limits_from_counting_experiment","Still need to update the script"); |
367 |
|
} |
368 |
|
|
369 |
|
|
416 |
|
TH1F *ZOSSFN = allsamples.Draw("ZOSSFN","-"+datajzb,binning, "JZB4limits", "events",cutmass&&cutOSSF&&limitnJetcut&&basiccut,dataormc,luminosity); |
417 |
|
TH1F *ZOSOFN = allsamples.Draw("ZOSOFN","-"+datajzb,binning, "JZB4limits", "events",cutmass&&cutOSOF&&limitnJetcut&&basiccut,dataormc,luminosity); |
418 |
|
|
419 |
< |
TH1F *SBOSSFP = allsamples.Draw("SBOSSFP",datajzb,binning, "JZB4limits", "events",cutOSSF&&limitnJetcut&&basiccut&&sidebandcut,dataormc,luminosity); |
420 |
< |
TH1F *SBOSOFP = allsamples.Draw("SBOSOFP",datajzb,binning, "JZB4limits", "events",cutOSOF&&limitnJetcut&&basiccut&&sidebandcut,dataormc,luminosity); |
421 |
< |
TH1F *SBOSSFN = allsamples.Draw("SBOSSFN","-"+datajzb,binning, "JZB4limits", "events",cutOSSF&&limitnJetcut&&basiccut&&sidebandcut,dataormc,luminosity); |
422 |
< |
TH1F *SBOSOFN = allsamples.Draw("SBOSOFN","-"+datajzb,binning, "JZB4limits", "events",cutOSOF&&limitnJetcut&&basiccut&&sidebandcut,dataormc,luminosity); |
419 |
> |
TH1F *SBOSSFP; |
420 |
> |
TH1F *SBOSOFP; |
421 |
> |
TH1F *SBOSSFN; |
422 |
> |
TH1F *SBOSOFN; |
423 |
|
|
424 |
|
TH1F *LZOSSFP = allsamples.Draw("LZOSSFP",mcjzb,binning, "JZB4limits", "events",cutmass&&cutOSSF&&limitnJetcut&&basiccut,mc,luminosity,allsamples.FindSample("LM4")); |
425 |
|
TH1F *LZOSOFP = allsamples.Draw("LZOSOFP",mcjzb,binning, "JZB4limits", "events",cutmass&&cutOSOF&&limitnJetcut&&basiccut,mc,luminosity,allsamples.FindSample("LM4")); |
426 |
|
TH1F *LZOSSFN = allsamples.Draw("LZOSSFN","-"+mcjzb,binning, "JZB4limits", "events",cutmass&&cutOSSF&&limitnJetcut&&basiccut,mc,luminosity,allsamples.FindSample("LM4")); |
427 |
|
TH1F *LZOSOFN = allsamples.Draw("LZOSOFN","-"+mcjzb,binning, "JZB4limits", "events",cutmass&&cutOSOF&&limitnJetcut&&basiccut,mc,luminosity,allsamples.FindSample("LM4")); |
428 |
|
|
429 |
< |
TH1F *LSBOSSFP = allsamples.Draw("LSBOSSFP",mcjzb,binning, "JZB4limits", "events",cutOSSF&&limitnJetcut&&basiccut&&sidebandcut,mc,luminosity,allsamples.FindSample("LM4")); |
430 |
< |
TH1F *LSBOSOFP = allsamples.Draw("LSBOSOFP",mcjzb,binning, "JZB4limits", "events",cutOSOF&&limitnJetcut&&basiccut&&sidebandcut,mc,luminosity,allsamples.FindSample("LM4")); |
431 |
< |
TH1F *LSBOSSFN = allsamples.Draw("LSBOSSFN","-"+mcjzb,binning, "JZB4limits", "events",cutOSSF&&limitnJetcut&&basiccut&&sidebandcut,mc,luminosity,allsamples.FindSample("LM4")); |
432 |
< |
TH1F *LSBOSOFN = allsamples.Draw("LSBOSOFN","-"+mcjzb,binning, "JZB4limits", "events",cutOSOF&&limitnJetcut&&basiccut&&sidebandcut,mc,luminosity,allsamples.FindSample("LM4")); |
429 |
> |
TH1F *LSBOSSFP; |
430 |
> |
TH1F *LSBOSOFP; |
431 |
> |
TH1F *LSBOSSFN; |
432 |
> |
TH1F *LSBOSOFN; |
433 |
> |
|
434 |
> |
flag_this_change(__FUNCTION__,__LINE__,false);//PlottingSetup::RestrictToMassPeak |
435 |
> |
if(PlottingSetup::RestrictToMassPeak) { |
436 |
> |
SBOSSFP = allsamples.Draw("SBOSSFP",datajzb,binning, "JZB4limits", "events",cutOSSF&&limitnJetcut&&basiccut&&sidebandcut,dataormc,luminosity); |
437 |
> |
SBOSOFP = allsamples.Draw("SBOSOFP",datajzb,binning, "JZB4limits", "events",cutOSOF&&limitnJetcut&&basiccut&&sidebandcut,dataormc,luminosity); |
438 |
> |
SBOSSFN = allsamples.Draw("SBOSSFN","-"+datajzb,binning, "JZB4limits", "events",cutOSSF&&limitnJetcut&&basiccut&&sidebandcut,dataormc,luminosity); |
439 |
> |
SBOSOFN = allsamples.Draw("SBOSOFN","-"+datajzb,binning, "JZB4limits", "events",cutOSOF&&limitnJetcut&&basiccut&&sidebandcut,dataormc,luminosity); |
440 |
> |
|
441 |
> |
LSBOSSFP = allsamples.Draw("LSBOSSFP",mcjzb,binning, "JZB4limits", "events",cutOSSF&&limitnJetcut&&basiccut&&sidebandcut,mc,luminosity,allsamples.FindSample("LM4")); |
442 |
> |
LSBOSOFP = allsamples.Draw("LSBOSOFP",mcjzb,binning, "JZB4limits", "events",cutOSOF&&limitnJetcut&&basiccut&&sidebandcut,mc,luminosity,allsamples.FindSample("LM4")); |
443 |
> |
LSBOSSFN = allsamples.Draw("LSBOSSFN","-"+mcjzb,binning, "JZB4limits", "events",cutOSSF&&limitnJetcut&&basiccut&&sidebandcut,mc,luminosity,allsamples.FindSample("LM4")); |
444 |
> |
LSBOSOFN = allsamples.Draw("LSBOSOFN","-"+mcjzb,binning, "JZB4limits", "events",cutOSOF&&limitnJetcut&&basiccut&&sidebandcut,mc,luminosity,allsamples.FindSample("LM4")); |
445 |
> |
} |
446 |
|
|
447 |
|
string obsname="data_obs"; |
448 |
|
string predname="background"; |
453 |
|
signalname="signal_"+identifier; |
454 |
|
} |
455 |
|
|
456 |
< |
TH1F *obs = (TH1F*)ZOSSFP->Clone(); |
456 |
> |
TH1F *obs = (TH1F*)ZOSSFP->Clone("observation"); |
457 |
|
obs->SetName(obsname.c_str()); |
458 |
|
obs->Write(); |
459 |
< |
TH1F *pred = (TH1F*)ZOSSFN->Clone(); |
460 |
< |
pred->Add(ZOSOFP,1.0/3); |
461 |
< |
pred->Add(ZOSOFN,-1.0/3); |
462 |
< |
pred->Add(SBOSSFP,1.0/3); |
463 |
< |
pred->Add(SBOSSFN,-1.0/3); |
464 |
< |
pred->Add(SBOSOFP,1.0/3); |
465 |
< |
pred->Add(SBOSOFN,-1.0/3); |
459 |
> |
TH1F *pred = (TH1F*)ZOSSFN->Clone("prediction"); |
460 |
> |
flag_this_change(__FUNCTION__,__LINE__,false);//PlottingSetup::RestrictToMassPeak |
461 |
> |
if(PlottingSetup::RestrictToMassPeak) { |
462 |
> |
pred->Add(ZOSOFP,1.0/3); |
463 |
> |
pred->Add(ZOSOFN,-1.0/3); |
464 |
> |
pred->Add(SBOSSFP,1.0/3); |
465 |
> |
pred->Add(SBOSSFN,-1.0/3); |
466 |
> |
pred->Add(SBOSOFP,1.0/3); |
467 |
> |
pred->Add(SBOSOFN,-1.0/3); |
468 |
> |
} else { |
469 |
> |
pred->Add(ZOSOFP,1.0); |
470 |
> |
pred->Add(ZOSOFN,-1.0); |
471 |
> |
} |
472 |
> |
|
473 |
|
pred->SetName(predname.c_str()); |
474 |
|
pred->Write(); |
475 |
|
|
480 |
|
TH1F *Lpred = new TH1F("Lpred","Lpred",binning.size()-1,&binning[0]); |
481 |
|
Lobs->Add(LZOSSFP); |
482 |
|
Lpred->Add(LZOSSFN); |
483 |
< |
Lpred->Add(LZOSOFP,1.0/3); |
484 |
< |
Lpred->Add(LZOSOFN,-1.0/3); |
485 |
< |
Lpred->Add(LSBOSSFP,1.0/3); |
486 |
< |
Lpred->Add(LSBOSSFN,-1.0/3); |
487 |
< |
Lpred->Add(LSBOSOFP,1.0/3); |
488 |
< |
Lpred->Add(LSBOSOFN,-1.0/3); |
483 |
> |
flag_this_change(__FUNCTION__,__LINE__,false);//PlottingSetup::RestrictToMassPeak |
484 |
> |
if(PlottingSetup::RestrictToMassPeak) { |
485 |
> |
Lpred->Add(LZOSOFP,1.0/3); |
486 |
> |
Lpred->Add(LZOSOFN,-1.0/3); |
487 |
> |
Lpred->Add(LSBOSSFP,1.0/3); |
488 |
> |
Lpred->Add(LSBOSSFN,-1.0/3); |
489 |
> |
Lpred->Add(LSBOSOFP,1.0/3); |
490 |
> |
Lpred->Add(LSBOSOFN,-1.0/3); |
491 |
> |
} else { |
492 |
> |
Lpred->Add(LZOSOFP,1.0); |
493 |
> |
Lpred->Add(LZOSOFN,-1.0); |
494 |
> |
} |
495 |
> |
|
496 |
|
TH1F *signal = (TH1F*)Lobs->Clone(); |
497 |
|
signal->Add(Lpred,-1); |
498 |
|
signal->SetName(signalname.c_str()); |
506 |
|
delete ZOSSFN; |
507 |
|
delete ZOSOFN; |
508 |
|
|
509 |
< |
delete SBOSSFP; |
510 |
< |
delete SBOSOFP; |
511 |
< |
delete SBOSSFN; |
512 |
< |
delete SBOSOFN; |
509 |
> |
if(PlottingSetup::RestrictToMassPeak) { |
510 |
> |
delete SBOSSFP; |
511 |
> |
delete SBOSOFP; |
512 |
> |
delete SBOSSFN; |
513 |
> |
delete SBOSOFN; |
514 |
> |
} |
515 |
|
|
516 |
|
delete LZOSSFP; |
517 |
|
delete LZOSOFP; |
518 |
|
delete LZOSSFN; |
519 |
|
delete LZOSOFN; |
520 |
|
|
521 |
< |
delete LSBOSSFP; |
522 |
< |
delete LSBOSOFP; |
523 |
< |
delete LSBOSSFN; |
524 |
< |
delete LSBOSOFN; |
521 |
> |
if(PlottingSetup::RestrictToMassPeak) { |
522 |
> |
delete LSBOSSFP; |
523 |
> |
delete LSBOSOFP; |
524 |
> |
delete LSBOSSFN; |
525 |
> |
delete LSBOSOFN; |
526 |
> |
} |
527 |
|
|
528 |
|
} |
529 |
|
|
573 |
|
limfile->Close(); |
574 |
|
write_info("prepare_limits","limitfile.root and datacard.txt have been generated. You can now use them to calculate limits!"); |
575 |
|
|
576 |
< |
} |
576 |
> |
} |