229 |
|
if(flipped==0) dout << "Calling limit capsule instead of calling : CL95(" << luminosity << "," << lumiuncert*luminosity << "," << mceff << "," << mcefferr << "," << Npred[ibin] << "," << Nprederr[ibin] << "," << Nobs[ibin] << "," << false << "," << nuisancemodel<< ") " << endl; |
230 |
|
if(flipped>0) dout << "Calling limit capsule instead of calling : CL95(" << luminosity << "," << lumiuncert*luminosity << "," << mceff << "," << mcefferr << "," << flippedNpred[ibin] << "," << flippedNprederr[ibin] << "," << flippedNobs[ibin] << "," << false << "," << nuisancemodel<< ") " << endl; |
231 |
|
|
232 |
< |
stringstream command; |
233 |
< |
if(flipped==0) 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 << " " << doasymptotic; |
234 |
< |
if(flipped>0) command << PlottingSetup::cbafbasedir << "/DistributedModelCalculations/Limits/TimedLimitCapsule.exec " << repname.str() << " " << luminosity << " " << luminosity*lumiuncert << " " << mceff << " " << mcefferr << " " << flippedNpred[ibin] << " " << flippedNprederr[ibin] << " " << flippedNobs[ibin] << " " << -1 << " " << PlottingSetup::basedirectory << "/" << plotfilename << " " << doexpected<< " " << doasymptotic; |
235 |
< |
dout << command.str() << endl; |
232 |
> |
|
233 |
> |
// write_warning(__FUNCTION__,"Creating special case here"); |
234 |
> |
// time_t msec = time(NULL)*1000; |
235 |
> |
// stringstream TimeCapsuleDirectory; |
236 |
> |
// TimeCapsuleDirectory << PlottingSetup::cbafbasedir << "/exchange/TimeCapsuleDir" << msec; |
237 |
> |
// gSystem->Exec(((string)"mkdir -p "+TimeCapsuleDirectory.str()).c_str()); |
238 |
> |
// gSystem->Exec(((string)"cp "+PlottingSetup::cbafbasedir+"/DistributedModelCalculations/Limits/TimedLimitCapsule.exec "+TimeCapsuleDirectory.str()).c_str()); |
239 |
> |
|
240 |
> |
stringstream command; |
241 |
> |
if(flipped==0) 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 << " " << doasymptotic; |
242 |
> |
if(flipped>0) command << PlottingSetup::cbafbasedir << "/DistributedModelCalculations/Limits/TimedLimitCapsule.exec " << repname.str() << " " << luminosity << " " << luminosity*lumiuncert << " " << mceff << " " << mcefferr << " " << flippedNpred[ibin] << " " << flippedNprederr[ibin] << " " << flippedNobs[ibin] << " " << -1 << " " << PlottingSetup::basedirectory << "/" << plotfilename << " " << doexpected<< " " << doasymptotic; |
243 |
> |
// if(flipped==0) command << TimeCapsuleDirectory.str() <<"/TimedLimitCapsule.exec " << repname.str() << " " << luminosity << " " << luminosity*lumiuncert << " " << mceff << " " << mcefferr << " " << Npred[ibin] << " " << Nprederr[ibin] << " " << Nobs[ibin] << " " << -1 << " " << PlottingSetup::basedirectory << "/" << plotfilename << " " << doexpected << " " << doasymptotic; |
244 |
> |
// if(flipped>0) command << TimeCapsuleDirectory.str() <<"/TimedLimitCapsule.exec " << repname.str() << " " << luminosity << " " << luminosity*lumiuncert << " " << mceff << " " << mcefferr << " " << flippedNpred[ibin] << " " << flippedNprederr[ibin] << " " << flippedNobs[ibin] << " " << -1 << " " << PlottingSetup::basedirectory << "/" << plotfilename << " " << doexpected<< " " << doasymptotic; |
245 |
> |
|
246 |
> |
dout << command.str() << endl; |
247 |
|
|
248 |
< |
int retval = 256; |
249 |
< |
int attempts=0; |
250 |
< |
while(!(retval==0||attempts>=3)) {//try up to 3 times |
248 |
> |
if(doasymptotic) write_warning(__FUNCTION__, "DOING ASYMPTOTIC LIMIT!"); |
249 |
> |
|
250 |
> |
int retval = 256; |
251 |
> |
int attempts=0; |
252 |
> |
while(!(retval==0||attempts>=3)) {//try up to 3 times |
253 |
|
attempts++; |
254 |
|
dout << "Starting limit calculation (TimedLimitCapsule) now : Attempt " << attempts << endl; |
255 |
|
retval=gSystem->Exec(command.str().c_str()); |
268 |
|
remove(repname.str().c_str()); |
269 |
|
sigma95=limres.observed; |
270 |
|
|
271 |
+ |
// write_warning(__FUNCTION__,"Deleting special case here"); |
272 |
+ |
// gSystem->Exec(((string)"ls -ltrh "+TimeCapsuleDirectory.str()).c_str()); |
273 |
+ |
// gSystem->Exec(((string)"rm "+TimeCapsuleDirectory.str()+"/TimedLimitCapsule.exec").c_str()); |
274 |
+ |
// gSystem->Exec(((string)"ls -ltrh "+TimeCapsuleDirectory.str()).c_str()); |
275 |
|
|
276 |
|
///------------------------------------------ < /NEW > ---------------------------------------------------------- |
277 |
|
vector<float> sigmas; |