#include TFile *gFileIn[4]; static const TString kNameFile1 = "pi0_noshift_hdroot_cut.root"; static const TString kNameFile2 = "pi0_noshift_hdroot.root"; // static const TString kNameFile3 = "pip_1.5degree_4.5GeV_10k_-1mshift_hdroot.root"; // static const TString kNameFile4 = "pip_1.5degree_4.5GeV_10k_secondariesOFF_-1mshift_hdroot.root"; //_______________________________________________________________ void PlotPics() { // // gFileIn[0] = new TFile(kNameFile1,"READ"); gFileIn[1] = new TFile(kNameFile2,"READ"); // gFileIn[2] = new TFile("/home/alexander/work/projects/gluex/analysis/20120619_pip_pim_acceptance_studies/analysis/check_reconstruction_with_particle_gun/"+kNameFile3,"READ"); // gFileIn[3] = new TFile("/home/alexander/work/projects/gluex/analysis/20120619_pip_pim_acceptance_studies/analysis/check_reconstruction_with_particle_gun/"+kNameFile4,"READ"); // General style gROOT->ProcessLine(".x Style_Default_2.C"); gROOT->SetStyle("Default_2"); gStyle->SetOptStat(0); gStyle->SetHistFillColor(32); gStyle->SetHistLineColor(1); gStyle->SetHistFillStyle(1001); gStyle->SetHistLineStyle(1); gStyle->SetHistLineWidth(1); gROOT->ForceStyle(); // Plot_Hist(); } //_______________________________________________________________ void Plot_Hist() { // TCanvas *cType = new TCanvas("cType","Particle type"); TH1D *hType = (TH1D*)gFileIn[0]->Get("Type"); hType->GetXaxis()->SetTitle("Particle code"); hType->SetTitle(""); hType->Draw(); TLatex text; text.SetNDC(); text.DrawLatex(0.21,0.15,"#gamma"); text.DrawLatex(0.3,0.15,"e^{+}"); text.DrawLatex(0.37,0.15,"e^{-}"); text.DrawLatex(0.68,0.15,"#pi^{0}"); cType->SaveAs("particle_type.pdf"); // TCanvas *cMgg = new TCanvas("cMgg","gamma-gamma invariant mass"); TH1D *hMgg = (TH1D*)gFileIn[1]->Get("Mgg"); hMgg->GetXaxis()->SetTitle("#gamma#gamma invariant mass (GeV)"); hMgg->SetTitle(""); hMgg->SetFillColor(20); hMgg->Draw(); TH1D *hMgg0 = (TH1D*)gFileIn[0]->Get("Mgg"); hMgg0->SetFillColor(28); hMgg0->Draw("same"); TLine l(.13498,0.,.13498,4000.); l.SetLineColor(kRed); l.Draw(); cMgg->SaveAs("mgg.pdf"); // E pi0 TCanvas *cEpi0Gen = new TCanvas("cEpi0Gen","Generated Epi0"); TH1D *hEpi0Gen = (TH1D*)gFileIn[0]->Get("EPi0Gen"); TH1D *hEpi0GenDet = (TH1D*)gFileIn[0]->Get("EPi0GenDet"); hEpi0Gen->GetXaxis()->SetTitle("E (GeV)"); hEpi0Gen->SetTitle(""); hEpi0Gen->Draw(); hEpi0GenDet->SetFillColor(50); hEpi0GenDet->Draw("same"); cEpi0Gen->SaveAs("Epi0Gen.pdf"); // TCanvas *cEpi0 = new TCanvas("cEpi0","Reconstructed Epi0"); TH1D *hEpi0 = (TH1D*)gFileIn[0]->Get("EPi0"); hEpi0->GetXaxis()->SetTitle("E (GeV)"); hEpi0->SetTitle(""); hEpi0->SetFillColor(28); hEpi0->Draw(); cEpi0->SaveAs("Epi0.pdf"); // E gamma TCanvas *cEgGen = new TCanvas("cEgGen","Generated Eg"); TH1D *hEgGen = (TH1D*)gFileIn[0]->Get("EGammaGen"); TH1D *hEgGenDet = (TH1D*)gFileIn[0]->Get("EGammaGenDet"); hEgGen->GetXaxis()->SetTitle("E (GeV)"); hEgGen->SetTitle(""); hEgGen->SetMinimum(0); hEgGen->Draw(); hEgGenDet->SetFillColor(50); hEgGenDet->Draw("same"); cEgGen->SaveAs("EgGen.pdf"); // TCanvas *cEg = new TCanvas("cEg","Reconstructed Eg"); TH1D *hEg = (TH1D*)gFileIn[0]->Get("EGamma"); hEg->GetXaxis()->SetTitle("E (GeV)"); hEg->SetTitle(""); hEg->SetFillColor(28); hEg->Draw(); cEg->SaveAs("Eg.pdf"); // Theta pi0 TCanvas *cThetaPi0Gen = new TCanvas("cThetaPi0Gen","Generated ThetaPi0"); TH1D *hThetaPi0Gen = (TH1D*)gFileIn[0]->Get("ThetaPi0Gen"); TH1D *hThetaPi0GenDet = (TH1D*)gFileIn[0]->Get("ThetaPi0GenDet"); hThetaPi0Gen->GetXaxis()->SetTitle("#theta (degrees)"); hThetaPi0Gen->SetTitle(""); hThetaPi0Gen->Draw(); hThetaPi0GenDet->SetFillColor(50); hThetaPi0GenDet->Draw("same"); cThetaPi0Gen->SaveAs("ThetaPi0Gen.pdf"); // TCanvas *cAccThetaPi0 = new TCanvas("cThetaAccPi0","Acceptance Pi0 vs ThetaPi0"); TH1D *hThetaAccPi0 = (TH1D*)hThetaPi0GenDet->Clone("ThetaAccPi0"); hThetaAccPi0->SetTitle(""); hThetaAccPi0->Sumw2(); hThetaAccPi0->Divide(hThetaPi0Gen); hThetaAccPi0->GetXaxis()->SetRange(0.,50.); hThetaAccPi0->SetMarkerStyle(20); hThetaAccPi0->SetMarkerColor(50); hThetaAccPi0->GetXaxis()->SetTitle("#theta (degrees)"); hThetaAccPi0->GetYaxis()->SetTitle("Acceptance"); hThetaAccPi0->Draw("p"); cAccThetaPi0->SaveAs("AccThetaPi0.pdf"); // TCanvas *cThetaPi0 = new TCanvas("cThetaPi0","Reconstructed ThetaPi0"); TH1D *hThetaPi0 = (TH1D*)gFileIn[0]->Get("ThetaPi0"); hThetaPi0->GetXaxis()->SetTitle("#theta (degrees)"); hThetaPi0->SetTitle(""); hThetaPi0->SetFillColor(28); hThetaPi0->Draw(); cThetaPi0->SaveAs("ThetaPi0.pdf"); // Theta gamma TCanvas *cThetaGammaGen = new TCanvas("cThetaGammaGen","Generated ThetaGamma"); TH1D *hThetaGammaGen = (TH1D*)gFileIn[0]->Get("ThetaGammaGen"); TH1D *hThetaGammaGenDet = (TH1D*)gFileIn[0]->Get("ThetaGammaGenDet"); hThetaGammaGen->GetXaxis()->SetTitle("#theta (degrees)"); hThetaGammaGen->SetTitle(""); hThetaGammaGen->Draw(); hThetaGammaGenDet->SetFillColor(50); hThetaGammaGenDet->Draw("same"); cThetaGammaGen->SaveAs("ThetaGammaGen.pdf"); // TCanvas *cThetaGamma = new TCanvas("cThetaGamma","Reconstructed ThetaGamma"); TH1D *hThetaGamma = (TH1D*)gFileIn[0]->Get("ThetaGamma"); hThetaGamma->GetXaxis()->SetTitle("#theta (degrees)"); hThetaGamma->SetTitle(""); hThetaGamma->SetFillColor(28); hThetaGamma->Draw(); cThetaGamma->SaveAs("ThetaGamma.pdf"); // Phi pi0 TCanvas *cPhiPi0Gen = new TCanvas("cPhiPi0Gen","Generated PhiPi0"); TH1D *hPhiPi0Gen = (TH1D*)gFileIn[0]->Get("PhiPi0Gen"); TH1D *hPhiPi0GenDet = (TH1D*)gFileIn[0]->Get("PhiPi0GenDet"); hPhiPi0Gen->GetXaxis()->SetTitle("#phi (degrees)"); hPhiPi0Gen->SetTitle(""); hPhiPi0Gen->Draw(); hPhiPi0GenDet->SetFillColor(50); hPhiPi0GenDet->Draw("same"); cPhiPi0Gen->SaveAs("PhiPi0Gen.pdf"); // TCanvas *cAccPhiPi0 = new TCanvas("cPhiAccPi0","Acceptance Pi0 vs PhiPi0"); TH1D *hPhiAccPi0 = (TH1D*)hPhiPi0GenDet->Clone("PhiAccPi0"); hPhiAccPi0->SetTitle(""); hPhiAccPi0->Sumw2(); hPhiAccPi0->Divide(hPhiPi0Gen); hPhiAccPi0->SetMarkerStyle(20); hPhiAccPi0->SetMarkerColor(50); hPhiAccPi0->GetXaxis()->SetTitle("#phi (degrees)"); hPhiAccPi0->GetYaxis()->SetTitle("Acceptance"); hPhiAccPi0->SetMaximum(1.1); hPhiAccPi0->SetMinimum(-0.1); hPhiAccPi0->Draw("p"); cAccPhiPi0->SaveAs("AccPhiPi0.pdf"); // TCanvas *cPhiPi0 = new TCanvas("cPhiPi0","Reconstructed PhiPi0"); TH1D *hPhiPi0 = (TH1D*)gFileIn[0]->Get("PhiPi0"); hPhiPi0->GetXaxis()->SetTitle("#phi (degrees)"); hPhiPi0->SetTitle(""); hPhiPi0->SetFillColor(28); hPhiPi0->SetMinimum(0.); hPhiPi0->Draw(); cPhiPi0->SaveAs("PhiPi0.pdf"); // Phi gamma TCanvas *cPhiGammaGen = new TCanvas("cPhiGammaGen","Generated PhiGamma"); TH1D *hPhiGammaGen = (TH1D*)gFileIn[0]->Get("PhiGammaGen"); TH1D *hPhiGammaGenDet = (TH1D*)gFileIn[0]->Get("PhiGammaGenDet"); hPhiGammaGen->GetXaxis()->SetTitle("#phi (degrees)"); hPhiGammaGen->SetTitle(""); hPhiGammaGen->SetMinimum(0.); hPhiGammaGen->Draw(); hPhiGammaGenDet->SetFillColor(50); hPhiGammaGenDet->Draw("same"); cPhiGammaGen->SaveAs("PhiGammaGen.pdf"); // TCanvas *cPhiGamma = new TCanvas("cPhiGamma","Reconstructed PhiGamma"); TH1D *hPhiGamma = (TH1D*)gFileIn[0]->Get("PhiGamma"); hPhiGamma->GetXaxis()->SetTitle("#phi (degrees)"); hPhiGamma->SetTitle(""); hPhiGamma->SetFillColor(28); hPhiGamma->SetMinimum(0.); hPhiGamma->Draw(); cPhiGamma->SaveAs("PhiGamma.pdf"); }