Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
plotQA_shape_HCAL.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file plotQA_shape_HCAL.C
1 #include "TPolyLine.h"
2 #include "TH1F.h"
3 #include "TLine.h"
4 #include "TCanvas.h"
5 
6 void PlotLine(double x1_val, double x2_val, double y1_val, double y2_val, int Line_Col, int LineWidth, int LineStyle)
7 {
8  TLine* Zero_line = new TLine();
9  Zero_line -> SetX1(x1_val);
10  Zero_line -> SetX2(x2_val);
11  Zero_line -> SetY1(y1_val);
12  Zero_line -> SetY2(y2_val);
13  Zero_line -> SetLineWidth(LineWidth);
14  Zero_line -> SetLineStyle(LineStyle);
15  Zero_line -> SetLineColor(Line_Col);
16  Zero_line -> Draw();
17  //delete Zero_line;
18 }
19 
21 {
22  TH1F *h_ihcal = new TH1F("h_ihcal","h_ihcal",3000,1100,1400);
23  for(int i_bin = 0; i_bin < 2000; ++i_bin)
24  {
25  h_ihcal->SetBinContent(i_bin+1,100.0);
26  h_ihcal->SetBinError(i_bin+1,1.0);
27  }
28 
29  h_ihcal->SetTitle("");
30  h_ihcal->SetStats(0);
31  h_ihcal->GetXaxis()->SetNdivisions(505);
32  h_ihcal->GetXaxis()->SetTitle("x (mm)");
33  h_ihcal->GetYaxis()->SetRangeUser(-400.0,-100.0);
34  h_ihcal->GetYaxis()->SetTitle("y (mm)");
35 
36  TCanvas *c_ihcal = new TCanvas("c_ihcal","c_ihcal",10,10,800,800);
37  c_ihcal->SetLeftMargin(0.15);
38  c_ihcal->SetBottomMargin(0.15);
39  c_ihcal->SetTicks(1,1);
40  c_ihcal->SetGrid(1,1);
41  h_ihcal->Draw("pE");
42 
43  double ihcal3_uL[2] = {1154.49, -189.06};
44  double ihcal3_uR[2] = {1297.94, -349.22};
45  double ihcal3_lR[2] = {1288.18, -357.80};
46  double ihcal3_lL[2] = {1157.30, -205.56};
47  PlotLine(ihcal3_uL[0],ihcal3_uR[0],ihcal3_uL[1],ihcal3_uR[1],1,2,2);
48  PlotLine(ihcal3_uL[0],ihcal3_lL[0],ihcal3_uL[1],ihcal3_lL[1],1,2,2);
49  PlotLine(ihcal3_lL[0],ihcal3_lR[0],ihcal3_lL[1],ihcal3_lR[1],1,2,2);
50  PlotLine(ihcal3_lR[0],ihcal3_uR[0],ihcal3_lR[1],ihcal3_uR[1],1,2,2);
51 
52  double ihcal2_uL[2] = {1157.5, -151.44};
53  double ihcal2_uR[2] = {1308.5, -286.96};
54  double ihcal2_lR[2] = {1298.8, -297.39};
55  double ihcal2_lL[2] = {1155.8, -163.92};
56  PlotLine(ihcal2_uL[0],ihcal2_uR[0],ihcal2_uL[1],ihcal2_uR[1],2,2,2);
57  PlotLine(ihcal2_uL[0],ihcal2_lL[0],ihcal2_uL[1],ihcal2_lL[1],2,2,2);
58  PlotLine(ihcal2_lL[0],ihcal2_lR[0],ihcal2_lL[1],ihcal2_lR[1],2,2,2);
59  PlotLine(ihcal2_lR[0],ihcal2_uR[0],ihcal2_lR[1],ihcal2_uR[1],2,2,2);
60  c_ihcal->SaveAs("./figures/c_shape_ihcal.eps");
61 
62  TH1F *h_ohcal = new TH1F("h_ohcal","h_ohcal",3000,1500,3000);
63  for(int i_bin = 0; i_bin < 2000; ++i_bin)
64  {
65  h_ohcal->SetBinContent(i_bin+1,100.0);
66  h_ohcal->SetBinError(i_bin+1,1.0);
67  }
68 
69  h_ohcal->SetTitle("");
70  h_ohcal->SetStats(0);
71  h_ohcal->GetXaxis()->SetNdivisions(505);
72  h_ohcal->GetXaxis()->SetTitle("x (mm)");
73  h_ohcal->GetYaxis()->SetRangeUser(-500.0,-200.0);
74  h_ohcal->GetYaxis()->SetTitle("y (mm)");
75 
76  TCanvas *c_ohcal = new TCanvas("c_ohcal","c_ohcal",10,10,800,800);
77  c_ohcal->SetLeftMargin(0.15);
78  c_ohcal->SetBottomMargin(0.15);
79  c_ohcal->SetTicks(1,1);
80  c_ohcal->SetGrid(1,1);
81  h_ohcal->Draw("pE");
82  double ohcal_uL[2] = {1777.6, -433.5};
83  double ohcal_uR[2] = {2600.4, -417.4};
84  double ohcal_lR[2] = {2601.2, -459.8};
85  double ohcal_lL[2] = {1770.9, -459.8};
86  PlotLine(ohcal_uL[0],ohcal_uR[0],ohcal_uL[1],ohcal_uR[1],2,2,2);
87  PlotLine(ohcal_uL[0],ohcal_lL[0],ohcal_uL[1],ohcal_lL[1],2,2,2);
88  PlotLine(ohcal_lL[0],ohcal_lR[0],ohcal_lL[1],ohcal_lR[1],2,2,2);
89  PlotLine(ohcal_lR[0],ohcal_uR[0],ohcal_lR[1],ohcal_uR[1],2,2,2);
90  c_ohcal->SaveAs("./figures/c_shape_ohcal.eps");
91 }