#include "draw_trigger_eff.omni.h" #include "draw_trigger_eff.omni.h" void setOPT_canvas(TCanvas *canvas, Int_t i, Int_t j) { gStyle->SetLineStyleString(22,"80 18 12 18 12 12"); gStyle->SetOptStat(0); gStyle->SetErrorX(0); gStyle->SetLineStyleString(22,"80 18 12 18 12 12"); gStyle->SetCanvasColor(10); gStyle->SetPadColor(10); gStyle->SetPadLeftMargin(0.2); gStyle->SetPadRightMargin(0.06); gStyle->SetPadTopMargin(0.03); gStyle->SetPadBottomMargin(0.2); canvas->ToggleEventStatus(); canvas->Range(-237.19,-8.78484,1074.67,-1.41487); canvas->SetFillColor(0); canvas->SetBorderMode(0); canvas->SetBorderSize(0); canvas->SetTickx(); canvas->SetTicky(); canvas->SetLeftMargin(0.0180804); canvas->SetRightMargin(0.0169196); canvas->SetTopMargin(0.0385488); canvas->SetBottomMargin(0.130385); canvas->SetFrameLineWidth(2); canvas->SetFrameBorderMode(0); canvas->SetFrameBorderSize(0); canvas->Divide(i,j); } void setOPT_hists(TH1F *hist, TString xAxisTitle="ala", TString MainTitle="ala", Int_t Ndevision=510, Int_t color=4) { hist->GetXaxis()->SetTitle(xAxisTitle); hist->GetYaxis()->SetTitle("conuts"); hist->GetXaxis()->SetTitleSize(0.06); hist->GetYaxis()->SetTitleSize(0.06); hist->GetXaxis()->SetTitleFont(42); hist->GetYaxis()->SetTitleFont(42); hist->GetXaxis()->SetNdivisions(Ndevision); hist->GetYaxis()->SetTitleOffset(1.2); hist->GetXaxis()->CenterTitle(); hist->GetYaxis()->CenterTitle(); hist->GetXaxis()->SetLabelFont(42); hist->GetYaxis()->SetLabelFont(42); hist->GetXaxis()->SetLabelSize(0.05); hist->GetYaxis()->SetLabelSize(0.05); hist->SetTitle(MainTitle); hist->SetLineColor(color); hist->SetLineWidth(2); } void draw_LVL1_LVL2_comparison() { TCanvas *LVL2_eff = new TCanvas("LVL2_eff", "LVL2_eff",176,28,900,912); TCanvas *LVL2_eff_lep_mom = new TCanvas("LVL2_eff_lep_mom", "LVL2_eff_lep_mom",176,28,900,912); TCanvas *LVL2_eff_lep_theta = new TCanvas("LVL2_eff_lep_theta", "LVL2_eff_lep_theta",176,28,900,912); TCanvas *LVL2_eff_lep_phi = new TCanvas("LVL2_eff_lep_phi", "LVL2_eff_lep_phi",176,28,900,912); setOPT_canvas(LVL2_eff,3,3); setOPT_canvas(LVL2_eff_lep_mom,2,2); setOPT_canvas(LVL2_eff_lep_theta,2,2); setOPT_canvas(LVL2_eff_lep_phi,2,2); Char_t name[256]; TFile *input=new TFile("hist_LVL1_LVL2_Full_GOODhv_TriggerDec_2.root","READ"); TFile *output = new TFile("hist_LVL2_eff_TriggerDec_2.root","recreate"); TH1F* hists_phi[2][3][3][3]; // [trigger][cut][sys][polarity] TH1F* hists_theta[2][3][3][3]; // [trigger][cut][sys][polarity] TH1F* hists_mom[2][3][3][3]; // [trigger][cut][sys][polarity] Int_t trigger, sys, cut, polarity; //////////////////////////////////////////////////////////////////////////////////////////////// // trigger =0 -> LVL1, trigger=1 -> LVL2 // // cut =0 -> NO cuts, cut=1 -> RICH cut, cut=2 -> ALL cuts (rich && shower && tof && tofino) // // system =0 -> Tofino/PreShower, system =1 -> Tof, system =2 -> BOTH systems // // polarity =0 -> positrons, polarity =1 -> electrons, polarity =2 -> no selection for pid // //////////////////////////////////////////////////////////////////////////////////////////////// input->cd(); for(Int_t i=0; i<2; i++) // trigger { for(Int_t l=0; l<3; l++) // cut number { for(Int_t k=0; k<3; k++) // system { for(Int_t j=0; j<3; j++) // polarity { sprintf(name,"htheta_triger%d_cut%d_sys%d_pol%d",i,l,k,j); hists_theta[i][l][k][j] = (TH1F*)input->Get(name); sprintf(name,"hphi_triger%d_cut%d_sys%d_pol%d",i,l,k,j); hists_phi[i][l][k][j] = (TH1F*)input->Get(name); sprintf(name,"hmom_triger%d_cut%d_sys%d_pol%d",i,l,k,j); hists_mom[i][l][k][j] = (TH1F*)input->Get(name); } } } } cut=2; setOPT_hists(hists_theta[0][cut][0][0],"#theta [#circ]","no system selection",510,2); setOPT_hists(hists_phi[0][cut][0][0], "#phi [#circ]","no system selection",510,2); setOPT_hists(hists_mom[0][cut][0][0], "p [MeV/c]","no system selection",505,2); setOPT_hists(hists_theta[1][cut][0][0]); setOPT_hists(hists_phi[1][cut][0][0]); setOPT_hists(hists_mom[1][cut][0][0]); setOPT_hists(hists_theta[0][cut][1][0],"#theta [#circ]","TOFino/PreShower",510,2); setOPT_hists(hists_phi[0][cut][1][0], "#phi [#circ]","TOFino/PreShower",510,2); setOPT_hists(hists_mom[0][cut][1][0], "p [MeV/c]","TOFino/PreShower",505,2); setOPT_hists(hists_theta[1][cut][1][0]); setOPT_hists(hists_phi[1][cut][1][0]); setOPT_hists(hists_mom[1][cut][1][0]); setOPT_hists(hists_theta[0][cut][2][0],"#theta [#circ]","TOF",510,2); setOPT_hists(hists_phi[0][cut][2][0], "#phi [#circ]","TOF",510,2); setOPT_hists(hists_mom[0][cut][2][0], "p [MeV/c]","TOF",505,2); setOPT_hists(hists_theta[1][cut][2][0]); setOPT_hists(hists_phi[1][cut][2][0]); setOPT_hists(hists_mom[1][cut][2][0]); setOPT_hists(hists_theta[0][cut][1][1],"#theta [#circ]"," e^{+}, TOFino/PreShower",510,2); setOPT_hists(hists_phi [0][cut][1][1], "#phi [#circ]"," e^{+}, TOFino/PreShower",510,2); setOPT_hists(hists_mom [0][cut][1][1], "p [MeV/c]"," e^{+}, TOFino/PreShower",505,2); setOPT_hists(hists_theta[1][cut][1][1]); setOPT_hists(hists_phi [1][cut][1][1]); setOPT_hists(hists_mom [1][cut][1][1]); setOPT_hists(hists_theta[0][cut][1][2],"#theta [#circ]"," e^{-}, TOFino/PreShower",510,2); setOPT_hists(hists_phi [0][cut][1][2], "#phi [#circ]"," e^{-}, TOFino/PreShower",510,2); setOPT_hists(hists_mom [0][cut][1][2], "p [MeV/c]"," e^{-}, TOFino/PreShower",505,2); setOPT_hists(hists_theta[1][cut][1][2]); setOPT_hists(hists_phi [1][cut][1][2]); setOPT_hists(hists_mom [1][cut][1][2]); setOPT_hists(hists_theta[0][cut][2][1],"#theta [#circ]"," e^{+}, TOF",510,2); setOPT_hists(hists_phi [0][cut][2][1], "#phi [#circ]"," e^{+}, TOF",510,2); setOPT_hists(hists_mom [0][cut][2][1], "p [MeV/c]"," e^{+}, TOF",505,2); setOPT_hists(hists_theta[1][cut][2][1]); setOPT_hists(hists_phi [1][cut][2][1]); setOPT_hists(hists_mom [1][cut][2][1]); setOPT_hists(hists_theta[0][cut][2][2],"#theta [#circ]"," e^{-}, TOF",510,2); setOPT_hists(hists_phi [0][cut][2][2], "#phi [#circ]"," e^{-}, TOF",510,2); setOPT_hists(hists_mom [0][cut][2][2], "p [MeV/c]"," e^{-}, TOF",505,2); setOPT_hists(hists_theta[1][cut][2][2]); setOPT_hists(hists_phi [1][cut][2][2]); setOPT_hists(hists_mom [1][cut][2][2]); LVL2_eff->cd(1); hists_theta[0][cut][0][0]->Draw(); hists_theta[1][cut][0][0]->Draw("same"); LVL2_eff->cd(2); hists_phi[0][cut][0][0]->Draw(); hists_phi[1][cut][0][0]->Draw("same"); LVL2_eff->cd(3); gPad->SetLogy(); hists_mom[0][cut][0][0]->Draw(); hists_mom[1][cut][0][0]->Draw("same"); LVL2_eff->cd(4); hists_theta[0][cut][1][0]->Draw(); hists_theta[1][cut][1][0]->Draw("same"); LVL2_eff->cd(5); hists_phi[0][cut][1][0]->Draw(); hists_phi[1][cut][1][0]->Draw("same"); LVL2_eff->cd(6); gPad->SetLogy(); hists_mom[0][cut][1][0]->Draw(); hists_mom[1][cut][1][0]->Draw("same"); LVL2_eff->cd(7); hists_theta[0][cut][2][0]->Draw(); hists_theta[1][cut][2][0]->Draw("same"); LVL2_eff->cd(8); hists_phi[0][cut][2][0]->Draw(); hists_phi[1][cut][2][0]->Draw("same"); LVL2_eff->cd(9); gPad->SetLogy(); hists_mom[0][cut][2][0]->Draw(); hists_mom[1][cut][2][0]->Draw("same"); ///////////////////////////////////////////////////////////////////// // All cuts have been applied, polarity selection ////////////////////////////////////////////////////////////// ////////////////// Theta //////////////////////// LVL2_eff_lep_theta->cd(1); hists_theta[0][cut][1][1]->Draw(); hists_theta[1][cut][1][1]->Draw("same"); LVL2_eff_lep_theta->cd(2); hists_theta[0][cut][1][2]->Draw(); hists_theta[1][cut][1][2]->Draw("same"); LVL2_eff_lep_theta->cd(3); hists_theta[0][cut][2][1]->Draw(); hists_theta[1][cut][2][1]->Draw("same"); LVL2_eff_lep_theta->cd(4); hists_theta[0][cut][2][2]->Draw(); hists_theta[1][cut][2][2]->Draw("same"); ////////////////// Phi //////////////////////// LVL2_eff_lep_phi->cd(1); hists_phi[0][cut][1][1]->Draw(); hists_phi[1][cut][1][1]->Draw("same"); LVL2_eff_lep_phi->cd(2); hists_phi[0][cut][1][2]->Draw(); hists_phi[1][cut][1][2]->Draw("same"); LVL2_eff_lep_phi->cd(3); hists_phi[0][cut][2][1]->Draw(); hists_phi[1][cut][2][1]->Draw("same"); LVL2_eff_lep_phi->cd(4); hists_phi[0][cut][2][2]->Draw(); hists_phi[1][cut][2][2]->Draw("same"); ////////////////// Momentum //////////////////////// LVL2_eff_lep_mom->cd(); LVL2_eff_lep_mom->cd(1); gPad->SetLogy(); hists_mom[0][cut][1][1]->Draw(); hists_mom[1][cut][1][1]->Draw("same"); LVL2_eff_lep_mom->cd(2); gPad->SetLogy(); hists_mom[0][cut][1][2]->Draw(); hists_mom[1][cut][1][2]->Draw("same"); LVL2_eff_lep_mom->cd(3); gPad->SetLogy(); hists_mom[0][cut][2][1]->Draw(); hists_mom[1][cut][2][1]->Draw("same"); LVL2_eff_lep_mom->cd(4); gPad->SetLogy(); hists_mom[0][cut][2][2]->Draw(); hists_mom[1][cut][2][2]->Draw("same"); output->cd(); LVL2_eff->Write(); LVL2_eff_lep_mom->Write(); LVL2_eff_lep_phi->Write(); LVL2_eff_lep_theta->Write(); }