int blessing_plots() { gROOT->Reset(); #define NFILES 10 #define NHISTOS 38 // Options : // --------- // Use ROOT smooth function for background histograms : Bool_t smooth_bk = false; // Re-bin mass histogram to remove some spikiness : Bool_t rebin_mass = false; // Process labels : // ---------------- Int_t WW = 0; Int_t TTBAR = 1; Int_t WZ = 2; Int_t ZEE = 3; Int_t ZMM = 4; Int_t ZTT = 5; Int_t FAKE = 6; Int_t DATA = 7; Int_t ZEE_T = 8; // Test file (met15) Int_t ZMM_T = 9; // Test file (met15) // File names // ---------- char* fileNames[NFILES] = { "root_files_26.07.2003/wwana_4111_040803_WW.root", "root_files_26.07.2003/wwana_4111_040803_TTBAR.root", "root_files_26.07.2003/wwana_4111_040803_WZ.root", "root_files_26.07.2003/wwana_4111_040803_ZEE.root", "root_files_26.07.2003/wwana_4111_040803_ZMUMU.root", // "root_files_26.07.2003/wwana_4111_040803_ZEE_met15.root", // "root_files_26.07.2003/wwana_4111_040803_ZMUMU_met15.root", "root_files_26.07.2003/wwana_4111_040803_ZTAUTAU.root", "root_files_26.07.2003/blessingPlotFakeBg_01.08.2003.root", "root_files_26.07.2003/wwana_4111_072703_allstat_l3.root", // "root_files_26.07.2003/wwana_4111_020803_background_ZEE_met15.root", // "root_files_26.07.2003/wwana_4111_020803_background_ZMUMU_met15.root"}; "root_files_26.07.2003/wwana_4111_040803_ZEE_met15.root", "root_files_26.07.2003/wwana_4111_040803_ZMUMU_met15.root"}; TFile* files[NFILES]; // Normalisations : // ---------------- Bool_t plot_ww_plus_bk_hist = false; Bool_t plot_ww_plus_bk_fit = true; Float_t data_comp_sf = 5.0; Float_t WW_EXPECTED = 7.0448*data_comp_sf; Float_t TTBAR_EXPECTED = 0.0294*data_comp_sf; Float_t WZ_EXPECTED = 0.1965*data_comp_sf; Float_t ZEE_EXPECTED = 0.4574*data_comp_sf; Float_t ZMM_EXPECTED = 0.8637*data_comp_sf; Float_t ZTT_EXPECTED = 0.1157*data_comp_sf; Float_t FAKE_EXPECTED = 0.7160*data_comp_sf; // Int_t nHistos = 38; Int_t PTL_WWALL = 0; Int_t PTL_WWEE = 1; Int_t PTL_WWEM = 2; Int_t PTL_WWMM = 3; Int_t LOWHIGHPT_WWALL = 4; Int_t LOWHIGHPT_WWEE = 5; Int_t LOWHIGHPT_WWEM = 6; Int_t LOWHIGHPT_WWMM = 7; Int_t OPENMET_WWALL = 8; Int_t OPENMET_WWEE = 9; Int_t OPENMET_WWEM = 10; Int_t OPENMET_WWMM = 11; Int_t MET_WWALL = 12; Int_t MET_WWEE = 13; Int_t MET_WWEM = 14; Int_t MET_WWMM = 15; Int_t ZMASS_WWALL = 16; Int_t ZMASS_WWEE = 17; Int_t ZMASS_WWEM = 18; Int_t ZMASS_WWMM = 19; Int_t DPHIMET_WWALL = 20; Int_t DPHIMET_WWEE = 21; Int_t DPHIMET_WWEM = 22; Int_t DPHIMET_WWMM = 23; Int_t ZMASS_DL0J_WWALL = 24; Int_t ZMASS_DL0J_WWEE = 25; Int_t ZMASS_DL0J_WWEM = 26; Int_t ZMASS_DL0J_WWMM = 27; Int_t ZMASS_DL0J_CC_WWALL = 28; Int_t ZMASS_DL0J_CC_WWEE = 29; Int_t ZMASS_DL0J_CC_WWEM = 30; Int_t ZMASS_DL0J_CC_WWMM = 31; Int_t ZMASS_DL0J_CP_WWALL = 32; Int_t ZMASS_DL0J_CP_WWEE = 33; Int_t ZMASS_DL0J_CP_WWEM = 34; Int_t ZMASS_DL0J_CP_WWMM = 35; Int_t ETA_PHXPEM_WWEE = 36; Int_t ETA_PHX_WWEE = 37; // Histogram labels : // ------------------ char* histoNames[NHISTOS] = { "ptl_wwall", "ptl_wwee", "ptl_wwem", "ptl_wwmm", "h_lowhighpt_wwall", "h_lowhighpt_wwee", "h_lowhighpt_wwem", "h_lowhighpt_wwmm", "h_dopenmet_njet0_wwall", "h_dopenmet_njet0_wwee", "h_dopenmet_njet0_wwem", "h_dopenmet_njet0_wwmm", "met_wwall", "met_wwee", "met_wwem", "met_wwmm", "zmass_wwall", "zmass_wwee", "zmass_wwem", "zmass_wwmm", "h_dphimet_njet0_wwall", "h_dphimet_njet0_wwee", "h_dphimet_njet0_wwem", "h_dphimet_njet0_wwmm", "zmass_dilep0jet_wwall", "zmass_dilep0jet_wwee", "zmass_dilep0jet_wwem", "zmass_dilep0jet_wwmm", "zmass_dilep0jet_cc_wwall", "zmass_dilep0jet_cc_wwee", "zmass_dilep0jet_cc_wwem", "zmass_dilep0jet_cc_wwmm", "zmass_dilep0jet_cp_wwall", "zmass_dilep0jet_cp_wwee", "zmass_dilep0jet_cp_wwem", "zmass_dilep0jet_cp_wwmm", "EtaPHXPEM_wwee", "EtaPHX_wwee" }; TObject* histos[NFILES][NHISTOS]; // Read in the histograms : // ------------------------ for (Int_t i=0; iGet(histoNames[j]); } } else { histos[i][PTL_WWALL] = (TObject*)gDirectory->Get("CEM_pt"); histos[i][MET_WWALL] = (TObject*)gDirectory->Get("CEM_met"); histos[i][ZMASS_WWALL] = (TObject*)gDirectory->Get("CEM_zmass"); } } // Global style settings : // ----------------------- TStyle *plain = new TStyle("Plain","Plain Style (no colors/fill areas)"); plain->SetCanvasBorderMode(0); plain->SetPadBorderMode(0); plain->SetPadColor(0); plain->SetCanvasColor(0); plain->SetTitleColor(0); plain->SetStatColor(0); plain->SetTitleX(0.6); plain->SetTitleW(0.6); gROOT->SetStyle("Plain"); gStyle->SetOptStat(0); // Make Canvas & Pad : // ------------------- TCanvas *c1 = new TCanvas("WWDILEPTON","WWDILEPTON",500,600); p1 = new TPad("pad1","pad1",.01,.05,.99,.95); p1->Draw(); p1->Divide(1,1); p1->cd(1); // Title to be used for all plots : // -------------------------------- TPaveLabel* title = new TPaveLabel(0.1,0.92,0.9,0.98,""); title->SetTextSize(0.5); title->SetFillColor(0); title->Paint("NDC"); title->SetBorderSize(1); // Luminosity (126 pb-1) : // ----------------------- TText* lumi = new TText(0.5,0.5,"L = 126 pb^-1!"); // lumi -> SetTextFont(62); lumi->SetTextSize(0.040); lumi->SetTextAlign(22); lumi->SetNDC(); // Cuts : // ------ TText* cuts = new TText(0.5,0.5,"N?jets!=0 ; Opposite Sign"); // cuts -> SetTextFont(62); cuts->SetTextSize(0.040); cuts->SetTextAlign(22); cuts->SetNDC(); // All cuts applied : // ------------------ TText* all_cuts = new TText(0.5,0.5,"All Cuts Applied"); // all_cuts -> SetTextFont(62); all_cuts->SetTextSize(0.040); all_cuts->SetTextAlign(22); all_cuts->SetNDC(); goto lepton_low_high; // Lepton pT : // ----------- TH1F* ww_ptl_wwall = (TH1F*)(histos[WW][PTL_WWALL]); TH1F* ttbar_ptl_wwall = (TH1F*)(histos[TTBAR][PTL_WWALL]); TH1F* wz_ptl_wwall = (TH1F*)(histos[WZ][PTL_WWALL]); TH1F* zee_ptl_wwall = (TH1F*)(histos[ZEE][PTL_WWALL]); TH1F* zmm_ptl_wwall = (TH1F*)(histos[ZMM][PTL_WWALL]); TH1F* ztt_ptl_wwall = (TH1F*)(histos[ZTT][PTL_WWALL]); TH1F* fake_ptl_wwall = (TH1F*)(histos[FAKE][PTL_WWALL]); TH1F* data_ptl_wwall = (TH1F*)(histos[DATA][PTL_WWALL]); norm_histo(ttbar_ptl_wwall,TTBAR_EXPECTED); norm_histo(wz_ptl_wwall,WZ_EXPECTED); norm_histo(zee_ptl_wwall,ZEE_EXPECTED); norm_histo(zmm_ptl_wwall,ZMM_EXPECTED); norm_histo(ztt_ptl_wwall,ZTT_EXPECTED); norm_histo(fake_ptl_wwall,FAKE_EXPECTED); TH1F* ptl_bk_sum = new TH1F(*ttbar_ptl_wwall); ptl_bk_sum->Add(wz_ptl_wwall); ptl_bk_sum->Add(zee_ptl_wwall); ptl_bk_sum->Add(zmm_ptl_wwall); ptl_bk_sum->Add(ztt_ptl_wwall); ptl_bk_sum->Add(fake_ptl_wwall); TH1F* ptl_bk_sum_smooth = new TH1F("ptl_bk_smooth","ptl_bk_smooth",36,20.0,200.0); for (Int_t i=1; i<=36; ++i) { ptl_bk_sum_smooth->SetBinContent(i,ptl_bk_sum->GetBinContent(i+4)); } if (smooth_bk) { cout << "integral before smoothing = " << ptl_bk_sum_smooth->Integral() << endl; ptl_bk_sum_smooth->Smooth(); cout << "integral after smoothing = " << ptl_bk_sum_smooth->Integral() << endl; } norm_histo(ww_ptl_wwall,WW_EXPECTED); // Add background to WW : if (plot_ww_plus_bk_hist && !plot_ww_plus_bk_fit) { if (smooth_bk) { // Need to add histograms with same numbers of bins : TH1F* ptl_bk_sum_smooth_to_add = new TH1F("ptl_bk_smooth_to_add","ptl_bk_smooth_to_add",40,0.0,200.0); for (Int_t i=1; i<=40; ++i) { if (i<=4) { ptl_bk_sum_smooth_to_add->SetBinContent(i,0.0); } else { ptl_bk_sum_smooth_to_add->SetBinContent(i,ptl_bk_sum_smooth->GetBinContent(i-4)); } } ww_ptl_wwall->Add(ptl_bk_sum_smooth_to_add); } else { ww_ptl_wwall->Add(ptl_bk_sum); } } // Fitting background shape : // -------------------------- //or (Int_t ibin=1; ibin<=ptl_bk_sum->GetNbinsX(); ++ibin) { // ptl_bk_sum->SetBinError(ibin,0.1); //} // TF1* myfit = new TF1("myfit","[0]*exp(-[1]*x)+1.01*exp(-0.5*((x-41.75)/14.33)^2)+[2]*exp(-[3]*x)",0,6); // TF1* myfit = new TF1("myfit","62.6151*exp(-0.154361*x)+[0]*exp(-0.5*((x-41.75)/14.33)^2)+0.594566*exp(-0.0171681*x)",0,6); // myfit->SetParameter(0,6.26151e+01); // myfit->SetParameter(1,1.54361e-01); // myfit->SetParameter(2,1.01); // myfit->SetParameter(3,41.75); // myfit->SetParameter(4,14.33); // myfit->SetParameter(2,5.94566e-01); // myfit->SetParameter(3,1.71681e-02); // ptl_bk_sum->Fit("myfit","","",20.0,200.0); // Hacked together from various sub-fits (not very satisfactory) : TF1* fitdraw_ptl = new TF1("fitdraw_ptl","[7]*([0]*exp(-[1]*x)+[2]*exp(-0.5*((x-[3])/[4])^2)+[5]*exp(-[6]*x))",20.0,200.0); fitdraw_ptl->SetParameter(0,6.26151e+01); fitdraw_ptl->SetParameter(1,1.54361e-01); fitdraw_ptl->SetParameter(2,1.01); fitdraw_ptl->SetParameter(3,41.75); fitdraw_ptl->SetParameter(4,14.33); fitdraw_ptl->SetParameter(5,5.94566e-01); fitdraw_ptl->SetParameter(6,1.71681e-02); fitdraw_ptl->SetParameter(7,1.00); // Function which fits met15 smoothed distribution : // TF1* fitdraw_ptl = new TF1("fitdraw_ptl","[7]*([0]*exp(-[1]*x)+[2]*exp(-0.5*((x-[3])/[4])^2)+[5]*exp(-[6]*x))",20.0,200.0); // fitdraw_ptl->SetParameter(0,6.26151e+01); // fitdraw_ptl->SetParameter(1,1.54361e-01); // fitdraw_ptl->SetParameter(2,8.24517e-01); // fitdraw_ptl->SetParameter(3,4.73179e+01); // fitdraw_ptl->SetParameter(4,6.73761e+00); // fitdraw_ptl->SetParameter(5,5.94566e-01); // fitdraw_ptl->SetParameter(6,1.71681e-02); // fitdraw_ptl->SetParameter(7,1.00); // Sort out normalisation : // ------------------------ Float_t binwidth=5.0; Float_t fitdraw_ptl_int = fitdraw_ptl->Integral(20.0,200.0,&0.0,0.01); cout << " fitdraw_ptl integral = " << fitdraw_ptl_int << endl; cout << " fitdraw_ptl integral/bin width = " << fitdraw_ptl_int/binwidth << endl; Float_t ptl_bk_sum_int = ptl_bk_sum->Integral(1,ptl_bk_sum->GetNbinsX()); cout << " ptl histo integral = " << ptl_bk_sum_int << endl; Float_t rescale_factor = ptl_bk_sum_int/(fitdraw_ptl_int/binwidth); cout << " rescale factor = " << rescale_factor << endl; fitdraw_ptl->SetParameter(7,rescale_factor); cout << " fitdraw_ptl integral (rescaled) = " << fitdraw_ptl->Integral(20.0,200.0,&0.0,0.01)/binwidth << endl; // Add function to WW expectation : // -------------------------------- if (plot_ww_plus_bk_fit) { for (Int_t ibin_ww = 5; ibin_ww<=40; ++ibin_ww) { ww_ptl_wwall->SetBinContent(ibin_ww,(ww_ptl_wwall->GetBinContent(ibin_ww)+fitdraw_ptl->Eval(ibin_ww*5.0-2.5)));; } } ww_ptl_wwall->GetYaxis()->SetTitleOffset(1.2); ww_ptl_wwall->GetYaxis()->CenterTitle(kTRUE); ww_ptl_wwall->GetYaxis()->SetTitle("Leptons/5 GeV"); ww_ptl_wwall->GetXaxis()->CenterTitle(kTRUE); ww_ptl_wwall->GetXaxis()->SetTitle("Lepton P_{T} (GeV)"); ww_ptl_wwall->SetTitle(""); ww_ptl_wwall->SetLineWidth(2); ww_ptl_wwall->Draw(""); data_ptl_wwall->SetFillColor(1); data_ptl_wwall->SetLineColor(1); data_ptl_wwall->Draw("same"); if (plot_ww_plus_bk_hist) { if (smooth_bk) { ptl_bk_sum_smooth->SetLineColor(2); ptl_bk_sum_smooth->SetLineWidth(2); ptl_bk_sum_smooth->SetFillColor(2); ptl_bk_sum_smooth->SetFillStyle(3004); ptl_bk_sum_smooth->Draw("same"); } else { ptl_bk_sum->SetLineColor(2); ptl_bk_sum->SetLineWidth(2); ptl_bk_sum->SetFillColor(2); // Doesn't show up in ps file : ptl_bk_sum->SetFillStyle(3004); ptl_bk_sum->Draw("same"); } ww_ptl_wwall->Draw("same"); // sort out x-axis } if (plot_ww_plus_bk_fit) { fitdraw_ptl->SetLineColor(2); fitdraw_ptl->SetLineWidth(2); fitdraw_ptl->SetFillColor(2); fitdraw_ptl->SetFillStyle(3004); fitdraw_ptl->Draw("same"); } TLegend* ptl_legend = new TLegend(0.42,0.47,0.86,0.865); ptl_legend->SetTextSize(0.040); ptl_legend->SetFillColor(0); ptl_legend->SetLineStyle(1); ptl_legend->SetLineColor(0); ptl_legend->AddEntry(ww_ptl_wwall,"(WW + Back.) X 5","f"); if (plot_ww_plus_bk_hist) { ptl_legend->AddEntry(ptl_bk_sum,"Back. X 5","f"); } if (plot_ww_plus_bk_fit) { ptl_legend->AddEntry(fitdraw_ptl,"Back. X 5","f"); } ptl_legend->AddEntry(data_ptl_wwall,"Data","f"); ptl_legend->Draw(""); title->SetLabel("CDF Run II Preliminary - Lepton P_{T} After All Cuts"); title->Draw(); lumi->SetX(0.535); lumi->SetY(0.42); lumi->Draw(); c1->SaveAs("ww_dilepton_ptl.eps"); c1->SaveAs("ww_dilepton_ptl.gif"); goto end; lepton_low_high: // Lepton pT (low vs. high) : // -------------------------- TH2F* ww_lowhighpt_wwall = (TH2F*)(histos[WW][LOWHIGHPT_WWALL]); TH2F* data_lowhighpt_wwee = (TH2F*)(histos[DATA][LOWHIGHPT_WWEE]); TH2F* data_lowhighpt_wwem = (TH2F*)(histos[DATA][LOWHIGHPT_WWEM]); TH2F* data_lowhighpt_wwmm = (TH2F*)(histos[DATA][LOWHIGHPT_WWMM]); ww_lowhighpt_wwall->GetYaxis()->SetTitleOffset(1.3); ww_lowhighpt_wwall->GetYaxis()->CenterTitle(kTRUE); // ww_lowhighpt_wwall->GetYaxis()->SetLimits(0.0,150.0); ww_lowhighpt_wwall->GetYaxis()->SetTitle("P_{T} (lowest P_{T} lepton) (GeV)"); ww_lowhighpt_wwall->GetXaxis()->CenterTitle(kTRUE); ww_lowhighpt_wwall->GetXaxis()->SetTitle("P_{T} (highest P_{T} lepton) (GeV)"); ww_lowhighpt_wwall->SetTitle(""); ww_lowhighpt_wwall->SetMarkerStyle(20); ww_lowhighpt_wwall->SetMarkerColor(7); ww_lowhighpt_wwall->SetMarkerSize(0.2); ww_lowhighpt_wwall->Draw(""); TH2F* dummy = new TH2F(); // For the legend dummy->SetMarkerStyle(20); dummy->SetMarkerColor(7); dummy->SetMarkerSize(1.50); data_lowhighpt_wwee->SetMarkerStyle(20); data_lowhighpt_wwee->SetMarkerColor(1); data_lowhighpt_wwee->SetMarkerSize(1.50); data_lowhighpt_wwee->Draw("same"); data_lowhighpt_wwem->SetMarkerStyle(29); data_lowhighpt_wwem->SetMarkerColor(2); data_lowhighpt_wwem->SetMarkerSize(1.50); data_lowhighpt_wwem->Draw("same"); data_lowhighpt_wwmm->SetMarkerStyle(21); data_lowhighpt_wwmm->SetMarkerColor(4); data_lowhighpt_wwmm->SetMarkerSize(1.50); data_lowhighpt_wwmm->Draw("same"); TLegend* lowhighpt_legend = new TLegend(0.14,0.60,0.45,0.865); lowhighpt_legend->SetTextSize(0.040); lowhighpt_legend->SetFillColor(0); lowhighpt_legend->SetLineStyle(1); lowhighpt_legend->SetLineColor(0); lowhighpt_legend->AddEntry(dummy,"MC WW","p"); lowhighpt_legend->AddEntry(data_lowhighpt_wwee,"Data ee","p"); lowhighpt_legend->AddEntry(data_lowhighpt_wwmm,"Data #mu#mu","p"); lowhighpt_legend->AddEntry(data_lowhighpt_wwem,"Data e#mu","p"); lowhighpt_legend->Draw(""); title->SetLabel("CDF Run II Preliminary - P_{T}(low) vs P_{T}(high)"); title->Draw(); lumi->SetX(0.265); lumi->SetY(0.56); lumi->Draw(); all_cuts->SetX(0.70); all_cuts->SetY(0.15); all_cuts->Draw(); c1->SaveAs("ww_dilepton_lowhighpt.eps"); c1->SaveAs("ww_dilepton_lowhighpt.gif"); title->SetTextSize(0.5); goto end; openmet: // Opening Angle vs. Missing-Et : // ------------------------------ TH2F* ww_openmet_wwall = (TH2F*)(histos[WW][OPENMET_WWALL]); TH2F* data_openmet_wwee = (TH2F*)(histos[DATA][OPENMET_WWEE]); TH2F* data_openmet_wwem = (TH2F*)(histos[DATA][OPENMET_WWEM]); TH2F* data_openmet_wwmm = (TH2F*)(histos[DATA][OPENMET_WWMM]); ww_openmet_wwall->GetYaxis()->SetTitleOffset(1.3); ww_openmet_wwall->GetYaxis()->CenterTitle(kTRUE); // ww_openmet_wwall->GetYaxis()->SetLimits(0.0,150.0); ww_openmet_wwall->GetYaxis()->SetTitle("Opening Angle (radians)"); ww_openmet_wwall->GetXaxis()->CenterTitle(kTRUE); ww_openmet_wwall->GetXaxis()->SetTitle("#slash{E}_{T} (GeV)"); ww_openmet_wwall->SetTitle(""); ww_openmet_wwall->SetMarkerStyle(20); ww_openmet_wwall->SetMarkerColor(7); ww_openmet_wwall->SetMarkerSize(0.2); ww_openmet_wwall->Draw(""); TH2F* dummy = new TH2F(); // For the legend dummy->SetMarkerStyle(20); dummy->SetMarkerColor(7); dummy->SetMarkerSize(1.0); data_openmet_wwee->SetMarkerStyle(20); data_openmet_wwee->SetMarkerColor(1); data_openmet_wwee->SetMarkerSize(1.0); data_openmet_wwee->Draw("same"); data_openmet_wwem->SetMarkerStyle(29); data_openmet_wwem->SetMarkerColor(2); data_openmet_wwem->SetMarkerSize(1.0); data_openmet_wwem->Draw("same"); data_openmet_wwmm->SetMarkerStyle(21); data_openmet_wwmm->SetMarkerColor(4); data_openmet_wwmm->SetMarkerSize(1.0); data_openmet_wwmm->Draw("same"); TLegend* openmet_legend = new TLegend(0.63,0.65.0,0.87,0.89); openmet_legend->SetTextSize(0.040); openmet_legend->SetFillColor(0); openmet_legend->SetLineStyle(1); openmet_legend->SetLineColor(0); openmet_legend->AddEntry(dummy,"MC WW","p"); openmet_legend->AddEntry(data_openmet_wwee,"Data ee","p"); openmet_legend->AddEntry(data_openmet_wwmm,"Data #mu#mu","p"); openmet_legend->AddEntry(data_openmet_wwem,"Data e#mu","p"); TH2F* dummy_pac = new TH2F(); // For the legend dummy_pac->SetMarkerStyle(24); dummy_pac->SetMarkerColor(1); dummy_pac->SetMarkerSize(1.50); openmet_legend->AddEntry(dummy_pac,"Pass All Cuts","p"); openmet_legend->Draw(""); // title->SetLabel("CDF Run II Preliminary - Opening Angle vs. #slash{E}_{T} (N_{jets}=0 \& O.S.)"); title->SetLabel("CDF Run II Preliminary - Opening Angle vs. #slash{E}_{T}"); title->Draw(); lumi->SetX(0.74); lumi->SetY(0.630); lumi->Draw(); cuts->SetX(0.68); cuts->SetY(0.15); cuts->Draw(); // Indicate cut position : // ----------------------- TLine tl(25.0,0.0,25.0,3.5); tl->SetLineWidth(2.0); tl->Draw("same"); // Circle the candidates : // ----------------------- TMarker tm1(87.2,1.935,24); tm1->SetMarkerSize(2.0); tm1->Draw("same"); TMarker tm2(60.55,1.515,24); tm2->SetMarkerSize(2.0); tm2->Draw("same"); TMarker tm3(56.45,1.61,24); tm3->SetMarkerSize(2.0); tm3->Draw("same"); TMarker tm4(33.3,1.995,24); tm4->SetMarkerSize(2.0); tm4->Draw("same"); TMarker tm5(66.0,2.64,24); tm5->SetMarkerSize(2.0); tm5->Draw("same"); c1->SaveAs("ww_dilepton_openmet.eps"); c1->SaveAs("ww_dilepton_openmet.gif"); title->SetTextSize(0.5); goto end; missing_et: // Missing-Et : // ------------ TH1F* ww_met_wwall = (TH1F*)(histos[WW][MET_WWALL]); TH1F* data_met_wwall = (TH1F*)(histos[DATA][MET_WWALL]); TH1F* data_met_wwee = (TH1F*)(histos[DATA][MET_WWEE]); TH1F* data_met_wwem = (TH1F*)(histos[DATA][MET_WWEM]); TH1F* data_met_wwmm = (TH1F*)(histos[DATA][MET_WWMM]); TH1F* ttbar_met_wwall = (TH1F*)(histos[TTBAR][MET_WWALL]); TH1F* wz_met_wwall = (TH1F*)(histos[WZ][MET_WWALL]); TH1F* zee_met_wwall = (TH1F*)(histos[ZEE][MET_WWALL]); TH1F* zmm_met_wwall = (TH1F*)(histos[ZMM][MET_WWALL]); TH1F* ztt_met_wwall = (TH1F*)(histos[ZTT][MET_WWALL]); TH1F* fake_met_wwall = (TH1F*)(histos[FAKE][MET_WWALL]); norm_histo(ttbar_met_wwall,TTBAR_EXPECTED); norm_histo(wz_met_wwall,WZ_EXPECTED); norm_histo(zee_met_wwall,ZEE_EXPECTED); norm_histo(zmm_met_wwall,ZMM_EXPECTED); norm_histo(ztt_met_wwall,ZTT_EXPECTED); norm_histo(fake_met_wwall,FAKE_EXPECTED); TH1F* met_bk_sum = new TH1F(*ttbar_met_wwall); met_bk_sum->Add(wz_met_wwall); met_bk_sum->Add(zee_met_wwall); met_bk_sum->Add(zmm_met_wwall); met_bk_sum->Add(ztt_met_wwall); met_bk_sum->Add(fake_met_wwall); TH1F* met_bk_sum_smooth = new TH1F("met_bk_smooth","met_bk_smooth",25,25.0,150.0); for (Int_t i=1; i<=25; ++i) { met_bk_sum_smooth->SetBinContent(i,met_bk_sum->GetBinContent(i+5)); } if (smooth_bk) { cout << "integral before smoothing = " << met_bk_sum_smooth->Integral() << endl; met_bk_sum_smooth->Smooth(); cout << "integral after smoothing = " << met_bk_sum_smooth->Integral() << endl; } norm_histo(ww_met_wwall,WW_EXPECTED); // Add background : if (plot_ww_plus_bk_hist && !plot_ww_plus_bk_fit) { if (smooth_bk) { // Need to add histograms with same numbers of bins : TH1F* met_bk_sum_smooth_to_add = new TH1F("met_bk_smooth_to_add","met_bk_smooth_to_add",30,0.0,150.0); for (Int_t i=1; i<=30; ++i) { if (i<=5) { met_bk_sum_smooth_to_add->SetBinContent(i,0.0); } else { met_bk_sum_smooth_to_add->SetBinContent(i,met_bk_sum_smooth->GetBinContent(i-5)); } } ww_met_wwall->Add(met_bk_sum_smooth_to_add); } else { ww_met_wwall->Add(met_bk_sum); } } // Fitting background shape : // -------------------------- // for (Int_t ibin=1; ibin<=met_bk_sum->GetNbinsX(); ++ibin) { // met_bk_sum->SetBinError(ibin,0.25); // } // TF1* myfit_met = new TF1("myfit_met","[0]*exp(-[1]*x)+[2]*exp(-0.5*((x-[3])/[4])^2)",0,1); // myfit_met->SetParameter(0,500.0); // myfit_met->SetParameter(1,0.2); // myfit_met->SetParameter(2,1.0); // myfit_met->SetParameter(3,60.0); // myfit_met->SetParameter(4,20.0); // met_bk_sum->Fit("myfit_met","","",25.0,150.0); // Resulting fit : // --------------- TF1* fitdraw_met = new TF1("fitdraw_met","[5]*([0]*exp(-[1]*x)+[2]*exp(-0.5*((x-[3])/[4])^2))",25.0,150.0); fitdraw_met->SetParameter(0,3.23186e+03); fitdraw_met->SetParameter(1,2.48158e-01); fitdraw_met->SetParameter(2,8.03094e-01); fitdraw_met->SetParameter(3,5.58356e+01); fitdraw_met->SetParameter(4,1.68392e+01); fitdraw_met->SetParameter(5,1.0); // Normalise the fit result : // -------------------------- Float_t binwidth_met=5.0; Float_t fitdraw_met_int = fitdraw_met->Integral(25.0,150.0,&0.0,0.01); cout << " fitdraw_met integral = " << fitdraw_met_int << endl; cout << " fitdraw_met integral/bin width = " << fitdraw_met_int/binwidth_met << endl; Float_t met_bk_sum_int = met_bk_sum->Integral(1,met_bk_sum->GetNbinsX()); cout << " met histo integral = " << met_bk_sum_int << endl; Float_t rescale_factor_met = met_bk_sum_int/(fitdraw_met_int/binwidth_met); cout << " rescale factor = " << rescale_factor_met << endl; fitdraw_met->SetParameter(5,rescale_factor_met); cout << " fitdraw_met integral (rescaled) = " << fitdraw_met->Integral(25.0,150.0,&0.0,0.01)/binwidth_met << endl; // Add function to WW expectation : // -------------------------------- if (plot_ww_plus_bk_fit) { for (Int_t ibin_ww = 6; ibin_ww<=30; ++ibin_ww) { ww_met_wwall->SetBinContent(ibin_ww,(ww_met_wwall->GetBinContent(ibin_ww)+fitdraw_met->Eval(ibin_ww*5.0-2.5))); } } ww_met_wwall->GetYaxis()->SetTitleOffset(1.2); ww_met_wwall->GetYaxis()->CenterTitle(kTRUE); ww_met_wwall->GetYaxis()->SetTitle("Events/5 GeV"); ww_met_wwall->GetXaxis()->CenterTitle(kTRUE); ww_met_wwall->GetXaxis()->SetTitle("#slash{E}_{T} (GeV)"); ww_met_wwall->SetLineWidth(2); ww_met_wwall->SetTitle(""); ww_met_wwall->Draw(""); data_met_wwall->SetFillColor(1); data_met_wwall->SetLineColor(1); data_met_wwall->Draw("same"); //data_met_wwee->SetFillColor(1); //data_met_wwee->SetLineColor(1); //data_met_wwee->Draw("same"); //data_met_wwem->SetFillColor(2); //data_met_wwem->SetLineColor(2); //data_met_wwem->Draw("same"); //data_met_wwmm->SetFillColor(4); //data_met_wwmm->SetLineColor(4); //data_met_wwmm->Draw("same"); if (plot_ww_plus_bk_hist) { if (smooth_bk) { met_bk_sum_smooth->SetLineColor(2); met_bk_sum_smooth->SetFillColor(2); met_bk_sum_smooth->SetLineWidth(2); met_bk_sum_smooth->SetFillStyle(3004); met_bk_sum_smooth->Draw("same"); } else { met_bk_sum->SetLineColor(2); met_bk_sum->SetFillColor(2); met_bk_sum->SetLineWidth(2); met_bk_sum->SetFillStyle(3004); met_bk_sum->Draw("same"); } ww_met_wwall->Draw("same"); // sort out x-axis } if (plot_ww_plus_bk_fit) { fitdraw_met->SetLineColor(2); fitdraw_met->SetLineWidth(2); fitdraw_met->SetFillColor(2); fitdraw_met->SetFillStyle(3004); fitdraw_met->Draw("same"); } TLegend* met_legend = new TLegend(0.48,0.54,0.86,0.885); met_legend->SetTextSize(0.040); met_legend->SetFillColor(0); met_legend->SetLineStyle(1); met_legend->SetLineColor(0); met_legend->AddEntry(ww_met_wwall,"(WW + Back.) X 5","f"); if (plot_ww_plus_bk_hist) { met_legend->AddEntry(met_bk_sum,"Back. X 5","f"); } if (plot_ww_plus_bk_fit) { met_legend->AddEntry(fitdraw_met,"Back. X 5","f"); } met_legend->AddEntry(data_met_wwall,"Data","f"); met_legend->Draw(""); title->SetLabel("CDF Run II Preliminary - #slash{E}_{T} After All Cuts"); title->Draw(); lumi->SetX(0.59); lumi->SetY(0.51); lumi->Draw(); c1->SaveAs("ww_dilepton_met.eps"); c1->SaveAs("ww_dilepton_met.gif"); goto end; invariant_mass: // Invariant Mass : // ---------------- TH1F* ww_zmass_wwall = (TH1F*)(histos[WW][ZMASS_WWALL]); TH1F* data_zmass_wwall = (TH1F*)(histos[DATA][ZMASS_WWALL]); TH1F* data_zmass_wwee = (TH1F*)(histos[DATA][ZMASS_WWEE]); TH1F* data_zmass_wwem = (TH1F*)(histos[DATA][ZMASS_WWEM]); TH1F* data_zmass_wwmm = (TH1F*)(histos[DATA][ZMASS_WWMM]); TH1F* ttbar_zmass_wwall = (TH1F*)(histos[TTBAR][ZMASS_WWALL]); TH1F* wz_zmass_wwall = (TH1F*)(histos[WZ][ZMASS_WWALL]); TH1F* zee_zmass_wwall = (TH1F*)(histos[ZEE][ZMASS_WWALL]); TH1F* zmm_zmass_wwall = (TH1F*)(histos[ZMM][ZMASS_WWALL]); TH1F* ztt_zmass_wwall = (TH1F*)(histos[ZTT][ZMASS_WWALL]); TH1F* fake_zmass_wwall = (TH1F*)(histos[FAKE][ZMASS_WWALL]); // Re-bin : // -------- TH1F* ww_zmass_wwall_rebin = new TH1F("ww_rebin","ww_rebin",20,0.0,200.0); TH1F* data_zmass_wwall_rebin = new TH1F("data_rebin","data_rebin",20,0.0,200.0); TH1F* data_zmass_wwee_rebin = new TH1F("data_ee_rebin","data_ee_rebin",20,0.0,200.0); TH1F* data_zmass_wwem_rebin = new TH1F("data_em_rebin","data_em_rebin",20,0.0,200.0); TH1F* data_zmass_wwmm_rebin = new TH1F("data_mm_rebin","data_mm_rebin",20,0.0,200.0); TH1F* ttbar_zmass_wwall_rebin = new TH1F("ttbar_rebin","ttbar_rebin",20,0.0,200.0); TH1F* wz_zmass_wwall_rebin = new TH1F("wz_rebin","wz_rebin",20,0.0,200.0); TH1F* zee_zmass_wwall_rebin = new TH1F("zee__rebin","zee_rebin",20,0.0,200.0); TH1F* zmm_zmass_wwall_rebin = new TH1F("zmm_rebin","zmm_rebin",20,0.0,200.0); TH1F* ztt_zmass_wwall_rebin = new TH1F("ztt_rebin","ztt_rebin",20,0.0,200.0); TH1F* fake_zmass_wwall_rebin = new TH1F("fake_rebin","fake_rebin",20,0.0,200.0); TH1F* ww_zmass_wwall_plot; TH1F* data_zmass_wwall_plot; TH1F* data_zmass_wwee_plot; TH1F* data_zmass_wwem_plot; TH1F* data_zmass_wwmm_plot; if (rebin_mass) { for (int i=1; i<= 20; i++) { Int_t b1 = 2*(i-1)+1; Int_t b2 = 2*(i-1)+2; ww_zmass_wwall_rebin->SetBinContent(i,ww_zmass_wwall->GetBinContent(b1)+ww_zmass_wwall->GetBinContent(b2)); data_zmass_wwall_rebin->SetBinContent(i,data_zmass_wwall->GetBinContent(b1)+data_zmass_wwall->GetBinContent(b2)); data_zmass_wwee_rebin->SetBinContent(i,data_zmass_wwee->GetBinContent(b1)+data_zmass_wwee->GetBinContent(b2)); data_zmass_wwem_rebin->SetBinContent(i,data_zmass_wwem->GetBinContent(b1)+data_zmass_wwem->GetBinContent(b2)); data_zmass_wwmm_rebin->SetBinContent(i,data_zmass_wwmm->GetBinContent(b1)+data_zmass_wwmm->GetBinContent(b2)); ttbar_zmass_wwall_rebin->SetBinContent(i,ttbar_zmass_wwall->GetBinContent(b1)+ttbar_zmass_wwall->GetBinContent(b2)); wz_zmass_wwall_rebin->SetBinContent(i,wz_zmass_wwall->GetBinContent(b1)+wz_zmass_wwall->GetBinContent(b2)); zee_zmass_wwall_rebin->SetBinContent(i,zee_zmass_wwall->GetBinContent(b1)+zee_zmass_wwall->GetBinContent(b2)); zmm_zmass_wwall_rebin->SetBinContent(i,zmm_zmass_wwall->GetBinContent(b1)+zmm_zmass_wwall->GetBinContent(b2)); ztt_zmass_wwall_rebin->SetBinContent(i,ztt_zmass_wwall->GetBinContent(b1)+ztt_zmass_wwall->GetBinContent(b2)); fake_zmass_wwall_rebin->SetBinContent(i,fake_zmass_wwall->GetBinContent(b1)+fake_zmass_wwall->GetBinContent(b2)); } ww_zmass_wwall_plot = ww_zmass_wwall_rebin; data_zmass_wwall_plot = data_zmass_wwall_rebin; data_zmass_wwee_plot = data_zmass_wwee_rebin; data_zmass_wwem_plot = data_zmass_wwem_rebin; data_zmass_wwmm_plot = data_zmass_wwmm_rebin; ttbar_zmass_wwall_plot = ttbar_zmass_wwall_rebin; wz_zmass_wwall_plot = wz_zmass_wwall_rebin; zee_zmass_wwall_plot = zee_zmass_wwall_rebin; zmm_zmass_wwall_plot = zmm_zmass_wwall_rebin; ztt_zmass_wwall_plot = ztt_zmass_wwall_rebin; fake_zmass_wwall_plot = fake_zmass_wwall_rebin; } else { ww_zmass_wwall_plot = ww_zmass_wwall; data_zmass_wwall_plot = data_zmass_wwall; data_zmass_wwee_plot = data_zmass_wwee; data_zmass_wwem_plot = data_zmass_wwem; data_zmass_wwmm_plot = data_zmass_wwmm; ttbar_zmass_wwall_plot = ttbar_zmass_wwall; wz_zmass_wwall_plot = wz_zmass_wwall; zee_zmass_wwall_plot = zee_zmass_wwall; zmm_zmass_wwall_plot = zmm_zmass_wwall; ztt_zmass_wwall_plot = ztt_zmass_wwall; fake_zmass_wwall_plot = fake_zmass_wwall; } norm_histo(ttbar_zmass_wwall_plot,TTBAR_EXPECTED); norm_histo(wz_zmass_wwall_plot,WZ_EXPECTED); norm_histo(zee_zmass_wwall_plot,ZEE_EXPECTED); norm_histo(zmm_zmass_wwall_plot,ZMM_EXPECTED); norm_histo(ztt_zmass_wwall_plot,ZTT_EXPECTED); norm_histo(fake_zmass_wwall_plot,FAKE_EXPECTED); TH1F* zmass_bk_sum_plot = new TH1F(*ttbar_zmass_wwall_plot); zmass_bk_sum_plot->Add(wz_zmass_wwall_plot); zmass_bk_sum_plot->Add(zee_zmass_wwall_plot); zmass_bk_sum_plot->Add(zmm_zmass_wwall_plot); zmass_bk_sum_plot->Add(ztt_zmass_wwall_plot); zmass_bk_sum_plot->Add(fake_zmass_wwall_plot); norm_histo(ww_zmass_wwall_plot,WW_EXPECTED); // Add background : if (plot_ww_plus_bk_hist && !plot_ww_plus_bk_fit) ww_zmass_wwall_plot->Add(zmass_bk_sum_plot); // Fitting background shape : // -------------------------- // Works well with met15 shape : // for (Int_t ibin=1; ibin<=zmass_bk_sum_plot->GetNbinsX(); ++ibin) { // zmass_bk_sum_plot->SetBinError(ibin,0.25); // } // TF1* myfit_zmass = new TF1("myfit_zmass","[0]*exp(-0.5*((x-[1])/[2])^2) + [3]*exp(-0.5*((x-[4])/[5])^2)",0.0,75.0); // myfit_zmass->SetParameter(0,1.5); // myfit_zmass->SetParameter(1,70.0); // myfit_zmass->SetParameter(2,5.0); // myfit_zmass->SetParameter(3,0.5); // myfit_zmass->SetParameter(4,100.0); // myfit_zmass->SetParameter(5,30.0); // zmass_bk_sum_plot->Fit("myfit_zmass","","",0.0,75.0); //for (Int_t ibin=1; ibin<=zmass_bk_sum_plot->GetNbinsX(); ++ibin) { // zmass_bk_sum_plot->SetBinError(ibin,0.25); //} // Works with error of 0.5 : //TF1* myfit_zmass = new TF1("myfit_zmass","[0]*exp(-0.5*((x-[1])/[2])^2)",0.0,75.0); //myfit_zmass->SetParameter(0,1.5); //myfit_zmass->SetParameter(1,70.0); //myfit_zmass->SetParameter(2,8.0); //zmass_bk_sum_plot->Fit("myfit_zmass","","",0.0,75.0); TF1* fitplot_zmass_low = new TF1("fitplot_zmass_low","[3]*([0]*exp(-0.5*((x-[1])/[2])^2))",0.0,75.0); fitplot_zmass_low->SetParameter(0,1.09352e+00); fitplot_zmass_low->SetParameter(1,7.51784e+01); fitplot_zmass_low->SetParameter(2,2.12276e+01); fitplot_zmass_low->SetParameter(3,1.0); // Works with error of 0.5 : // TF1* myfit_zmass = new TF1("myfit_zmass","[0]*exp(-0.5*((x-[1])/[2])^2)",105.0,200.0); // myfit_zmass->SetParameter(0,1.5); // myfit_zmass->SetParameter(1,90.0); // myfit_zmass->SetParameter(2,24.0); // Works with error of 0.25 : // TF1* myfit_zmass = new TF1("myfit_zmass","[0]*exp(-[1]*x)",105.0,200.0); // myfit_zmass->SetParameter(0,1.5); // myfit_zmass->SetParameter(1,90.0); // zmass_bk_sum_plot->Fit("myfit_zmass","","",105.0,200.0); TF1* fitplot_zmass_high = new TF1("fitplot_zmass_high","[2]*([0]*exp(-[1]*x))",105.0,200.0); fitplot_zmass_high->SetParameter(0,4.30424e+00); fitplot_zmass_high->SetParameter(1,2.38862e-02); fitplot_zmass_high->SetParameter(2,1.0); // Works with error of 0.25 : // TF1* myfit_zmass = new TF1("myfit_zmass","[0]*exp(-[1]*x)",75.0,105.0); // zmass_bk_sum_plot->Fit("myfit_zmass","","",75.0,105.0); TF1* fitplot_zmass_medium = new TF1("fitplot_zmass_medium","[2]*([0]*exp(-[1]*x))",75.0,105.0); fitplot_zmass_medium->SetParameter(0,2.35262e+00); fitplot_zmass_medium->SetParameter(1,2.68275e-02); fitplot_zmass_medium->SetParameter(2,1.0); // Normalise the fit result : // -------------------------- Float_t binwidth_mass=5.0; Float_t fitplot_zmass_int = fitplot_zmass_low->Integral(0.0,75.0,&0.0,0.01); cout << " fitplot_zmass integral = " << fitplot_zmass_int << endl; cout << " fitplot_zmass integral/bin width = " << fitplot_zmass_int/binwidth_mass << endl; Float_t zmass_bk_sum_int = zmass_bk_sum_plot->Integral(1,15); cout << " zmass histo integral = " << zmass_bk_sum_int << endl; Float_t rescale_factor_mass = zmass_bk_sum_int/(fitplot_zmass_int/binwidth_mass); cout << " rescale factor = " << rescale_factor_mass << endl; fitplot_zmass_low->SetParameter(3,rescale_factor_mass); cout << " fitplot_zmass integral (rescaled) = " << fitplot_zmass_low->Integral(0.0,75.0,&0.0,0.01)/binwidth_mass << endl; fitplot_zmass_int = fitplot_zmass_medium->Integral(75.0,105.0,&0.0,0.01); cout << " fitplot_zmass integral = " << fitplot_zmass_int << endl; cout << " fitplot_zmass integral/bin width = " << fitplot_zmass_int/binwidth_mass << endl; zmass_bk_sum_int = zmass_bk_sum_plot->Integral(16,21); cout << " zmass histo integral = " << zmass_bk_sum_int << endl; rescale_factor_mass = zmass_bk_sum_int/(fitplot_zmass_int/binwidth_mass); cout << " rescale factor = " << rescale_factor_mass << endl; fitplot_zmass_medium->SetParameter(2,rescale_factor_mass); cout << " fitplot_zmass integral (rescaled) = " << fitplot_zmass_medium->Integral(75.0,105.0,&0.0,0.01)/binwidth_mass << endl; Float_t fitplot_zmass_int = fitplot_zmass_high->Integral(105.0,200.0,&0.0,0.01); cout << " fitplot_zmass integral = " << fitplot_zmass_int << endl; cout << " fitplot_zmass integral/bin width = " << fitplot_zmass_int/binwidth_mass << endl; Float_t zmass_bk_sum_int = zmass_bk_sum_plot->Integral(22,40); cout << " zmass histo integral = " << zmass_bk_sum_int << endl; rescale_factor_mass = zmass_bk_sum_int/(fitplot_zmass_int/binwidth_mass); cout << " rescale factor = " << rescale_factor_mass << endl; fitplot_zmass_high->SetParameter(2,rescale_factor_mass); cout << " fitplot_zmass integral (rescaled) = " << fitplot_zmass_high->Integral(105.0,200.0,&0.0,0.01)/binwidth_mass << endl; // Add function to WW expectation : // -------------------------------- if (plot_ww_plus_bk_fit) { for (Int_t ibin_ww = 1; ibin_ww<=15; ++ibin_ww) { ww_zmass_wwall_plot->SetBinContent(ibin_ww,(ww_zmass_wwall_plot->GetBinContent(ibin_ww)+fitplot_zmass_low->Eval(ibin_ww*5.0-2.5))); } for (Int_t ibin_ww = 16; ibin_ww<=21; ++ibin_ww) { ww_zmass_wwall_plot->SetBinContent(ibin_ww,(ww_zmass_wwall_plot->GetBinContent(ibin_ww)+fitplot_zmass_medium->Eval(ibin_ww*5.0-2.5))); } for (Int_t ibin_ww = 22; ibin_ww<=40; ++ibin_ww) { ww_zmass_wwall_plot->SetBinContent(ibin_ww,(ww_zmass_wwall_plot->GetBinContent(ibin_ww)+fitplot_zmass_high->Eval(ibin_ww*5.0-2.5))); } } ww_zmass_wwall_plot->GetYaxis()->SetTitleOffset(1.2); ww_zmass_wwall_plot->GetYaxis()->CenterTitle(kTRUE); ww_zmass_wwall_plot->GetYaxis()->SetTitle("Events/5 GeV"); ww_zmass_wwall_plot->GetXaxis()->CenterTitle(kTRUE); ww_zmass_wwall_plot->GetXaxis()->SetTitle("Dilepton Invariant Mass (GeV)"); ww_zmass_wwall_plot->SetLineWidth(2); ww_zmass_wwall_plot->SetTitle(""); ww_zmass_wwall_plot->Draw(""); //data_zmass_wwall_plot->SetFillColor(1); //data_zmass_wwall_plot->SetLineColor(1); //data_zmass_wwall_plot->Draw("same"); data_zmass_wwee_plot->SetFillColor(1); data_zmass_wwee_plot->SetLineColor(1); data_zmass_wwee_plot->Draw("same"); data_zmass_wwem_plot->SetFillColor(2); data_zmass_wwem_plot->SetLineColor(2); data_zmass_wwem_plot->Draw("same"); data_zmass_wwmm_plot->SetFillColor(4); data_zmass_wwmm_plot->SetLineColor(4); data_zmass_wwmm_plot->Draw("same"); if (plot_ww_plus_bk_hist) { zmass_bk_sum_plot->SetLineWidth(2); zmass_bk_sum_plot->SetLineColor(2); zmass_bk_sum_plot->SetFillColor(2); zmass_bk_sum_plot->SetFillStyle(3004); zmass_bk_sum_plot->Draw("same"); ww_zmass_wwall_plot->Draw("same"); } if (plot_ww_plus_bk_fit) { fitplot_zmass_low->SetLineWidth(2); fitplot_zmass_low->SetLineColor(2); fitplot_zmass_low->SetFillColor(2); fitplot_zmass_low->SetFillStyle(3004); fitplot_zmass_low->Draw("same"); fitplot_zmass_medium->SetLineWidth(2); fitplot_zmass_medium->SetLineColor(2); fitplot_zmass_medium->SetFillColor(2); fitplot_zmass_medium->SetFillStyle(3004); fitplot_zmass_medium->Draw("same"); fitplot_zmass_high->SetLineWidth(2); fitplot_zmass_high->SetLineColor(2); fitplot_zmass_high->SetFillColor(2); fitplot_zmass_high->SetFillStyle(3004); fitplot_zmass_high->Draw("same"); // Fix up the discontinuities with some lines : TLine tl_mass_1(75.0,fitplot_zmass_low->Eval(75.0),75.0,fitplot_zmass_medium->Eval(75.0)); TLine tl_mass_2(105.0,fitplot_zmass_medium->Eval(105.0),105.0,fitplot_zmass_high->Eval(105.0)); tl_mass_1->SetLineWidth(2); tl_mass_1->SetLineColor(2); tl_mass_2->SetLineWidth(2); tl_mass_2->SetLineColor(2); tl_mass_1->Draw("same"); tl_mass_2->Draw("same"); } TLegend* zmass_legend = new TLegend(0.50,0.55,0.86,0.865); zmass_legend->SetTextSize(0.040); zmass_legend->SetFillColor(0); zmass_legend->SetLineStyle(1); zmass_legend->SetLineColor(0); zmass_legend->AddEntry(ww_zmass_wwall_plot,"(WW + Back.) X 5","f"); if (plot_ww_plus_bk_hist) { zmass_legend->AddEntry(zmass_bk_sum_plot,"Back. X 5","f"); } if (plot_ww_plus_bk_fit) { zmass_legend->AddEntry(fitplot_zmass_low,"Back. X 5","f"); } zmass_legend->AddEntry(data_zmass_wwee_plot,"Data ee","f"); zmass_legend->AddEntry(data_zmass_wwmm_plot,"Data #mu#mu","f"); zmass_legend->AddEntry(data_zmass_wwem_plot,"Data e#mu","f"); zmass_legend->Draw(""); title->SetLabel("CDF Run II Preliminary - Dilepton Mass After All Cuts"); title->Draw(); lumi->SetX(0.62); lumi->SetY(0.50); lumi->Draw(); c1->SaveAs("ww_dilepton_mass.eps"); c1->SaveAs("ww_dilepton_mass.gif"); goto end; dphimet: // DPhi vs. Missing-Et : // --------------------- TH2F* ww_dphimet_wwall = (TH2F*)(histos[WW][DPHIMET_WWALL]); TH2F* data_dphimet_wwee = (TH2F*)(histos[DATA][DPHIMET_WWEE]); TH2F* data_dphimet_wwem = (TH2F*)(histos[DATA][DPHIMET_WWEM]); TH2F* data_dphimet_wwmm = (TH2F*)(histos[DATA][DPHIMET_WWMM]); ww_dphimet_wwall->GetYaxis()->SetTitleOffset(1.3); ww_dphimet_wwall->GetYaxis()->CenterTitle(kTRUE); // ww_dphimet_wwall->GetYaxis()->SetLimits(0.0,150.0); ww_dphimet_wwall->GetYaxis()->SetTitle("#Delta#phi (#slash{E}_{T},closest lepton)"); ww_dphimet_wwall->GetXaxis()->CenterTitle(kTRUE); ww_dphimet_wwall->GetXaxis()->SetTitle("#slash{E}_{T} (GeV)"); ww_dphimet_wwall->SetTitle(""); ww_dphimet_wwall->SetMarkerStyle(20); ww_dphimet_wwall->SetMarkerColor(7); ww_dphimet_wwall->SetMarkerSize(0.2); ww_dphimet_wwall->Draw(""); TH2F* dummy = new TH2F(); // For the legend dummy->SetMarkerStyle(20); dummy->SetMarkerColor(7); dummy->SetMarkerSize(1.00); data_dphimet_wwee->SetMarkerStyle(20); data_dphimet_wwee->SetMarkerColor(1); data_dphimet_wwee->SetMarkerSize(1.0); data_dphimet_wwee->Draw("same"); data_dphimet_wwem->SetMarkerStyle(29); data_dphimet_wwem->SetMarkerColor(2); data_dphimet_wwem->SetMarkerSize(1.3); data_dphimet_wwem->Draw("same"); data_dphimet_wwmm->SetMarkerStyle(21); data_dphimet_wwmm->SetMarkerColor(4); data_dphimet_wwmm->SetMarkerSize(1.0); data_dphimet_wwmm->Draw("same"); TLegend* dphimet_legend = new TLegend(0.64,0.67.0,0.87,0.89); dphimet_legend->SetTextSize(0.040); dphimet_legend->SetFillColor(0); dphimet_legend->SetLineStyle(1); dphimet_legend->SetLineColor(0); dphimet_legend->AddEntry(dummy,"MC WW","p"); dphimet_legend->AddEntry(data_dphimet_wwee,"Data ee","p"); dphimet_legend->AddEntry(data_dphimet_wwmm,"Data #mu#mu","p"); dphimet_legend->AddEntry(data_dphimet_wwem,"Data e#mu","p"); dphimet_legend->Draw(""); // title->SetLabel("CDF Run II Preliminary - #Delta#phi vs #slash{E}_{T} (N_{jets}=0 \& O.S.)"); title->SetLabel("CDF Run II Preliminary - #Delta#phi vs #slash{E}_{T}"); title->Draw(); lumi->SetX(0.75); lumi->SetY(0.63); lumi->Draw(); cuts->SetX(0.68); cuts->SetY(0.15); cuts->Draw(); // Indicate cut position : // ----------------------- TLine tl1(25.0,0.349,25.0,3.5); tl1->SetLineWidth(2.0); tl1->Draw("same"); TLine tl2(25.0,0.349,50.0,0.349); tl2->SetLineWidth(2.0); tl2->Draw("same"); TLine tl3(50.0,0.349,50.0,0.0); tl3->SetLineWidth(2.0); tl3->Draw("same"); c1->SaveAs("ww_dilepton_dphimet.eps"); c1->SaveAs("ww_dilepton_dphimet.gif"); goto end; // Checking plug efficiencies : // ---------------------------- // DY-EE : // ======= TH1F* zee_zmass_dilep0j_wwee = (TH1F*)(histos[ZEE][ZMASS_DL0J_WWEE]); TH1F* zee_zmass_dilep0j_cc_wwee = (TH1F*)(histos[ZEE][ZMASS_DL0J_CC_WWEE]); TH1F* zee_zmass_dilep0j_cp_wwee = (TH1F*)(histos[ZEE][ZMASS_DL0J_CP_WWEE]); //zee_zmass_dilep0j_wwee->Draw(); //zee_zmass_dilep0j_cc_wwee->Draw("same"); //zee_zmass_dilep0j_cp_wwee->Draw("same"); // Count the total number of events : // ---------------------------------- Float_t ntot_zee = zee_zmass_dilep0j_wwee->GetEntries(); Float_t ntot_cc_zee = zee_zmass_dilep0j_cc_wwee->GetEntries(); Float_t ntot_cp_zee = zee_zmass_dilep0j_cp_wwee->GetEntries(); cout << " MC DY-EE : ntot_zee = " << ntot_zee << endl; cout << " MC DY-EE : ntot_cc_zee = " << ntot_cc_zee << endl; cout << " MC DY-EE : ntot_cp_zee = " << ntot_cp_zee << endl; cout << " MC DY-EE : ntot cp/(cc+cp) = " << ntot_cp_zee/(ntot_cc_zee+ntot_cp_zee) << endl; // Count in the Z peak (706 < MASS < 106 GeV) : // -------------------------------------------- Float_t zpeak_zee = zee_zmass_dilep0j_wwee->Integral(39,53); Float_t zpeak_cc_zee = zee_zmass_dilep0j_cc_wwee->Integral(39,53); Float_t zpeak_cp_zee = zee_zmass_dilep0j_cp_wwee->Integral(39,53); cout << " MC DY-EE : zpeak_zee = " << zpeak_zee << endl; cout << " MC DY-EE : zpeak_cc_zee = " << zpeak_cc_zee << endl; cout << " MC DY-EE : zpeak_cp_zee = " << zpeak_cp_zee << endl; Float_t zpeak_ratio_zee = zpeak_cp_zee/(zpeak_cc_zee+zpeak_cp_zee); Float_t zpeak_ratio_zee_err = sqrt((zpeak_ratio_zee*(1.0-zpeak_ratio_zee))/(zpeak_cc_zee+zpeak_cp_zee)); cout << " MC DY-EE : zpeak cp/(cc+cp) = " << zpeak_ratio_zee << " +/- " << zpeak_ratio_zee_err << endl; // Look at eta distributions : // --------------------------- TH1F* zee_eta_phxpem_wwee = (TH1F*)(histos[ZEE][ETA_PHXPEM_WWEE]); TH1F* zee_eta_phx_wwee = (TH1F*)(histos[ZEE][ETA_PHX_WWEE]); // Zero some bins on the edge of the acceptance : zee_eta_phxpem_wwee->SetBinContent(2,0.0); zee_eta_phxpem_wwee->SetBinContent(9,0.0); zee_eta_phxpem_wwee->SetBinContent(16,0.0); zee_eta_phxpem_wwee->SetBinContent(23,0.0); zee_eta_phx_wwee->SetBinContent(2,0.0); zee_eta_phx_wwee->SetBinContent(9,0.0); zee_eta_phx_wwee->SetBinContent(16,0.0); zee_eta_phx_wwee->SetBinContent(23,0.0); // zee_eta_phxpem_wwee->Draw(); // zee_eta_phx_wwee->Draw("same"); TH1F* zee_eta_eff = new TH1F("zee_phx_eff","PHX eff",24,-3.0,3.0); // Required to get the binomial errors right : // ------------------------------------------- // zee_eta_phx_wwee->Sumw2(); // zee_eta_phxpem_wwee->Sumw2(); zee_eta_eff->Divide(zee_eta_phx_wwee,zee_eta_phxpem_wwee,1.0,1.0,"B"); zee_eta_eff->SetTitle(""); zee_eta_eff->GetYaxis()->SetTitleOffset(1.2); zee_eta_eff->GetYaxis()->CenterTitle(kTRUE); zee_eta_eff->GetYaxis()->SetTitle("Efficiency"); zee_eta_eff->GetXaxis()->CenterTitle(kTRUE); zee_eta_eff->GetXaxis()->SetTitle("Eta"); zee_eta_eff->SetTitle(""); zee_eta_eff->SetLineWidth(2.0); zee_eta_eff->Draw(); // Overall errors : // ---------------- int zee_pos_eta_numer = zee_eta_phx_wwee->Integral(17,22); int zee_pos_eta_denom = zee_eta_phxpem_wwee->Integral(17,22); int zee_neg_eta_numer = zee_eta_phx_wwee->Integral(3,8); int zee_neg_eta_denom = zee_eta_phxpem_wwee->Integral(3,8); double zee_pos_eta_eff = (1.0*zee_pos_eta_numer)/(1.0*zee_pos_eta_denom); double zee_pos_eta_err = sqrt(zee_pos_eta_eff*(1.0-zee_pos_eta_eff)/zee_pos_eta_denom); double zee_neg_eta_eff = (1.0*zee_neg_eta_numer)/(1.0*zee_neg_eta_denom); double zee_neg_eta_err = sqrt(zee_neg_eta_eff*(1.0-zee_neg_eta_eff)/zee_neg_eta_denom); cout << " MC DY-EE : positive eta (EAST) PHX efficiency = " << zee_pos_eta_eff << " +/- " << zee_pos_eta_err << endl; cout << " MC DY-EE : negative eta (WEST) PHX efficiency = " << zee_neg_eta_eff << " +/- " << zee_neg_eta_err << endl; // DATA EE : // ========= TH1F* data_zmass_dilep0j_wwee = (TH1F*)(histos[DATA][ZMASS_DL0J_WWEE]); TH1F* data_zmass_dilep0j_cc_wwee = (TH1F*)(histos[DATA][ZMASS_DL0J_CC_WWEE]); TH1F* data_zmass_dilep0j_cp_wwee = (TH1F*)(histos[DATA][ZMASS_DL0J_CP_WWEE]); //data_zmass_dilep0j_wwee->Draw(); //data_zmass_dilep0j_cc_wwee->Draw("same"); //data_zmass_dilep0j_cp_wwee->Draw("same"); // Count the total number of events : // ---------------------------------- Float_t ntot_data = data_zmass_dilep0j_wwee->GetEntries(); Float_t ntot_cc_data = data_zmass_dilep0j_cc_wwee->GetEntries(); Float_t ntot_cp_data = data_zmass_dilep0j_cp_wwee->GetEntries(); cout << " DATA EE : ntot_data = " << ntot_data << endl; cout << " DATA EE : ntot_cc_data = " << ntot_cc_data << endl; cout << " DATA EE : ntot_cp_data = " << ntot_cp_data << endl; cout << " DATA EE : ntot cp/(cc+cp) = " << ntot_cp_data/(ntot_cc_data+ntot_cp_data) << endl; // Count in the Z peak (706 < MASS < 106 GeV) : // -------------------------------------------- Float_t zpeak_data = data_zmass_dilep0j_wwee->Integral(39,53); Float_t zpeak_cc_data = data_zmass_dilep0j_cc_wwee->Integral(39,53); Float_t zpeak_cp_data = data_zmass_dilep0j_cp_wwee->Integral(39,53); cout << " DATA EE : zpeak_data = " << zpeak_data << endl; cout << " DATA EE : zpeak_cc_data = " << zpeak_cc_data << endl; cout << " DATA EE : zpeak_cp_data = " << zpeak_cp_data << endl; Float_t zpeak_ratio_data = zpeak_cp_data/(zpeak_cc_data+zpeak_cp_data); Float_t zpeak_ratio_data_err = sqrt((zpeak_ratio_data*(1.0-zpeak_ratio_data))/(zpeak_cc_data+zpeak_cp_data)); cout << " DATA EE : zpeak cp/(cc+cp) = " << zpeak_ratio_data << " +/- " << zpeak_ratio_data_err << endl; // Look at eta distributions : // --------------------------- TH1F* data_eta_phxpem_wwee = (TH1F*)(histos[DATA][ETA_PHXPEM_WWEE]); TH1F* data_eta_phx_wwee = (TH1F*)(histos[DATA][ETA_PHX_WWEE]); // Zero some bins on the edge of the acceptance : data_eta_phxpem_wwee->SetBinContent(2,0.0); data_eta_phxpem_wwee->SetBinContent(9,0.0); data_eta_phxpem_wwee->SetBinContent(16,0.0); data_eta_phxpem_wwee->SetBinContent(23,0.0); data_eta_phx_wwee->SetBinContent(2,0.0); data_eta_phx_wwee->SetBinContent(9,0.0); data_eta_phx_wwee->SetBinContent(16,0.0); data_eta_phx_wwee->SetBinContent(23,0.0); // data_eta_phxpem_wwee->Draw(); // data_eta_phx_wwee->Draw("same"); TH1F* data_eta_eff = new TH1F("data_phx_eff","PHX eff",24,-3.0,3.0); // Required to get the binomial errors right : // ------------------------------------------- data_eta_phx_wwee->Sumw2(); data_eta_phxpem_wwee->Sumw2(); data_eta_eff->Divide(data_eta_phx_wwee,data_eta_phxpem_wwee,1.0,1.0,"B"); data_eta_eff->SetLineWidth(2.0); data_eta_eff->Draw("sameep"); // Overall errors : // ---------------- int data_pos_eta_numer = data_eta_phx_wwee->Integral(17,22); int data_pos_eta_denom = data_eta_phxpem_wwee->Integral(17,22); int data_neg_eta_numer = data_eta_phx_wwee->Integral(3,8); int data_neg_eta_denom = data_eta_phxpem_wwee->Integral(3,8); double data_pos_eta_eff = (1.0*data_pos_eta_numer)/(1.0*data_pos_eta_denom); double data_pos_eta_err = sqrt(data_pos_eta_eff*(1.0-data_pos_eta_eff)/data_pos_eta_denom); double data_neg_eta_eff = (1.0*data_neg_eta_numer)/(1.0*data_neg_eta_denom); double data_neg_eta_err = sqrt(data_neg_eta_eff*(1.0-data_neg_eta_eff)/data_neg_eta_denom); cout << " DATA EE : positive eta (EAST) PHX efficiency = " << data_pos_eta_eff << " +/- " << data_pos_eta_err << endl; cout << " DATA EE : negative eta (WEST) PHX efficiency = " << data_neg_eta_eff << " +/- " << data_neg_eta_err << endl; cout << " DATA EE : positive eta (EAST) PHX+PEM = " << data_pos_eta_denom << endl; cout << " DATA EE : negative eta (WEST) PHX+PEM = " << data_neg_eta_denom << endl; //TLegend* phxeff_legend = new TLegend(0.70,0.72.0,0.87,0.89); //phxeff_legend->SetTextSize(0.040); //phxeff_legend->SetFillColor(0); //phxeff_legend->SetLineStyle(1); //phxeff_legend->SetLineColor(0); //phxeff_legend->AddEntry(zee_eta_eff,"MC ee"); //phxeff_legend->AddEntry(data_eta_eff,"Data ee"); //phxeff_legend->Draw(""); title->SetLabel("PHX Efficiency"); title->Draw(); c1->SaveAs("drellyan_mc_data_eff.eps"); c1->SaveAs("drellyan_mc_data_eff.gif"); studies: // Getting smooth Drell-Yan backgrond distributions : // -------------------------------------------------- // files[ZEE]->cd(); // files[ZEE]->ls(); TH1F* zee_ptl_wwall_met15 = (TH1F*)(histos[ZEE_T][PTL_WWALL]); TH1F* zee_ptl_wwall_default = (TH1F*)(histos[ZEE][PTL_WWALL]); TH1F* zee_mass_wwall_met15 = (TH1F*)(histos[ZEE_T][ZMASS_WWALL]); TH1F* zee_mass_wwall_default = (TH1F*)(histos[ZEE][ZMASS_WWALL]); TH1F* zmm_ptl_wwall_met15 = (TH1F*)(histos[ZMM_T][PTL_WWALL]); TH1F* zmm_ptl_wwall_default = (TH1F*)(histos[ZMM][PTL_WWALL]); TH1F* zmm_mass_wwall_met15 = (TH1F*)(histos[ZMM_T][ZMASS_WWALL]); TH1F* zmm_mass_wwall_default = (TH1F*)(histos[ZMM][ZMASS_WWALL]); zee_ptl_wwall_met15->Scale(zee_ptl_wwall_default->Integral()/zee_ptl_wwall_met15->Integral()); zee_mass_wwall_met15->Scale(zee_mass_wwall_default->Integral()/zee_mass_wwall_met15->Integral()); zmm_ptl_wwall_met15->Scale(zmm_ptl_wwall_default->Integral()/zmm_ptl_wwall_met15->Integral()); zmm_mass_wwall_met15->Scale(zmm_mass_wwall_default->Integral()/zmm_mass_wwall_met15->Integral()); //TH1F* zee_met_wwall = (TH1F*)gDirectory->Get("met_wwall"); //TH1F* zee_zmass_wwall = (TH1F*)gDirectory->Get("zmass_wwall"); //zee_met_zmass_wwall_nzm->Draw(); //zee_met_zmass_wwall->Draw("same"); //zee_zmass_wwall->Draw("lc"); p1->cd(1); zee_ptl_wwall_default->Draw("e"); zee_ptl_wwall_met15->Draw("same"); p1->cd(2); zee_mass_wwall_default->Draw("e"); zee_mass_wwall_met15->Draw("same"); p1->cd(3); zmm_ptl_wwall_default->Draw("e"); zmm_ptl_wwall_met15->Draw("same"); p1->cd(4); zmm_mass_wwall_default->Draw("e"); zmm_mass_wwall_met15->Draw("same"); end: return 1; } void norm_histo(TH1F*& histo, Float_t norm) { // hist->GetEntries : includes underflow & overflow bins // hist->Integral : does NOT include underflow & overflow bins // hist->Integral(0,nbins+1) : does include underflow & overflow : use this // cout << "ww_ptl_wwall->GetEntries() = " << ww_ptl_wwall->GetEntries() << endl; // cout << "ww_ptl_wwall->GetSumOfWeights() = " << ww_ptl_wwall->GetSumOfWeights() << endl; // cout << "ww_ptl_wwall->GetIntegral() = " << ww_ptl_wwall->Integral() << endl; // cout << "ww_ptl_wwall->GetNbinsX() = " << ww_ptl_wwall->GetNbinsX() << endl; // cout << "ww_ptl_wwall->GetIntegral(0,nb+1) = " << ww_ptl_wwall->Integral(0,ww_ptl_wwall->GetNbinsX()+1) << endl; histo->Scale(norm/histo->Integral(0,histo->GetNbinsX()+1)); }