Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
plotQA_EnergyAsmm_production.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file plotQA_EnergyAsmm_production.C
1 #include <string>
2 #include "TString.h"
3 #include "TFile.h"
4 #include "TH2F.h"
5 #include "TH1F.h"
6 #include "TCanvas.h"
7 
8 void plotQA_EnergyAsmm_production(string runID = "0422")
9 {
10  string mom;
11  if(runID == "0422") mom = "8GeV";
12  string inputfile = Form("/sphenix/user/xusun/TestBeam/ShowerCalib/Proto4ShowerInfoRAW_%s.root",runID.c_str());
13  TFile *File_InPut = TFile::Open(inputfile.c_str());
14  TH2F *h_mAsymmEnergy_raw= (TH2F*)File_InPut->Get("h_tower_energy_raw");
15  TH2F *h_mAsymmEnergy_calib = (TH2F*)File_InPut->Get("h_tower_energy_calib");
16 
17  TCanvas *c_EnergyAsmm = new TCanvas("c_EnergyAsmm","c_EnergyAsmm",10,10,1600,800);
18  c_EnergyAsmm->Divide(2,1);
19  for(int i_pad = 0; i_pad < 2; ++i_pad)
20  {
21  c_EnergyAsmm->cd(i_pad+1);
22  c_EnergyAsmm->cd(i_pad+1)->SetLeftMargin(0.15);
23  c_EnergyAsmm->cd(i_pad+1)->SetBottomMargin(0.15);
24  c_EnergyAsmm->cd(i_pad+1)->SetTicks(1,1);
25  c_EnergyAsmm->cd(i_pad+1)->SetGrid(0,0);
26  }
27  c_EnergyAsmm->cd(1);
28  // h_mAsymmEnergy_raw->SetStats(0);
29  h_mAsymmEnergy_raw->SetTitle("ADC vs. Asymm");
30 
31  h_mAsymmEnergy_raw->GetYaxis()->SetTitle("ADC");
32  h_mAsymmEnergy_raw->GetYaxis()->CenterTitle();
33  h_mAsymmEnergy_raw->GetYaxis()->SetNdivisions(505);
34 
35  h_mAsymmEnergy_raw->GetXaxis()->SetTitle("E_{Asymm}");
36  h_mAsymmEnergy_raw->GetXaxis()->CenterTitle();
37 
38  h_mAsymmEnergy_raw->Draw("colz");
39 
40  c_EnergyAsmm->cd(2);
41  // h_mAsymmEnergy_calib->SetStats(0);
42  h_mAsymmEnergy_calib->SetTitle("Energy vs. Asymm");
43 
44  h_mAsymmEnergy_calib->GetYaxis()->SetTitle("Energy (GeV)");
45  h_mAsymmEnergy_calib->GetYaxis()->CenterTitle();
46  h_mAsymmEnergy_calib->GetYaxis()->SetNdivisions(505);
47 
48  h_mAsymmEnergy_calib->GetXaxis()->SetTitle("E_{Asymm}");
49  h_mAsymmEnergy_calib->GetXaxis()->CenterTitle();
50 
51  h_mAsymmEnergy_calib->Draw("colz");
52 
53  string fig_name = Form("../figures/HCAL_ShowerCalib/c_EnergyAsmm_nocuts_%s.eps",mom.c_str());
54  c_EnergyAsmm->SaveAs(fig_name.c_str());
55 }