9 #include "TGraphAsymmErrors.h" 24 double minimalDifference = 1e+10;
25 bool rangeExceeded =
true;
26 double tanBetaTarget = -1;
27 double xsecTarget = -1;
28 int ibmax = 10*
int(maxTanBeta-minTanBeta);
29 for (
int ib=0; ib<ibmax; ++ib) {
31 double tanBeta = minTanBeta + 0.1*double(ib);
36 double BrAbb = my.
br_Abb(mA,tanBeta);
37 double BrHbb = my.
br_Hbb(mA,tanBeta);
39 double totXSec = sigmaBBA*BrAbb + sigmaBBH*BrHbb;
40 double difference = TMath::Abs(totXSec-xsection);
42 if (difference<minimalDifference) {
43 minimalDifference = difference;
44 tanBetaTarget = tanBeta;
48 if (totXSec>xsection) {
49 rangeExceeded =
false;
56 tanBetaTarget = tanBetaTarget*TMath::Sqrt(xsection/xsecTarget);
66 std::string output =
"",
67 const std::string benchmark =
"mhmodp_mu200_13TeV.root",
68 bool blindData =
true,
73 std::string Lumi =
"20 fb^{-1}",
74 std::string xtitle =
"m_{A} [GeV]",
75 std::string ytitle =
"tan#beta",
91 gStyle->SetOptFit(0000);
92 gStyle->SetErrorX(0.5);
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;
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());
137 float massMin = 1000;
140 while (inputList >> fileName) {
144 TFile * file =
new TFile(fileName.c_str());
146 TTree * tree = (TTree*)file->Get(
"limit");
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);
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");
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");
294 TPad * pad = (TPad*)canv->GetPad(0);
302 canv->SetLogy(
false);
304 std::string out_name = bench_name +
"_tanBeta";
305 if(output !=
"") out_name = out_name + output;
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)
void CMS_lumi(TPad *pad, TString mytxt="", int iPeriod=20, int iPosX=0)
void SetStyle()
define common styles
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)