6 TString fileNew =
"FieldMap_1900.root";
7 TString fileOld =
"field_sp41v5_ascii_Extrap.root";
10 fieldNew->SetFormat(1);
11 fieldOld->SetFormat(0);
19 const Int_t nXbins = 100;
20 Float_t xStep = (xMax - xMin) / nXbins;
23 const Int_t nYbins = 100;
24 Float_t yStep = (yMax - yMin) / nYbins;
27 const Int_t nZbins = 100;
28 Float_t zStep = (zMax - zMin) / nZbins;
30 TFile* f =
new TFile(
"field_QA.root",
"RECREATE");
32 TH1F* hBx_Z_center_old =
33 new TH1F(
"hBx_Z_center_old",
"Z profile of Bx in center; Z, cm; By, kGs", nZbins, zMin, zMax);
34 TH1F* hBx_Z_center_new =
35 new TH1F(
"hBx_Z_center_new",
"Z profile of Bx in center; Z, cm; By, kGs", nZbins, zMin, zMax);
36 TH1F* hBy_Z_center_old =
37 new TH1F(
"hBy_Z_center_old",
"Z profile of By in center; Z, cm; By, kGs", nZbins, zMin, zMax);
38 TH1F* hBy_Z_center_new =
39 new TH1F(
"hBy_Z_center_new",
"Z profile of By in center; Z, cm; By, kGs", nZbins, zMin, zMax);
40 TH1F* hBz_Z_center_old =
41 new TH1F(
"hBz_Z_center_old",
"Z profile of Bz in center; Z, cm; By, kGs", nZbins, zMin, zMax);
42 TH1F* hBz_Z_center_new =
43 new TH1F(
"hBz_Z_center_new",
"Z profile of Bz in center; Z, cm; By, kGs", nZbins, zMin, zMax);
45 for (
Int_t k = 0; k < nZbins; ++k) {
55 hBx_Z_center_new->
Write();
56 hBx_Z_center_old->
Write();
57 hBy_Z_center_new->
Write();
58 hBy_Z_center_old->
Write();
59 hBz_Z_center_new->
Write();
60 hBz_Z_center_old->
Write();
62 TH1F* hBx_Y_center_old =
63 new TH1F(
"hBx_Y_center_old",
"Y profile of Bx in center; Y, cm; Bx, kGs", nYbins, yMin, yMax);
64 TH1F* hBx_Y_center_new =
65 new TH1F(
"hBx_Y_center_new",
"Y profile of Bx in center; Y, cm; Bx, kGs", nYbins, yMin, yMax);
66 TH1F* hBy_Y_center_old =
67 new TH1F(
"hBy_Y_center_old",
"Y profile of By in center; Y, cm; By, kGs", nYbins, yMin, yMax);
68 TH1F* hBy_Y_center_new =
69 new TH1F(
"hBy_Y_center_new",
"Y profile of By in center; Y, cm; By, kGs", nYbins, yMin, yMax);
70 TH1F* hBz_Y_center_old =
71 new TH1F(
"hBz_Y_center_old",
"Y profile of Bz in center; Y, cm; Bz, kGs", nYbins, yMin, yMax);
72 TH1F* hBz_Y_center_new =
73 new TH1F(
"hBz_Y_center_new",
"Y profile of Bz in center; Y, cm; Bz, kGs", nYbins, yMin, yMax);
75 for (
Int_t k = 0; k < nYbins; ++k) {
85 hBx_Y_center_new->
Write();
86 hBx_Y_center_old->
Write();
87 hBy_Y_center_new->
Write();
88 hBy_Y_center_old->
Write();
89 hBz_Y_center_new->
Write();
90 hBz_Y_center_old->
Write();
92 TH1F* hBx_X_center_old =
93 new TH1F(
"hBx_X_center_old",
"X profile of Bx in center; X, cm; Bx, kGs", nXbins, xMin, xMax);
94 TH1F* hBx_X_center_new =
95 new TH1F(
"hBx_X_center_new",
"X profile of Bx in center; X, cm; Bx, kGs", nXbins, xMin, xMax);
96 TH1F* hBy_X_center_old =
97 new TH1F(
"hBy_X_center_old",
"X profile of By in center; X, cm; By, kGs", nXbins, xMin, xMax);
98 TH1F* hBy_X_center_new =
99 new TH1F(
"hBy_X_center_new",
"X profile of By in center; X, cm; By, kGs", nXbins, xMin, xMax);
100 TH1F* hBz_X_center_old =
101 new TH1F(
"hBz_X_center_old",
"X profile of Bz in center; X, cm; Bz, kGs", nXbins, xMin, xMax);
102 TH1F* hBz_X_center_new =
103 new TH1F(
"hBz_X_center_new",
"X profile of Bz in center; X, cm; Bz, kGs", nXbins, xMin, xMax);
105 for (
Int_t k = 0; k < nXbins; ++k) {
115 hBx_X_center_new->
Write();
116 hBx_X_center_old->
Write();
117 hBy_X_center_new->
Write();
118 hBy_X_center_old->
Write();
119 hBz_X_center_new->
Write();
120 hBz_X_center_old->
Write();
122 const Int_t nXslices = 10;
123 const Int_t nYslices = 10;
124 const Int_t nZslices = 10;
125 const Int_t nComp = 3;
126 TString comp[nComp] = {
"x",
"y",
"z"};
127 TH2F* hB_XZ_new[nComp][nYslices];
128 TH2F* hB_XZ_old[nComp][nYslices];
129 TH2F* hB_XZ_dif[nComp][nYslices];
130 TH2F* hB_YZ_new[nComp][nXslices];
131 TH2F* hB_YZ_old[nComp][nXslices];
132 TH2F* hB_YZ_dif[nComp][nXslices];
133 TH2F* hB_XY_new[nComp][nZslices];
134 TH2F* hB_XY_old[nComp][nZslices];
135 TH2F* hB_XY_dif[nComp][nZslices];
137 const Int_t nPlanes = 3;
138 TString planes[nPlanes] = {
"XZ",
"YZ",
"XY"};
141 for (
Int_t iC = 0; iC < nComp; ++iC) {
142 for (
Int_t iPlane = 0; iPlane < nPlanes; ++iPlane) {
143 cB[iC][iPlane] =
new TCanvas(
Form(
"cB%s_%s", comp[iC].Data(), planes[iPlane].Data()),
144 Form(
"cB%s_%s", comp[iC].Data(), planes[iPlane].Data()), 300, 1000);
145 cB[iC][iPlane]->
Divide(3, 10);
147 for (
Int_t i = 0;
i < nYslices; ++
i) {
148 hB_XZ_new[iC][
i] =
new TH2F(
Form(
"hB%s_XZ_new_%d", comp[iC].Data(),
i),
149 Form(
"B%s new, XZ profile, Y slice %d; Z, cm; X, cm", comp[iC].Data(),
i),
150 nZbins, zMin, zMax, nXbins, xMin, xMax);
151 hB_XZ_old[iC][
i] =
new TH2F(
Form(
"hB%s_XZ_old_%d", comp[iC].Data(),
i),
152 Form(
"B%s old, XZ profile, Y slice %d; Z, cm; X, cm", comp[iC].Data(),
i),
153 nZbins, zMin, zMax, nXbins, xMin, xMax);
154 hB_XZ_dif[iC][
i] =
new TH2F(
Form(
"hB%s_XZ_dif_%d", comp[iC].Data(),
i),
155 Form(
"B%s dif, XZ profile, Y slice %d; Z, cm; X, cm", comp[iC].Data(),
i),
156 nZbins, zMin, zMax, nXbins, xMin, xMax);
157 Float_t y = yMin +
i * (yMax - yMin) / nYslices;
158 for (
Int_t j = 0; j < nXbins; ++j) {
160 for (
Int_t k = 0; k < nZbins; ++k) {
163 : (iC == 1) ? fieldNew->
GetBy(x, y, z)
164 : (iC == 2) ? fieldNew->
GetBz(x, y, z)
167 : (iC == 1) ? fieldOld->
GetBy(x, y, z)
168 : (iC == 2) ? fieldOld->
GetBz(x, y, z)
175 hB_XZ_new[iC][
i]->
Write();
176 hB_XZ_old[iC][
i]->
Write();
177 hB_XZ_dif[iC][
i]->
Write();
178 cB[iC][0]->
cd(3 *
i + 1);
179 hB_XZ_new[iC][
i]->
Draw(
"colz");
180 cB[iC][0]->
cd(3 *
i + 2);
181 hB_XZ_old[iC][
i]->
Draw(
"colz");
182 cB[iC][0]->
cd(3 *
i + 3);
183 hB_XZ_dif[iC][
i]->
Draw(
"colz");
185 for (
Int_t i = 0;
i < nXslices; ++
i) {
186 hB_YZ_new[iC][
i] =
new TH2F(
Form(
"hB%s_YZ_new_%d", comp[iC].Data(),
i),
187 Form(
"B%s new, YZ profile, X slice %d; Z, cm; Y, cm", comp[iC].Data(),
i),
188 nZbins, zMin, zMax, nYbins, yMin, yMax);
189 hB_YZ_old[iC][
i] =
new TH2F(
Form(
"hB%s_YZ_old_%d", comp[iC].Data(),
i),
190 Form(
"B%s old, YZ profile, X slice %d; Z, cm; Y, cm", comp[iC].Data(),
i),
191 nZbins, zMin, zMax, nYbins, yMin, yMax);
192 hB_YZ_dif[iC][
i] =
new TH2F(
Form(
"hB%s_YZ_dif_%d", comp[iC].Data(),
i),
193 Form(
"B%s dif, YZ profile, X slice %d; Z, cm; Y, cm", comp[iC].Data(),
i),
194 nZbins, zMin, zMax, nYbins, yMin, yMax);
195 Float_t x = xMin +
i * (xMax - xMin) / nXslices;
196 for (
Int_t j = 0; j < nYbins; ++j) {
198 for (
Int_t k = 0; k < nZbins; ++k) {
201 : (iC == 1) ? fieldNew->
GetBy(x, y, z)
202 : (iC == 2) ? fieldNew->
GetBz(x, y, z)
205 : (iC == 1) ? fieldOld->
GetBy(x, y, z)
206 : (iC == 2) ? fieldOld->
GetBz(x, y, z)
213 hB_YZ_new[iC][
i]->
Write();
214 hB_YZ_old[iC][
i]->
Write();
215 hB_YZ_dif[iC][
i]->
Write();
216 cB[iC][1]->
cd(3 *
i + 1);
217 hB_YZ_new[iC][
i]->
Draw(
"colz");
218 cB[iC][1]->
cd(3 *
i + 2);
219 hB_YZ_old[iC][
i]->
Draw(
"colz");
220 cB[iC][1]->
cd(3 *
i + 3);
221 hB_YZ_dif[iC][
i]->
Draw(
"colz");
223 for (
Int_t i = 0;
i < nZslices; ++
i) {
224 hB_XY_new[iC][
i] =
new TH2F(
Form(
"hB%s_XY_new_%d", comp[iC].Data(),
i),
225 Form(
"B%s new, XY profile, Z slice %d; Y, cm; X, cm", comp[iC].Data(),
i),
226 nYbins, yMin, yMax, nXbins, xMin, xMax);
227 hB_XY_old[iC][
i] =
new TH2F(
Form(
"hB%s_XY_old_%d", comp[iC].Data(),
i),
228 Form(
"B%s old, XY profile, Z slice %d; Y, cm; X, cm", comp[iC].Data(),
i),
229 nYbins, yMin, yMax, nXbins, xMin, xMax);
230 hB_XY_dif[iC][
i] =
new TH2F(
Form(
"hB%s_XY_dif_%d", comp[iC].Data(),
i),
231 Form(
"B%s dif, XY profile, Z slice %d; Y, cm; X, cm", comp[iC].Data(),
i),
232 nYbins, yMin, yMax, nXbins, xMin, xMax);
233 Float_t z = zMin +
i * (zMax - zMin) / nZslices;
234 for (
Int_t j = 0; j < nXbins; ++j) {
236 for (
Int_t k = 0; k < nYbins; ++k) {
239 : (iC == 1) ? fieldNew->
GetBy(x, y, z)
240 : (iC == 2) ? fieldNew->
GetBz(x, y, z)
243 : (iC == 1) ? fieldOld->
GetBy(x, y, z)
244 : (iC == 2) ? fieldOld->
GetBz(x, y, z)
251 hB_XY_new[iC][
i]->
Write();
252 hB_XY_old[iC][
i]->
Write();
253 hB_XY_dif[iC][
i]->
Write();
254 cB[iC][2]->
cd(3 *
i + 1);
255 hB_XY_new[iC][
i]->
Draw(
"colz");
256 cB[iC][2]->
cd(3 *
i + 2);
257 hB_XY_old[iC][
i]->
Draw(
"colz");
258 cB[iC][2]->
cd(3 *
i + 3);
259 hB_XY_dif[iC][
i]->
Draw(
"colz");
261 for (
Int_t iPlane = 0; iPlane < nPlanes; ++iPlane) {
262 cB[iC][iPlane]->
SaveAs(
Form(
"cB%s_%s.pdf", comp[iC].Data(), planes[iPlane].Data()));