Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
plotQA_cosmic_horizontal.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file plotQA_cosmic_horizontal.C
1 #include "TFile.h"
2 #include "TString.h"
3 #include "TH1F.h"
4 #include "TCanvas.h"
5 #include "TLegend.h"
6 #include <string>
7 
9 {
10  string inputfile = "./OutPut/Proto4SampleFrac.root";
11  TFile *File_InPut = TFile::Open(inputfile.c_str());
12 
13  TH1F *h_hcalin_tower_sim[16];
14  for(int i_tower = 0; i_tower < 16; ++i_tower)
15  {
16  string HistName = Form("h_hcalin_tower_%d_sim",i_tower);
17  h_hcalin_tower_sim[i_tower] = (TH1F*)File_InPut->Get(HistName.c_str())->Clone();
18  }
19 
20  TCanvas *c_hcalin = new TCanvas("c_hcalin","c_hcalin",10,10,1600,1600);
21  c_hcalin->Divide(4,4,0,0);
22  for(int i_row = 0; i_row < 4; ++i_row)
23  {
24  for(int i_col =0; i_col < 4; ++i_col)
25  {
26  int i_pad = 4*(4-(i_row+1))+i_col+1;
27  int i_hist = i_row + 4*i_col;
28  c_hcalin->cd(i_pad);
29  h_hcalin_tower_sim[i_hist]->GetXaxis()->SetRangeUser(2,20);
30  h_hcalin_tower_sim[i_hist]->Draw();
31  }
32  }
33  c_hcalin->SaveAs("./figures/c_hcalin_horizontal.eps");
34 
35  TH1F *h_hcalout_tower_sim[16];
36  for(int i_tower = 0; i_tower < 16; ++i_tower)
37  {
38  string HistName = Form("h_hcalout_tower_%d_sim",i_tower);
39  h_hcalout_tower_sim[i_tower] = (TH1F*)File_InPut->Get(HistName.c_str())->Clone();
40  }
41 
42  TCanvas *c_hcalout = new TCanvas("c_hcalout","c_hcalout",10,10,1600,1600);
43  c_hcalout->Divide(4,4,0,0);
44  for(int i_row = 0; i_row < 4; ++i_row)
45  {
46  for(int i_col =0; i_col < 4; ++i_col)
47  {
48  int i_pad = 4*(4-(i_row+1))+i_col+1;
49  int i_hist = i_row + 4*i_col;
50  c_hcalout->cd(i_pad);
51  h_hcalout_tower_sim[i_hist]->GetXaxis()->SetRangeUser(2,20);
52  h_hcalout_tower_sim[i_hist]->Draw();
53  }
54  }
55  c_hcalout->SaveAs("./figures/c_hcalout_horizontal.eps");
56 }