Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
plotQA_tower_distribution.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file plotQA_tower_distribution.C
1 #include "TString.h"
2 #include "TFile.h"
3 #include "TCanvas.h"
4 #include "TH1F.h"
5 #include "TLegend.h"
6 
7 void plotQA_tower_distribution(const string runId = "0571")
8 {
9  int hbdchanIHC[4][4] = {{16, 12, 8, 4},
10  {15, 11, 7, 3},
11  {14, 10, 6, 2},
12  {13, 9, 5, 1}};
13 
14  string inputfile = Form("/sphenix/user/xusun/TestBeam/ShowerCalib/Proto4ShowerInfoRAW_%s.root",runId.c_str());
15  TFile *File_InPut = TFile::Open(inputfile.c_str());
16 
17  TH1F *h_hcalin_tower_calib[16];
18  TH1F *h_hcalout_tower_calib[16];
19  for(int i_tower = 0; i_tower < 16; ++i_tower)
20  {
21  string HistName;
22 
23  HistName= Form("h_hcalin_lg_tower_%d_calib",i_tower);
24  h_hcalin_tower_calib[i_tower] = (TH1F*)File_InPut->Get(HistName.c_str())->Clone();
25 
26  HistName= Form("h_hcalout_lg_tower_%d_calib",i_tower);
27  h_hcalout_tower_calib[i_tower] = (TH1F*)File_InPut->Get(HistName.c_str())->Clone();
28  }
29 
30  TCanvas *c_hcal_in = new TCanvas("c_hcal_in","c_hcal_in",10,10,1600,1600);
31  c_hcal_in->Divide(4,4);
32  for(int i_row = 0; i_row < 4; ++i_row)
33  {
34  for(int i_col = 0; i_col < 4; ++i_col)
35  {
36  int i_pad = 4*i_row+i_col+1;
37  int i_tower = hbdchanIHC[i_row][i_col]-1;
38  c_hcal_in->cd(i_pad);
39  c_hcal_in->cd(i_pad)->SetLogy();
40  h_hcalin_tower_calib[i_tower]->Draw();
41  }
42  }
43  c_hcal_in->SaveAs("../figures/HCAL_TowerMap/c_hcal_in_0571.eps");
44  // c_hcal_in->SaveAs("../figures/HCAL_TowerMap/c_hcal_in.pdf");
45 
46  TCanvas *c_hcal_out = new TCanvas("c_hcal_out","c_hcal_out",10,10,1600,1600);
47  c_hcal_out->Divide(4,4);
48  for(int i_row = 0; i_row < 4; ++i_row)
49  {
50  for(int i_col = 0; i_col < 4; ++i_col)
51  {
52  int i_pad = 4*i_row+i_col+1;
53  int i_tower = hbdchanIHC[i_row][i_col]-1;
54  c_hcal_out->cd(i_pad);
55  c_hcal_out->cd(i_pad)->SetLogy();
56  h_hcalout_tower_calib[i_tower]->Draw();
57  }
58  }
59  c_hcal_out->SaveAs("../figures/HCAL_TowerMap/c_hcal_out_0571.eps");
60  // c_hcal_out->SaveAs("../figures/HCAL_TowerMap/c_hcal_out.pdf");
61 }