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); |
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}"; |
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 |
269 |
– |
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); |
280 |
– |
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)) ) { |
476 |
|
desertline->Draw("same"); |
477 |
|
} |
478 |
|
|
455 |
– |
TH2F *emptyh = new TH2F("emptyh","emptyh",1,1,2,1,1,2); |
456 |
– |
|
457 |
– |
|
479 |
|
exclline->Draw("c"); |
480 |
|
|
481 |
|
// fill_with_text(exclline,excllined3,excllinet3,finalcanvas,scantype,scanx); |
511 |
|
if(!file0) return hpt_; |
512 |
|
TDirectory *dir; |
513 |
|
TH2D * hMuPt; |
493 |
– |
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); |
626 |
– |
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; |
809 |
|
set_range(limits,true,false); |
810 |
|
set_range(limitmap,true,false); |
811 |
|
|
793 |
– |
TGraph *emptygraph = new TGraph(0); |
794 |
– |
|
812 |
|
overview->Divide(3,2); |
813 |
|
overview->cd(1); |
814 |
|
overview->cd(1)->SetLogz(1); |
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; |
1015 |
|
vector<TH2F*> crosssections; |
1016 |
|
vector<TH2F*> AbsCrossSection; |
1017 |
|
vector<TH2F*> FilterEfficiencies; |
1018 |
< |
for(int ilim=0;ilim<limits.size();ilim++) { |
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]); |
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++) { |
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],FilterEfficiencies[0],AbsCrossSection[0],bestlimits, bestexplimits[0], bestexplimits[1], bestexplimits[2], bestexplimits[3], bestexplimits[4]); |
1064 |
|
int sign=1; |
1065 |
|
for(int i=0;i<gr->GetN();i++) { |
1066 |
|
Double_t x,y,x1,y1,x2,y2; |
1048 |
– |
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 |
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=PlottingSetup::cbafbasedir+"/"+PlottingSetup::SMSReferenceXSFile; |
1241 |
|
|
1242 |
|
int scantype=PlottingSetup::SMS; |
1243 |
|
std::string scanx = "0"; // Just for the legend |
1217 |
– |
if (TString(file->GetName()).Contains("T5zzl")) scanx = "0.75"; |
1218 |
– |
else if(TString(file->GetName()).Contains("T5zzh")) scanx = "0.25"; |
1219 |
– |
else if(TString(file->GetName()).Contains("T5zz")) scanx = "0.5"; |
1244 |
|
|
1245 |
|
vector<TH2F*> systematics_histos; |
1246 |
|
vector<TH2F*> limits_histos; |
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); |