void DMAHCALBooker::Book1DHistograms(std::string hname, int NLayer, int NBins, int lower_bound, int upper_bound) { std::vector<TH1F*> h1D(NLayer); TString name; for(int i = 0; i < NLayer; i++) { name = hname; name += i+1; h1D[i] = new TH1F(name, "", NBins, lower_bound, upper_bound); m_list1D->Add(h1D[i]); } m_objectList.insert(std::make_pair("1D", m_list1D)); }
void HiggsPlot::PlotExclusion(int iDecay, double tBmH_max, TString Option){ //_varyRD = 0; if(iDecay<0 || iDecay>3) {cout<<"iDecay must be 0, 1, 2 or 3"<<endl; return;} styles style; style.setPadsStyle(-1); style.setDefaultStyle(); int nBins = 1000, nBins2D = 400; double LikelytBmH=-1, Pvalue, Pmin=1; TString hName, epsName = "public_html/Higgs_Exclusion1D_TEMP_BaBar.eps",label; TCanvas can("can","Exclusion 2HDM"); TH1F h1D("h1D","",nBins,0,tBmH_max); h1D.GetXaxis()->SetTitle("tan#beta/m_{H^{+}} (GeV^{-1})"); h1D.GetYaxis()->SetTitle("Exclusion probability (%)"); double tBmH; for(int bin=1; bin<=nBins; bin++){ tBmH = h1D.GetBinCenter(bin); Pvalue = ProbChi2(iDecay, tBmH); if(Pvalue<Pmin) {LikelytBmH = tBmH; Pmin=Pvalue;} h1D.SetBinContent(bin, 100*Pvalue); } h1D.Draw("c"); Pvalue = ProbChi2(iDecay, 0); label = "#splitline{SM excluded at "; label += RoundNumber(sqrt(2)*TMath::ErfInverse(Pvalue),1); label +=" #sigma}{"; label += "Most likely tan#beta/m_{H^{+}} = "; label += RoundNumber(LikelytBmH,2); label += "}"; TLatex latex; latex.SetNDC(kTRUE); latex.SetTextAlign(31); latex.SetTextSize(style.TitleSize); double xLabel = 1-style.PadRightMargin-0.02; if(iDecay==2) { xLabel = style.PadLeftMargin+0.03; latex.SetTextAlign(11); } latex.DrawLatex(xLabel,style.PadBottomMargin+0.1,label); ////////////////// Plot 2D /////////////////////// int nSigmas[] = {2,3,4, 5}, Nsig=4; double dl[5]; for(int ns=0; ns<Nsig+1; ns++) dl[ns] = IntG(0,1,-nSigmas[ns],nSigmas[ns]); TLine line; line.SetLineStyle(2); line.SetLineColor(1); line.SetLineWidth(1); line.DrawLine(0,dl[3]*100,tBmH_max,dl[3]*100); line.DrawLine(0,dl[0]*100,tBmH_max,dl[0]*100); epsName.ReplaceAll("TEMP",DecayName[iDecay]); can.SaveAs(epsName); int colors[] = {kBlue-10, kBlue-9, kBlue-7, kBlue-4, 0}; gStyle->SetPalette(Nsig, colors); TH2F h2D("h2D","",nBins2D,15,1000,nBins2D,0,110); h2D.GetYaxis()->CenterTitle(true); h2D.GetXaxis()->CenterTitle(true); h2D.GetYaxis()->SetTitle("tan#beta"); h2D.GetXaxis()->SetTitle("m_{H^{+}} (GeV)"); // h2D.GetYaxis()->SetTitle("B"); h2D.GetXaxis()->SetTitle("M"); for(int binH=1; binH<=nBins2D; binH++){ for(int binB=1; binB<=nBins2D; binB++){ tBmH = h2D.GetYaxis()->GetBinCenter(binB)/h2D.GetXaxis()->GetBinCenter(binH); h2D.SetCellContent(binH, binB, ProbChi2(iDecay, tBmH)); } } h2D.SetContour(Nsig,dl); h2D.Draw(Option); TH1F *histo[5]; double legW = 0.134, legH = 0.37; double legX = 1-style.PadRightMargin-0.02, legY = style.PadBottomMargin+legH+0.04; TLegend *leg = new TLegend(legX-legW, legY-legH, legX, legY); leg->SetTextSize(0.075); leg->SetFillColor(0); leg->SetTextFont(style.nFont); histo[4] = new TH1F("WhiteH","",10,0,10); histo[4]->SetLineColor(10);histo[4]->SetFillColor(10); leg->AddEntry(histo[4],""); for(int ileg=0; ileg<Nsig; ileg++) { TString labhisto = "histo"; labhisto += ileg+1; histo[ileg] = new TH1F(labhisto,"histo",10,0,10); histo[ileg]->SetLineColor(colors[ileg]);histo[ileg]->SetFillColor(colors[ileg]); labhisto = " "; labhisto += nSigmas[ileg]; labhisto += "#sigma"; leg->AddEntry(histo[ileg],labhisto); } leg->Draw(); latex.SetTextSize(style.TitleSize*1.1); latex.SetTextAlign(13); latex.DrawLatex(legX-legW+0.015, legY-0.02, "Excl. at"); epsName.ReplaceAll("1D","2D"); can.SaveAs(epsName); for(int his=0; his<Nsig; his++) histo[his]->Delete(); }