Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
plotQA_cosmic_hcalin.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file plotQA_cosmic_hcalin.C
1 #include "TString.h"
2 #include "TFile.h"
3 #include "TCanvas.h"
4 #include "TH1F.h"
5 #include "TH3F.h"
6 
8 {
9  TCanvas *c_samplefrac = new TCanvas("c_samplefrac","c_samplefrac",10,10,1200,1500);
10  c_samplefrac->Divide(4,5);
11  for(int i_pos = 0; i_pos < 5; ++i_pos)
12  {
13  for(int i_add = 0; i_add < 4; ++i_add)
14  {
15  int i_pad = 4*i_pos + i_add;
16  c_samplefrac->cd(i_pad+1);
17  c_samplefrac->cd(i_pad+1)->SetLeftMargin(0.15);
18  c_samplefrac->cd(i_pad+1)->SetBottomMargin(0.15);
19  c_samplefrac->cd(i_pad+1)->SetGrid(0,0);
20  c_samplefrac->cd(i_pad+1)->SetTicks(1,1);
21  std::string inputfile = Form("./OutPut/SampleFrac/Proto4SampleFrac_HCALIN_%d%d.root",i_pos,i_add);
22  TFile *File_InPut = TFile::Open(inputfile.c_str());
23  TH1F *h_samplefrac = (TH1F*)File_InPut->Get("h_QAG4Sim_HCALIN_G4Hit_SF");
24  h_samplefrac->DrawCopy();
25  h_samplefrac->Reset();
26  File_InPut->Close();
27  }
28  }
29  c_samplefrac->SaveAs("./figures/c_cosmic_hcalin_sf.eps");
30 
31  TFile *File_InPut = TFile::Open("./OutPut/SampleFrac/Proto4SampleFrac_HCALIN.root");
32  TH3F *h_track = (TH3F*)File_InPut->Get("h_QAG4Sim_HCALIN_G4Hit_XYZ");
33  TH1F *h_sf = (TH1F*)File_InPut->Get("h_QAG4Sim_HCALIN_G4Hit_SF");
34 
35  TCanvas *c_cosmic = new TCanvas("c_cosmic","c_cosmic",10,10,800,800);
36  c_cosmic->cd()->SetLeftMargin(0.15);
37  c_cosmic->cd()->SetBottomMargin(0.15);
38  c_cosmic->cd()->SetGrid(0,0);
39  c_cosmic->cd()->SetTicks(1,1);
40  h_track->GetYaxis()->SetRangeUser(120,150);
41  h_track->DrawCopy();
42  c_cosmic->SaveAs("./figures/c_cosmic_hcalin_track.eps");
43 
44  TCanvas *c_samplefrac_all = new TCanvas("c_samplefrac_all","c_samplefrac_all",10,10,800,800);
45  c_samplefrac_all->cd()->SetLeftMargin(0.15);
46  c_samplefrac_all->cd()->SetBottomMargin(0.15);
47  c_samplefrac_all->cd()->SetGrid(0,0);
48  c_samplefrac_all->cd()->SetTicks(1,1);
49  h_sf->DrawCopy();
50  c_samplefrac_all->SaveAs("./figures/c_cosmic_hcalin_sf_all.eps");
51 
52  File_InPut->Close();
53 }