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 |
+ |
|
50 |
|
void set_range(TH2F *histo, int scantype, bool pushoutlabels); |
51 |
|
void smooth_line(TGraph *gr); |
52 |
+ |
void draw_diagonal_xchange(int scantype, std::string scanx); |
53 |
|
TH2F* adjust_histo(TH2F *oldhist, TH2F *refhisto); |
54 |
|
TGraph* get_mSUGRA_exclusion_line(TH2F *exclusionhisto, int scantype); |
55 |
|
TGraph* thin_line(TGraph *gr); |
56 |
|
TGraph *MarcosExclusionLine(TH2F *exclusionshape, int scantype); |
57 |
+ |
TH2F* get_XS(string filename, string mass, TH2F *histo); |
58 |
+ |
|
59 |
+ |
float getSMSxs(float mlsp,float mglu) { |
60 |
+ |
TH2F *refh = new TH2F("ReferenceHisto","ReferenceHisto",(int)((mgluend-mglustart)/mglustep+1),mglustart-0.5*mglustep,mgluend+0.5*mglustep,int((mLSPend-mLSPstart)/mLSPstep+1),mLSPstart-0.5*mLSPstep,mLSPend+0.5*mLSPstep); |
61 |
+ |
refh->SetBinContent(refh->FindBin(mglu,mlsp),1);//only compute the cross section for our point |
62 |
+ |
TFile *xsecfile = new TFile((PlottingSetup::cbafbasedir+"/"+PlottingSetup::SMSReferenceXSFile).c_str()); |
63 |
+ |
if(xsecfile->IsZombie()) { |
64 |
+ |
write_error(__FUNCTION__,"Cross section file is invalid!!!!"); |
65 |
+ |
return -1; |
66 |
+ |
} |
67 |
+ |
xsecfile->Close(); |
68 |
+ |
delete xsecfile; |
69 |
+ |
TH2F *xsec = adjust_histo(get_XS(PlottingSetup::cbafbasedir+"/"+PlottingSetup::SMSReferenceXSFile,"gluino",refh),refh); |
70 |
+ |
int GlobalBin = xsec->FindBin(mglu,mlsp); |
71 |
+ |
float refxs=xsec->GetBinContent(GlobalBin); |
72 |
+ |
delete refh; |
73 |
+ |
delete xsec; |
74 |
+ |
return refxs; |
75 |
+ |
} |
76 |
|
|
77 |
|
void write_SMS_text(int scantype, std::string& scanx, float xpos = 0.22 ) { |
78 |
|
string legT5zz="pp #rightarrow #tilde{g} #tilde{g}, #tilde{g} #rightarrow 2j + #chi^{0}_{2}, #chi^{0}_{2} #rightarrow Z #chi^{0}_{1}"; |
97 |
|
// if(scantype==PlottingSetup::GMSB) title3->Draw("same"); |
98 |
|
} |
99 |
|
|
100 |
+ |
void draw_diagonal_xchange(int scantype, std::string scanx = "" ) { |
101 |
+ |
// Line marking the diagonal |
102 |
+ |
TLine *line; |
103 |
+ |
float verticaloffset=0.0; |
104 |
+ |
if(scantype==PlottingSetup::GMSB) verticaloffset=75.0; |
105 |
+ |
line = new TLine(50.+75.0, 50.0+verticaloffset, 1200., 1200.0-75.0+verticaloffset); |
106 |
+ |
line->SetLineStyle(7); |
107 |
+ |
line->SetLineWidth(4); |
108 |
+ |
//line->Draw("same"); // Do not draw: draw the other one instead |
109 |
+ |
|
110 |
+ |
// Add a dashed line to indicate where x changes |
111 |
+ |
float offset = 0.; |
112 |
+ |
if ( 0 == scanx.compare("0.5") ) { offset = 91.2/0.5; } |
113 |
+ |
else if ( 0 == scanx.compare("0.25") ) { offset = 91.2/0.25; } |
114 |
+ |
else if ( 0 == scanx.compare("0.75") ) { offset = 91.2/0.75; } |
115 |
+ |
else if ( scantype==PlottingSetup::GMSB) { offset = 0; }; |
116 |
+ |
|
117 |
+ |
if ( offset>0. ) { |
118 |
+ |
line->DrawLine(50+offset, 50.0, 1175., 1175.0-offset); |
119 |
+ |
}else if ( scantype==PlottingSetup::GMSB ) { |
120 |
+ |
line->DrawLine(100, 100, 1175., 1175.0-offset); |
121 |
+ |
} |
122 |
+ |
} |
123 |
+ |
|
124 |
|
void fill_with_text(TGraph *real, TGraph *down, TGraph *up, TVirtualPad *can, int scantype, std::string scanx = "") { |
125 |
|
can->cd(); |
126 |
|
float xpos_of_text = 0.22; |
127 |
|
TLegend* this_leg = new TLegend(xpos_of_text,0.6,0.38,0.75); |
128 |
+ |
//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. |
129 |
|
this_leg->SetFillColor(0); |
130 |
|
this_leg->SetBorderSize(0); |
131 |
|
this_leg->SetTextSize(0.035); |
132 |
+ |
//this_leg->SetTextSize(0.04); // paper style. |
133 |
|
if(scantype==PlottingSetup::SMS||scantype==PlottingSetup::GMSB) { |
134 |
|
//this_leg->AddEntry(real,"#sigma^{prod} = #sigma^{NLO-QCD}" , "l"); |
135 |
|
//this_leg->AddEntry(up,"#sigma^{prod} = 3 #times #sigma^{NLO-QCD}" , "l"); |
142 |
|
} |
143 |
|
|
144 |
|
this_leg->Draw(); |
145 |
< |
|
145 |
> |
TText *title = write_text(xpos_of_text+0.005,0.52,"JZB"); |
146 |
> |
title->SetTextSize(0.04); |
147 |
> |
title->SetTextAlign(13); |
148 |
> |
title->SetTextFont(62); |
149 |
> |
title->Draw(); |
150 |
> |
|
151 |
|
write_SMS_text( scantype, scanx, xpos_of_text ); |
152 |
|
|
153 |
|
// //string legT5zz="pp #rightarrow #tilde{g} #tilde{g}, #tilde{g} #rightarrow 2j + #chi^{0}_{1}, #chi^{0}_{1} #rightarrow Z + #tilde{G}"; |
168 |
|
// title3->SetTextColor(kRed); |
169 |
|
//// if(scantype==PlottingSetup::GMSB) title3->Draw("same"); |
170 |
|
DrawPrelim(); |
171 |
< |
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"); |
171 |
> |
draw_diagonal_xchange( scantype, scanx ); |
172 |
|
} |
173 |
|
|
174 |
|
TH2F* prep_histo(TH2F *oldhist, int scantype) {///DONE |
207 |
|
} |
208 |
|
exclusion->SetLineColor(kBlue); |
209 |
|
exclusion->SetLineWidth(2); |
210 |
+ |
//exclusion->SetLineWidth(4); // paper style |
211 |
|
exclusion->SetLineStyle(isprimary); |
212 |
|
return exclusion; |
213 |
|
} |
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 |
239 |
– |
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); |
250 |
– |
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)) ) { |
403 |
|
} |
404 |
|
realgraph->SetLineColor(TColor::GetColor("#151515")); //nice black |
405 |
|
realgraph->SetLineWidth(2); |
406 |
+ |
//realgraph->SetLineWidth(4);//paper style |
407 |
|
|
408 |
|
return realgraph; |
409 |
|
} |
464 |
|
TCanvas *finalcanvas = new TCanvas("finalcanvas","finalcanvas"); |
465 |
|
finalcanvas->SetLogz(1); |
466 |
|
finalcanvas->cd(); |
467 |
< |
finalcanvas->SetRightMargin(0.1); |
413 |
< |
// limits->Draw("COLZ"); |
467 |
> |
limits->Draw("COLZ"); |
468 |
|
|
469 |
|
|
470 |
|
TLine *desertline; |
471 |
|
if(drawefficiencydesertline) { |
472 |
|
desertline = new TLine(375,50,1200,875); |
473 |
|
desertline->SetLineWidth(3); |
474 |
+ |
//desertline->SetLineWidth(4); // paper style |
475 |
|
desertline->SetLineColor(kBlack); |
476 |
|
desertline->Draw("same"); |
477 |
|
} |
478 |
|
|
479 |
< |
TH2F *emptyh = new TH2F("emptyh","emptyh",1,1,2,1,1,2); |
425 |
< |
|
426 |
< |
SugarCoatThis(finalcanvas,10,emptyh,exclline); |
427 |
< |
// exclline->Draw("c"); |
479 |
> |
exclline->Draw("c"); |
480 |
|
|
481 |
|
// fill_with_text(exclline,excllined3,excllinet3,finalcanvas,scantype,scanx); |
482 |
|
stringstream real; |
511 |
|
if(!file0) return hpt_; |
512 |
|
TDirectory *dir; |
513 |
|
TH2D * hMuPt; |
462 |
– |
TH1* H; |
514 |
|
|
515 |
|
if(dirName == "0") { |
516 |
|
hMuPt = (TH2D*) file0->Get(histoName); |
643 |
|
for(int i=1;i<exclusionhisto->GetNbinsX();i++) { |
644 |
|
pair<float,float> anything = find_point(exclusionhisto,i); |
645 |
|
pair<float,float> intthing = find_interpolated_point(exclusionhisto,i); |
595 |
– |
float value=anything.second; |
646 |
|
if(intthing.second>anything.second) anything.second=intthing.second; |
647 |
|
if(anything.second>100&&anything.second<1500) points.push_back(anything); |
648 |
|
} |
660 |
|
float lastx2=0; |
661 |
|
float lasty2=0; |
662 |
|
|
663 |
< |
for(int i=0;i<points.size();i++) { |
663 |
> |
for(int i=0;i<(int)points.size();i++) { |
664 |
|
xpoints[i]=points[i].first; |
665 |
|
spoints[i]=points[i].second; |
666 |
|
if(scantype==PlottingSetup::mSUGRA) { |
667 |
< |
if(i>1&&i<points.size()-1) spoints[i]=(1.0/3.0)*(points[i-1].second+points[i].second+points[i+1].second); |
668 |
< |
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); |
669 |
< |
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); |
667 |
> |
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); |
668 |
> |
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); |
669 |
> |
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); |
670 |
|
} |
671 |
|
|
672 |
|
bool usethispoint=true; |
684 |
|
pointcounter++; |
685 |
|
} |
686 |
|
} |
687 |
< |
for(int i=pointcounter;i<points.size();i++) graph->SetPoint(i,lastx,lasty); |
687 |
> |
for(int i=pointcounter;i<=(int)points.size();i++) graph->SetPoint(i,lastx,lasty); |
688 |
|
if(scantype==PlottingSetup::GMSB||scantype==PlottingSetup::SMS) { |
689 |
|
//The final point will be a continuation of the last one, towards the diagonal |
690 |
|
float x,y; |
696 |
|
return graph; |
697 |
|
} |
698 |
|
|
699 |
< |
void draw_mSUGRA_exclusion(TH2F *crosssection, TH2F *limitmap, TH2F *expmap, TH2F *expplusmap, TH2F *expminusmap, TH2F *exp2plusmap, TH2F *exp2minusmap) { |
699 |
> |
TH2F* cast_into_shape(TH2F *origin, TH2F *reference) { |
700 |
> |
TH2F *newh = (TH2F*)reference->Clone(origin->GetName()); |
701 |
> |
for(int ix=1;ix<=reference->GetNbinsX();ix++) { |
702 |
> |
for(int iy=1;iy<=reference->GetNbinsY();iy++) { |
703 |
> |
// reference->SetBinContent(ix,iy,origin->GetBinContent(ix,iy)); |
704 |
> |
newh->SetBinContent(ix,iy,origin->GetBinContent(ix,iy)); |
705 |
> |
} |
706 |
> |
} |
707 |
> |
return newh; |
708 |
> |
} |
709 |
> |
|
710 |
> |
void draw_mSUGRA_exclusion(TH2F *ocrosssection, TH2F *oFilterEfficiency, TH2F *oabsXS, TH2F *limitmap, TH2F *expmap, TH2F *expplusmap, TH2F *expminusmap, TH2F *exp2plusmap, TH2F *exp2minusmap) { |
711 |
> |
TH2F *crosssection = (TH2F*)ocrosssection->Clone("crosssection"); |
712 |
> |
// TH2F *limitmap = (TH2F*)olimitmap->Clone(((string)olimitmap->GetName()+"clone").c_str()); |
713 |
|
TH2F *cleanhisto = (TH2F*)limitmap->Clone("clean"); |
714 |
|
for(int ix=1;ix<=cleanhisto->GetNbinsX();ix++) { |
715 |
|
for(int iy=1;iy<=cleanhisto->GetNbinsY();iy++) { |
716 |
|
cleanhisto->SetBinContent(ix,iy,0); |
717 |
|
} |
718 |
|
} |
719 |
+ |
|
720 |
+ |
|
721 |
+ |
TH2F *FilterEfficiency; |
722 |
+ |
TH2F *absXS; |
723 |
+ |
|
724 |
+ |
|
725 |
+ |
|
726 |
+ |
|
727 |
+ |
write_warning(__FUNCTION__,"You'll want to switch off 'wrongwaytodothis')"); |
728 |
+ |
|
729 |
+ |
if(wrongwaytodothis) { |
730 |
+ |
//this part is the one you want to remove. |
731 |
+ |
TFile *Efficiencies = new TFile("FilterEfficiencyv3.root"); |
732 |
+ |
FilterEfficiency = cast_into_shape((TH2F*) Efficiencies->Get("FilterEfficiency"),limitmap); |
733 |
+ |
assert(FilterEfficiency); |
734 |
+ |
assert(crosssection); |
735 |
+ |
absXS=(TH2F*)crosssection->Clone("absXS"); |
736 |
+ |
crosssection->Multiply(FilterEfficiency); |
737 |
+ |
} else { |
738 |
+ |
//this part is the one you want to keep! |
739 |
+ |
FilterEfficiency=(TH2F*)oFilterEfficiency->Clone("FilterEfficiency"); |
740 |
+ |
absXS=(TH2F*)oabsXS->Clone("absXS"); |
741 |
+ |
} |
742 |
+ |
|
743 |
+ |
|
744 |
|
|
745 |
|
TH2F *limits = (TH2F*)limitmap->Clone("limits"); |
746 |
|
set_range(limits,true,false); |
803 |
|
CompleteSave(te,saveas.str()); |
804 |
|
delete te; |
805 |
|
|
806 |
< |
TCanvas *overview = new TCanvas("overview","overview",1000,1000); |
806 |
> |
TCanvas *overview = new TCanvas("overview","overview",1500,1000); |
807 |
> |
|
808 |
|
set_range(crosssection,true,false); |
809 |
|
set_range(limits,true,false); |
810 |
|
set_range(limitmap,true,false); |
811 |
|
|
812 |
< |
TGraph *emptygraph = new TGraph(0); |
724 |
< |
|
725 |
< |
overview->Divide(2,2); |
812 |
> |
overview->Divide(3,2); |
813 |
|
overview->cd(1); |
814 |
|
overview->cd(1)->SetLogz(1); |
815 |
< |
crosssection->GetZaxis()->SetRangeUser(0.0001,100); |
816 |
< |
// SugarCoatThis(overview->cd(1),10,crosssection,emptygraph); |
730 |
< |
crosssection->Draw("COLZ"); |
815 |
> |
absXS->GetZaxis()->SetRangeUser(0.0001,100); |
816 |
> |
absXS->Draw("COLZ"); |
817 |
|
TText *title0 = write_title("Cross Section"); |
818 |
|
title0->Draw("same"); |
819 |
|
overview->cd(2); |
820 |
< |
overview->cd(2)->SetLogz(1); |
821 |
< |
limits->GetZaxis()->SetRangeUser(0.1,100); |
820 |
> |
FilterEfficiency->GetZaxis()->SetRangeUser(0.01,0.7); |
821 |
> |
FilterEfficiency->Draw("COLZ"); |
822 |
> |
TText *title0aa = write_title("Filter #epsilon"); |
823 |
> |
title0aa->Draw("same"); |
824 |
> |
overview->cd(3); |
825 |
> |
overview->cd(3)->SetLogz(1); |
826 |
> |
crosssection->GetZaxis()->SetRangeUser(0.0001,100); |
827 |
> |
crosssection->Draw("COLZ"); |
828 |
> |
TText *title0a = write_title("Filter #epsilon x Cross Section"); |
829 |
> |
title0a->Draw("same"); |
830 |
> |
|
831 |
> |
overview->cd(4); |
832 |
> |
overview->cd(4)->SetLogz(1); |
833 |
> |
limits->GetZaxis()->SetRangeUser(0.01,100); |
834 |
|
limits->Draw("COLZ"); |
835 |
|
TText *title1 = write_title("Cross Section Upper Limit"); |
836 |
|
title1->Draw("same"); |
837 |
< |
overview->cd(3); |
837 |
> |
overview->cd(5); |
838 |
|
limitmap->Draw("COLZ"); |
839 |
|
TText *title2 = write_title("UL/XS"); |
840 |
|
title2->Draw("same"); |
841 |
|
observed->Draw("c"); |
842 |
< |
overview->cd(4); |
843 |
< |
overview->cd(4)->SetRightMargin(standardmargin); |
842 |
> |
overview->cd(6); |
843 |
> |
overview->cd(6)->SetRightMargin(standardmargin); |
844 |
|
// decorate_mSUGRA(cleanhisto,overview->cd(4),expected,expected2,observed); |
845 |
< |
SugarCoatThis(overview->cd(4),10,noh,observed); |
845 |
> |
SugarCoatThis(overview->cd(6),10,noh,observed); |
846 |
|
// observed->Draw("c"); |
847 |
|
stringstream saveas2; |
848 |
|
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); |
850 |
|
CompleteSave(overview,saveas2.str()); |
851 |
|
delete overview; |
852 |
|
delete noh; |
853 |
< |
|
853 |
> |
delete crosssection; |
854 |
> |
delete absXS; |
855 |
> |
delete FilterEfficiency; |
856 |
|
|
857 |
|
} |
858 |
|
|
871 |
|
int mappoint=name.find("map"); |
872 |
|
if(mappoint<0||mappoint>500) return name; // this mean that something weird is happening |
873 |
|
stringstream nice_label; |
874 |
< |
nice_label << "JZB > " << name.substr(mappoint+3,name.size()) << " GeV"; |
874 |
> |
string identifier=name.substr(mappoint+3,name.size()); |
875 |
> |
if(identifier!="0") nice_label << "JZB > " << name.substr(mappoint+3,name.size()) << " GeV"; |
876 |
> |
else nice_label << "JZB shape"; |
877 |
|
return nice_label.str(); |
878 |
|
} |
879 |
|
|
901 |
|
|
902 |
|
float findmaxentry(vector<TH2F*> histos, int i, int j) { |
903 |
|
float max = histos[0]->GetBinContent(i,j); |
904 |
< |
for(int k=0;k<histos.size();k++) { |
904 |
> |
for(int k=0;k<(int)histos.size();k++) { |
905 |
|
float entry = histos[k]->GetBinContent(i,j); |
906 |
|
if(entry>=max) max=entry; |
907 |
|
} |
917 |
|
} |
918 |
|
if(explimits.size()==0) { |
919 |
|
write_warning(__FUNCTION__,"There are no expected limits! Will compute best limits based on observed limits! (WATCH OUT THIS IS DISCOURAGED!"); |
920 |
< |
for(int i=0;i<obslimits.size();i++) explimits.push_back(obslimits[i]); |
920 |
> |
for(int i=0;i<(int)obslimits.size();i++) explimits.push_back(obslimits[i]); |
921 |
|
} |
922 |
|
TH2F *bestlimit=(TH2F*)obslimits[0]->Clone("bestlimits"); |
923 |
|
TH2F *bestexplimit=(TH2F*)obslimits[0]->Clone("bestexplimits"); |
932 |
|
float min=findmaxentry(explimits,i,j); |
933 |
|
float omin=obslimits[0]->GetBinContent(i,j); |
934 |
|
int source=0; |
935 |
< |
for(int k=0;k<explimits.size();k++) { |
935 |
> |
for(int k=0;k<(int)explimits.size();k++) { |
936 |
|
float currlim=explimits[k]->GetBinContent(i,j); |
937 |
|
if(currlim<=min&&currlim>0) { |
938 |
|
min=currlim; |
965 |
|
bestlimitsource->Draw("COL"); |
966 |
|
gPad->Update(); |
967 |
|
TLegend *sourceleg = new TLegend(0.2,0.5,0.55,0.75); |
968 |
< |
for(int i=0;i<explimits.size();i++) { |
968 |
> |
for(int i=0;i<(int)explimits.size();i++) { |
969 |
|
stringstream legendentry; |
970 |
< |
legendentry << i+1 << " = " << give_nice_source_label(explimits[i]->GetName()); |
970 |
> |
legendentry << give_nice_source_label(explimits[i]->GetName()); |
971 |
|
Int_t currcol=get_exclusion_region_color(i+1,bestlimitsource); |
972 |
|
explimits[i]->SetFillColor(currcol); |
973 |
|
explimits[i]->SetLineColor(currcol); |
1003 |
|
} |
1004 |
|
xsecfile->Close(); |
1005 |
|
} |
1006 |
< |
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 |
1006 |
> |
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 |
1007 |
|
|
1008 |
|
vector<TH2F*> explimits; |
1009 |
|
vector<TH2F*> exp1mlimits; |
1013 |
|
vector<TH2F*> obslimits; |
1014 |
|
vector<TH2F*> flipmaps; |
1015 |
|
vector<TH2F*> crosssections; |
1016 |
< |
|
1017 |
< |
for(int ilim=0;ilim<limits.size();ilim++) { |
1016 |
> |
vector<TH2F*> AbsCrossSection; |
1017 |
> |
vector<TH2F*> FilterEfficiencies; |
1018 |
> |
for(int ilim=0;ilim<(int)limits.size();ilim++) { |
1019 |
|
if(TString(limits[ilim]->GetName()).Contains("_explimitmap")) explimits.push_back(limits[ilim]); |
1020 |
|
if(scantype==PlottingSetup::mSUGRA && TString(limits[ilim]->GetName()).Contains("_exp1plimitmap")) exp1plimits.push_back(limits[ilim]); |
1021 |
|
if(scantype==PlottingSetup::mSUGRA && TString(limits[ilim]->GetName()).Contains("_exp1mlimitmap")) exp1mlimits.push_back(limits[ilim]); |
1022 |
|
if(scantype==PlottingSetup::mSUGRA && TString(limits[ilim]->GetName()).Contains("_exp2plimitmap")) exp2plimits.push_back(limits[ilim]); |
1023 |
|
if(scantype==PlottingSetup::mSUGRA && TString(limits[ilim]->GetName()).Contains("_exp2mlimitmap")) exp2mlimits.push_back(limits[ilim]); |
1024 |
< |
if(scantype==PlottingSetup::mSUGRA && TString(limits[ilim]->GetName()).Contains("_XS")) crosssections.push_back(limits[ilim]); |
1024 |
> |
// if(scantype==PlottingSetup::mSUGRA && TString(limits[ilim]->GetName()).Contains("_XS")) crosssections.push_back(limits[ilim]); |
1025 |
> |
if(scantype==PlottingSetup::mSUGRA && TString(limits[ilim]->GetName()).Contains("_absXS")) AbsCrossSection.push_back(limits[ilim]); |
1026 |
> |
if(scantype==PlottingSetup::mSUGRA && TString(limits[ilim]->GetName()).Contains("_FilterEfficiency")) FilterEfficiencies.push_back(limits[ilim]); |
1027 |
> |
if(wrongwaytodothis) { |
1028 |
> |
if(scantype==PlottingSetup::mSUGRA && TString(limits[ilim]->GetName()).Contains("_XS")) AbsCrossSection.push_back(limits[ilim]); |
1029 |
> |
if(scantype==PlottingSetup::mSUGRA && TString(limits[ilim]->GetName()).Contains("_absXS")) crosssections .push_back(limits[ilim]); |
1030 |
> |
if(scantype==PlottingSetup::mSUGRA && TString(limits[ilim]->GetName()).Contains("_XS")) FilterEfficiencies.push_back(limits[ilim]); |
1031 |
> |
} |
1032 |
|
if(TString(limits[ilim]->GetName()).Contains("_limitmap")) obslimits.push_back(limits[ilim]); |
1033 |
|
// if(TString(limits[ilim]->GetName()).Contains("_limitflipmap")) flipmaps.push_back(limits[ilim]); |
1034 |
|
} |
1035 |
|
|
1036 |
+ |
cout << "Size: " << AbsCrossSection.size() << endl; |
1037 |
|
TH2F *xsec; |
1038 |
|
if(scantype!=PlottingSetup::mSUGRA) xsec = adjust_histo(get_XS(xsecfilename,"gluino",limits[0]),limits[0]); |
1039 |
|
vector<TH2F*> bestexplimits; |
1040 |
|
TH2F *bestlimits = make_best_limits(explimits,obslimits,scantype, scanx, exp1mlimits, exp1plimits, exp2mlimits, exp2plimits, bestexplimits); |
1041 |
|
bestlimits->GetZaxis()->SetRangeUser(limits_lower_bound,limits_upper_bound); |
1042 |
|
|
1043 |
< |
for(int ilim=0;ilim<limits.size();ilim++) { |
1043 |
> |
for(int ilim=0;ilim<(int)limits.size();ilim++) { |
1044 |
|
limits[ilim]->GetZaxis()->SetRangeUser(limits_lower_bound,limits_upper_bound); |
1045 |
|
} |
1046 |
|
|
1047 |
|
if(scantype!=PlottingSetup::mSUGRA) { |
1048 |
< |
for(int ilim=0;ilim<obslimits.size();ilim++) make_SMS_exclusion(obslimits[ilim],xsec,scantype,scanx); |
1048 |
> |
for(int ilim=0;ilim<(int)obslimits.size();ilim++) make_SMS_exclusion(obslimits[ilim],xsec,scantype,scanx); |
1049 |
|
make_SMS_exclusion(bestlimits,xsec,scantype,scanx); |
1050 |
|
} else { |
1051 |
< |
for(int ilim=0;ilim<obslimits.size();ilim++) { |
1052 |
< |
draw_mSUGRA_exclusion(crosssections[0], obslimits[ilim], explimits[ilim], exp1mlimits[ilim], exp1plimits[ilim], exp2mlimits[ilim], exp2plimits[ilim]); |
1051 |
> |
for(int ilim=0;ilim<(int)obslimits.size();ilim++) { |
1052 |
> |
draw_mSUGRA_exclusion(crosssections[0],FilterEfficiencies[0],AbsCrossSection[0],obslimits[ilim], explimits[ilim], exp1mlimits[ilim], exp1plimits[ilim], exp2mlimits[ilim], exp2plimits[ilim]); |
1053 |
|
} |
1054 |
< |
draw_mSUGRA_exclusion(crosssections[0], bestlimits, bestexplimits[0], bestexplimits[1], bestexplimits[2], bestexplimits[3], bestexplimits[4]); |
1054 |
> |
draw_mSUGRA_exclusion(crosssections[0],FilterEfficiencies[0],AbsCrossSection[0],bestlimits, bestexplimits[0], bestexplimits[1], bestexplimits[2], bestexplimits[3], bestexplimits[4]); |
1055 |
|
} |
1056 |
|
delete bestlimits; |
1057 |
|
} |
1064 |
|
int sign=1; |
1065 |
|
for(int i=0;i<gr->GetN();i++) { |
1066 |
|
Double_t x,y,x1,y1,x2,y2; |
956 |
– |
bool turning=false; |
1067 |
|
gr->GetPoint(i,x,y); |
1068 |
|
gr->GetPoint(i+1,x1,y1);//need to handle exception here |
1069 |
|
gr->GetPoint(i-1,x2,y2);//need to handle exception here |
1090 |
|
void set_range(TH2F *histo, int scantype, bool pushoutyz=false) { |
1091 |
|
gStyle->SetPadLeftMargin(0.18); |
1092 |
|
gStyle->SetPadRightMargin(0.19); |
1093 |
+ |
// histo->GetXaxis()->SetLabelSize(0.035); //paper style |
1094 |
+ |
// histo->GetYaxis()->SetLabelSize(0.035); //paper style |
1095 |
|
if(scantype==PlottingSetup::mSUGRA) { |
1096 |
|
histo->GetXaxis()->SetRangeUser(0,PlottingSetup::m0end); |
1097 |
|
histo->GetYaxis()->SetRangeUser(0,PlottingSetup::m12end); |
1200 |
|
TPRegexp pat("\\d+$"); |
1201 |
|
size_t index = name.Index(pat,0); |
1202 |
|
string cut = string("JZB > ")+(name(index,name.Length()-index).Data())+" GeV"; |
1203 |
+ |
//string cut = string("#splitline{JZB > ")+(name(index,name.Length()-index).Data())+" GeV}{n_{jets} #geq 3}"; //paper style |
1204 |
|
TText *text = write_text(xpos_of_text,0.73,cut); |
1205 |
|
text->SetTextAlign(11); |
1206 |
|
text->SetTextSize(0.035); |
1207 |
|
text->Draw(); |
1208 |
+ |
draw_diagonal_xchange( scantype, scanx ); |
1209 |
|
} |
1210 |
|
|
1211 |
|
CompleteSave(can,(saveto+(string)histo->GetName())); |
1217 |
|
|
1218 |
|
void make_all_syst_plots(vector<TH2F*> all_histos,int scantype,std::string& scanx) { |
1219 |
|
string saveto="Systematics/"; |
1220 |
< |
for(int iplot=0;iplot<all_histos.size();iplot++) { |
1220 |
> |
for(int iplot=0;iplot<(int)all_histos.size();iplot++) { |
1221 |
|
process_syst_plot(all_histos[iplot],saveto,scantype,scanx); |
1222 |
|
} |
1223 |
|
} |
1224 |
|
|
1225 |
+ |
string IdentifyScan(TString histoname) { |
1226 |
+ |
cout << "We are dealing with a histo called " << histoname << endl; |
1227 |
+ |
if (histoname.Contains("T5zzl")) return "0.75"; |
1228 |
+ |
if(histoname.Contains("T5zzh")) return "0.25"; |
1229 |
+ |
if(histoname.Contains("T5zz")) return "0.5"; |
1230 |
+ |
|
1231 |
+ |
return "IdentifyScanError"+string(histoname.Data()); |
1232 |
+ |
} |
1233 |
+ |
|
1234 |
|
void process_file(TFile* file, float stdmargin) { |
1235 |
|
standardmargin=stdmargin; |
1236 |
< |
xsecfilename="reference_xSec_SMS-new.root"; |
1236 |
> |
xsecfilename=PlottingSetup::cbafbasedir+"/"+PlottingSetup::SMSReferenceXSFile; |
1237 |
|
|
1238 |
|
// can receive a file with systematics and limits mixed, or a file with systematics only , or a file with limits only. |
1239 |
|
TIter nextkey(file->GetListOfKeys()); |
1241 |
|
|
1242 |
|
int scantype=PlottingSetup::SMS; |
1243 |
|
std::string scanx = "0"; // Just for the legend |
1121 |
– |
if (TString(file->GetName()).Contains("T5zzl")) scanx = "0.75"; |
1122 |
– |
else if(TString(file->GetName()).Contains("T5zzh")) scanx = "0.25"; |
1123 |
– |
else if(TString(file->GetName()).Contains("T5zz")) scanx = "0.5"; |
1244 |
|
|
1245 |
|
vector<TH2F*> systematics_histos; |
1246 |
|
vector<TH2F*> limits_histos; |
1261 |
|
if(name.Contains("exclusionmap")) is_limit=true; |
1262 |
|
if(name.Contains("crosssectionmap")) is_limit=true; |
1263 |
|
if(name.Contains("XS")) is_limit=true; |
1264 |
+ |
if(name.Contains("absXS")) is_limit=true; |
1265 |
|
if(name.Contains("limitflipmap")) is_limit=true; |
1266 |
|
|
1267 |
|
if(name.Contains("sysjes")) is_systematic=true; |
1285 |
|
else if(is_systematic) systematics_histos.push_back((TH2F*) obj); |
1286 |
|
if(name.Contains("mSUGRA")) scantype=PlottingSetup::mSUGRA; |
1287 |
|
if(name.Contains("GMSB")) scantype=PlottingSetup::GMSB; |
1288 |
+ |
if(name.Contains("ScanIdentifier")) scanx=IdentifyScan(name); |
1289 |
|
} |
1290 |
+ |
// if (TString(file->GetName()).Contains("T5zzl")) scanx = "0.75"; |
1291 |
+ |
// else if(TString(file->GetName()).Contains("T5zzh")) scanx = "0.25"; |
1292 |
+ |
// else if(TString(file->GetName()).Contains("T5zz")) scanx = "0.5"; |
1293 |
|
write_warning(__FUNCTION__,"Deactivated systematics plots"); |
1294 |
|
// if(systematics_histos.size()>0) make_all_syst_plots(systematics_histos,scantype,scanx); |
1295 |
|
if(limits_histos.size()>0) create_exclusion_plots(limits_histos,scantype,scanx); |