#include "Analysis/Tools/interface/HttStylesNew.h"
#include "Analysis/Tools/interface/CMS_lumi.h"
#include "Analysis/Tools/interface/mssm_xs_tools.h"
#include "TMath.h"
#include "TTree.h"
#include "TGraph.h"
#include "TGraphAsymmErrors.h"
#include "TCanvas.h"
#include "TString.h"
#include "sstream"
#include "string"
#include <iostream>
#include <fstream>
Go to the source code of this file.
|
void | PlotTanBetaLimit (const std::string fileList="Hbb.limits", std::string output="", const std::string benchmark="mhmodp_mu200_13TeV.root", bool blindData=true, float yMin=1, float yMax=60, float xMin=100, float xMax=1300, std::string Lumi="20 fb^{-1}", std::string xtitle="m_{A} [GeV]", std::string ytitle="tan#beta", bool logY=true) |
|
double | XSecToTanBeta (mssm_xs_tools my, double mA, double xsection, double minTanBeta, double maxTanBeta) |
|
void PlotTanBetaLimit |
( |
const std::string |
fileList = "Hbb.limits" , |
|
|
std::string |
output = "" , |
|
|
const std::string |
benchmark = "mhmodp_mu200_13TeV.root" , |
|
|
bool |
blindData = true , |
|
|
float |
yMin = 1 , |
|
|
float |
yMax = 60 , |
|
|
float |
xMin = 100 , |
|
|
float |
xMax = 1300 , |
|
|
std::string |
Lumi = "20 fb^{-1}" , |
|
|
std::string |
xtitle = "m_{A} [GeV]" , |
|
|
std::string |
ytitle = "tan#beta" , |
|
|
bool |
logY = true |
|
) |
| |
Definition at line 65 of file PlotTanBetaLimit.h.
References CMS_lumi(), extraText, nano_94X_2017_rereco31Mar18-v1::fileName, leg, lumi_13TeV, SetStyle(), writeExtraText, and XSecToTanBeta().
74 std::string xtitle = "m_{A} [GeV]
", 75 std::string ytitle = "tan#beta
", 80 // char * filelist - List of files (output RooT files 81 // produced by 'combine -M Asymptotic') 82 // char * benchmarks - MSSM benchmark scenario file 83 // (cross sections + BRs) : 85 // mhmodp_mu200_13TeV.root, 87 // blindData - true : blind observed limits 88 // false : show observed limits 91 gStyle->SetOptFit(0000); 92 gStyle->SetErrorX(0.5); 95 mssm_xs_tools my(benchmark.c_str(),true,0); 97 double minTanBeta = 1; 98 double maxTanBeta = 60; 100 std::string Benchmark(benchmark.c_str()); 101 std::string bench_name; 102 if(Benchmark.find("mhmodp_mu200
") != std::string::npos) bench_name = "mhmodp_mu200
"; 103 else bench_name = "ANOTHER_BENCH
"; 104 std::string header("mhmod+
"); 105 if (Benchmark.find("hMSSM
") != std::string::npos) 109 const int nPoints = 100; 111 // signal strength limits sigma*BR / sigma*BR (at tanb=30) 113 double minus2R[nPoints]; 114 double minus1R[nPoints]; 115 double medianR[nPoints]; 116 double plus1R[nPoints]; 117 double plus2R[nPoints]; 118 double obsR[nPoints]; 121 double minus2[nPoints]; 122 double minus1[nPoints]; 123 double median[nPoints]; 124 double plus1[nPoints]; 125 double plus2[nPoints]; 127 std::ifstream inputList(fileList); 128 std::string FileList(fileList.c_str()); 130 std::string fileName; 137 float massMin = 1000; 140 while (inputList >> fileName) { 142 // std::cout << fileName << std::endl; 144 TFile * file = new TFile(fileName.c_str()); 146 TTree * tree = (TTree*)file->Get("limit
"); 148 // std::cout << "file :
" << file << std::endl; 149 // std::cout << "tree :
" << tree << std::endl; 151 tree->SetBranchAddress("limit
",&LIMIT); 152 tree->SetBranchAddress("mh
",&MH); 156 if (MH<massMin) massMin = MH; 157 if (MH>massMax) massMax = MH; 160 minus2R[counter] = XSecToTanBeta(my,MH,LIMIT,minTanBeta,maxTanBeta); 162 // std::cout << mA[counter] << std::endl; 165 minus1R[counter] = XSecToTanBeta(my,MH,LIMIT,minTanBeta,maxTanBeta); 168 medianR[counter] = XSecToTanBeta(my,MH,LIMIT,minTanBeta,maxTanBeta); 171 plus1R[counter] = XSecToTanBeta(my,MH,LIMIT,minTanBeta,maxTanBeta); 174 plus2R[counter] = XSecToTanBeta(my,MH,LIMIT,minTanBeta,maxTanBeta); 177 obsR[counter] = XSecToTanBeta(my,MH,LIMIT,minTanBeta,maxTanBeta); 179 obsR[counter] = medianR[counter]; 186 std::cout << std::endl; 187 std::cout << "m(
H) -2s -1s median +1s +2s obs
" << std::endl; 189 for (int i=0; i<counter; ++i) { 192 minus2[i] = minus2R[i]; 193 minus1[i] = minus1R[i]; 194 median[i] = medianR[i]; 195 plus1[i] = plus1R[i]; 196 plus2[i] = plus2R[i]; 199 sprintf(strOut,"%4i %6.1f %6.1f %6.1f %6.1f %6.1f %6.1f
", 200 int(mA[i]),minus2[i],minus1[i],median[i],plus1[i],plus2[i],obs[i]); 201 std::cout << strOut << std::endl; 204 std::cout << std::endl; 206 double zeros[nPoints]; 207 double upper[nPoints]; 208 double lower[nPoints]; 209 double central[nPoints]; 210 for (int i=0; i<counter; ++i) { 213 minus2[i] = median[i] - minus2[i]; 214 minus1[i] = median[i] - minus1[i]; 215 plus1[i] = plus1[i] - median[i]; 216 plus2[i] = plus2[i] - median[i]; 217 upper[i] = 15 - central[i]; 218 lower[i] = central[i] - obs[i]; 222 int nPointsX = counter; 224 TGraph * obsG = new TGraph(nPointsX, mA, obs); 225 obsG->SetLineWidth(3); 226 obsG->SetLineColor(1); 227 obsG->SetLineWidth(2); 228 obsG->SetMarkerColor(1); 229 obsG->SetMarkerStyle(20); 230 obsG->SetMarkerSize(1.4); 232 TGraph * expG = new TGraph(nPointsX, mA, median); 233 expG->SetLineWidth(3); 234 expG->SetLineColor(2); 235 expG->SetLineStyle(2); 237 TGraphAsymmErrors * observed = new TGraphAsymmErrors(nPointsX, mA, central, zeros, zeros, lower, upper); 238 observed->SetFillColor(kCyan-4); 239 observed->SetLineWidth(3); 241 TGraphAsymmErrors * innerBand = new TGraphAsymmErrors(nPointsX, mA, median, zeros, zeros, minus1, plus1); 242 innerBand->SetFillColor(kGreen); 243 innerBand->SetLineColor(kGreen); 245 TGraphAsymmErrors * outerBand = new TGraphAsymmErrors(nPointsX, mA, median, zeros, zeros, minus2, plus2); 246 outerBand->SetFillColor(kYellow); 247 outerBand->SetLineColor(kYellow); 251 if (xMax>0) massMax = xMax; 253 frame = new TH2F("frame
","",2,massMin,massMax,2,yMin,yMax); 254 frame->GetXaxis()->SetTitle(xtitle.c_str()); 255 frame->GetYaxis()->SetTitle(ytitle.c_str()); 256 frame->GetXaxis()->SetNdivisions(510); 257 frame->GetYaxis()->SetNdivisions(206); 258 frame->GetYaxis()->SetTitleOffset(1.3); 259 frame->GetYaxis()->SetTitleSize(0.048); 260 frame->GetXaxis()->SetTitleOffset(1.05); 262 TCanvas *canv = new TCanvas("canv
", "histograms
", 600, 600); 266 outerBand->Draw("3same
"); 267 innerBand->Draw("3same
"); 270 obsG->Draw("lpsame
"); 272 // float xLeg = 0.18; 273 // float yLeg = 0.83; 274 // float xLegend = 0.57; 275 // float yLegend = 0.41; 276 // float sizeLeg = 0.27; 278 TLegend * leg = new TLegend(0.65,0.17,0.92,0.44); 279 leg->SetFillColor(0); 280 leg->SetTextSize(0.035); 281 leg->SetBorderSize(0); 282 leg->SetHeader(header.c_str()); 284 leg->AddEntry(obsG,"Observed
","lp
"); 285 leg->AddEntry(expG,"Expected
","l
"); 286 leg->AddEntry(innerBand,"#pm1#sigma Expected
","f"); 287 leg->AddEntry(outerBand,"#pm2#sigma Expected
","f"); 289 // TLine * line = new TLine(massMin,1,massMax,1); 290 // line->SetLineWidth(2); 291 // line->SetLineStyle(2); 294 TPad * pad = (TPad*)canv->GetPad(0); 295 writeExtraText = true; 297 extraText = "Simulation
"; 302 canv->SetLogy(false); 304 std::string out_name = bench_name + "_tanBeta
"; 305 if(output != "") out_name = out_name + output; 306 // canv->Print(suffix+".pdf
","Portrait pdf
"); 307 canv->Print( (out_name + ".png
").c_str() ); 308 canv->Print( (out_name+".pdf
").c_str());
double XSecToTanBeta |
( |
mssm_xs_tools |
my, |
|
|
double |
mA, |
|
|
double |
xsection, |
|
|
double |
minTanBeta, |
|
|
double |
maxTanBeta |
|
) |
| |