Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
plotQA_EnergyAsmm_analysis.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file plotQA_EnergyAsmm_analysis.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_analysis(string runID = "0571")
9 {
10  string mom;
11  if(runID == "1087") mom = "5GeV";
12  if(runID == "0422") mom = "8GeV";
13  if(runID == "0571") mom = "12GeV";
14  if(runID == "0821") mom = "60GeV";
15  if(runID == "0498") mom = "120GeV";
16  string inputfile = Form("/sphenix/user/xusun/TestBeam/ShowerCalibAna/Proto4ShowerInfoRAW_%s.root",runID.c_str());
17  TFile *File_InPut = TFile::Open(inputfile.c_str());
18  TH2F *h_mAsymmAdc_mixed = (TH2F*)File_InPut->Get("h_mAsymmAdc_mixed");
19  TH2F *h_mAsymmAdc_electron = (TH2F*)File_InPut->Get("h_mAsymmAdc_electron");
20  TH2F *h_mAsymmAdc_pion = (TH2F*)File_InPut->Get("h_mAsymmAdc_pion");
21 
22  TCanvas *c_AsymmAdc = new TCanvas("c_AsymmAdc","c_AsymmAdc",10,10,1500,500);
23  c_AsymmAdc->Divide(3,1);
24  for(int i_pad = 0; i_pad < 3; ++i_pad)
25  {
26  c_AsymmAdc->cd(i_pad+1);
27  c_AsymmAdc->cd(i_pad+1)->SetLeftMargin(0.15);
28  c_AsymmAdc->cd(i_pad+1)->SetBottomMargin(0.15);
29  c_AsymmAdc->cd(i_pad+1)->SetTicks(1,1);
30  c_AsymmAdc->cd(i_pad+1)->SetGrid(0,0);
31  }
32  c_AsymmAdc->cd(1);
33  h_mAsymmAdc_mixed->SetStats(0);
34  h_mAsymmAdc_mixed->SetTitle("ADC vs. Asymm");
35 
36  h_mAsymmAdc_mixed->GetYaxis()->SetTitle("ADC");
37  h_mAsymmAdc_mixed->GetYaxis()->CenterTitle();
38  h_mAsymmAdc_mixed->GetYaxis()->SetNdivisions(505);
39 
40  h_mAsymmAdc_mixed->GetXaxis()->SetTitle("E_{Asymm}");
41  h_mAsymmAdc_mixed->GetXaxis()->CenterTitle();
42 
43  h_mAsymmAdc_mixed->Draw("colz");
44 
45  c_AsymmAdc->cd(2);
46  h_mAsymmAdc_electron->SetStats(0);
47  h_mAsymmAdc_electron->SetTitle("ADC vs. Asymm");
48 
49  h_mAsymmAdc_electron->GetYaxis()->SetTitle("ADC");
50  h_mAsymmAdc_electron->GetYaxis()->CenterTitle();
51  h_mAsymmAdc_electron->GetYaxis()->SetNdivisions(505);
52 
53  h_mAsymmAdc_electron->GetXaxis()->SetTitle("E_{Asymm}");
54  h_mAsymmAdc_electron->GetXaxis()->CenterTitle();
55 
56  h_mAsymmAdc_electron->Draw("colz");
57 
58  c_AsymmAdc->cd(3);
59  h_mAsymmAdc_pion->SetStats(0);
60  h_mAsymmAdc_pion->SetTitle("ADC vs. Asymm");
61 
62  h_mAsymmAdc_pion->GetYaxis()->SetTitle("ADC");
63  h_mAsymmAdc_pion->GetYaxis()->CenterTitle();
64  h_mAsymmAdc_pion->GetYaxis()->SetNdivisions(505);
65 
66  h_mAsymmAdc_pion->GetXaxis()->SetTitle("E_{Asymm}");
67  h_mAsymmAdc_pion->GetXaxis()->CenterTitle();
68 
69  h_mAsymmAdc_pion->Draw("colz");
70 
71  string fig_name;
72  fig_name = Form("../figures/HCAL_ShowerCalib/c_AsymmAdc_%s.eps",mom.c_str());
73  c_AsymmAdc->SaveAs(fig_name.c_str());
74 
75  //-----------------------------------------------------------------
76 
77  TH2F *h_mAsymmEnergy_mixed_wo_cut = (TH2F*)File_InPut->Get("h_mAsymmEnergy_mixed_wo_cut");
78  TH2F *h_mAsymmEnergy_electron_wo_cut = (TH2F*)File_InPut->Get("h_mAsymmEnergy_electron_wo_cut");
79  TH2F *h_mAsymmEnergy_pion_wo_cut = (TH2F*)File_InPut->Get("h_mAsymmEnergy_pion_wo_cut");
80 
81  TCanvas *c_AsymmEnergy_wo_cut = new TCanvas("c_AsymmEnergy_wo_cut","c_AsymmEnergy_wo_cut",30,150,1500,500);
82  c_AsymmEnergy_wo_cut->Divide(3,1);
83  for(int i_pad = 0; i_pad < 3; ++i_pad)
84  {
85  c_AsymmEnergy_wo_cut->cd(i_pad+1);
86  c_AsymmEnergy_wo_cut->cd(i_pad+1)->SetLeftMargin(0.15);
87  c_AsymmEnergy_wo_cut->cd(i_pad+1)->SetBottomMargin(0.15);
88  c_AsymmEnergy_wo_cut->cd(i_pad+1)->SetTicks(1,1);
89  c_AsymmEnergy_wo_cut->cd(i_pad+1)->SetGrid(0,0);
90  }
91  c_AsymmEnergy_wo_cut->cd(1);
92  h_mAsymmEnergy_mixed_wo_cut->SetStats(0);
93  h_mAsymmEnergy_mixed_wo_cut->SetTitle("Energy vs. Asymm");
94 
95  h_mAsymmEnergy_mixed_wo_cut->GetYaxis()->SetTitle("Energy (GeV)");
96  h_mAsymmEnergy_mixed_wo_cut->GetYaxis()->CenterTitle();
97  h_mAsymmEnergy_mixed_wo_cut->GetYaxis()->SetNdivisions(505);
98 
99  h_mAsymmEnergy_mixed_wo_cut->GetXaxis()->SetTitle("E_{Asymm}");
100  h_mAsymmEnergy_mixed_wo_cut->GetXaxis()->CenterTitle();
101 
102  h_mAsymmEnergy_mixed_wo_cut->Draw("colz");
103 
104  c_AsymmEnergy_wo_cut->cd(2);
105  h_mAsymmEnergy_electron_wo_cut->SetStats(0);
106  h_mAsymmEnergy_electron_wo_cut->SetTitle("Energy vs. Asymm");
107 
108  h_mAsymmEnergy_electron_wo_cut->GetYaxis()->SetTitle("Energy (GeV)");
109  h_mAsymmEnergy_electron_wo_cut->GetYaxis()->CenterTitle();
110  h_mAsymmEnergy_electron_wo_cut->GetYaxis()->SetNdivisions(505);
111 
112  h_mAsymmEnergy_electron_wo_cut->GetXaxis()->SetTitle("E_{Asymm}");
113  h_mAsymmEnergy_electron_wo_cut->GetXaxis()->CenterTitle();
114 
115  h_mAsymmEnergy_electron_wo_cut->Draw("colz");
116 
117  c_AsymmEnergy_wo_cut->cd(3);
118  h_mAsymmEnergy_pion_wo_cut->SetStats(0);
119  h_mAsymmEnergy_pion_wo_cut->SetTitle("Energy vs. Asymm");
120 
121  h_mAsymmEnergy_pion_wo_cut->GetYaxis()->SetTitle("Energy (GeV)");
122  h_mAsymmEnergy_pion_wo_cut->GetYaxis()->CenterTitle();
123  h_mAsymmEnergy_pion_wo_cut->GetYaxis()->SetNdivisions(505);
124 
125  h_mAsymmEnergy_pion_wo_cut->GetXaxis()->SetTitle("E_{Asymm}");
126  h_mAsymmEnergy_pion_wo_cut->GetXaxis()->CenterTitle();
127 
128  h_mAsymmEnergy_pion_wo_cut->Draw("colz");
129 
130  fig_name = Form("../figures/HCAL_ShowerCalib/c_AsymmEnergy_wo_cut_%s.eps",mom.c_str());
131  c_AsymmEnergy_wo_cut->SaveAs(fig_name.c_str());
132 
133  //-----------------------------------------------------------------
134 
135  TH2F *h_mAsymmEnergy_mixed = (TH2F*)File_InPut->Get("h_mAsymmEnergy_mixed");
136  TH2F *h_mAsymmEnergy_electron = (TH2F*)File_InPut->Get("h_mAsymmEnergy_electron");
137  TH2F *h_mAsymmEnergy_pion = (TH2F*)File_InPut->Get("h_mAsymmEnergy_pion");
138 
139  TCanvas *c_AsymmEnergy = new TCanvas("c_AsymmEnergy","c_AsymmEnergy",60,300,1500,500);
140  c_AsymmEnergy->Divide(3,1);
141  for(int i_pad = 0; i_pad < 3; ++i_pad)
142  {
143  c_AsymmEnergy->cd(i_pad+1);
144  c_AsymmEnergy->cd(i_pad+1)->SetLeftMargin(0.15);
145  c_AsymmEnergy->cd(i_pad+1)->SetBottomMargin(0.15);
146  c_AsymmEnergy->cd(i_pad+1)->SetTicks(1,1);
147  c_AsymmEnergy->cd(i_pad+1)->SetGrid(0,0);
148  }
149  c_AsymmEnergy->cd(1);
150  h_mAsymmEnergy_mixed->SetStats(0);
151  h_mAsymmEnergy_mixed->SetTitle("Energy vs. Asymm");
152 
153  h_mAsymmEnergy_mixed->GetYaxis()->SetTitle("Energy (GeV)");
154  h_mAsymmEnergy_mixed->GetYaxis()->CenterTitle();
155  h_mAsymmEnergy_mixed->GetYaxis()->SetNdivisions(505);
156 
157  h_mAsymmEnergy_mixed->GetXaxis()->SetTitle("E_{Asymm}");
158  h_mAsymmEnergy_mixed->GetXaxis()->CenterTitle();
159 
160  h_mAsymmEnergy_mixed->Draw("colz");
161 
162  c_AsymmEnergy->cd(2);
163  h_mAsymmEnergy_electron->SetStats(0);
164  h_mAsymmEnergy_electron->SetTitle("Energy vs. Asymm");
165 
166  h_mAsymmEnergy_electron->GetYaxis()->SetTitle("Energy (GeV)");
167  h_mAsymmEnergy_electron->GetYaxis()->CenterTitle();
168  h_mAsymmEnergy_electron->GetYaxis()->SetNdivisions(505);
169 
170  h_mAsymmEnergy_electron->GetXaxis()->SetTitle("E_{Asymm}");
171  h_mAsymmEnergy_electron->GetXaxis()->CenterTitle();
172 
173  h_mAsymmEnergy_electron->Draw("colz");
174 
175  c_AsymmEnergy->cd(3);
176  h_mAsymmEnergy_pion->SetStats(0);
177  h_mAsymmEnergy_pion->SetTitle("Energy vs. Asymm");
178 
179  h_mAsymmEnergy_pion->GetYaxis()->SetTitle("Energy (GeV)");
180  h_mAsymmEnergy_pion->GetYaxis()->CenterTitle();
181  h_mAsymmEnergy_pion->GetYaxis()->SetNdivisions(505);
182 
183  h_mAsymmEnergy_pion->GetXaxis()->SetTitle("E_{Asymm}");
184  h_mAsymmEnergy_pion->GetXaxis()->CenterTitle();
185 
186  h_mAsymmEnergy_pion->Draw("colz");
187 
188  fig_name = Form("../figures/HCAL_ShowerCalib/c_AsymmEnergy_%s.eps",mom.c_str());
189  c_AsymmEnergy->SaveAs(fig_name.c_str());
190 }