LHC gas pressures for LSS2 Optics Version 6.3 (LHC Project Note 274)
[u/mrichter/AliRoot.git] / LHC / PlotPressure.C
CommitLineData
c0382a57 1void PlotPressure()
2{
3 FILE* file;
4 file=fopen("gasPressure.dat","r");
5 Float_t z1[20];
6 Float_t g1[20], g2[20], g3[20], g4[20], g5[20];
7 Float_t z2[21];
8 Float_t h1[21], h2[21], h3[21], h4[21], h5[21];
9
10 char c[45];
11 Float_t z;
12
13 for (Int_t i = 0; i < 20; i++)
14 {
15 fscanf(file, "%f %f %f %f %f %f", &z,
16 &g1[i], &g2[i], &g3[i], &g4[i], &g5[i]);
17// printf("%d %f %f %f %f %f %f \n", i, z1[i],
18// g1[i][0], g1[i][1], g1[i][2], g1[i][3], g1[i][4]);
19 if (i > 0) {
20 z1[i] = z1[i-1] + z;
21 } else {
22 z1[i] = 20.;
23 }
24 }
25
26
27 for (Int_t i = 0; i < 21; i++)
28 {
29 fscanf(file, "%f %f %f %f %f %f", &z,
30 &h1[i], &h2[i], &h3[i], &h4[i], &h5[i]);
31 if (i > 0) {
32 z2[i] = z2[i-1] + z;
33 } else {
34 z2[i] = 20.;
35 }
36 }
37
38//
39//
40 TCanvas *c1 = new TCanvas("c1","Gas Pressure Beam 1", 200, 10, 700, 500);
41 gPad->SetLogy();
42
43 TGraph* gr1 = new TGraph(20, z1, g1);
44 gr1->SetMaximum(1e17);
45 gr1->SetMinimum(1e11);
46 gr1->SetLineColor(1);
47 gr1->SetTitle("Ring 1: Beginning of Run");
48
49 TGraph* gr2 = new TGraph(20, z1, g3);
50 gr2->SetLineColor(2);
51
52 TGraph* gr3 = new TGraph(20, z1, g5);
53 gr3->SetLineColor(4);
54
55 gr1->Draw("AL");
56 gr2->Draw("L");
57// gr3->Draw("L");
58 text();
59
60//
61//
62 TCanvas *c2 = new TCanvas("c2","Gas Pressure Beam 1", 200, 10, 700, 500);
63 gPad->SetLogy();
64
65 TGraph* gr4 = new TGraph(20, z1, g2);
66 gr4->SetMaximum(1e17);
67 gr4->SetMinimum(1e11);
68 gr4->SetLineColor(1);
69 gr4->SetTitle("Ring 1");
70
71 TGraph* gr5 = new TGraph(20, z1, g4);
72 gr5->SetLineColor(2);
73
74 TGraph* gr6 = new TGraph(20, z1, g5);
75 gr6->SetLineColor(4);
76
77 gr4->Draw("AL");
78 gr5->Draw("L");
79 gr6->Draw("L");
80 text();
81
82//
83//
84 TCanvas *c3 = new TCanvas("c3","Gas Pressure Beam 2", 200, 10, 700, 500);
85 gPad->SetLogy();
86
87 TGraph* hr1 = new TGraph(21, z2, h1);
88 hr1->SetMaximum(1e17);
89 hr1->SetMinimum(1e11);
90 hr1->SetLineColor(1);
91 hr1->SetTitle("Ring 2: Beginning of Run");
92
93 TGraph* hr2 = new TGraph(21, z2, h3);
94 hr2->SetLineColor(2);
95
96 TGraph* hr3 = new TGraph(21, z2, h5);
97 hr3->SetLineColor(4);
98
99 hr1->Draw("AL");
100 hr2->Draw("L");
101// hr3->Draw("L");
102 text();
103
104//
105//
106 TCanvas *c4 = new TCanvas("c4","Gas Pressure Beam 2", 200, 10, 700, 500);
107 gPad->SetLogy();
108
109 TGraph* hr4 = new TGraph(21, z2, h2);
110 hr4->SetMaximum(1e17);
111 hr4->SetMinimum(1e11);
112 hr4->SetLineColor(1);
113 hr4->SetTitle("Ring 2");
114
115 TGraph* hr5 = new TGraph(21, z2, h4);
116 hr5->SetLineColor(2);
117
118 TGraph* hr6 = new TGraph(21, z2, h5);
119 hr6->SetLineColor(4);
120
121 hr4->Draw("AL");
122 hr5->Draw("L");
123 hr6->Draw("L");
124 text();
125
126}
127
128void text()
129{
130
131 TPave *pave = new TPave(194.619,11.0495,293.103,12.6485,4,"br");
132 pave->SetFillColor(18);
133 pave->Draw();
134 TLine *line = new TLine(199.702,11.8109,232.106,11.8109);
135 line->SetLineColor(2);
136 line->Draw();
137 line = new TLine(198.431,12.2868,232.106,12.2868);
138 line->Draw();
139 line = new TLine(199.066,11.3731,232.742,11.3731);
140 line->SetLineColor(4);
141 line->Draw();
142 line = new TLine(215.586,13.3338,215.586,13.3147);
143 line->Draw();
144 tex = new TLatex(239.096,11.6777,"2nd year");
145 tex->SetTextSize(0.05);
146 tex->SetLineWidth(2);
147 tex->Draw();
148 tex = new TLatex(236.554,12.1536,"1st year");
149 tex->SetTextSize(0.0507614);
150 tex->SetLineWidth(2);
151 tex->Draw();
152 tex = new TLatex(239.096,11.2589,"3rd year");
153 tex->SetTextSize(0.05);
154 tex->SetLineWidth(2);
155 tex->Draw();
156 c1->Modified();
157 c1->cd();
158}