266 |
|
stringstream partial; |
267 |
|
partial << "Limits/exclusion__" << limits->GetName(); |
268 |
|
fill_with_text(exclline,excllined3,excllinet3,ca->cd(4),scantype); |
269 |
< |
CompleteSave(ca,partial.str()); |
269 |
> |
// CompleteSave(ca,partial.str()); |
270 |
|
|
271 |
|
ca->cd(5); |
272 |
|
(hardlimit(rellimits))->Draw("COL"); |
273 |
|
exclline->Draw("same"); |
274 |
+ |
TText *a = write_title("Exclusion shape for 3x#sigma_{ref}"); |
275 |
+ |
a->Draw(); |
276 |
|
ca->cd(6); |
277 |
|
(hardlimit(rellimitst3))->Draw("COL"); |
278 |
|
excllinet3->Draw("same"); |
279 |
+ |
TText *b = write_title("Exclusion shape for #sigma_{ref}"); |
280 |
+ |
b->Draw(); |
281 |
|
ca->cd(7); |
282 |
|
(hardlimit(rellimitsd3))->Draw("COLZ"); |
283 |
+ |
TText *c = write_title("Exclusion shape for #sigma_{ref}/3"); |
284 |
+ |
c->Draw(); |
285 |
|
excllined3->Draw("same"); |
286 |
|
|
287 |
|
CompleteSave(ca,partial.str()+"__PlusInfo"); |
292 |
|
|
293 |
|
void get_Marias_exclusion_line(TH2F *limit_ref, float pointsX[200], float pointsY[200], int &ixNew, int &counter, int &foundDiag) { |
294 |
|
// part of Mariarosaria's getRefXsecGraph function |
289 |
– |
double refMult = 3.0; |
295 |
|
bool enough = false; |
296 |
|
Int_t nBinX= limit_ref->GetXaxis()->GetNbins(); |
297 |
|
Int_t nBinY= limit_ref->GetYaxis()->GetNbins(); |
302 |
|
if(limit_ref->GetBinContent(i,j)==0) continue; |
303 |
|
if( limit_ref->GetBinContent(i,j)>0. && limit_ref->GetBinContent(i,j)<=1.) { |
304 |
|
double xsLimitAbove = limit_ref->GetBinContent(i, j+1); |
300 |
– |
double xsLimitBelow = limit_ref->GetBinContent(i, j-1); |
305 |
|
|
306 |
|
double xsLimit = limit_ref->GetBinContent(i, j); |
307 |
|
if((fail(1.0,xsLimitAbove)) && (!fail(1.0,xsLimit)) ) { |
415 |
|
return thin; |
416 |
|
} |
417 |
|
|
418 |
< |
void make_SMS_exclusion(TH2F *rawlimits,TH2F *xsec,int scantype,std::string& scanx) { |
418 |
> |
void make_SMS_exclusion(TH2F *rawlimits,TH2F *xsec,int scantype,std::string& scanx, bool isobserved) { |
419 |
> |
write_warning(__FUNCTION__,"DEBUGGING THIS FUNCTION"); cout << "Working on : " << rawlimits->GetName() << endl; if(!Contains(rawlimits->GetName(),"map0")) return; |
420 |
|
TH2F *limits = prep_histo(rawlimits,scantype); // this is to be independent of the style used at creation time |
421 |
|
//here we get some limits and the cross section; we want to make an exclusion plot! |
422 |
|
TH2F *rellimits = (TH2F*)limits->Clone("rellimits"); |
477 |
|
desertline->Draw("same"); |
478 |
|
} |
479 |
|
|
475 |
– |
TH2F *emptyh = new TH2F("emptyh","emptyh",1,1,2,1,1,2); |
476 |
– |
|
477 |
– |
|
480 |
|
exclline->Draw("c"); |
481 |
|
|
482 |
|
// fill_with_text(exclline,excllined3,excllinet3,finalcanvas,scantype,scanx); |
483 |
|
stringstream real; |
484 |
< |
real << "Limits/final_exclusion__" << limits->GetName(); |
484 |
> |
real << "Limits/"; |
485 |
> |
if(!isobserved) real << "expected/expected_"; |
486 |
> |
real << "final_exclusion__" << limits->GetName(); |
487 |
|
|
488 |
|
if(Contains(limits->GetName(),"bestlimits")) { |
489 |
|
cout << "----------> " << limits->GetName() << endl; |
514 |
|
if(!file0) return hpt_; |
515 |
|
TDirectory *dir; |
516 |
|
TH2D * hMuPt; |
513 |
– |
TH1* H; |
517 |
|
|
518 |
|
if(dirName == "0") { |
519 |
|
hMuPt = (TH2D*) file0->Get(histoName); |
646 |
|
for(int i=1;i<exclusionhisto->GetNbinsX();i++) { |
647 |
|
pair<float,float> anything = find_point(exclusionhisto,i); |
648 |
|
pair<float,float> intthing = find_interpolated_point(exclusionhisto,i); |
646 |
– |
float value=anything.second; |
649 |
|
if(intthing.second>anything.second) anything.second=intthing.second; |
650 |
|
if(anything.second>100&&anything.second<1500) points.push_back(anything); |
651 |
|
} |
663 |
|
float lastx2=0; |
664 |
|
float lasty2=0; |
665 |
|
|
666 |
< |
for(int i=0;i<points.size();i++) { |
666 |
> |
for(int i=0;i<(int)points.size();i++) { |
667 |
|
xpoints[i]=points[i].first; |
668 |
|
spoints[i]=points[i].second; |
669 |
|
if(scantype==PlottingSetup::mSUGRA) { |
670 |
< |
if(i>1&&i<points.size()-1) spoints[i]=(1.0/3.0)*(points[i-1].second+points[i].second+points[i+1].second); |
671 |
< |
if(i>2&&i<points.size()-2) spoints[i]=(1.0/5.0)*(points[i-2].second+points[i-1].second+points[i].second+points[i+1].second+points[i+2].second); |
672 |
< |
if(i>3&&i<points.size()-3) spoints[i]=(1.0/7.0)*(points[i-3].second+points[i-2].second+points[i-1].second+points[i].second+points[i+1].second+points[i+2].second+points[i+3].second); |
670 |
> |
if(i>1&&i<(int)points.size()-1) spoints[i]=(1.0/3.0)*(points[i-1].second+points[i].second+points[i+1].second); |
671 |
> |
if(i>2&&i<(int)points.size()-2) spoints[i]=(1.0/5.0)*(points[i-2].second+points[i-1].second+points[i].second+points[i+1].second+points[i+2].second); |
672 |
> |
if(i>3&&i<(int)points.size()-3) spoints[i]=(1.0/7.0)*(points[i-3].second+points[i-2].second+points[i-1].second+points[i].second+points[i+1].second+points[i+2].second+points[i+3].second); |
673 |
|
} |
674 |
|
|
675 |
|
bool usethispoint=true; |
687 |
|
pointcounter++; |
688 |
|
} |
689 |
|
} |
690 |
< |
for(int i=pointcounter;i<=points.size();i++) graph->SetPoint(i,lastx,lasty); |
690 |
> |
for(int i=pointcounter;i<=(int)points.size();i++) graph->SetPoint(i,lastx,lasty); |
691 |
|
if(scantype==PlottingSetup::GMSB||scantype==PlottingSetup::SMS) { |
692 |
|
//The final point will be a continuation of the last one, towards the diagonal |
693 |
|
float x,y; |
710 |
|
return newh; |
711 |
|
} |
712 |
|
|
713 |
< |
void draw_mSUGRA_exclusion(TH2F *ocrosssection, TH2F *oFilterEfficiency, TH2F *oabsXS, TH2F *limitmap, TH2F *expmap, TH2F *expplusmap, TH2F *expminusmap, TH2F *exp2plusmap, TH2F *exp2minusmap) { |
713 |
> |
void draw_mSUGRA_exclusion(TH2F *ocrosssection, TH2F *oFilterEfficiency, TH2F *oabsXS, TH2F *limitmap, TH2F *expmap, TH2F *expplusmap, TH2F *expminusmap, TH2F *exp2plusmap, TH2F *exp2minusmap, bool isobserved) { |
714 |
|
TH2F *crosssection = (TH2F*)ocrosssection->Clone("crosssection"); |
715 |
|
// TH2F *limitmap = (TH2F*)olimitmap->Clone(((string)olimitmap->GetName()+"clone").c_str()); |
716 |
|
TH2F *cleanhisto = (TH2F*)limitmap->Clone("clean"); |
801 |
|
// expected->Draw("c"); |
802 |
|
// observed->Draw("c"); |
803 |
|
stringstream saveas; |
804 |
< |
if((int)((string)limitmap->GetName()).find("limitmap")>0) saveas << "Limits/final_exclusion_for_JZB_geq_" << ((string)limitmap->GetName()).substr(((string)limitmap->GetName()).find("limitmap")+8,10); |
805 |
< |
else saveas << "Limits/final_exclusion_for_bestlimits"; |
804 |
> |
if((int)((string)limitmap->GetName()).find("limitmap")>0) { |
805 |
> |
saveas << "Limits/"; |
806 |
> |
if(!isobserved) saveas << "expected/expected_"; |
807 |
> |
saveas << "final_exclusion_for_JZB_geq_" << ((string)limitmap->GetName()).substr(((string)limitmap->GetName()).find("limitmap")+8,10); |
808 |
> |
} else { |
809 |
> |
saveas << "Limits/"; |
810 |
> |
if(!isobserved) saveas << "expected/expected"; |
811 |
> |
saveas << "final_exclusion_for_bestlimits"; |
812 |
> |
} |
813 |
|
CompleteSave(te,saveas.str()); |
814 |
|
delete te; |
815 |
|
|
819 |
|
set_range(limits,true,false); |
820 |
|
set_range(limitmap,true,false); |
821 |
|
|
813 |
– |
TGraph *emptygraph = new TGraph(0); |
814 |
– |
|
822 |
|
overview->Divide(3,2); |
823 |
|
overview->cd(1); |
824 |
|
overview->cd(1)->SetLogz(1); |
855 |
|
SugarCoatThis(overview->cd(6),10,noh,observed); |
856 |
|
// observed->Draw("c"); |
857 |
|
stringstream saveas2; |
858 |
< |
if((int)((string)limitmap->GetName()).find("limitmap")>0) saveas2 << "Limits/exclusion_overview_for_JZB_geq_" << ((string)limitmap->GetName()).substr(((string)limitmap->GetName()).find("limitmap")+8,10); |
859 |
< |
else saveas2 << "Limits/exclusion_overview_for_bestlimits"; |
858 |
> |
if((int)((string)limitmap->GetName()).find("limitmap")>0) { |
859 |
> |
saveas2 << "Limits/"; |
860 |
> |
if(!isobserved) saveas << "expected/expected_"; |
861 |
> |
saveas2 << "exclusion_overview_for_JZB_geq_" << ((string)limitmap->GetName()).substr(((string)limitmap->GetName()).find("limitmap")+8,10); |
862 |
> |
} else { |
863 |
> |
saveas2 << "Limits/"; |
864 |
> |
if(!isobserved) saveas << "expected/expected_"; |
865 |
> |
saveas2 << "exclusion_overview_for_bestlimits"; |
866 |
> |
} |
867 |
|
CompleteSave(overview,saveas2.str()); |
868 |
|
delete overview; |
869 |
|
delete noh; |
888 |
|
int mappoint=name.find("map"); |
889 |
|
if(mappoint<0||mappoint>500) return name; // this mean that something weird is happening |
890 |
|
stringstream nice_label; |
891 |
< |
nice_label << "JZB > " << name.substr(mappoint+3,name.size()) << " GeV"; |
891 |
> |
string identifier=name.substr(mappoint+3,name.size()); |
892 |
> |
if(identifier!="0") nice_label << "JZB > " << name.substr(mappoint+3,name.size()) << " GeV"; |
893 |
> |
else nice_label << "JZB shape"; |
894 |
|
return nice_label.str(); |
895 |
|
} |
896 |
|
|
918 |
|
|
919 |
|
float findmaxentry(vector<TH2F*> histos, int i, int j) { |
920 |
|
float max = histos[0]->GetBinContent(i,j); |
921 |
< |
for(int k=0;k<histos.size();k++) { |
921 |
> |
for(int k=0;k<(int)histos.size();k++) { |
922 |
|
float entry = histos[k]->GetBinContent(i,j); |
923 |
|
if(entry>=max) max=entry; |
924 |
|
} |
934 |
|
} |
935 |
|
if(explimits.size()==0) { |
936 |
|
write_warning(__FUNCTION__,"There are no expected limits! Will compute best limits based on observed limits! (WATCH OUT THIS IS DISCOURAGED!"); |
937 |
< |
for(int i=0;i<obslimits.size();i++) explimits.push_back(obslimits[i]); |
937 |
> |
for(int i=0;i<(int)obslimits.size();i++) explimits.push_back(obslimits[i]); |
938 |
|
} |
939 |
|
TH2F *bestlimit=(TH2F*)obslimits[0]->Clone("bestlimits"); |
940 |
|
TH2F *bestexplimit=(TH2F*)obslimits[0]->Clone("bestexplimits"); |
949 |
|
float min=findmaxentry(explimits,i,j); |
950 |
|
float omin=obslimits[0]->GetBinContent(i,j); |
951 |
|
int source=0; |
952 |
< |
for(int k=0;k<explimits.size();k++) { |
952 |
> |
for(int k=0;k<(int)explimits.size();k++) { |
953 |
|
float currlim=explimits[k]->GetBinContent(i,j); |
954 |
|
if(currlim<=min&&currlim>0) { |
955 |
|
min=currlim; |
982 |
|
bestlimitsource->Draw("COL"); |
983 |
|
gPad->Update(); |
984 |
|
TLegend *sourceleg = new TLegend(0.2,0.5,0.55,0.75); |
985 |
< |
for(int i=0;i<explimits.size();i++) { |
985 |
> |
for(int i=0;i<(int)explimits.size();i++) { |
986 |
|
stringstream legendentry; |
987 |
< |
legendentry << i+1 << " = " << give_nice_source_label(explimits[i]->GetName()); |
987 |
> |
legendentry << give_nice_source_label(explimits[i]->GetName()); |
988 |
|
Int_t currcol=get_exclusion_region_color(i+1,bestlimitsource); |
989 |
|
explimits[i]->SetFillColor(currcol); |
990 |
|
explimits[i]->SetLineColor(currcol); |
1020 |
|
} |
1021 |
|
xsecfile->Close(); |
1022 |
|
} |
1023 |
< |
if(scantype!=PlottingSetup::mSUGRA) for(int i=0;i<limits.size();i++) limits[i]->Scale(1./0.19); // because for T5zz we forced one z to decay leptonically |
1023 |
> |
if(scantype!=PlottingSetup::mSUGRA) for(int i=0;i<(int)limits.size();i++) limits[i]->Scale(1./0.19); // because for T5zz we forced one z to decay leptonically |
1024 |
|
|
1025 |
|
vector<TH2F*> explimits; |
1026 |
|
vector<TH2F*> exp1mlimits; |
1032 |
|
vector<TH2F*> crosssections; |
1033 |
|
vector<TH2F*> AbsCrossSection; |
1034 |
|
vector<TH2F*> FilterEfficiencies; |
1035 |
< |
for(int ilim=0;ilim<limits.size();ilim++) { |
1035 |
> |
for(int ilim=0;ilim<(int)limits.size();ilim++) { |
1036 |
|
if(TString(limits[ilim]->GetName()).Contains("_explimitmap")) explimits.push_back(limits[ilim]); |
1037 |
|
if(scantype==PlottingSetup::mSUGRA && TString(limits[ilim]->GetName()).Contains("_exp1plimitmap")) exp1plimits.push_back(limits[ilim]); |
1038 |
|
if(scantype==PlottingSetup::mSUGRA && TString(limits[ilim]->GetName()).Contains("_exp1mlimitmap")) exp1mlimits.push_back(limits[ilim]); |
1057 |
|
TH2F *bestlimits = make_best_limits(explimits,obslimits,scantype, scanx, exp1mlimits, exp1plimits, exp2mlimits, exp2plimits, bestexplimits); |
1058 |
|
bestlimits->GetZaxis()->SetRangeUser(limits_lower_bound,limits_upper_bound); |
1059 |
|
|
1060 |
< |
for(int ilim=0;ilim<limits.size();ilim++) { |
1060 |
> |
for(int ilim=0;ilim<(int)limits.size();ilim++) { |
1061 |
|
limits[ilim]->GetZaxis()->SetRangeUser(limits_lower_bound,limits_upper_bound); |
1062 |
|
} |
1063 |
|
|
1064 |
|
if(scantype!=PlottingSetup::mSUGRA) { |
1065 |
< |
for(int ilim=0;ilim<obslimits.size();ilim++) make_SMS_exclusion(obslimits[ilim],xsec,scantype,scanx); |
1066 |
< |
make_SMS_exclusion(bestlimits,xsec,scantype,scanx); |
1065 |
> |
for(int ilim=0;ilim<(int)obslimits.size();ilim++) make_SMS_exclusion(obslimits[ilim],xsec,scantype,scanx,true); |
1066 |
> |
for(int ilim=0;ilim<(int)obslimits.size();ilim++) make_SMS_exclusion(explimits[ilim],xsec,scantype,scanx,false);//plotting expected limits |
1067 |
> |
make_SMS_exclusion(bestlimits,xsec,scantype,scanx,true); |
1068 |
|
} else { |
1069 |
< |
for(int ilim=0;ilim<obslimits.size();ilim++) { |
1070 |
< |
draw_mSUGRA_exclusion(crosssections[0],FilterEfficiencies[0],AbsCrossSection[0],obslimits[ilim], explimits[ilim], exp1mlimits[ilim], exp1plimits[ilim], exp2mlimits[ilim], exp2plimits[ilim]); |
1069 |
> |
for(int ilim=0;ilim<(int)obslimits.size();ilim++) { |
1070 |
> |
draw_mSUGRA_exclusion(crosssections[0],FilterEfficiencies[0],AbsCrossSection[0],obslimits[ilim], explimits[ilim], exp1mlimits[ilim], exp1plimits[ilim], exp2mlimits[ilim], exp2plimits[ilim],true); |
1071 |
> |
draw_mSUGRA_exclusion(crosssections[0],FilterEfficiencies[0],AbsCrossSection[0],explimits[ilim], explimits[ilim], exp1mlimits[ilim], exp1plimits[ilim], exp2mlimits[ilim], exp2plimits[ilim],false); |
1072 |
|
} |
1073 |
< |
draw_mSUGRA_exclusion(crosssections[0],FilterEfficiencies[0],AbsCrossSection[0],bestlimits, bestexplimits[0], bestexplimits[1], bestexplimits[2], bestexplimits[3], bestexplimits[4]); |
1073 |
> |
draw_mSUGRA_exclusion(crosssections[0],FilterEfficiencies[0],AbsCrossSection[0],bestlimits, bestexplimits[0], bestexplimits[1], bestexplimits[2], bestexplimits[3], bestexplimits[4],true); |
1074 |
|
} |
1075 |
|
delete bestlimits; |
1076 |
|
} |
1083 |
|
int sign=1; |
1084 |
|
for(int i=0;i<gr->GetN();i++) { |
1085 |
|
Double_t x,y,x1,y1,x2,y2; |
1068 |
– |
bool turning=false; |
1086 |
|
gr->GetPoint(i,x,y); |
1087 |
|
gr->GetPoint(i+1,x1,y1);//need to handle exception here |
1088 |
|
gr->GetPoint(i-1,x2,y2);//need to handle exception here |
1236 |
|
|
1237 |
|
void make_all_syst_plots(vector<TH2F*> all_histos,int scantype,std::string& scanx) { |
1238 |
|
string saveto="Systematics/"; |
1239 |
< |
for(int iplot=0;iplot<all_histos.size();iplot++) { |
1239 |
> |
for(int iplot=0;iplot<(int)all_histos.size();iplot++) { |
1240 |
|
process_syst_plot(all_histos[iplot],saveto,scantype,scanx); |
1241 |
|
} |
1242 |
|
} |
1243 |
|
|
1244 |
+ |
string IdentifyScan(TString histoname) { |
1245 |
+ |
cout << "We are dealing with a histo called " << histoname << endl; |
1246 |
+ |
if (histoname.Contains("T5zzl")) return "0.75"; |
1247 |
+ |
if(histoname.Contains("T5zzh")) return "0.25"; |
1248 |
+ |
if(histoname.Contains("T5zz")) return "0.5"; |
1249 |
+ |
|
1250 |
+ |
return "IdentifyScanError"+string(histoname.Data()); |
1251 |
+ |
} |
1252 |
+ |
|
1253 |
|
void process_file(TFile* file, float stdmargin) { |
1254 |
|
standardmargin=stdmargin; |
1255 |
|
xsecfilename=PlottingSetup::cbafbasedir+"/"+PlottingSetup::SMSReferenceXSFile; |
1260 |
|
|
1261 |
|
int scantype=PlottingSetup::SMS; |
1262 |
|
std::string scanx = "0"; // Just for the legend |
1237 |
– |
if (TString(file->GetName()).Contains("T5zzl")) scanx = "0.75"; |
1238 |
– |
else if(TString(file->GetName()).Contains("T5zzh")) scanx = "0.25"; |
1239 |
– |
else if(TString(file->GetName()).Contains("T5zz")) scanx = "0.5"; |
1263 |
|
|
1264 |
|
vector<TH2F*> systematics_histos; |
1265 |
|
vector<TH2F*> limits_histos; |
1304 |
|
else if(is_systematic) systematics_histos.push_back((TH2F*) obj); |
1305 |
|
if(name.Contains("mSUGRA")) scantype=PlottingSetup::mSUGRA; |
1306 |
|
if(name.Contains("GMSB")) scantype=PlottingSetup::GMSB; |
1307 |
+ |
if(name.Contains("ScanIdentifier")) scanx=IdentifyScan(name); |
1308 |
|
} |
1309 |
+ |
// if (TString(file->GetName()).Contains("T5zzl")) scanx = "0.75"; |
1310 |
+ |
// else if(TString(file->GetName()).Contains("T5zzh")) scanx = "0.25"; |
1311 |
+ |
// else if(TString(file->GetName()).Contains("T5zz")) scanx = "0.5"; |
1312 |
|
write_warning(__FUNCTION__,"Deactivated systematics plots"); |
1313 |
|
// if(systematics_histos.size()>0) make_all_syst_plots(systematics_histos,scantype,scanx); |
1314 |
|
if(limits_histos.size()>0) create_exclusion_plots(limits_histos,scantype,scanx); |