// prepare final histograms for human analysis // of reconstructed angles info // 30/05/2014 A.Karavdina void AnaAng(TString file_sig_name= "/panda/scrut14/macro/scrut/fastsim_hc/hc_rho0pi0_fast.root_taskana.root", TString path="/panda/scrut14/macro/scrut/fastsim_hc/"){ //prepare input&output --------------------------- TString fout_pdf_o = path+"/plotAngRes.pdf("; TString fout_pdf_c = path+"/plotAngRes.pdf)"; TString fout_root = path+"/plotAngRes.root"; TFile *finSIG = new TFile(file_sig_name.Data(),"READ"); TTree *tree_sig_raw = (TTree*)finSIG->Get("ntp3"); TTree *tree_sig_4Cfit = (TTree*)finSIG->Get("ntp4"); TTree *tree_sig_rho = (TTree*)finSIG->Get("ntp2"); TTree *tree_sig_pi0 = (TTree*)finSIG->Get("ntp1"); TTree *tree_sig_eta = (TTree*)finSIG->Get("ntp5"); TTree *tree_sig_pipl = (TTree*)finSIG->Get("ntp6"); TTree *tree_sig_pimn = (TTree*)finSIG->Get("ntp7"); TTree *tree_sig_mc = (TTree*)finSIG->Get("nmc"); //END prepare input&output --------------------------- //Fill hists ----------------------------------------- TH1 *hcosTh_hc_rho = new TH1D("hcosTh_hc_rho","; cos#theta^{#rho}_{h_c}",1e3,-1,1); TH1 *hcosPh_hc_rho = new TH1D("hcosPh_hc_rho","; cos#phi^{#rho}_{h_c}",1e3,-1,1); tree_sig_rho->Project("hcosTh_hc_rho","TMath::Cos(rho_hc_rest_tht)"); tree_sig_rho->Project("hcosPh_hc_rho","TMath::Cos(rho_hc_rest_phi)"); TH1 *hTh_hc_rho = new TH1D("hTh_hc_rho",";#theta^{#rho}_{h_c}",1e3,0,180); TH1 *hPh_hc_rho = new TH1D("hPh_hc_rho",";#phi^{#rho}_{h_c}",1e3,-180,180); tree_sig_rho->Project("hTh_hc_rho","rho_hc_rest_tht*TMath::RadToDeg()"); tree_sig_rho->Project("hPh_hc_rho","rho_hc_rest_phi*TMath::RadToDeg()"); TH1 *hcosTh_hc_eta = new TH1D("hcosTh_hc_eta","; cos#theta^{#eta}_{h_c}",1e3,-1,1); TH1 *hcosPh_hc_eta = new TH1D("hcosPh_hc_eta","; cos#phi^{#eta}_{h_c}",1e3,-1,1); tree_sig_eta->Project("hcosTh_hc_eta","TMath::Cos(eta_hc_rest_tht)"); tree_sig_eta->Project("hcosPh_hc_eta","TMath::Cos(eta_hc_rest_phi)"); TH1 *hTh_hc_eta = new TH1D("hTh_hc_eta",";#theta^{#eta}_{h_c}",1e3,0,180); TH1 *hPh_hc_eta = new TH1D("hPh_hc_eta",";#phi^{#eta}_{h_c}",1e3,-180,180); tree_sig_eta->Project("hTh_hc_eta","eta_hc_rest_tht*TMath::RadToDeg()"); tree_sig_eta->Project("hPh_hc_eta","eta_hc_rest_phi*TMath::RadToDeg()"); TH1 *hcosTh_hc_pi0 = new TH1D("hcosTh_hc_pi0","; cos#theta^{#pi0}_{h_c}",1e3,-1,1); TH1 *hcosPh_hc_pi0 = new TH1D("hcosPh_hc_pi0","; cos#phi^{#pi0}_{h_c}",1e3,-1,1); tree_sig_pi0->Project("hcosTh_hc_pi0","TMath::Cos(pi0_hc_rest_tht)"); tree_sig_pi0->Project("hcosPh_hc_pi0","TMath::Cos(pi0_hc_rest_phi)"); TH1 *hTh_hc_pi0 = new TH1D("hTh_hc_pi0",";#theta^{#pi0}_{h_c}",1e3,0,180); TH1 *hPh_hc_pi0 = new TH1D("hPh_hc_pi0",";#phi^{#pi0}_{h_c}",1e3,-180,180); tree_sig_pi0->Project("hTh_hc_pi0","pi0_hc_rest_tht*TMath::RadToDeg()"); tree_sig_pi0->Project("hPh_hc_pi0","pi0_hc_rest_phi*TMath::RadToDeg()"); TH1 *hcosTh_hc_pipl = new TH1D("hcosTh_hc_pipl","; cos#theta^{#pi^{+}}_{h_c}",1e3,-1,1); TH1 *hcosPh_hc_pipl = new TH1D("hcosPh_hc_pipl","; cos#phi^{#pi^{+}}_{h_c}",1e3,-1,1); tree_sig_pipl->Project("hcosTh_hc_pipl","TMath::Cos(pipl_hc_rest_tht)"); tree_sig_pipl->Project("hcosPh_hc_pipl","TMath::Cos(pipl_hc_rest_phi)"); TH1 *hTh_hc_pipl = new TH1D("hTh_hc_pipl",";#theta^{#pi^{+}}_{h_c}",1e3,0,180); TH1 *hPh_hc_pipl = new TH1D("hPh_hc_pipl",";#phi^{#pi^{+}}_{h_c}",1e3,-180,180); tree_sig_pipl->Project("hTh_hc_pipl","pipl_hc_rest_tht*TMath::RadToDeg()"); tree_sig_pipl->Project("hPh_hc_pipl","pipl_hc_rest_phi*TMath::RadToDeg()"); TH1 *hcosTh_hc_pimn = new TH1D("hcosTh_hc_pimn","; cos#theta^{#pi^{-}}_{h_c}",1e3,-1,1); TH1 *hcosPh_hc_pimn = new TH1D("hcosPh_hc_pimn","; cos#phi^{#pi^{-}}_{h_c}",1e3,-1,1); tree_sig_pimn->Project("hcosTh_hc_pimn","TMath::Cos(pimn_hc_rest_tht)"); tree_sig_pimn->Project("hcosPh_hc_pimn","TMath::Cos(pimn_hc_rest_phi)"); TH1 *hTh_hc_pimn = new TH1D("hTh_hc_pimn",";#theta^{#pi^{-}}_{h_c}",1e3,0,180); TH1 *hPh_hc_pimn = new TH1D("hPh_hc_pimn",";#phi^{#pi^{-}}_{h_c}",1e3,-180,180); tree_sig_pimn->Project("hTh_hc_pimn","pimn_hc_rest_tht*TMath::RadToDeg()"); tree_sig_pimn->Project("hPh_hc_pimn","pimn_hc_rest_phi*TMath::RadToDeg()"); //LAB TH1 *hcosTh_LAB_pi0 = new TH1D("hcosTh_LAB_pi0","; cos#theta^{#pi0}_{LAB}",1e3,-1,1); TH1 *hcosPh_LAB_pi0 = new TH1D("hcosPh_LAB_pi0","; cos#phi^{#pi0}_{LAB}",1e3,-1,1); tree_sig_pi0->Project("hcosTh_LAB_pi0","TMath::Cos(pi0tht)"); tree_sig_pi0->Project("hcosPh_LAB_pi0","TMath::Cos(pi0phi)"); TH1 *hTh_LAB_pi0 = new TH1D("hTh_LAB_pi0",";#theta^{#pi0}_{LAB}",1e3,0,180); TH1 *hPh_LAB_pi0 = new TH1D("hPh_LAB_pi0",";#phi^{#pi0}_{LAB}",1e3,-180,180); tree_sig_pi0->Project("hTh_LAB_pi0","pi0tht*TMath::RadToDeg()"); tree_sig_pi0->Project("hPh_LAB_pi0","pi0phi*TMath::RadToDeg()"); TH1 *hcosTh_LAB_pipl = new TH1D("hcosTh_LAB_pipl","; cos#theta^{#pi^{+}}_{LAB}",1e3,-1,1); TH1 *hcosPh_LAB_pipl = new TH1D("hcosPh_LAB_pipl","; cos#phi^{#pi^{+}}_{LAB}",1e3,-1,1); tree_sig_pipl->Project("hcosTh_LAB_pipl","TMath::Cos(pipltht)"); tree_sig_pipl->Project("hcosPh_LAB_pipl","TMath::Cos(piplphi)"); TH1 *hTh_LAB_pipl = new TH1D("hTh_LAB_pipl",";#theta^{#pi^{+}}_{LAB}",1e3,0,180); TH1 *hPh_LAB_pipl = new TH1D("hPh_LAB_pipl",";#phi^{#pi^{+}}_{LAB}",1e3,-180,180); tree_sig_pipl->Project("hTh_LAB_pipl","pipltht*TMath::RadToDeg()"); tree_sig_pipl->Project("hPh_LAB_pipl","piplphi*TMath::RadToDeg()"); TH1 *hcosTh_LAB_pimn = new TH1D("hcosTh_LAB_pimn","; cos#theta^{#pi^{-}}_{LAB}",1e3,-1,1); TH1 *hcosPh_LAB_pimn = new TH1D("hcosPh_LAB_pimn","; cos#phi^{#pi^{-}}_{LAB}",1e3,-1,1); tree_sig_pimn->Project("hcosTh_LAB_pimn","TMath::Cos(pimntht)"); tree_sig_pimn->Project("hcosPh_LAB_pimn","TMath::Cos(pimnphi)"); TH1 *hTh_LAB_pimn = new TH1D("hTh_LAB_pimn",";#theta^{#pi^{-}}_{LAB}",1e3,0,180); TH1 *hPh_LAB_pimn = new TH1D("hPh_LAB_pimn",";#phi^{#pi^{-}}_{LAB}",1e3,-180,180); tree_sig_pimn->Project("hTh_LAB_pimn","pimntht*TMath::RadToDeg()"); tree_sig_pimn->Project("hPh_LAB_pimn","pimnphi*TMath::RadToDeg()"); //END fill hists ------------------------------------------ TCanvas c1; c1.Divide(2,2); c1.cd(1); hcosTh_hc_rho->Draw(); c1.cd(3); hcosPh_hc_rho->Draw(); c1.cd(2); hcosTh_hc_eta->Draw(); c1.cd(4); hcosPh_hc_eta->Draw(); c1.Print(fout_pdf_o); TCanvas c2; c2.Divide(2,2); c2.cd(1); hTh_hc_rho->Draw(); c2.cd(3); hPh_hc_rho->Draw(); c2.cd(2); hTh_hc_eta->Draw(); c2.cd(4); hPh_hc_eta->Draw(); c2.Print(fout_pdf_o); TCanvas c3; c3.Divide(3,2); c3.cd(1); hcosTh_hc_pi0->Draw(); c3.cd(4); hcosPh_hc_pi0->Draw(); c3.cd(2); hcosTh_hc_pimn->Draw(); c3.cd(5); hcosPh_hc_pimn->Draw(); c3.cd(3); hcosTh_hc_pipl->Draw(); c3.cd(6); hcosPh_hc_pipl->Draw(); c3.Print(fout_pdf_o); TCanvas c4; c4.Divide(3,2); c4.cd(1); hTh_hc_pi0->Draw(); c4.cd(4); hPh_hc_pi0->Draw(); c4.cd(2); hTh_hc_pimn->Draw(); c4.cd(5); hPh_hc_pimn->Draw(); c4.cd(3); hTh_hc_pipl->Draw(); c4.cd(6); hPh_hc_pipl->Draw(); c4.Print(fout_pdf_o); //LAB TCanvas c5; c5.Divide(3,2); c5.cd(1); hcosTh_LAB_pi0->Draw(); c5.cd(4); hcosPh_LAB_pi0->Draw(); c5.cd(2); hcosTh_LAB_pimn->Draw(); c5.cd(5); hcosPh_LAB_pimn->Draw(); c5.cd(3); hcosTh_LAB_pipl->Draw(); c5.cd(6); hcosPh_LAB_pipl->Draw(); c5.Print(fout_pdf_o); TCanvas c6; c6.Divide(3,2); c6.cd(1); hTh_LAB_pi0->Draw(); c6.cd(4); hPh_LAB_pi0->Draw(); c6.cd(2); hTh_LAB_pimn->Draw(); c6.cd(5); hPh_LAB_pimn->Draw(); c6.cd(3); hTh_LAB_pipl->Draw(); c6.cd(6); hPh_LAB_pipl->Draw(); c6.Print(fout_pdf_c); TFile *fout = new TFile(fout_root,"RECREATE"); hcosTh_hc_rho->Write(); hcosPh_hc_rho->Write(); hcosTh_hc_eta->Write(); hcosPh_hc_eta->Write(); hTh_hc_rho->Write(); hPh_hc_rho->Write(); hTh_hc_eta->Write(); hPh_hc_eta->Write(); hcosTh_hc_pi0->Write(); hcosPh_hc_pi0->Write(); hcosTh_hc_pimn->Write(); hcosPh_hc_pimn->Write(); hcosTh_hc_pipl->Write(); hcosPh_hc_pipl->Write(); hTh_hc_pi0->Write(); hPh_hc_pi0->Write(); hTh_hc_pimn->Write(); hPh_hc_pimn->Write(); hTh_hc_pipl->Write(); hPh_hc_pipl->Write(); hcosTh_LAB_pi0->Write(); hcosPh_LAB_pi0->Write(); hcosTh_LAB_pimn->Write(); hcosPh_LAB_pimn->Write(); hcosTh_LAB_pipl->Write(); hcosPh_LAB_pipl->Write(); hTh_LAB_pi0->Write(); hPh_LAB_pi0->Write(); hTh_LAB_pimn->Write(); hPh_LAB_pimn->Write(); hTh_LAB_pipl->Write(); hPh_LAB_pipl->Write(); fout->Close(); }