#include #include #include #include #include #include #include #include #include #include #include "/opt/homebrew/Cellar/root/6.30.00/share/root/macros/lhcbStyle.C" #include "truthmatch_Conds.h" void Bs_MCORR_Plot_Func(std::vector rootList, std::vector legList, std::vector colorList, int binNum, TString conds[], float xRange[2], float timesMax, const char* savePath){ TLegend* legend = new TLegend(0.64, 0.695, 0.9, 0.915); legend->SetLineWidth(0); float lumi = 5.57; float sigmabb = 144.e9; gROOT->ProcessLine(".L lhcbStyle.C"); lhcbStyle(); int sampNumb = rootList.size(); THStack* histStack = new THStack("histStack", "Bs_MCORR"); TH1F* histVec[sampNumb]; for(int i=0; iGet("DecayTree"); histVec[i] = new TH1F(Form("Hist %i", i), "", binNum, xRange[0], xRange[1]); histVec[i]->SetAxisRange(xRange[0], xRange[1]); //tree->Project(Form("Hist %i", i), "Bs_MCORR", Form("%f*%f*Weight_Norm%s", lumi, sigmabb, conds)); tree->Project(Form("Hist %i", i), "Bs_MCORR", conds[i]); legend->AddEntry(histVec[i], Form("%s , #int = %i",legList[i], (int)round(histVec[i]->Integral())), "l"); histVec[i]->Scale(1./histVec[i]->Integral()); //histVec[i]->SetFillColor(colorList[i]); //histVec[i]->SetLineWidth(0); histVec[i]->SetLineColor(colorList[i]); histVec[i]->SetMarkerSize(.1); histStack->Add(histVec[i], "HIST && E1 && EX0"); } float maxBin = histStack->GetMaximum(); histStack->SetMaximum(maxBin * timesMax); histStack->SetTitle(";M_{corr} [MeV/c^{2}]"); TCanvas *canvas = new TCanvas("canvas", "Canvas", 1300, 1080); histStack->Draw("nostack"); TPaveText* lhcbText = new TPaveText(.17, .855, .32, .925, "BRNDC"); lhcbText->SetFillColor(0); lhcbText->SetTextAlign(12); lhcbText->SetBorderSize(0); lhcbText->SetLineWidth(0); lhcbText->AddText("LHCb MC"); lhcbText->Draw(); legend->Draw(); canvas->SaveAs(Form("%s.pdf",savePath)); canvas->Close(); } void Bs_MCORR_Plot() { float timesMax = .6; float xRange[2] = {2500, 5750}; int binNum = 65; TString conds[3] = {ccbarCondTruth, ccbarCondSoftFake, ccbarCondSupFake}; /****************************************************************************************************** //const char* rootFile1 = "/Users/acaillet/Documents/PhD/Tuples/Run2_Tuples/Signal/Bs2KMuNu_MagUp_2016_TRIMMER.root"; const char* rootFile1 = "/Users/acaillet/Documents/PhD/Tuples/Run2_Tuples/Signal/bs2kmunu_MagUp_2016_TRIMMER.root"; const char* rootFile2 = "/Users/acaillet/Documents/PhD/Tuples/Run2_Tuples/Bkg/Hb2Hc_2016_MagUp_TRIMMER_Re.root"; const char* rootFile3 = "/Users/acaillet/Documents/PhD/Tuples/Run2_Tuples/Bkg/Bu2ccbarKX_2016_MagUp_TRIMMER_Re.root"; const char* rootFile4 = "/Users/acaillet/Documents/PhD/Tuples/Run2_Tuples/Bkg/Bu2JpsiK_2016_MagUp_TRIMMER.root"; const char* rootFile5 = "/Users/acaillet/Documents/PhD/Tuples/Run2_Tuples/Bkg/Bs2JpsiPhi_2016_MagUp_TRIMMER.root"; const char* rootFile6 = "/Users/acaillet/Documents/PhD/Tuples/Run2_Tuples/Bkg/Bs2KstMuNu_2016_MagUp_TRIMMER.root"; const char* rootFile7 = "/Users/acaillet/Documents/PhD/Tuples/Run2_Tuples/Bkg/Bs2Kst1430MuNu_2016_MagUp_TRIMMER.root"; const char* rootFile8 = "/Users/acaillet/Documents/PhD/Tuples/Run2_Tuples/Bkg/Bs2Kst2MuNu_2016_MagUp_TRIMMER.root"; const char* l1 = "B^{0}_{s} #rightarrow K^{-} #mu^{+} #nu"; const char* l2 = "H_{b} #rightarrow H_{c}(#rightarrow K^{+}X)#mu^{+}X'"; const char* l3 = "B^{+} #rightarrow c #bar{c} K X"; const char* l4 = "B^{+} #rightarrow J/#psi K^{+}"; const char* l5 = "B^{0}_{s} #rightarrow J/#psi #phi"; const char* l6 = "B^{0}_{s} #rightarrow K^{*-} #mu^{+} #nu"; const char* l7 = "B^{0}_{s} #rightarrow K^{*-}(1430) #mu^{+} #nu"; const char* l8 = "B^{0}_{s} #rightarrow K^{*-}_{2} #mu^{+} #nu"; int c1 = 210; int c2 = 2; int c3 = 51; int c4 = 4; int c5 = 3; int c6 = 227; int c7 = 226; int c8 = 225; std::vector rootList; rootList.push_back(rootFile1); rootList.push_back(rootFile6); rootList.push_back(rootFile7); rootList.push_back(rootFile8); rootList.push_back(rootFile3); rootList.push_back(rootFile2); std::vector legList; legList.push_back(l1); legList.push_back(l6); legList.push_back(l7); legList.push_back(l8); legList.push_back(l3); legList.push_back(l2); std::vector colorList; colorList.push_back(c1); colorList.push_back(c6); colorList.push_back(c7); colorList.push_back(c8); colorList.push_back(c3); colorList.push_back(c2); ******************************************************************************************************/ /******************************************************************************************************/ const char* rootFile1 = "/Users/acaillet/Documents/PhD/Tuples/Run2_Tuples/Bkg/Bu2ccbarKX_2016_MagUp_Re.root"; const char* rootFile2 = rootFile1; const char* rootFile3 = rootFile1; const char* l1 = "B #rightarrow c #bar{c} K X TRUTH"; const char* l2 = "B #rightarrow c #bar{c} K X SoftFAKE"; const char* l3 = "B #rightarrow c #bar{c} K X SupFAKE"; int c1 = 1; int c2 = 2; int c3 = 4; std::vector rootList; rootList.push_back(rootFile1); rootList.push_back(rootFile2); rootList.push_back(rootFile3); std::vector legList; legList.push_back(l1); legList.push_back(l2); legList.push_back(l3); std::vector colorList; colorList.push_back(c1); colorList.push_back(c2); colorList.push_back(c3); /******************************************************************************************************/ const char* savePath = "/Users/acaillet/Documents/PhD/VarPlots/Bs_MCORR_Comb_Compare/Bs_MCORR_B2ccbarKX_TRUTH_FAKE_SupFAKE"; Bs_MCORR_Plot_Func(rootList, legList, colorList, binNum, conds, xRange, timesMax, savePath); }