CbmRoot
Loading...
Searching...
No Matches
CbmLitFieldApproximationQa.cxx
Go to the documentation of this file.
1/* Copyright (C) 2009-2014 GSI/JINR-LIT, Darmstadt/Dubna
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Andrey Lebedev [committer] */
4
11
15#include "CbmDrawHist.h"
16#include "CbmHistManager.h"
18#include "CbmUtils.h"
19#include "FairField.h"
20#include "FairRunAna.h"
21#include "FairRuntimeDb.h"
22#include "TCanvas.h"
23#include "TF1.h"
24#include "TF2.h"
25#include "TGraph.h"
26#include "TGraph2D.h"
27#include "TH2D.h"
28#include "TLegend.h"
29#include "TPad.h"
30#include "TPaveText.h"
31#include "TStyle.h"
34#include "base/CbmLitFloat.h"
35
36#include <boost/assign/list_of.hpp>
37
38#include <cmath>
39#include <limits>
40#include <sstream>
41#include <string>
42
43using boost::assign::list_of;
45using Cbm::ToString;
49using std::cout;
50using std::endl;
51using std::string;
52
54 : fField(NULL)
55 , fNofSlices(0)
56 , fZSlicePosition()
57 , fXSlicePosition()
58 , fYSlicePosition()
59 , fOutputDir("./field/")
60 , fAcceptanceAngleX(25.)
61 , fAcceptanceAngleY(25.)
62 , fNofBinsX(30)
63 , fNofBinsY(30)
64 , fUseEllipseAcc(true)
65 , fPolynomDegreeIndex(1)
66 , fNofPolynoms(4)
67 , fPolynomDegrees()
68 , fFitter()
69 , fGridCreator()
70 , fHM(NULL)
71 , fFixedBounds(true)
72{
73}
74
76
78{
81
82 // Calculate (X, Y) window for each slice
85 for (Int_t i = 0; i < fNofSlices; i++) {
86 Double_t tanXangle = tan(fAcceptanceAngleX * 3.14159265 / 180); //
87 Double_t tanYangle = tan(fAcceptanceAngleY * 3.14159265 / 180); //
88 fXSlicePosition[i] = fZSlicePosition[i] * tanXangle;
89 fYSlicePosition[i] = fZSlicePosition[i] * tanYangle;
90 }
91
92 // Create field approximation tool for each polynom degree
93 fFitter.resize(fNofPolynoms);
94 for (UInt_t i = 0; i < fNofPolynoms; i++) {
96 fFitter[i]->SetXangle(fAcceptanceAngleX);
97 fFitter[i]->SetYangle(fAcceptanceAngleY);
98 fFitter[i]->SetNofBinsX(100); //fNofBinsX);
99 fFitter[i]->SetNofBinsY(100); //fNofBinsY);
100 fFitter[i]->SetUseEllipseAcc(fUseEllipseAcc);
101 }
102
103 // Create grid creator tool
105
106 fField = FairRunAna::Instance()->GetField();
107
108 fHM = new CbmHistManager();
109
110 // Fill and create graphs and histograms
111 CreateHistos();
112
113 // This is always needed since field map is always drawn for comparison
114 FillBHistos();
115
116 // Check and draw polynomial field approximation
118
119 // Check and draw histograms for grid creator tool
121
123 report->Create(fHM, fOutputDir);
124 delete report;
125
126 fHM->WriteToFile();
127
128 return kSUCCESS;
129}
130
132
134
142
144{
145 string names[] = {"Bx", "By", "Bz", "Mod"};
146 string zTitle[] = {"B_{x} [kGauss]", "B_{y} [kGauss]", "B_{z} [kGauss]", "|B| [kGauss]"};
147 for (Int_t v = 0; v < 4; v++) {
148 for (Int_t i = 0; i < fNofSlices; i++) {
149 TGraph2D* graph = new TGraph2D();
150 string name = "hfa_" + names[v] + "_Graph2D_" + ToString<Int_t>(fZSlicePosition[i]);
151 string title = name + ";X [cm];Y [cm];" + zTitle[v];
152 graph->SetNameTitle(name.c_str(), title.c_str());
153 fHM->Add(name, graph);
154 }
155 }
156}
157
159{
160 string names[] = {"Bx", "By", "Bz", "Mod"};
161
162 //Int_t nofBinsX = fNofBinsX;
163 //Int_t nofBinsY = fNofBinsY;
164 Int_t nofBinsErrB = 100;
165 Int_t nofBinsRelErrB = 100;
166 Int_t nofBinsErrX = 100;
167 Int_t nofBinsErrY = 100;
168 Double_t minErrB = 0., maxErrB = 0., minRelErrB = 0., maxRelErrB = 0.;
169 if (fFixedBounds) {
170 minErrB = -0.5;
171 maxErrB = 0.5;
172 minRelErrB = -10.;
173 maxRelErrB = 10.;
174 }
175
176 string zTitle[] = {"B_{x} [kGauss]", "B_{y} [kGauss]", "B_{z} [kGauss]", "|B| [kGauss]"};
177 string errTitle[] = {"B_{x} error [kGauss]", "B_{y} error [kGauss]", "B_{z} error [kGauss]", "|B| error [kGauss]"};
178 string relErrTitle[] = {"B_{x} relative error [%]", "B_{y} relative error [%]", "B_{z} relative error [%]",
179 "|B| relative error [%]"};
180
181 // Create histograms
182 for (Int_t v = 0; v < 4; v++) {
183 for (Int_t i = 0; i < fNofSlices; i++) {
184 for (UInt_t j = 0; j < fNofPolynoms; j++) {
185 TGraph2D* graph = new TGraph2D();
186 string name = "hfa_" + names[v] + "Apr_Graph2D" + "_" + ToString<Int_t>(fZSlicePosition[i]) + "_"
188 string title = name + ";X [cm];Y [cm];" + zTitle[v];
189 graph->SetNameTitle(name.c_str(), title.c_str());
190 fHM->Add(name, graph);
191
192 name = "hfa_" + names[v] + "ErrApr_H1_" + ToString<Int_t>(fZSlicePosition[i]) + "_"
194 title = name + ";" + errTitle[v] + ";Counter";
195 fHM->Add(name, new TH1D(name.c_str(), title.c_str(), nofBinsErrB, minErrB, maxErrB));
196
197 name = "hfa_" + names[v] + "ErrApr_H2_" + ToString<Int_t>(fZSlicePosition[i]) + "_"
199 title = name + ";X [cm];Y [cm];" + errTitle[v];
200 fHM->Add(name, new TH2D(name.c_str(), title.c_str(), nofBinsErrX, -fXSlicePosition[i], fXSlicePosition[i],
201 nofBinsErrY, -fYSlicePosition[i], fYSlicePosition[i]));
202
203 name = "hfa_" + names[v] + "RelErrApr_H1_" + ToString<Int_t>(fZSlicePosition[i]) + "_"
205 title = name + ";" + relErrTitle[v] + ";Counter";
206 fHM->Add(name, new TH1D(name.c_str(), title.c_str(), nofBinsRelErrB, minRelErrB, maxRelErrB));
207
208 name = "hfa_" + names[v] + "RelErrApr_H2_" + ToString<Int_t>(fZSlicePosition[i]) + "_"
210 title = name + ";X [cm];Y [cm];" + relErrTitle[v];
211 fHM->Add(name, new TH2D(name.c_str(), title.c_str(), nofBinsErrX, -fXSlicePosition[i], fXSlicePosition[i],
212 nofBinsErrY, -fYSlicePosition[i], fYSlicePosition[i]));
213 }
214 }
215 }
216 cout << "-I- CbmLitFieldApproximationQa::CreateFitterErrHistos: Field fitter "
217 "error histograms created"
218 << endl;
219}
220
222{
223 string names[] = {"Bx", "By", "Bz", "Mod"};
224
225 //Int_t nofBinsX = fNofBinsX;
226 //Int_t nofBinsY = fNofBinsY;
227 Int_t nofBinsErrB = 100;
228 Int_t nofBinsRelErrB = 100;
229 Int_t nofBinsErrX = 100;
230 Int_t nofBinsErrY = 100;
231 Double_t minErrB = 0., maxErrB = 0., minRelErrB = 0., maxRelErrB = 0.;
232 if (fFixedBounds) {
233 minErrB = -0.5;
234 maxErrB = 0.5;
235 minRelErrB = -10.;
236 maxRelErrB = 10.;
237 }
238
239 string zTitle[] = {"B_{x} [kGauss]", "B_{y} [kGauss]", "B_{z} [kGauss]", "|B| [kGauss]"};
240 string errTitle[] = {"B_{x} error [kGauss]", "B_{y} error [kGauss]", "B_{z} error [kGauss]", "|B| error [kGauss]"};
241 string relErrTitle[] = {"B_{x} relative error [%]", "B_{y} relative error [%]", "B_{z} relative error [%]",
242 "|B| relative error [%]"};
243
244 // Create histograms
245 for (Int_t v = 0; v < 4; v++) {
246 for (Int_t i = 0; i < fNofSlices; i++) {
247 TGraph2D* graph = new TGraph2D();
248 string name = "hfa_" + names[v] + "Grid_Graph2D_" + ToString<Int_t>(fZSlicePosition[i]);
249 string title = name + ";X [cm]; Y [cm];" + zTitle[v];
250 graph->SetNameTitle(name.c_str(), title.c_str());
251 fHM->Add(name, graph);
252
253 name = "hfa_" + names[v] + "ErrGrid_H1_" + ToString<Int_t>(fZSlicePosition[i]);
254 title = name + ";" + errTitle[v] + ";Counter";
255 fHM->Add(name, new TH1D(name.c_str(), title.c_str(), nofBinsErrB, minErrB, maxErrB));
256
257 name = "hfa_" + names[v] + "ErrGrid_H2_" + ToString<Int_t>(fZSlicePosition[i]);
258 title = name + ";X [cm];Y [cm];" + errTitle[v];
259 fHM->Add(name, new TH2D(name.c_str(), title.c_str(), nofBinsErrX, -fXSlicePosition[i], fXSlicePosition[i],
260 nofBinsErrY, -fYSlicePosition[i], fYSlicePosition[i]));
261
262 name = "hfa_" + names[v] + "RelErrGrid_H1_" + ToString<Int_t>(fZSlicePosition[i]);
263 title = name + ";" + relErrTitle[v] + ";Counter";
264 fHM->Add(name, new TH1D(name.c_str(), title.c_str(), nofBinsRelErrB, minRelErrB, maxRelErrB));
265
266 name = "hfa_" + names[v] + "RelErrGrid_H2_" + ToString<Int_t>(fZSlicePosition[i]);
267 title = name + ";X [cm];Y [cm];" + relErrTitle[v];
268 fHM->Add(name, new TH2D(name.c_str(), title.c_str(), nofBinsErrX, -fXSlicePosition[i], fXSlicePosition[i],
269 nofBinsErrY, -fYSlicePosition[i], fYSlicePosition[i]));
270 }
271 }
272 cout << "-I- CbmLitFieldApproximationQa::CreateGridErrHistos(): Grid creator "
273 "error histograms created"
274 << endl;
275}
276
278{
279 // Fill graphs for magnetic field for each (X, Y) slice
280 for (Int_t iSlice = 0; iSlice < fNofSlices; iSlice++) { // loop over slices
281 Double_t Z = fZSlicePosition[iSlice];
282
283 Int_t cnt = 0;
284 Double_t HX = 2 * fXSlicePosition[iSlice] / fNofBinsX; // step size for X position
285 Double_t HY = 2 * fYSlicePosition[iSlice] / fNofBinsY; // step size for Y position
286 for (Int_t iX = 0; iX < fNofBinsX; iX++) { // loop over x position
287 Double_t X = -fXSlicePosition[iSlice] + (iX + 0.5) * HX;
288 for (Int_t iY = 0; iY < fNofBinsY; iY++) { // loop over y position
289 Double_t Y = -fYSlicePosition[iSlice] + (iY + 0.5) * HY;
290
291 // Check acceptance for ellipse
292 Double_t el = (X * X) / (fXSlicePosition[iSlice] * fXSlicePosition[iSlice])
293 + (Y * Y) / (fYSlicePosition[iSlice] * fYSlicePosition[iSlice]);
294 if (fUseEllipseAcc && el > 1.) {
295 continue;
296 }
297
298 // Get field value
299 Double_t pos[3] = {X, Y, Z};
300 Double_t B[3];
301 fField->GetFieldValue(pos, B);
302
303 Double_t Bmod = sqrt(B[0] * B[0] + B[1] * B[1] + B[2] * B[2]);
304
305 string s = ToString<Int_t>(fZSlicePosition[iSlice]);
306 fHM->G2(string("hfa_Bx_Graph2D_") + s)->SetPoint(cnt, X, Y, B[0]);
307 fHM->G2(string("hfa_By_Graph2D_") + s)->SetPoint(cnt, X, Y, B[1]);
308 fHM->G2(string("hfa_Bz_Graph2D_") + s)->SetPoint(cnt, X, Y, B[2]);
309 fHM->G2(string("hfa_Mod_Graph2D_") + s)->SetPoint(cnt, X, Y, Bmod);
310 cnt++;
311 }
312 }
313 }
314}
315
317{
318 vector<vector<LitFieldSliceScal>> slices;
319 slices.resize(fNofPolynoms);
320 for (UInt_t i = 0; i < fNofPolynoms; i++) {
321 slices[i].resize(fNofSlices);
322 }
323
324 // Approximate field in each slice for each polynomial degree
325 for (UInt_t i = 0; i < fNofPolynoms; i++) {
326 for (Int_t j = 0; j < fNofSlices; j++) {
327 fFitter[i]->FitSlice(fZSlicePosition[j], slices[i][j]);
328 cout << "-I- CbmLitFieldApproximationQa::FillFieldApproximationHistos: "
329 << " field approximation (degree=" << fPolynomDegrees[i] << ", Z=" << fZSlicePosition[j] << ")" << endl;
330 }
331 }
332
333 // Fill graph for approximated field map
334 for (Int_t iSlice = 0; iSlice < fNofSlices; iSlice++) { // Loop over slices
335 //Double_t Z = fZSlicePosition[iSlice];
336 Int_t cnt = 0;
337
338 Double_t HX = 2 * fXSlicePosition[iSlice] / fNofBinsX; // Step size for X position
339 Double_t HY = 2 * fYSlicePosition[iSlice] / fNofBinsY; // Step size for Y position
340 for (Int_t iX = 0; iX < fNofBinsX; iX++) { // Loop over x position
341 Double_t X = -fXSlicePosition[iSlice] + (iX + 0.5) * HX;
342 for (Int_t iY = 0; iY < fNofBinsY; iY++) { // Loop over y position
343 Double_t Y = -fYSlicePosition[iSlice] + (iY + 0.5) * HY;
344
345 // Check acceptance for ellipse
346 Double_t el = (X * X) / (fXSlicePosition[iSlice] * fXSlicePosition[iSlice])
347 + (Y * Y) / (fYSlicePosition[iSlice] * fYSlicePosition[iSlice]);
348 if (fUseEllipseAcc && el > 1.) {
349 continue;
350 }
351
352 for (UInt_t p = 0; p < fNofPolynoms; p++) {
354 slices[p][iSlice].GetFieldValue(X, Y, v);
355 Double_t mod = sqrt(v.Bx * v.Bx + v.By * v.By + v.Bz * v.Bz);
356 string s = ToString<Int_t>(fZSlicePosition[iSlice]) + "_" + ToString<Int_t>(fPolynomDegrees[p]);
357 fHM->G2(string("hfa_BxApr_Graph2D_") + s)->SetPoint(cnt, X, Y, v.Bx);
358 fHM->G2(string("hfa_ByApr_Graph2D_") + s)->SetPoint(cnt, X, Y, v.By);
359 fHM->G2(string("hfa_BzApr_Graph2D_") + s)->SetPoint(cnt, X, Y, v.Bz);
360 fHM->G2(string("hfa_ModApr_Graph2D_") + s)->SetPoint(cnt, X, Y, mod);
361 }
362 cnt++;
363 } // End loop over y position
364 } // End loop over x position
365 } // End loop over slices
366
367 // Fill error histograms
368 Int_t nofBinsX = 100;
369 Int_t nofBinsY = 100;
370 for (Int_t iSlice = 0; iSlice < fNofSlices; iSlice++) {
371 Double_t Z = fZSlicePosition[iSlice];
372 Double_t HX = 2 * fXSlicePosition[iSlice] / nofBinsX; // step size for X position
373 Double_t HY = 2 * fYSlicePosition[iSlice] / nofBinsY; // step size for Y position
374 for (Int_t iX = 0; iX < nofBinsX; iX++) { // loop over x position
375 Double_t X = -fXSlicePosition[iSlice] + (iX + 0.5) * HX;
376 for (Int_t iY = 0; iY < nofBinsY; iY++) { // loop over y position
377 Double_t Y = -fYSlicePosition[iSlice] + (iY + 0.5) * HY;
378
379 // Check acceptance for ellipse
380 Double_t el = (X * X) / (fXSlicePosition[iSlice] * fXSlicePosition[iSlice])
381 + (Y * Y) / (fYSlicePosition[iSlice] * fYSlicePosition[iSlice]);
382 if (fUseEllipseAcc && el > 1.) {
383 continue;
384 }
385
386 // Get field value
387 Double_t pos[3] = {X, Y, Z};
388 Double_t B[3];
389 fField->GetFieldValue(pos, B);
390
391 Double_t Bmod = sqrt(B[0] * B[0] + B[1] * B[1] + B[2] * B[2]);
392
393 for (UInt_t p = 0; p < fNofPolynoms; p++) {
395 slices[p][iSlice].GetFieldValue(X, Y, v);
396 Double_t mod = sqrt(v.Bx * v.Bx + v.By * v.By + v.Bz * v.Bz);
397
398 Double_t errBx = B[0] - v.Bx;
399 Double_t errBy = B[1] - v.By;
400 Double_t errBz = B[2] - v.Bz;
401 Double_t errMod = Bmod - mod;
402 Double_t relErrBx = (B[0] != 0.) ? (errBx / B[0]) * 100. : 0.;
403 Double_t relErrBy = (B[1] != 0.) ? (errBy / B[1]) * 100. : 0.;
404 Double_t relErrBz = (B[2] != 0.) ? (errBz / B[2]) * 100. : 0.;
405 Double_t relErrMod = (Bmod != 0.) ? (errMod / Bmod) * 100. : 0;
406
407 string s = ToString<Int_t>(fZSlicePosition[iSlice]) + "_" + ToString<Int_t>(fPolynomDegrees[p]);
408 fHM->H1(string("hfa_BxErrApr_H1_") + s)->Fill(errBx);
409 fHM->H1(string("hfa_BxRelErrApr_H1_") + s)->Fill(relErrBx);
410 fHM->H2(string("hfa_BxErrApr_H2_") + s)->Fill(X, Y, errBx);
411 fHM->H2(string("hfa_BxRelErrApr_H2_") + s)->Fill(X, Y, relErrBx);
412 fHM->H1(string("hfa_ByErrApr_H1_") + s)->Fill(errBy);
413 fHM->H1(string("hfa_ByRelErrApr_H1_") + s)->Fill(relErrBy);
414 fHM->H2(string("hfa_ByErrApr_H2_") + s)->Fill(X, Y, errBy);
415 fHM->H2(string("hfa_ByRelErrApr_H2_") + s)->Fill(X, Y, relErrBy);
416 fHM->H1(string("hfa_BzErrApr_H1_") + s)->Fill(errBz);
417 fHM->H1(string("hfa_BzRelErrApr_H1_") + s)->Fill(relErrBz);
418 fHM->H2(string("hfa_BzErrApr_H2_") + s)->Fill(X, Y, errBz);
419 fHM->H2(string("hfa_BzRelErrApr_H2_") + s)->Fill(X, Y, relErrBz);
420 fHM->H1(string("hfa_ModErrApr_H1_") + s)->Fill(errMod);
421 fHM->H1(string("hfa_ModRelErrApr_H1_") + s)->Fill(relErrMod);
422 fHM->H2(string("hfa_ModErrApr_H2_") + s)->Fill(X, Y, errMod);
423 fHM->H2(string("hfa_ModRelErrApr_H2_") + s)->Fill(X, Y, relErrMod);
424 }
425 }
426 }
427 }
428}
429
431{
432 vector<LitFieldGrid> grids;
433 grids.resize(fNofSlices);
434 for (Int_t iSlice = 0; iSlice < fNofSlices; iSlice++) {
435 fGridCreator->CreateGrid(fZSlicePosition[iSlice], grids[iSlice]);
436 }
437
438 // Fill graph
439 for (Int_t iSlice = 0; iSlice < fNofSlices; iSlice++) {
440 Int_t cnt = 0;
441 //Double_t Z = fZSlicePosition[iSlice];
442 Double_t HX = 2 * fXSlicePosition[iSlice] / fNofBinsX; // step size for X position
443 Double_t HY = 2 * fYSlicePosition[iSlice] / fNofBinsY; // step size for Y position
444 for (Int_t iX = 0; iX < fNofBinsX; iX++) { // loop over x position
445 Double_t X = -fXSlicePosition[iSlice] + (iX + 0.5) * HX;
446 for (Int_t iY = 0; iY < fNofBinsY; iY++) { // loop over y position
447 Double_t Y = -fYSlicePosition[iSlice] + (iY + 0.5) * HY;
449 grids[iSlice].GetFieldValue(X, Y, v);
450 Double_t mod = sqrt(v.Bx * v.Bx + v.By * v.By + v.Bz * v.Bz);
451 string s = ToString<Int_t>(fZSlicePosition[iSlice]);
452 fHM->G2(string("hfa_BxGrid_Graph2D_") + s)->SetPoint(cnt, X, Y, v.Bx);
453 fHM->G2(string("hfa_ByGrid_Graph2D_") + s)->SetPoint(cnt, X, Y, v.By);
454 fHM->G2(string("hfa_BzGrid_Graph2D_") + s)->SetPoint(cnt, X, Y, v.Bz);
455 fHM->G2(string("hfa_ModGrid_Graph2D_") + s)->SetPoint(cnt, X, Y, mod);
456 cnt++;
457 }
458 }
459 }
460
461 // Fill error histograms
462 Int_t nofBinsX = 100;
463 Int_t nofBinsY = 100;
464 for (Int_t iSlice = 0; iSlice < fNofSlices; iSlice++) {
465 Double_t Z = fZSlicePosition[iSlice];
466 Double_t HX = 2 * fXSlicePosition[iSlice] / nofBinsX; // step size for X position
467 Double_t HY = 2 * fYSlicePosition[iSlice] / nofBinsY; // step size for Y position
468 for (Int_t iX = 0; iX < nofBinsX; iX++) { // loop over x position
469 Double_t X = -fXSlicePosition[iSlice] + (iX + 0.5) * HX;
470 for (Int_t iY = 0; iY < nofBinsY; iY++) { // loop over y position
471 Double_t Y = -fYSlicePosition[iSlice] + (iY + 0.5) * HY;
472
473 // Get field value
474 Double_t pos[3] = {X, Y, Z};
475 Double_t B[3];
476 fField->GetFieldValue(pos, B);
477
478 Double_t Bmod = sqrt(B[0] * B[0] + B[1] * B[1] + B[2] * B[2]);
479
481 grids[iSlice].GetFieldValue(X, Y, v);
482 Double_t mod = sqrt(v.Bx * v.Bx + v.By * v.By + v.Bz * v.Bz);
483
484 Double_t errBx = B[0] - v.Bx;
485 Double_t errBy = B[1] - v.By;
486 Double_t errBz = B[2] - v.Bz;
487 Double_t errMod = Bmod - mod;
488 Double_t relErrBx = (B[0] != 0.) ? (errBx / B[0]) * 100. : 0.;
489 Double_t relErrBy = (B[1] != 0.) ? (errBy / B[1]) * 100. : 0.;
490 Double_t relErrBz = (B[2] != 0.) ? (errBz / B[2]) * 100. : 0.;
491 Double_t relErrMod = (Bmod != 0.) ? (errMod / Bmod) * 100. : 0;
492
493 string s = ToString<Int_t>(fZSlicePosition[iSlice]);
494 fHM->H1(string("hfa_BxErrGrid_H1_") + s)->Fill(errBx);
495 fHM->H1(string("hfa_BxRelErrGrid_H1_") + s)->Fill(relErrBx);
496 fHM->H2(string("hfa_BxErrGrid_H2_") + s)->Fill(X, Y, errBx);
497 fHM->H2(string("hfa_BxRelErrGrid_H2_") + s)->Fill(X, Y, relErrBx);
498 fHM->H1(string("hfa_ByErrGrid_H1_") + s)->Fill(errBy);
499 fHM->H1(string("hfa_ByRelErrGrid_H1_") + s)->Fill(relErrBy);
500 fHM->H2(string("hfa_ByErrGrid_H2_") + s)->Fill(X, Y, errBy);
501 fHM->H2(string("hfa_ByRelErrGrid_H2_") + s)->Fill(X, Y, relErrBy);
502 fHM->H1(string("hfa_BzErrGrid_H1_") + s)->Fill(errBz);
503 fHM->H1(string("hfa_BzRelErrGrid_H1_") + s)->Fill(relErrBz);
504 fHM->H2(string("hfa_BzErrGrid_H2_") + s)->Fill(X, Y, errBz);
505 fHM->H2(string("hfa_BzRelErrGrid_H2_") + s)->Fill(X, Y, relErrBz);
506 fHM->H1(string("hfa_ModErrGrid_H1_") + s)->Fill(errMod);
507 fHM->H1(string("hfa_ModRelErrGrid_H1_") + s)->Fill(relErrMod);
508 fHM->H2(string("hfa_ModErrGrid_H2_") + s)->Fill(X, Y, errMod);
509 fHM->H2(string("hfa_ModRelErrGrid_H2_") + s)->Fill(X, Y, relErrMod);
510 }
511 }
512 }
513}
514
std::string ToString(ECbmModuleId modId)
Definition CbmDefs.cxx:70
Helper functions for drawing 1D and 2D histograms and graphs.
Histogram manager.
Creates field QA report.
ClassImp(CbmLitFieldApproximationQa)
Field map approximation QA.
Implementation of the polynomial field approximation.
Class creates grid with magnetic field values at a certain Z position.
Define floating point number type litfloat.
friend fvec sqrt(const fvec &a)
fscal v[fmask::Size]
Definition KfSimdPseudo.h:4
Class stores a grid of magnetic field values in XY slice at Z position.
Approximated magnetic field slice in XY plane perpendicular to Z.
Magnetic field value at a certain point in the space.
Histogram manager.
TGraph2D * G2(const std::string &name) const
Return pointer to TGraph2D.
TH2 * H2(const std::string &name) const
Return pointer to TH2 histogram.
void WriteToFile()
Write all objects to current opened file.
void Add(const std::string &name, TNamed *object)
Add new named object to manager.
std::string ToString() const
Return string representation of class.
TH1 * H1(const std::string &name) const
Return pointer to TH1 histogram.
Field map approximation QA.
void CreateGridHistos()
Create histograms for grid creator.
void CreateFitterHistos()
Create histograms for field approximation.
virtual ~CbmLitFieldApproximationQa()
Destructor.
void FillGridCreatorHistos()
fill histograms for grid creator tool.
virtual InitStatus Init()
Inherited from FairTask.
void FillBHistos()
Fill graphs and histos for field map for each field component (Bx, By, Bz, |B|).
vector< CbmLitFieldFitter * > fFitter
CbmLitFieldGridCreator * fGridCreator
virtual void Exec(Option_t *opt)
Inherited from FairTask.
void CreateFieldHistos()
Create field histograms.
virtual void Finish()
Inherited from FairTask.
void FillFieldApproximationHistos()
Fill histograms for polynomial field approximation.
Implementation of the polynomial field approximation.
void CreateGrid(fscal Z, lit::parallel::LitFieldGrid &grid)
Main function which creates grid with magnetic field values in (X, Y) slice.
Base class for simulation reports.
void Create(CbmHistManager *histManager, const std::string &outputDir)
Main function which creates report data.
Class stores a grid of magnetic field values in XY slice at Z position.
Approximated magnetic field slice in XY plane perpendicular to Z.
Magnetic field value at a certain point in the space.
void SaveCanvasAsImage(TCanvas *c, const string &dir, const string &option)
Definition CbmUtils.cxx:36
std::string ToString(const T &value)
Definition CbmUtils.h:26