259 |
|
{ |
260 |
|
ipoint++; |
261 |
|
if(!runninglocally&&!do_this_point(ipoint,(int)Npoints,(int)jobnumber,(int)njobs)) continue; |
262 |
+ |
int GlobalBin=flipmap->FindBin(mglu,mlsp); |
263 |
|
float currmceff=mceff->GetBinContent(mceff->FindBin(mglu,mlsp)); |
264 |
|
float currtoterr=(fullerr->GetBinContent(fullerr->FindBin(mglu,mlsp)))*currmceff; |
265 |
|
float nevents=NEvents->GetBinContent(NEvents->FindBin(mglu,mlsp)); |
266 |
|
int flipped = (int)(lflip->GetBinContent(lflip->FindBin(mglu,mlsp))); |
267 |
< |
flipmap->Fill(mglu,mlsp,flipped); |
267 |
> |
flipmap->SetBinContent(GlobalBin,flipped); |
268 |
|
dout << "Looking at point " << ipoint << " / " << Npoints << " with masses " << massgluname << " = " << mglu << " and " << massLSPname << " = " << mlsp << endl; |
269 |
|
dout << "Found : MCeff=" << currmceff << " and total error=" << currtoterr << " and Nevents=" << nevents << endl; |
270 |
|
string plotfilename=(string)(TString(massgluname)+TString(any2string(mglu))+TString("__")+TString(massLSPname)+TString(any2string(mlsp))+TString(".png")); |
276 |
|
sigmas=compute_one_upper_limit(currmceff,currtoterr,ibin,mcjzb,plotfilename,true, flipped); |
277 |
|
|
278 |
|
|
279 |
< |
if(sigmas[0]>0) limitmap->Fill(mglu,mlsp,sigmas[0]); //anything else is an error code |
279 |
> |
if(sigmas[0]>0) limitmap->SetBinContent(GlobalBin,sigmas[0]); //anything else is an error code |
280 |
|
if(sigmas.size()>1) { |
281 |
< |
explimitmap->Fill(mglu,mlsp,sigmas[1]); |
282 |
< |
exp1plimitmap->Fill(mglu,mlsp,sigmas[2]); |
283 |
< |
exp1mlimitmap->Fill(mglu,mlsp,sigmas[3]); |
284 |
< |
exp2plimitmap->Fill(mglu,mlsp,sigmas[4]); |
285 |
< |
exp2mlimitmap->Fill(mglu,mlsp,sigmas[5]); |
281 |
> |
explimitmap->SetBinContent(GlobalBin,sigmas[1]); |
282 |
> |
exp1plimitmap->SetBinContent(GlobalBin,sigmas[2]); |
283 |
> |
exp1mlimitmap->SetBinContent(GlobalBin,sigmas[3]); |
284 |
> |
exp2plimitmap->SetBinContent(GlobalBin,sigmas[4]); |
285 |
> |
exp2mlimitmap->SetBinContent(GlobalBin,sigmas[5]); |
286 |
|
} |
287 |
|
|
288 |
|
dout << "An upper limit has been added for this point ( " << massgluname << " = " << mglu << " and " << massLSPname << " = " << mlsp << " ) at " << sigmas[0] << endl; |
292 |
|
float totxs; |
293 |
|
float xs=get_xs(totxs,mglu,mlsp,massgluname,massLSPname,xsec,mcjzb,requireZ); |
294 |
|
if(xs>0) rel_limit=sigmas[0]/xs; |
295 |
< |
exclmap->Fill(mglu,mlsp,rel_limit); |
296 |
< |
xsmap->Fill(mglu,mlsp,xs); |
297 |
< |
totxsmap->Fill(mglu,mlsp,totxs); |
295 |
> |
exclmap->SetBinContent(GlobalBin,rel_limit); |
296 |
> |
xsmap->SetBinContent(GlobalBin,xs); |
297 |
> |
totxsmap->SetBinContent(GlobalBin,totxs); |
298 |
|
} |
299 |
|
} |
300 |
|
} |
429 |
|
for (int mlsp=(int)mLSPstart;mlsp<=mLSPend&&(ismSUGRA||mlsp<=mglu);mlsp+=(int)mLSPstep) |
430 |
|
{ |
431 |
|
ipoint++; |
432 |
+ |
int GlobalBin=efficiencymap->FindBin(mglu,mlsp); |
433 |
|
if(!runninglocally&&!do_this_point(ipoint,(int)Npoints,(int)jobnumber,(int)njobs)) continue; |
434 |
|
int flipped=0; |
435 |
|
float result=-987,resulterr=-987; |
461 |
|
flipped=1; |
462 |
|
MCefficiency((scansample.collection)[scanfileindex].events,result,resulterr,flipped,mcjzb,requireZ,(int)nevents,addcut.str(),-1); |
463 |
|
} |
464 |
< |
efficiencymap->Fill(mglu,mlsp,result); |
465 |
< |
efficiencymap->SetBinError(mglu,mlsp,resulterr); |
466 |
< |
flipmap->Fill(mglu,mlsp,flipped); |
467 |
< |
noscefficiencymap->Fill(mglu,mlsp,effwosigcont.getValue()); |
468 |
< |
noscefficiencymap->SetBinError(mglu,mlsp,effwosigcont.getError()); |
464 |
> |
efficiencymap->SetBinContent(GlobalBin,result); |
465 |
> |
efficiencymap->SetBinError(GlobalBin,resulterr); |
466 |
> |
flipmap->SetBinContent(GlobalBin,flipped); |
467 |
> |
noscefficiencymap->SetBinContent(GlobalBin,effwosigcont.getValue()); |
468 |
> |
noscefficiencymap->SetBinError(GlobalBin,effwosigcont.getError()); |
469 |
|
//Partial efficiencies |
470 |
|
float resultAcc, resultID, resultJets, resultSignal; |
471 |
|
float resulterrAcc, resulterrID, resulterrJets, resulterrSignal; |
473 |
|
MCPartialefficiency((scansample.collection)[scanfileindex].events,resultID,resulterrID,flipped,mcjzb,requireZ,(int)nevents,addcut.str(),-1, 2); |
474 |
|
MCPartialefficiency((scansample.collection)[scanfileindex].events,resultJets,resulterrJets,flipped,mcjzb,requireZ,(int)nevents,addcut.str(),-1, 3); |
475 |
|
MCPartialefficiency((scansample.collection)[scanfileindex].events,resultSignal,resulterrSignal,flipped,mcjzb,requireZ,(int)nevents,addcut.str(),-1, 4); |
476 |
< |
efficiencymapAcc->Fill(mglu,mlsp,resultAcc); |
477 |
< |
efficiencymapAcc->SetBinError(mglu,mlsp,resulterrAcc); |
478 |
< |
efficiencymapID->Fill(mglu,mlsp,resultID); |
479 |
< |
efficiencymapAcc->SetBinError(mglu,mlsp,resulterrID); |
480 |
< |
efficiencymapJets->Fill(mglu,mlsp,resultJets); |
481 |
< |
efficiencymapAcc->SetBinError(mglu,mlsp,resulterrJets); |
482 |
< |
efficiencymapSignal->Fill(mglu, mlsp, resultSignal); |
483 |
< |
efficiencymapAcc->SetBinError(mglu,mlsp,resulterrSignal); |
476 |
> |
efficiencymapAcc->SetBinContent(GlobalBin,resultAcc); |
477 |
> |
efficiencymapAcc->SetBinError(GlobalBin,resulterrAcc); |
478 |
> |
efficiencymapID->SetBinContent(GlobalBin,resultID); |
479 |
> |
efficiencymapAcc->SetBinError(GlobalBin,resulterrID); |
480 |
> |
efficiencymapJets->SetBinContent(GlobalBin,resultJets); |
481 |
> |
efficiencymapAcc->SetBinError(GlobalBin,resulterrJets); |
482 |
> |
efficiencymapSignal->SetBinContent(GlobalBin,resultSignal); |
483 |
> |
efficiencymapAcc->SetBinError(GlobalBin,resulterrSignal); |
484 |
|
finish = clock(); |
485 |
|
} |
486 |
< |
Neventsmap->Fill(mglu,mlsp,nevents); |
487 |
< |
ipointmap->Fill(mglu,mlsp,ipoint); |
486 |
> |
Neventsmap->SetBinContent(GlobalBin,nevents); |
487 |
> |
ipointmap->SetBinContent(GlobalBin,ipoint); |
488 |
|
if(efficiencyonly) continue; |
489 |
|
|
490 |
|
do_systematics_for_one_file((scansample.collection)[scanfileindex].events,(int)nevents,"SUSY SCAN", systematics,flipped, mcjzb,datajzb,peakerror,requireZ, addcut.str(),true);//mSUGRA is now always true here because we always want to compute PDF systematics |
499 |
|
float mcwoscefr= systematics[0][9]; // error on efficiency without signal contamination |
500 |
|
float sys_pdf = 0; |
501 |
|
if(systematics[0].size()>10) sys_pdf = systematics[0][10]; // PDF |
500 |
– |
// efficiencymap->Fill(mglu,mlsp,mceff); |
501 |
– |
// efficiencymap->SetBinError(efficiencymap->FindBin(mglu,mlsp),mcefferr); |
502 |
– |
// noscefficiencymap->Fill(mglu,mlsp,mcwoscef); |
503 |
– |
// noscefficiencymap->SetBinError(efficiencymap->FindBin(mglu,mlsp),mcwoscefr); |
502 |
|
|
503 |
|
if(mceff!=mceff||toterr!=toterr||mceff<0 && (!systematicsonly&&!efficiencyonly)) { |
504 |
|
dout << "Limits can't be calculated for this configuration (mglu="<<mglu<<" , mlsp="<<mlsp << ") as either the efficiency or its error are not positive numbers! (mceff="<<mceff<<" and toterr="<<toterr<<")"<< endl; |
512 |
|
// do_limit_wrapper(mceff,toterr,ibin,mcjzb,sigmas,plotfilename); |
513 |
|
dout << "back in " << __FUNCTION__ << endl; |
514 |
|
if(sigmas[0]>-0.5) { // negative sigmas are the error signature of do_limit_wrapper, so we want to exclude them. |
515 |
< |
limitmap->Fill(mglu,mlsp,sigmas[0]); |
515 |
> |
limitmap->SetBinContent(GlobalBin,sigmas[0]); |
516 |
|
if(sigmas.size()>1) { |
517 |
< |
explimitmap->Fill(mglu,mlsp,sigmas[1]); |
518 |
< |
exp1plimitmap->Fill(mglu,mlsp,sigmas[2]); |
519 |
< |
exp1mlimitmap->Fill(mglu,mlsp,sigmas[3]); |
520 |
< |
exp2plimitmap->Fill(mglu,mlsp,sigmas[4]); |
521 |
< |
exp2mlimitmap->Fill(mglu,mlsp,sigmas[5]); |
517 |
> |
explimitmap->SetBinContent(GlobalBin,sigmas[1]); |
518 |
> |
exp1plimitmap->SetBinContent(GlobalBin,sigmas[2]); |
519 |
> |
exp1mlimitmap->SetBinContent(GlobalBin,sigmas[3]); |
520 |
> |
exp2plimitmap->SetBinContent(GlobalBin,sigmas[4]); |
521 |
> |
exp2mlimitmap->SetBinContent(GlobalBin,sigmas[5]); |
522 |
|
} |
523 |
|
|
524 |
< |
sysjesmap->Fill(mglu,mlsp,sys_jes); |
525 |
< |
sysjsumap->Fill(mglu,mlsp,sys_jsu); |
526 |
< |
sysresmap->Fill(mglu,mlsp,sys_res); |
527 |
< |
syspdfmap->Fill(mglu,mlsp,sys_pdf); |
528 |
< |
systotmap->Fill(mglu,mlsp,toterr/mceff);//total relative (!) error |
529 |
< |
sysstatmap->Fill(mglu,mlsp,mcefferr);//total relative (!) error |
524 |
> |
sysjesmap->SetBinContent(GlobalBin,sys_jes); |
525 |
> |
sysjsumap->SetBinContent(GlobalBin,sys_jsu); |
526 |
> |
sysresmap->SetBinContent(GlobalBin,sys_res); |
527 |
> |
syspdfmap->SetBinContent(GlobalBin,sys_pdf); |
528 |
> |
systotmap->SetBinContent(GlobalBin,toterr/mceff);//total relative (!) error |
529 |
> |
sysstatmap->SetBinContent(GlobalBin,mcefferr);//total relative (!) error |
530 |
|
dout << "A limit has been added at " << sigmas[0] << " for m_{glu}="<<mglu << " and m_{lsp}="<<mlsp<<endl; |
531 |
|
} //end of if sigma is positive |
532 |
|
|
533 |
|
//end of not systematics only condition |
534 |
|
} |
535 |
|
if(systematicsonly) { |
536 |
< |
sysjesmap->Fill(mglu,mlsp,sys_jes); |
537 |
< |
sysjsumap->Fill(mglu,mlsp,sys_jsu); |
538 |
< |
sysresmap->Fill(mglu,mlsp,sys_res); |
539 |
< |
syspdfmap->Fill(mglu,mlsp,sys_pdf); |
540 |
< |
systotmap->Fill(mglu,mlsp,toterr/mceff);//total relative (!) error |
541 |
< |
sysstatmap->Fill(mglu,mlsp,mcefferr);//total relative (!) error |
536 |
> |
sysjesmap->SetBinContent(GlobalBin,sys_jes); |
537 |
> |
sysjsumap->SetBinContent(GlobalBin,sys_jsu); |
538 |
> |
sysresmap->SetBinContent(GlobalBin,sys_res); |
539 |
> |
syspdfmap->SetBinContent(GlobalBin,sys_pdf); |
540 |
> |
systotmap->SetBinContent(GlobalBin,toterr/mceff);//total relative (!) error |
541 |
> |
sysstatmap->SetBinContent(GlobalBin,mcefferr);//total relative (!) error |
542 |
|
} |
543 |
|
}//efficiency is valid |
544 |
|
finish = clock(); |
545 |
< |
timemap->Fill(mglu,mlsp,((float(finish)-float(start))/CLOCKS_PER_SEC)); |
545 |
> |
timemap->SetBinContent(GlobalBin,((float(finish)-float(start))/CLOCKS_PER_SEC)); |
546 |
|
} |
547 |
|
} |
548 |
|
|