2 |
|
#include <vector> |
3 |
|
#include <sys/stat.h> |
4 |
|
#include <sstream> |
5 |
+ |
#include <assert.h> |
6 |
|
|
7 |
|
#include <TCut.h> |
8 |
|
#include <TLatex.h> |
42 |
|
|
43 |
|
bool drawefficiencydesertline=false; |
44 |
|
|
45 |
+ |
bool wrongwaytodothis=true; |
46 |
+ |
|
47 |
|
string xsecfilename; |
48 |
|
|
49 |
|
void set_range(TH2F *histo, int scantype, bool pushoutlabels); |
50 |
|
void smooth_line(TGraph *gr); |
51 |
+ |
void draw_diagonal_xchange(int scantype, std::string scanx); |
52 |
|
TH2F* adjust_histo(TH2F *oldhist, TH2F *refhisto); |
53 |
|
TGraph* get_mSUGRA_exclusion_line(TH2F *exclusionhisto, int scantype); |
54 |
|
TGraph* thin_line(TGraph *gr); |
77 |
|
// if(scantype==PlottingSetup::GMSB) title3->Draw("same"); |
78 |
|
} |
79 |
|
|
80 |
+ |
void draw_diagonal_xchange(int scantype, std::string scanx = "" ) { |
81 |
+ |
// Line marking the diagonal |
82 |
+ |
TLine *line; |
83 |
+ |
float verticaloffset=0.0; |
84 |
+ |
if(scantype==PlottingSetup::GMSB) verticaloffset=75.0; |
85 |
+ |
line = new TLine(50.+75.0, 50.0+verticaloffset, 1200., 1200.0-75.0+verticaloffset); |
86 |
+ |
line->SetLineStyle(7); |
87 |
+ |
line->SetLineWidth(4); |
88 |
+ |
//line->Draw("same"); // Do not draw: draw the other one instead |
89 |
+ |
|
90 |
+ |
// Add a dashed line to indicate where x changes |
91 |
+ |
float offset = 0.; |
92 |
+ |
if ( 0 == scanx.compare("0.5") ) { offset = 91.2/0.5; } |
93 |
+ |
else if ( 0 == scanx.compare("0.25") ) { offset = 91.2/0.25; } |
94 |
+ |
else if ( 0 == scanx.compare("0.75") ) { offset = 91.2/0.75; } |
95 |
+ |
else if ( scantype==PlottingSetup::GMSB) { offset = 0; }; |
96 |
+ |
|
97 |
+ |
if ( offset>0. ) { |
98 |
+ |
line->DrawLine(50+offset, 50.0, 1175., 1175.0-offset); |
99 |
+ |
}else if ( scantype==PlottingSetup::GMSB ) { |
100 |
+ |
line->DrawLine(100, 100, 1175., 1175.0-offset); |
101 |
+ |
} |
102 |
+ |
} |
103 |
+ |
|
104 |
|
void fill_with_text(TGraph *real, TGraph *down, TGraph *up, TVirtualPad *can, int scantype, std::string scanx = "") { |
105 |
|
can->cd(); |
106 |
|
float xpos_of_text = 0.22; |
107 |
|
TLegend* this_leg = new TLegend(xpos_of_text,0.6,0.38,0.75); |
108 |
+ |
//TLegend* this_leg = new TLegend(xpos_of_text,0.55,0.45,0.75,"n_{jets} #geq 3"); // this was the style of the paper. |
109 |
|
this_leg->SetFillColor(0); |
110 |
|
this_leg->SetBorderSize(0); |
111 |
|
this_leg->SetTextSize(0.035); |
112 |
+ |
//this_leg->SetTextSize(0.04); // paper style. |
113 |
|
if(scantype==PlottingSetup::SMS||scantype==PlottingSetup::GMSB) { |
114 |
|
//this_leg->AddEntry(real,"#sigma^{prod} = #sigma^{NLO-QCD}" , "l"); |
115 |
|
//this_leg->AddEntry(up,"#sigma^{prod} = 3 #times #sigma^{NLO-QCD}" , "l"); |
122 |
|
} |
123 |
|
|
124 |
|
this_leg->Draw(); |
125 |
< |
|
125 |
> |
TText *title = write_text(xpos_of_text+0.005,0.52,"JZB"); |
126 |
> |
title->SetTextSize(0.04); |
127 |
> |
title->SetTextAlign(13); |
128 |
> |
title->SetTextFont(62); |
129 |
> |
title->Draw(); |
130 |
> |
|
131 |
|
write_SMS_text( scantype, scanx, xpos_of_text ); |
132 |
|
|
133 |
|
// //string legT5zz="pp #rightarrow #tilde{g} #tilde{g}, #tilde{g} #rightarrow 2j + #chi^{0}_{1}, #chi^{0}_{1} #rightarrow Z + #tilde{G}"; |
148 |
|
// title3->SetTextColor(kRed); |
149 |
|
//// if(scantype==PlottingSetup::GMSB) title3->Draw("same"); |
150 |
|
DrawPrelim(); |
151 |
< |
TLine *line; |
117 |
< |
float verticaloffset=0.0; |
118 |
< |
if(scantype==PlottingSetup::GMSB) verticaloffset=75.0; |
119 |
< |
line = new TLine(50.+75.0, 50.0+verticaloffset, 1200., 1200.0-75.0+verticaloffset); |
120 |
< |
line->SetLineStyle(2); |
121 |
< |
line->SetLineWidth(2); |
122 |
< |
line->Draw("same"); |
151 |
> |
draw_diagonal_xchange( scantype, scanx ); |
152 |
|
} |
153 |
|
|
154 |
|
TH2F* prep_histo(TH2F *oldhist, int scantype) {///DONE |
187 |
|
} |
188 |
|
exclusion->SetLineColor(kBlue); |
189 |
|
exclusion->SetLineWidth(2); |
190 |
+ |
//exclusion->SetLineWidth(4); // paper style |
191 |
|
exclusion->SetLineStyle(isprimary); |
192 |
|
return exclusion; |
193 |
|
} |
379 |
|
} |
380 |
|
realgraph->SetLineColor(TColor::GetColor("#151515")); //nice black |
381 |
|
realgraph->SetLineWidth(2); |
382 |
+ |
//realgraph->SetLineWidth(4);//paper style |
383 |
|
|
384 |
|
return realgraph; |
385 |
|
} |
440 |
|
TCanvas *finalcanvas = new TCanvas("finalcanvas","finalcanvas"); |
441 |
|
finalcanvas->SetLogz(1); |
442 |
|
finalcanvas->cd(); |
443 |
< |
finalcanvas->SetRightMargin(0.1); |
413 |
< |
// limits->Draw("COLZ"); |
443 |
> |
limits->Draw("COLZ"); |
444 |
|
|
445 |
|
|
446 |
|
TLine *desertline; |
447 |
|
if(drawefficiencydesertline) { |
448 |
|
desertline = new TLine(375,50,1200,875); |
449 |
|
desertline->SetLineWidth(3); |
450 |
+ |
//desertline->SetLineWidth(4); // paper style |
451 |
|
desertline->SetLineColor(kBlack); |
452 |
|
desertline->Draw("same"); |
453 |
|
} |
454 |
|
|
455 |
|
TH2F *emptyh = new TH2F("emptyh","emptyh",1,1,2,1,1,2); |
456 |
|
|
457 |
< |
SugarCoatThis(finalcanvas,10,emptyh,exclline); |
458 |
< |
// exclline->Draw("c"); |
457 |
> |
|
458 |
> |
exclline->Draw("c"); |
459 |
|
|
460 |
|
// fill_with_text(exclline,excllined3,excllinet3,finalcanvas,scantype,scanx); |
461 |
|
stringstream real; |
665 |
|
pointcounter++; |
666 |
|
} |
667 |
|
} |
668 |
< |
for(int i=pointcounter;i<points.size();i++) graph->SetPoint(i,lastx,lasty); |
668 |
> |
for(int i=pointcounter;i<=points.size();i++) graph->SetPoint(i,lastx,lasty); |
669 |
|
if(scantype==PlottingSetup::GMSB||scantype==PlottingSetup::SMS) { |
670 |
|
//The final point will be a continuation of the last one, towards the diagonal |
671 |
|
float x,y; |
677 |
|
return graph; |
678 |
|
} |
679 |
|
|
680 |
< |
void draw_mSUGRA_exclusion(TH2F *crosssection, TH2F *limitmap, TH2F *expmap, TH2F *expplusmap, TH2F *expminusmap, TH2F *exp2plusmap, TH2F *exp2minusmap) { |
680 |
> |
TH2F* cast_into_shape(TH2F *origin, TH2F *reference) { |
681 |
> |
TH2F *newh = (TH2F*)reference->Clone(origin->GetName()); |
682 |
> |
for(int ix=1;ix<=reference->GetNbinsX();ix++) { |
683 |
> |
for(int iy=1;iy<=reference->GetNbinsY();iy++) { |
684 |
> |
// reference->SetBinContent(ix,iy,origin->GetBinContent(ix,iy)); |
685 |
> |
newh->SetBinContent(ix,iy,origin->GetBinContent(ix,iy)); |
686 |
> |
} |
687 |
> |
} |
688 |
> |
return newh; |
689 |
> |
} |
690 |
> |
|
691 |
> |
void draw_mSUGRA_exclusion(TH2F *ocrosssection, TH2F *oFilterEfficiency, TH2F *oabsXS, TH2F *limitmap, TH2F *expmap, TH2F *expplusmap, TH2F *expminusmap, TH2F *exp2plusmap, TH2F *exp2minusmap) { |
692 |
> |
TH2F *crosssection = (TH2F*)ocrosssection->Clone("crosssection"); |
693 |
> |
// TH2F *limitmap = (TH2F*)olimitmap->Clone(((string)olimitmap->GetName()+"clone").c_str()); |
694 |
|
TH2F *cleanhisto = (TH2F*)limitmap->Clone("clean"); |
695 |
|
for(int ix=1;ix<=cleanhisto->GetNbinsX();ix++) { |
696 |
|
for(int iy=1;iy<=cleanhisto->GetNbinsY();iy++) { |
697 |
|
cleanhisto->SetBinContent(ix,iy,0); |
698 |
|
} |
699 |
|
} |
700 |
+ |
|
701 |
+ |
|
702 |
+ |
TH2F *FilterEfficiency; |
703 |
+ |
TH2F *absXS; |
704 |
+ |
|
705 |
+ |
|
706 |
+ |
|
707 |
+ |
|
708 |
+ |
write_warning(__FUNCTION__,"You'll want to switch off 'wrongwaytodothis')"); |
709 |
+ |
|
710 |
+ |
if(wrongwaytodothis) { |
711 |
+ |
//this part is the one you want to remove. |
712 |
+ |
TFile *Efficiencies = new TFile("FilterEfficiencyv3.root"); |
713 |
+ |
FilterEfficiency = cast_into_shape((TH2F*) Efficiencies->Get("FilterEfficiency"),limitmap); |
714 |
+ |
assert(FilterEfficiency); |
715 |
+ |
assert(crosssection); |
716 |
+ |
absXS=(TH2F*)crosssection->Clone("absXS"); |
717 |
+ |
crosssection->Multiply(FilterEfficiency); |
718 |
+ |
} else { |
719 |
+ |
//this part is the one you want to keep! |
720 |
+ |
FilterEfficiency=(TH2F*)oFilterEfficiency->Clone("FilterEfficiency"); |
721 |
+ |
absXS=(TH2F*)oabsXS->Clone("absXS"); |
722 |
+ |
} |
723 |
+ |
|
724 |
+ |
|
725 |
|
|
726 |
|
TH2F *limits = (TH2F*)limitmap->Clone("limits"); |
727 |
|
set_range(limits,true,false); |
784 |
|
CompleteSave(te,saveas.str()); |
785 |
|
delete te; |
786 |
|
|
787 |
< |
TCanvas *overview = new TCanvas("overview","overview",1000,1000); |
787 |
> |
TCanvas *overview = new TCanvas("overview","overview",1500,1000); |
788 |
> |
|
789 |
|
set_range(crosssection,true,false); |
790 |
|
set_range(limits,true,false); |
791 |
|
set_range(limitmap,true,false); |
792 |
|
|
793 |
|
TGraph *emptygraph = new TGraph(0); |
794 |
|
|
795 |
< |
overview->Divide(2,2); |
795 |
> |
overview->Divide(3,2); |
796 |
|
overview->cd(1); |
797 |
|
overview->cd(1)->SetLogz(1); |
798 |
< |
crosssection->GetZaxis()->SetRangeUser(0.0001,100); |
799 |
< |
// SugarCoatThis(overview->cd(1),10,crosssection,emptygraph); |
730 |
< |
crosssection->Draw("COLZ"); |
798 |
> |
absXS->GetZaxis()->SetRangeUser(0.0001,100); |
799 |
> |
absXS->Draw("COLZ"); |
800 |
|
TText *title0 = write_title("Cross Section"); |
801 |
|
title0->Draw("same"); |
802 |
|
overview->cd(2); |
803 |
< |
overview->cd(2)->SetLogz(1); |
804 |
< |
limits->GetZaxis()->SetRangeUser(0.1,100); |
803 |
> |
FilterEfficiency->GetZaxis()->SetRangeUser(0.01,0.7); |
804 |
> |
FilterEfficiency->Draw("COLZ"); |
805 |
> |
TText *title0aa = write_title("Filter #epsilon"); |
806 |
> |
title0aa->Draw("same"); |
807 |
> |
overview->cd(3); |
808 |
> |
overview->cd(3)->SetLogz(1); |
809 |
> |
crosssection->GetZaxis()->SetRangeUser(0.0001,100); |
810 |
> |
crosssection->Draw("COLZ"); |
811 |
> |
TText *title0a = write_title("Filter #epsilon x Cross Section"); |
812 |
> |
title0a->Draw("same"); |
813 |
> |
|
814 |
> |
overview->cd(4); |
815 |
> |
overview->cd(4)->SetLogz(1); |
816 |
> |
limits->GetZaxis()->SetRangeUser(0.01,100); |
817 |
|
limits->Draw("COLZ"); |
818 |
|
TText *title1 = write_title("Cross Section Upper Limit"); |
819 |
|
title1->Draw("same"); |
820 |
< |
overview->cd(3); |
820 |
> |
overview->cd(5); |
821 |
|
limitmap->Draw("COLZ"); |
822 |
|
TText *title2 = write_title("UL/XS"); |
823 |
|
title2->Draw("same"); |
824 |
|
observed->Draw("c"); |
825 |
< |
overview->cd(4); |
826 |
< |
overview->cd(4)->SetRightMargin(standardmargin); |
825 |
> |
overview->cd(6); |
826 |
> |
overview->cd(6)->SetRightMargin(standardmargin); |
827 |
|
// decorate_mSUGRA(cleanhisto,overview->cd(4),expected,expected2,observed); |
828 |
< |
SugarCoatThis(overview->cd(4),10,noh,observed); |
828 |
> |
SugarCoatThis(overview->cd(6),10,noh,observed); |
829 |
|
// observed->Draw("c"); |
830 |
|
stringstream saveas2; |
831 |
|
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); |
833 |
|
CompleteSave(overview,saveas2.str()); |
834 |
|
delete overview; |
835 |
|
delete noh; |
836 |
< |
|
836 |
> |
delete crosssection; |
837 |
> |
delete absXS; |
838 |
> |
delete FilterEfficiency; |
839 |
|
|
840 |
|
} |
841 |
|
|
994 |
|
vector<TH2F*> obslimits; |
995 |
|
vector<TH2F*> flipmaps; |
996 |
|
vector<TH2F*> crosssections; |
997 |
< |
|
997 |
> |
vector<TH2F*> AbsCrossSection; |
998 |
> |
vector<TH2F*> FilterEfficiencies; |
999 |
|
for(int ilim=0;ilim<limits.size();ilim++) { |
1000 |
|
if(TString(limits[ilim]->GetName()).Contains("_explimitmap")) explimits.push_back(limits[ilim]); |
1001 |
|
if(scantype==PlottingSetup::mSUGRA && TString(limits[ilim]->GetName()).Contains("_exp1plimitmap")) exp1plimits.push_back(limits[ilim]); |
1002 |
|
if(scantype==PlottingSetup::mSUGRA && TString(limits[ilim]->GetName()).Contains("_exp1mlimitmap")) exp1mlimits.push_back(limits[ilim]); |
1003 |
|
if(scantype==PlottingSetup::mSUGRA && TString(limits[ilim]->GetName()).Contains("_exp2plimitmap")) exp2plimits.push_back(limits[ilim]); |
1004 |
|
if(scantype==PlottingSetup::mSUGRA && TString(limits[ilim]->GetName()).Contains("_exp2mlimitmap")) exp2mlimits.push_back(limits[ilim]); |
1005 |
< |
if(scantype==PlottingSetup::mSUGRA && TString(limits[ilim]->GetName()).Contains("_XS")) crosssections.push_back(limits[ilim]); |
1005 |
> |
// if(scantype==PlottingSetup::mSUGRA && TString(limits[ilim]->GetName()).Contains("_XS")) crosssections.push_back(limits[ilim]); |
1006 |
> |
if(scantype==PlottingSetup::mSUGRA && TString(limits[ilim]->GetName()).Contains("_absXS")) AbsCrossSection.push_back(limits[ilim]); |
1007 |
> |
if(scantype==PlottingSetup::mSUGRA && TString(limits[ilim]->GetName()).Contains("_FilterEfficiency")) FilterEfficiencies.push_back(limits[ilim]); |
1008 |
> |
if(wrongwaytodothis) { |
1009 |
> |
if(scantype==PlottingSetup::mSUGRA && TString(limits[ilim]->GetName()).Contains("_XS")) AbsCrossSection.push_back(limits[ilim]); |
1010 |
> |
if(scantype==PlottingSetup::mSUGRA && TString(limits[ilim]->GetName()).Contains("_absXS")) crosssections .push_back(limits[ilim]); |
1011 |
> |
if(scantype==PlottingSetup::mSUGRA && TString(limits[ilim]->GetName()).Contains("_XS")) FilterEfficiencies.push_back(limits[ilim]); |
1012 |
> |
} |
1013 |
|
if(TString(limits[ilim]->GetName()).Contains("_limitmap")) obslimits.push_back(limits[ilim]); |
1014 |
|
// if(TString(limits[ilim]->GetName()).Contains("_limitflipmap")) flipmaps.push_back(limits[ilim]); |
1015 |
|
} |
1016 |
|
|
1017 |
+ |
cout << "Size: " << AbsCrossSection.size() << endl; |
1018 |
|
TH2F *xsec; |
1019 |
|
if(scantype!=PlottingSetup::mSUGRA) xsec = adjust_histo(get_XS(xsecfilename,"gluino",limits[0]),limits[0]); |
1020 |
|
vector<TH2F*> bestexplimits; |
1030 |
|
make_SMS_exclusion(bestlimits,xsec,scantype,scanx); |
1031 |
|
} else { |
1032 |
|
for(int ilim=0;ilim<obslimits.size();ilim++) { |
1033 |
< |
draw_mSUGRA_exclusion(crosssections[0], obslimits[ilim], explimits[ilim], exp1mlimits[ilim], exp1plimits[ilim], exp2mlimits[ilim], exp2plimits[ilim]); |
1033 |
> |
draw_mSUGRA_exclusion(crosssections[0],FilterEfficiencies[0],AbsCrossSection[0],obslimits[ilim], explimits[ilim], exp1mlimits[ilim], exp1plimits[ilim], exp2mlimits[ilim], exp2plimits[ilim]); |
1034 |
|
} |
1035 |
< |
draw_mSUGRA_exclusion(crosssections[0], bestlimits, bestexplimits[0], bestexplimits[1], bestexplimits[2], bestexplimits[3], bestexplimits[4]); |
1035 |
> |
draw_mSUGRA_exclusion(crosssections[0],FilterEfficiencies[0],AbsCrossSection[0],bestlimits, bestexplimits[0], bestexplimits[1], bestexplimits[2], bestexplimits[3], bestexplimits[4]); |
1036 |
|
} |
1037 |
|
delete bestlimits; |
1038 |
|
} |
1072 |
|
void set_range(TH2F *histo, int scantype, bool pushoutyz=false) { |
1073 |
|
gStyle->SetPadLeftMargin(0.18); |
1074 |
|
gStyle->SetPadRightMargin(0.19); |
1075 |
+ |
// histo->GetXaxis()->SetLabelSize(0.035); //paper style |
1076 |
+ |
// histo->GetYaxis()->SetLabelSize(0.035); //paper style |
1077 |
|
if(scantype==PlottingSetup::mSUGRA) { |
1078 |
|
histo->GetXaxis()->SetRangeUser(0,PlottingSetup::m0end); |
1079 |
|
histo->GetYaxis()->SetRangeUser(0,PlottingSetup::m12end); |
1182 |
|
TPRegexp pat("\\d+$"); |
1183 |
|
size_t index = name.Index(pat,0); |
1184 |
|
string cut = string("JZB > ")+(name(index,name.Length()-index).Data())+" GeV"; |
1185 |
+ |
//string cut = string("#splitline{JZB > ")+(name(index,name.Length()-index).Data())+" GeV}{n_{jets} #geq 3}"; //paper style |
1186 |
|
TText *text = write_text(xpos_of_text,0.73,cut); |
1187 |
|
text->SetTextAlign(11); |
1188 |
|
text->SetTextSize(0.035); |
1189 |
|
text->Draw(); |
1190 |
+ |
draw_diagonal_xchange( scantype, scanx ); |
1191 |
|
} |
1192 |
|
|
1193 |
|
CompleteSave(can,(saveto+(string)histo->GetName())); |
1206 |
|
|
1207 |
|
void process_file(TFile* file, float stdmargin) { |
1208 |
|
standardmargin=stdmargin; |
1209 |
< |
xsecfilename="reference_xSec_SMS-new.root"; |
1209 |
> |
xsecfilename=PlottingSetup::cbafbasedir+"/"+PlottingSetup::SMSReferenceXSFile; |
1210 |
|
|
1211 |
|
// can receive a file with systematics and limits mixed, or a file with systematics only , or a file with limits only. |
1212 |
|
TIter nextkey(file->GetListOfKeys()); |
1237 |
|
if(name.Contains("exclusionmap")) is_limit=true; |
1238 |
|
if(name.Contains("crosssectionmap")) is_limit=true; |
1239 |
|
if(name.Contains("XS")) is_limit=true; |
1240 |
+ |
if(name.Contains("absXS")) is_limit=true; |
1241 |
|
if(name.Contains("limitflipmap")) is_limit=true; |
1242 |
|
|
1243 |
|
if(name.Contains("sysjes")) is_systematic=true; |