void test() { TFile *f = new TFile("toys_tag.root", "read"); TTree *pll = (TTree*) f->Get("pll"); TH1::SetDefaultSumw2(); TH1F *h = new TH1F("h", "h", 30,-3,3); TCanvas *c = new TCanvas(); TString ftag = "toys_tag.root"; ftag.ReplaceAll("_comb.root",""); ftag.ReplaceAll("output_",""); h->GetXaxis()->SetTitle("alpha"); h->GetYaxis()->SetTitle("Number of Toys (a.u.)"); TString SampleTag="toys_tag.root"; TGraphErrors *g_b = new TGraphErrors(); TGraphErrors *g_sb = new TGraphErrors(); g_b->SetTitle("Background only, "+SampleTag); g_sb->SetTitle("Signal+Background, "+SampleTag); int counter_b=0; TString s_alpha[1000]; double bkg_mean[1000]; double bkg_sigma[1000]; double sb_mean[1000]; double sb_sigma[1000]; h->SetTitle("alpha_B_EFF (sig model, "+SampleTag+")"); pll->Draw("alpha_B_EFF>>h","is_alt==0"); h->Scale(1./h->Integral(0,999)); h->Fit("gaus"); h->Draw("HIST"); h->Draw("PE,same"); c->Print("pull_alpha_B_EFF_sigmodel_"+ftag+".png"); g_sb->SetPoint(counter_b, counter_b+1, h->GetMean()); g_sb->SetPointError(counter_b, 0., h->GetRMS()); s_alpha[counter_b] = "alpha_B_EFF"; sb_mean[counter_b] = h->GetMean(); sb_sigma[counter_b] = h->GetRMS(); ++counter_b; h->SetTitle("alpha_EL_ID (sig model, "+SampleTag+")"); pll->Draw("alpha_EL_ID>>h","is_alt==0"); h->Scale(1./h->Integral(0,999)); h->Fit("gaus"); h->Draw("HIST"); h->Draw("PE,same"); c->Print("pull_alpha_EL_ID_sigmodel_"+ftag+".png"); g_sb->SetPoint(counter_b, counter_b+1, h->GetMean()); g_sb->SetPointError(counter_b, 0., h->GetRMS()); s_alpha[counter_b] = "alpha_EL_ID"; sb_mean[counter_b] = h->GetMean(); sb_sigma[counter_b] = h->GetRMS(); ++counter_b; h->SetTitle("alpha_EMBISO (sig model, "+SampleTag+")"); pll->Draw("alpha_EMBISO>>h","is_alt==0"); h->Scale(1./h->Integral(0,999)); h->Fit("gaus"); h->Draw("HIST"); h->Draw("PE,same"); c->Print("pull_alpha_EMBISO_sigmodel_"+ftag+".png"); g_sb->SetPoint(counter_b, counter_b+1, h->GetMean()); g_sb->SetPointError(counter_b, 0., h->GetRMS()); s_alpha[counter_b] = "alpha_EMBISO"; sb_mean[counter_b] = h->GetMean(); sb_sigma[counter_b] = h->GetRMS(); ++counter_b; h->SetTitle("alpha_EMBMFS (sig model, "+SampleTag+")"); pll->Draw("alpha_EMBMFS>>h","is_alt==0"); h->Scale(1./h->Integral(0,999)); h->Fit("gaus"); h->Draw("HIST"); h->Draw("PE,same"); c->Print("pull_alpha_EMBMFS_sigmodel_"+ftag+".png"); g_sb->SetPoint(counter_b, counter_b+1, h->GetMean()); g_sb->SetPointError(counter_b, 0., h->GetRMS()); s_alpha[counter_b] = "alpha_EMBMFS"; sb_mean[counter_b] = h->GetMean(); sb_sigma[counter_b] = h->GetRMS(); ++counter_b; h->SetTitle("alpha_JER (sig model, "+SampleTag+")"); pll->Draw("alpha_JER>>h","is_alt==0"); h->Scale(1./h->Integral(0,999)); h->Fit("gaus"); h->Draw("HIST"); h->Draw("PE,same"); c->Print("pull_alpha_JER_sigmodel_"+ftag+".png"); g_sb->SetPoint(counter_b, counter_b+1, h->GetMean()); g_sb->SetPointError(counter_b, 0., h->GetRMS()); s_alpha[counter_b] = "alpha_JER"; sb_mean[counter_b] = h->GetMean(); sb_sigma[counter_b] = h->GetRMS(); ++counter_b; h->SetTitle("alpha_JES_BJet (sig model, "+SampleTag+")"); pll->Draw("alpha_JES_BJet>>h","is_alt==0"); h->Scale(1./h->Integral(0,999)); h->Fit("gaus"); h->Draw("HIST"); h->Draw("PE,same"); c->Print("pull_alpha_JES_BJet_sigmodel_"+ftag+".png"); g_sb->SetPoint(counter_b, counter_b+1, h->GetMean()); g_sb->SetPointError(counter_b, 0., h->GetRMS()); s_alpha[counter_b] = "alpha_JES_BJet"; sb_mean[counter_b] = h->GetMean(); sb_sigma[counter_b] = h->GetRMS(); ++counter_b; h->SetTitle("alpha_JES_EtaModelling (sig model, "+SampleTag+")"); pll->Draw("alpha_JES_EtaModelling>>h","is_alt==0"); h->Scale(1./h->Integral(0,999)); h->Fit("gaus"); h->Draw("HIST"); h->Draw("PE,same"); c->Print("pull_alpha_JES_EtaModelling_sigmodel_"+ftag+".png"); g_sb->SetPoint(counter_b, counter_b+1, h->GetMean()); g_sb->SetPointError(counter_b, 0., h->GetRMS()); s_alpha[counter_b] = "alpha_JES_EtaModelling"; sb_mean[counter_b] = h->GetMean(); sb_sigma[counter_b] = h->GetRMS(); ++counter_b; h->SetTitle("alpha_JES_FlavCompG (sig model, "+SampleTag+")"); pll->Draw("alpha_JES_FlavCompG>>h","is_alt==0"); h->Scale(1./h->Integral(0,999)); h->Fit("gaus"); h->Draw("HIST"); h->Draw("PE,same"); c->Print("pull_alpha_JES_FlavCompG_sigmodel_"+ftag+".png"); g_sb->SetPoint(counter_b, counter_b+1, h->GetMean()); g_sb->SetPointError(counter_b, 0., h->GetRMS()); s_alpha[counter_b] = "alpha_JES_FlavCompG"; sb_mean[counter_b] = h->GetMean(); sb_sigma[counter_b] = h->GetRMS(); ++counter_b; h->SetTitle("alpha_JES_FlavCompQ (sig model, "+SampleTag+")"); pll->Draw("alpha_JES_FlavCompQ>>h","is_alt==0"); h->Scale(1./h->Integral(0,999)); h->Fit("gaus"); h->Draw("HIST"); h->Draw("PE,same"); c->Print("pull_alpha_JES_FlavCompQ_sigmodel_"+ftag+".png"); g_sb->SetPoint(counter_b, counter_b+1, h->GetMean()); g_sb->SetPointError(counter_b, 0., h->GetRMS()); s_alpha[counter_b] = "alpha_JES_FlavCompQ"; sb_mean[counter_b] = h->GetMean(); sb_sigma[counter_b] = h->GetRMS(); ++counter_b; h->SetTitle("alpha_JES_FlavResp (sig model, "+SampleTag+")"); pll->Draw("alpha_JES_FlavResp>>h","is_alt==0"); h->Scale(1./h->Integral(0,999)); h->Fit("gaus"); h->Draw("HIST"); h->Draw("PE,same"); c->Print("pull_alpha_JES_FlavResp_sigmodel_"+ftag+".png"); g_sb->SetPoint(counter_b, counter_b+1, h->GetMean()); g_sb->SetPointError(counter_b, 0., h->GetRMS()); s_alpha[counter_b] = "alpha_JES_FlavResp"; sb_mean[counter_b] = h->GetMean(); sb_sigma[counter_b] = h->GetRMS(); ++counter_b; h->SetTitle("alpha_JES_Modelling (sig model, "+SampleTag+")"); pll->Draw("alpha_JES_Modelling>>h","is_alt==0"); h->Scale(1./h->Integral(0,999)); h->Fit("gaus"); h->Draw("HIST"); h->Draw("PE,same"); c->Print("pull_alpha_JES_Modelling_sigmodel_"+ftag+".png"); g_sb->SetPoint(counter_b, counter_b+1, h->GetMean()); g_sb->SetPointError(counter_b, 0., h->GetRMS()); s_alpha[counter_b] = "alpha_JES_Modelling"; sb_mean[counter_b] = h->GetMean(); sb_sigma[counter_b] = h->GetRMS(); ++counter_b; h->SetTitle("alpha_JES_PURhoG (sig model, "+SampleTag+")"); pll->Draw("alpha_JES_PURhoG>>h","is_alt==0"); h->Scale(1./h->Integral(0,999)); h->Fit("gaus"); h->Draw("HIST"); h->Draw("PE,same"); c->Print("pull_alpha_JES_PURhoG_sigmodel_"+ftag+".png"); g_sb->SetPoint(counter_b, counter_b+1, h->GetMean()); g_sb->SetPointError(counter_b, 0., h->GetRMS()); s_alpha[counter_b] = "alpha_JES_PURhoG"; sb_mean[counter_b] = h->GetMean(); sb_sigma[counter_b] = h->GetRMS(); ++counter_b; h->SetTitle("alpha_JES_PURhoQ (sig model, "+SampleTag+")"); pll->Draw("alpha_JES_PURhoQ>>h","is_alt==0"); h->Scale(1./h->Integral(0,999)); h->Fit("gaus"); h->Draw("HIST"); h->Draw("PE,same"); c->Print("pull_alpha_JES_PURhoQ_sigmodel_"+ftag+".png"); g_sb->SetPoint(counter_b, counter_b+1, h->GetMean()); g_sb->SetPointError(counter_b, 0., h->GetRMS()); s_alpha[counter_b] = "alpha_JES_PURhoQ"; sb_mean[counter_b] = h->GetMean(); sb_sigma[counter_b] = h->GetRMS(); ++counter_b; h->SetTitle("alpha_JVF (sig model, "+SampleTag+")"); pll->Draw("alpha_JVF>>h","is_alt==0"); h->Scale(1./h->Integral(0,999)); h->Fit("gaus"); h->Draw("HIST"); h->Draw("PE,same"); c->Print("pull_alpha_JVF_sigmodel_"+ftag+".png"); g_sb->SetPoint(counter_b, counter_b+1, h->GetMean()); g_sb->SetPointError(counter_b, 0., h->GetRMS()); s_alpha[counter_b] = "alpha_JVF"; sb_mean[counter_b] = h->GetMean(); sb_sigma[counter_b] = h->GetRMS(); ++counter_b; h->SetTitle("alpha_LH_QBKG_EL (sig model, "+SampleTag+")"); pll->Draw("alpha_LH_QBKG_EL>>h","is_alt==0"); h->Scale(1./h->Integral(0,999)); h->Fit("gaus"); h->Draw("HIST"); h->Draw("PE,same"); c->Print("pull_alpha_LH_QBKG_EL_sigmodel_"+ftag+".png"); g_sb->SetPoint(counter_b, counter_b+1, h->GetMean()); g_sb->SetPointError(counter_b, 0., h->GetRMS()); s_alpha[counter_b] = "alpha_LH_QBKG_EL"; sb_mean[counter_b] = h->GetMean(); sb_sigma[counter_b] = h->GetRMS(); ++counter_b; h->SetTitle("alpha_LH_QBKG_MU (sig model, "+SampleTag+")"); pll->Draw("alpha_LH_QBKG_MU>>h","is_alt==0"); h->Scale(1./h->Integral(0,999)); h->Fit("gaus"); h->Draw("HIST"); h->Draw("PE,same"); c->Print("pull_alpha_LH_QBKG_MU_sigmodel_"+ftag+".png"); g_sb->SetPoint(counter_b, counter_b+1, h->GetMean()); g_sb->SetPointError(counter_b, 0., h->GetRMS()); s_alpha[counter_b] = "alpha_LH_QBKG_MU"; sb_mean[counter_b] = h->GetMean(); sb_sigma[counter_b] = h->GetRMS(); ++counter_b; h->SetTitle("alpha_LH_TBKG (sig model, "+SampleTag+")"); pll->Draw("alpha_LH_TBKG>>h","is_alt==0"); h->Scale(1./h->Integral(0,999)); h->Fit("gaus"); h->Draw("HIST"); h->Draw("PE,same"); c->Print("pull_alpha_LH_TBKG_sigmodel_"+ftag+".png"); g_sb->SetPoint(counter_b, counter_b+1, h->GetMean()); g_sb->SetPointError(counter_b, 0., h->GetRMS()); s_alpha[counter_b] = "alpha_LH_TBKG"; sb_mean[counter_b] = h->GetMean(); sb_sigma[counter_b] = h->GetRMS(); ++counter_b; h->SetTitle("alpha_LH_WBKG (sig model, "+SampleTag+")"); pll->Draw("alpha_LH_WBKG>>h","is_alt==0"); h->Scale(1./h->Integral(0,999)); h->Fit("gaus"); h->Draw("HIST"); h->Draw("PE,same"); c->Print("pull_alpha_LH_WBKG_sigmodel_"+ftag+".png"); g_sb->SetPoint(counter_b, counter_b+1, h->GetMean()); g_sb->SetPointError(counter_b, 0., h->GetRMS()); s_alpha[counter_b] = "alpha_LH_WBKG"; sb_mean[counter_b] = h->GetMean(); sb_sigma[counter_b] = h->GetRMS(); ++counter_b; h->SetTitle("alpha_L_EFF (sig model, "+SampleTag+")"); pll->Draw("alpha_L_EFF>>h","is_alt==0"); h->Scale(1./h->Integral(0,999)); h->Fit("gaus"); h->Draw("HIST"); h->Draw("PE,same"); c->Print("pull_alpha_L_EFF_sigmodel_"+ftag+".png"); g_sb->SetPoint(counter_b, counter_b+1, h->GetMean()); g_sb->SetPointError(counter_b, 0., h->GetRMS()); s_alpha[counter_b] = "alpha_L_EFF"; sb_mean[counter_b] = h->GetMean(); sb_sigma[counter_b] = h->GetRMS(); ++counter_b; h->SetTitle("alpha_MET (sig model, "+SampleTag+")"); pll->Draw("alpha_MET>>h","is_alt==0"); h->Scale(1./h->Integral(0,999)); h->Fit("gaus"); h->Draw("HIST"); h->Draw("PE,same"); c->Print("pull_alpha_MET_sigmodel_"+ftag+".png"); g_sb->SetPoint(counter_b, counter_b+1, h->GetMean()); g_sb->SetPointError(counter_b, 0., h->GetRMS()); s_alpha[counter_b] = "alpha_MET"; sb_mean[counter_b] = h->GetMean(); sb_sigma[counter_b] = h->GetRMS(); ++counter_b; h->SetTitle("alpha_MU_ID (sig model, "+SampleTag+")"); pll->Draw("alpha_MU_ID>>h","is_alt==0"); h->Scale(1./h->Integral(0,999)); h->Fit("gaus"); h->Draw("HIST"); h->Draw("PE,same"); c->Print("pull_alpha_MU_ID_sigmodel_"+ftag+".png"); g_sb->SetPoint(counter_b, counter_b+1, h->GetMean()); g_sb->SetPointError(counter_b, 0., h->GetRMS()); s_alpha[counter_b] = "alpha_MU_ID"; sb_mean[counter_b] = h->GetMean(); sb_sigma[counter_b] = h->GetRMS(); ++counter_b; h->SetTitle("alpha_PILEUP (sig model, "+SampleTag+")"); pll->Draw("alpha_PILEUP>>h","is_alt==0"); h->Scale(1./h->Integral(0,999)); h->Fit("gaus"); h->Draw("HIST"); h->Draw("PE,same"); c->Print("pull_alpha_PILEUP_sigmodel_"+ftag+".png"); g_sb->SetPoint(counter_b, counter_b+1, h->GetMean()); g_sb->SetPointError(counter_b, 0., h->GetRMS()); s_alpha[counter_b] = "alpha_PILEUP"; sb_mean[counter_b] = h->GetMean(); sb_sigma[counter_b] = h->GetRMS(); ++counter_b; h->SetTitle("alpha_Q2_Z (sig model, "+SampleTag+")"); pll->Draw("alpha_Q2_Z>>h","is_alt==0"); h->Scale(1./h->Integral(0,999)); h->Fit("gaus"); h->Draw("HIST"); h->Draw("PE,same"); c->Print("pull_alpha_Q2_Z_sigmodel_"+ftag+".png"); g_sb->SetPoint(counter_b, counter_b+1, h->GetMean()); g_sb->SetPointError(counter_b, 0., h->GetRMS()); s_alpha[counter_b] = "alpha_Q2_Z"; sb_mean[counter_b] = h->GetMean(); sb_sigma[counter_b] = h->GetRMS(); ++counter_b; h->SetTitle("alpha_Q2_bbA (sig model, "+SampleTag+")"); pll->Draw("alpha_Q2_bbA>>h","is_alt==0"); h->Scale(1./h->Integral(0,999)); h->Fit("gaus"); h->Draw("HIST"); h->Draw("PE,same"); c->Print("pull_alpha_Q2_bbA_sigmodel_"+ftag+".png"); g_sb->SetPoint(counter_b, counter_b+1, h->GetMean()); g_sb->SetPointError(counter_b, 0., h->GetRMS()); s_alpha[counter_b] = "alpha_Q2_bbA"; sb_mean[counter_b] = h->GetMean(); sb_sigma[counter_b] = h->GetRMS(); ++counter_b; h->SetTitle("alpha_Q2_ggA (sig model, "+SampleTag+")"); pll->Draw("alpha_Q2_ggA>>h","is_alt==0"); h->Scale(1./h->Integral(0,999)); h->Fit("gaus"); h->Draw("HIST"); h->Draw("PE,same"); c->Print("pull_alpha_Q2_ggA_sigmodel_"+ftag+".png"); g_sb->SetPoint(counter_b, counter_b+1, h->GetMean()); g_sb->SetPointError(counter_b, 0., h->GetRMS()); s_alpha[counter_b] = "alpha_Q2_ggA"; sb_mean[counter_b] = h->GetMean(); sb_sigma[counter_b] = h->GetRMS(); ++counter_b; h->SetTitle("alpha_TAU_EL (sig model, "+SampleTag+")"); pll->Draw("alpha_TAU_EL>>h","is_alt==0"); h->Scale(1./h->Integral(0,999)); h->Fit("gaus"); h->Draw("HIST"); h->Draw("PE,same"); c->Print("pull_alpha_TAU_EL_sigmodel_"+ftag+".png"); g_sb->SetPoint(counter_b, counter_b+1, h->GetMean()); g_sb->SetPointError(counter_b, 0., h->GetRMS()); s_alpha[counter_b] = "alpha_TAU_EL"; sb_mean[counter_b] = h->GetMean(); sb_sigma[counter_b] = h->GetRMS(); ++counter_b; h->SetTitle("alpha_TAU_ID (sig model, "+SampleTag+")"); pll->Draw("alpha_TAU_ID>>h","is_alt==0"); h->Scale(1./h->Integral(0,999)); h->Fit("gaus"); h->Draw("HIST"); h->Draw("PE,same"); c->Print("pull_alpha_TAU_ID_sigmodel_"+ftag+".png"); g_sb->SetPoint(counter_b, counter_b+1, h->GetMean()); g_sb->SetPointError(counter_b, 0., h->GetRMS()); s_alpha[counter_b] = "alpha_TAU_ID"; sb_mean[counter_b] = h->GetMean(); sb_sigma[counter_b] = h->GetRMS(); ++counter_b; h->SetTitle("alpha_TAU_MU (sig model, "+SampleTag+")"); pll->Draw("alpha_TAU_MU>>h","is_alt==0"); h->Scale(1./h->Integral(0,999)); h->Fit("gaus"); h->Draw("HIST"); h->Draw("PE,same"); c->Print("pull_alpha_TAU_MU_sigmodel_"+ftag+".png"); g_sb->SetPoint(counter_b, counter_b+1, h->GetMean()); g_sb->SetPointError(counter_b, 0., h->GetRMS()); s_alpha[counter_b] = "alpha_TAU_MU"; sb_mean[counter_b] = h->GetMean(); sb_sigma[counter_b] = h->GetRMS(); ++counter_b; h->SetTitle("alpha_TES_E_FAKE (sig model, "+SampleTag+")"); pll->Draw("alpha_TES_E_FAKE>>h","is_alt==0"); h->Scale(1./h->Integral(0,999)); h->Fit("gaus"); h->Draw("HIST"); h->Draw("PE,same"); c->Print("pull_alpha_TES_E_FAKE_sigmodel_"+ftag+".png"); g_sb->SetPoint(counter_b, counter_b+1, h->GetMean()); g_sb->SetPointError(counter_b, 0., h->GetRMS()); s_alpha[counter_b] = "alpha_TES_E_FAKE"; sb_mean[counter_b] = h->GetMean(); sb_sigma[counter_b] = h->GetRMS(); ++counter_b; h->SetTitle("alpha_TES_FAKE (sig model, "+SampleTag+")"); pll->Draw("alpha_TES_FAKE>>h","is_alt==0"); h->Scale(1./h->Integral(0,999)); h->Fit("gaus"); h->Draw("HIST"); h->Draw("PE,same"); c->Print("pull_alpha_TES_FAKE_sigmodel_"+ftag+".png"); g_sb->SetPoint(counter_b, counter_b+1, h->GetMean()); g_sb->SetPointError(counter_b, 0., h->GetRMS()); s_alpha[counter_b] = "alpha_TES_FAKE"; sb_mean[counter_b] = h->GetMean(); sb_sigma[counter_b] = h->GetRMS(); ++counter_b; h->SetTitle("alpha_TES_REAL (sig model, "+SampleTag+")"); pll->Draw("alpha_TES_REAL>>h","is_alt==0"); h->Scale(1./h->Integral(0,999)); h->Fit("gaus"); h->Draw("HIST"); h->Draw("PE,same"); c->Print("pull_alpha_TES_REAL_sigmodel_"+ftag+".png"); g_sb->SetPoint(counter_b, counter_b+1, h->GetMean()); g_sb->SetPointError(counter_b, 0., h->GetRMS()); s_alpha[counter_b] = "alpha_TES_REAL"; sb_mean[counter_b] = h->GetMean(); sb_sigma[counter_b] = h->GetRMS(); ++counter_b; h->SetTitle("alpha_XS_DB (sig model, "+SampleTag+")"); pll->Draw("alpha_XS_DB>>h","is_alt==0"); h->Scale(1./h->Integral(0,999)); h->Fit("gaus"); h->Draw("HIST"); h->Draw("PE,same"); c->Print("pull_alpha_XS_DB_sigmodel_"+ftag+".png"); g_sb->SetPoint(counter_b, counter_b+1, h->GetMean()); g_sb->SetPointError(counter_b, 0., h->GetRMS()); s_alpha[counter_b] = "alpha_XS_DB"; sb_mean[counter_b] = h->GetMean(); sb_sigma[counter_b] = h->GetRMS(); ++counter_b; h->SetTitle("alpha_XS_Z (sig model, "+SampleTag+")"); pll->Draw("alpha_XS_Z>>h","is_alt==0"); h->Scale(1./h->Integral(0,999)); h->Fit("gaus"); h->Draw("HIST"); h->Draw("PE,same"); c->Print("pull_alpha_XS_Z_sigmodel_"+ftag+".png"); g_sb->SetPoint(counter_b, counter_b+1, h->GetMean()); g_sb->SetPointError(counter_b, 0., h->GetRMS()); s_alpha[counter_b] = "alpha_XS_Z"; sb_mean[counter_b] = h->GetMean(); sb_sigma[counter_b] = h->GetRMS(); ++counter_b; int n_NPs = counter_b; gStyle->SetPalette(1); int counter_rqcd=0; TString s_rqcd[1000]; TGraphErrors *gr_b = new TGraphErrors(); TGraphErrors *gr_sb = new TGraphErrors(); TH1F *h2 = new TH1F("h2", "h2", 80, 0.8,1.6); h2->GetXaxis()->SetTitle("alpha"); h2->GetYaxis()->SetTitle("Number of Toys (a.u.)"); h2->SetTitle("rQCD_tag_el (Bkg only, "+SampleTag+")"); pll->Draw("rQCD_tag_el>>h2","is_alt==1"); h2->Scale(1./h2->Integral(0,999)); h2->Draw("HIST"); h2->Draw("PE,same"); gr_b->SetPoint(counter_rqcd, counter_rqcd+1, h->GetMean()); gr_b->SetPointError(counter_rqcd, 0., h->GetRMS()); h2->SetTitle("rQCD_tag_el (sig model, "+SampleTag+")"); pll->Draw("rQCD_tag_el>>h","is_alt==0"); h2->Scale(1./h2->Integral(0,999)); h2->Draw("HIST"); h2->Draw("PE,same"); gr_sb->SetPoint(counter_rqcd, counter_rqcd+1, h->GetMean()); gr_sb->SetPointError(counter_rqcd, 0., h->GetRMS()); s_rqcd[counter_rqcd] = "rQCD_tag_el"; ++counter_rqcd; h2->SetTitle("rQCD_tag_mu (Bkg only, "+SampleTag+")"); pll->Draw("rQCD_tag_mu>>h2","is_alt==1"); h2->Scale(1./h2->Integral(0,999)); h2->Draw("HIST"); h2->Draw("PE,same"); gr_b->SetPoint(counter_rqcd, counter_rqcd+1, h->GetMean()); gr_b->SetPointError(counter_rqcd, 0., h->GetRMS()); h2->SetTitle("rQCD_tag_mu (sig model, "+SampleTag+")"); pll->Draw("rQCD_tag_mu>>h","is_alt==0"); h2->Scale(1./h2->Integral(0,999)); h2->Draw("HIST"); h2->Draw("PE,same"); gr_sb->SetPoint(counter_rqcd, counter_rqcd+1, h->GetMean()); gr_sb->SetPointError(counter_rqcd, 0., h->GetRMS()); s_rqcd[counter_rqcd] = "rQCD_tag_mu"; ++counter_rqcd; TCanvas *c1 = new TCanvas("c1", "c1", 2000,1600); TH1F *h1 = new TH1F("h1", "h1", 100, 0, counter_b+1); h1->Fill(-100,0); h1->GetYaxis()->SetTitle("#alpha #pm #sigma"); h1->SetStats(0); h1->GetXaxis()->SetLabelOffset(99); h1->GetXaxis()->SetTickLength(0); h1->GetXaxis()->SetAxisColor(0); //h1->GetYaxis()->SetLabelOffset(99); h1->GetYaxis()->SetRangeUser(-3,3); h1->SetLineColor(0); h1->SetLineWidth(0); h1->SetTitle("Background Only, "+SampleTag); gPad->SetGridy(); h1->Draw("hist"); g_b->SetMarkerStyle(20); g_b->SetMarkerSize(2); g_b->SetLineWidth(2); g_b->Draw("PE,same"); Float_t x, y; y = gPad->GetUymin() - 2.05*h1->GetYaxis()->GetBinWidth(1); TText t; t.SetTextAngle(90); t.SetTextSize(0.03); t.SetTextAlign(33); for (int i=0;iGetXaxis()->GetBinCenter(i+1); TString s_label = s_alpha[i]; s_label.ReplaceAll("alpha_",""); t.DrawText(x,y,s_label.Data()); } TCanvas *c2 = new TCanvas("c2", "c2", 2000,1600); h1->SetTitle("Signal+Background, "+SampleTag); gPad->SetGridy(); h1->Draw("hist"); g_sb->SetMarkerStyle(20); g_sb->Draw("PE,same"); t.SetTextAngle(90); t.SetTextSize(0.03); t.SetTextAlign(33); for (int i=0;iGetXaxis()->GetBinCenter(i+1); TString s_label = s_alpha[i]; s_label.ReplaceAll("alpha_",""); t.DrawText(x,y,s_label.Data()); } c2->Print("AllPoints_sigmodel_"+ftag+".png"); TCanvas *c3 = new TCanvas("c3", "c3", 2000,1600); h1->SetTitle("Background only, "+SampleTag); gPad->SetGridy(); h1->Draw("hist"); gr_b->SetMarkerStyle(20); gr_b->Draw("PE,same"); t.SetTextAngle(90); t.SetTextSize(0.03); t.SetTextAlign(33); for (int i=0;iGetXaxis()->GetBinCenter(i+1); TString s_label = s_rqcd[i]; s_label.ReplaceAll("alpha_",""); t.DrawText(x,y,s_label.Data()); } TCanvas *c4 = new TCanvas("c4", "c4", 2000,1600); h1->SetTitle("Signal+Background, "+SampleTag); gPad->SetGridy(); h1->Draw("hist"); gr_sb->SetMarkerStyle(20); gr_sb->Draw("PE,same"); t.SetTextAngle(90); t.SetTextSize(0.03); t.SetTextAlign(33); for (int i=0;iGetXaxis()->GetBinCenter(i+1); TString s_label = s_rqcd[i]; s_label.ReplaceAll("alpha_",""); t.DrawText(x,y,s_label.Data()); } c4->Print("rQCD_sigmodel_"+ftag+".png"); double corr_matrix[1000][1000]; TH2D *h_full_corr_matrix = new TH2D("CM","correlation matrix "+SampleTag, n_NPs, 0., double(n_NPs), n_NPs, 0., double(n_NPs)); TH1F *h_s = new TH1F("h_s","h_s", 100, -10000, 10000); TH1F *h_s1 = new TH1F("h_s1","h_s1", 100, -10000, 10000); for (int i=0; iDraw(theCutRMSi+">>h_s", "is_alt==0"); pll->Draw(s_alpha[i]+">>h_s1", "is_alt==0"); sb_mean[i] = h_s1->GetMean(); sb_sigma[i] = sqrt( h_s->GetMean() - sb_mean[i]*sb_mean[i] ); cout << "Sigma Cut: (" << i << ") = " << theCutRMSi << " result: " << sb_sigma[i] << endl; } for (int i=0; iDraw(theCut+">>h_s", "is_alt==0"); corr_matrix[i][j] = (h_s->GetMean() - sb_mean[i]*sb_mean[j])/(sb_sigma[i]*sb_sigma[j]); corr_matrix[j][i] = corr_matrix[i][j]; h_full_corr_matrix->SetBinContent(i+1,j+1, corr_matrix[i][j]); h_full_corr_matrix->SetBinContent(j+1,i+1, corr_matrix[i][j]); TString label_x = s_alpha[i]; label_x.ReplaceAll("alpha_",""); TString label_y = s_alpha[j]; label_y.ReplaceAll("alpha_",""); h_full_corr_matrix->GetXaxis()->SetBinLabel(i+1, label_x.Data()); h_full_corr_matrix->GetYaxis()->SetBinLabel(j+1, label_y.Data()); cout << "Cut: (" << i << ", " << j << ") = " << theCut << " / " << sb_sigma[i] << "*" << sb_sigma[j] << "( = "<< sb_sigma[i]*sb_sigma[j] << ")" << " result: " << corr_matrix[i][j] << endl; } } // print numerically the TCanvas *c_cm = new TCanvas("c_cm", "c_cm", 2000,1600); gStyle->SetOptStat(0); h_full_corr_matrix->GetZaxis()->SetRangeUser(-1,1); h_full_corr_matrix->Draw("colz"); c_cm->Print("AllPoints_corrMatrix_sigmodel_"+ftag+".png"); }