170 |
|
|
171 |
|
} |
172 |
|
|
173 |
< |
vector<float> compute_one_upper_limit(float mceff,float mcefferr, int ibin, string mcjzb, string plotfilename, bool doobserved) { |
173 |
> |
vector<float> compute_one_upper_limit(float mceff,float mcefferr, int ibin, string mcjzb, string plotfilename, bool doexpected) { |
174 |
|
float sigma95=-9.9,sigma95A=-9.9; |
175 |
|
/* |
176 |
|
USAGE OF ROOSTATS_CL95 |
215 |
|
|
216 |
|
dout << "Calling limit capsule instead of calling : CL95(" << luminosity << "," << lumiuncert*luminosity << "," << mceff << "," << mcefferr << "," << Npred[ibin] << "," << Nprederr[ibin] << "," << Nobs[ibin] << "," << false << "," << nuisancemodel<< ") " << endl; |
217 |
|
|
218 |
< |
stringstream command; |
219 |
< |
command << PlottingSetup::cbafbasedir << "/DistributedModelCalculations/Limits/LimitCapsule.exec " << repname.str() << " " << luminosity << " " << luminosity*lumiuncert << " " << mceff << " " << mcefferr << " " << Npred[ibin] << " " << Nprederr[ibin] << " " << Nobs[ibin] << " " << -1 << " " << plotfilename; |
218 |
> |
write_warning(__FUNCTION__,"To update to roostats, replace LimitCapsule.exec with NewLimitCapsule.exec below (line"+string(any2string(__LINE__))+")"); |
219 |
> |
stringstream command; // if you want to use roostats instead of cmscl95, please replace "LimitCapsule.exec" below with "NewLimitCapsule.exec" |
220 |
> |
command << PlottingSetup::cbafbasedir << "/DistributedModelCalculations/Limits/LimitCapsule.exec " << repname.str() << " " << luminosity << " " << luminosity*lumiuncert << " " << mceff << " " << mcefferr << " " << Npred[ibin] << " " << Nprederr[ibin] << " " << Nobs[ibin] << " " << -1 << " " << PlottingSetup::basedirectory << "/" << plotfilename << " " << doexpected; |
221 |
|
dout << command.str() << endl; |
222 |
|
|
223 |
|
int retval = 256; |
232 |
|
limres.readDroplet(repname.str()); |
233 |
|
dout << limres << endl; |
234 |
|
remove(repname.str().c_str()); |
235 |
< |
sigma95=limres.expected; |
235 |
> |
sigma95=limres.observed; |
236 |
|
|
237 |
|
|
238 |
|
///------------------------------------------ < /NEW > ---------------------------------------------------------- |
239 |
< |
//if(doobserved) nlimittoysused=nlimittoys; |
239 |
> |
//if(doexpected) nlimittoysused=nlimittoys; |
240 |
|
// nlimittoysused=nlimittoys; |
241 |
|
// dout << "Now calling : CL95(" << luminosity << "," << lumiuncert*luminosity << "," << mceff << "," << mcefferr << "," << Npred[ibin] << "," << Nprederr[ibin] << "," << Nobs[ibin] << "," << false << "," << nuisancemodel<< ") " << endl; |
242 |
|
// sigma95 = CL95(luminosity, lumiuncert*luminosity, mceff, mcefferr, Npred[ibin], Nprederr[ibin], Nobs[ibin], false, nuisancemodel); |
256 |
|
sigmas.push_back(limit.GetTwoSigmaLowRange());//expected, 2 down |
257 |
|
*/ |
258 |
|
// float limit = roostats_cl95(luminosity,lumiuncert*luminosity,mceff,mcefferr,Npred[ibin],Nprederr[ibin],nlimittoysused,false,nuisancemodel,limitmethod,plotfilename,0); |
259 |
< |
if(doobserved) { |
260 |
< |
write_warning(__FUNCTION__,"OBSERVED LIMITS HAVE BEEN SWITCHED OFF TEMPORARILY"); |
259 |
> |
if(doexpected) { |
260 |
> |
write_warning(__FUNCTION__,"EXPECTED LIMITS HAVE BEEN SWITCHED OFF TEMPORARILY"); |
261 |
|
// dout << "Now calling : CLA(" << luminosity << "," << lumiuncert*luminosity << "," << mceff << "," << mcefferr << "," << Npred[ibin] << "," << Nprederr[ibin] << "," << nuisancemodel<< ") " << endl; |
262 |
|
// sigma95A = CLA(luminosity, lumiuncert*luminosity, mceff, mcefferr, Npred[ibin], Nprederr[ibin], nuisancemodel); |
263 |
|
} |
273 |
|
write_warning(__FUNCTION__,"STILL MISSING SIGMAS, LIMITS, EVERYTHING ..."); |
274 |
|
} |
275 |
|
|
276 |
< |
void compute_upper_limits_from_counting_experiment(vector<vector<float> > uncertainties,vector<float> jzbcuts, string mcjzb, bool doobserved) { |
276 |
> |
void compute_upper_limits_from_counting_experiment(vector<vector<float> > uncertainties,vector<float> jzbcuts, string mcjzb, bool doexpected) { |
277 |
|
dout << "Doing counting experiment ... " << endl; |
278 |
|
vector<vector<string> > limits; |
279 |
|
vector<vector<float> > vlimits; |
298 |
|
// float expected=observed/luminosity; |
299 |
|
string plotfilename=(string)(TString(signalsamples.collection[isample].samplename)+TString("___JZB_geq_")+TString(any2string(JZBcutat))+TString(".png")); |
300 |
|
dout << "Sample: " << signalsamples.collection[isample].samplename << ", JZB>"<<JZBcutat<< " : " << mceff << " +/- " << staterr << " (stat) +/- " << systerr << " (syst) --> toterr = " << toterr << endl; |
301 |
< |
vector<float> sigmas = compute_one_upper_limit(mceff,toterr,ibin,mcjzb,plotfilename,doobserved); |
301 |
> |
vector<float> sigmas = compute_one_upper_limit(mceff,toterr,ibin,mcjzb,plotfilename,doexpected); |
302 |
|
|
303 |
< |
if(doobserved) { |
303 |
> |
if(doexpected) { |
304 |
|
// rows.push_back(any2string(sigmas[0])+";"+any2string(sigmas[1])+";"+"("+any2string(expected)+")"); |
305 |
|
rows.push_back(any2string(sigmas[0])+";"+any2string(sigmas[1])+";"+"("+any2string(signalsamples.collection[isample].xs)+")"); |
306 |
|
vrows.push_back(sigmas[0]); |
334 |
|
dout << endl; |
335 |
|
} |
336 |
|
|
337 |
< |
if(!doobserved) { |
337 |
> |
if(!doexpected) { |
338 |
|
dout << endl << endl << "LIMITS: (Tex)" << endl; |
339 |
|
tout << "\\begin{table}[hbtp]" << endl; |
340 |
|
tout << "\\renewcommand{\\arraystretch}{1.3}" << endl; |
373 |
|
} |
374 |
|
dout << endl; |
375 |
|
} |
375 |
– |
|
376 |
– |
write_warning(__FUNCTION__,"Still need to update the script"); |
376 |
|
} |
377 |
|
|
378 |
|
|