void test(TString var="meff",TString plotname="v1j"){ gErrorIgnoreLevel = kError; // gROOT->LoadMacro("/scratch/jvamen/Atlasstyle/AtlasStyle.C"); //SetAtlasStyle(); //gStyle->SetOptStat(000000); //gStyle->SetOptTitle(0); //gStyle->SetHatchesLineWidth(2); //TString var="meff"; TFile* f=new TFile("./single_"+plotname+".root"); TH1F* toys=(TH1F*)f->Get("toys"); TH1F* signal=(TH1F*)f->Get("Signal"); TVectorF * pmin=(TVectorF*)f->Get("pmin"); bool data=true; int number= pmin(0); float pval = pmin(1); if(pval<0) data=false; TCanvas c("c","c"); c.SetLogy(); toys->SetFillColorAlpha(kBlue,0.35); toys->GetYaxis()->SetTitle("pseudo-experiments"); toys->GetXaxis()->SetTitle("-log_{10}(p-value)"); toys->Draw(); signal->SetFillColorAlpha(kRed, 0.35); signal->GetYaxis()->SetTitle("pseudo-experiments"); signal->GetXaxis()->SetTitle("-log_{10}(p-value)"); signal->Draw("same"); double heigth=toys->GetMaximum(); std::cout<<"hootgte: "<<1.2*heigth<SetBorderSize(0); legend->SetTextFont(42); legend->SetTextSize(0.027); legend->SetFillColor(0); legend->SetFillStyle(0); legend->SetLineColor(0); //legend->SetHeader("#splitline{pseudo-experiments SM-only}{ including sys. correlations}"); TString plotname_script=plotname; plotname_script.ReplaceAll("g","#gamma"); plotname_script.ReplaceAll("v","#nu"); legend->SetHeader("Channel:"+plotname_script+" "); legend->AddEntry(toys, "pseudo-experiments", "lpf"); legend->AddEntry(signal,"Signal gtt(800)","lpf"); TLegend *legend2 = new TLegend(0.68, 0.8, 0.8, 0.7); legend2->SetBorderSize(0); legend2->SetTextFont(42); legend2->SetTextSize(0.03); legend2->SetFillColor(0); legend2->SetFillStyle(0); legend2->SetLineColor(0); legend2->SetHeader("#splitline{the black line indicates the p_{min}}{observed in data}"); legend2->Draw("same"); legend->Draw("same"); double lumiData = 20281.4; TLatex n; n.SetNDC(); n.SetTextColor(kBlack); n.SetTextFont(72); n.SetTextSize(0.04); if(var=="meff") n.DrawLatex(0.75,0.2,"Variable: m_{eff}"); if(var=="met") n.DrawLatex(0.75,0.87,"Variable: E_{T}^{miss}"); if(var=="minv") n.DrawLatex(0.75,0.87,"Variable: m_{inv}"); n.SetTextFont(72); n.SetTextSize(0.04); n.DrawLatex(0.40,0.86,"ATLAS"); n.SetTextFont(42); n.DrawLatex(0.50,0.86,"Preliminary"); n.SetNDC(); n.SetTextFont(42); n.SetTextColor(kBlack); mytext = n.DrawLatex(0.4, 0.8, Form("#intL dt = %.1f fb^{-1}, #sqrt{s} = 8 TeV", lumiData/1000. )); mytext->SetTextSize(0.03); TString outdir="./"; c.Print(outdir+plotname+".eps"); c.Print(outdir+plotname+".pdf"); c.Print(outdir+plotname+".png"); c.Print(outdir+plotname+".C"); c.Print(outdir+plotname+".root"); exit(); }