16#include "FairRunAna.h"
19 : fField(FairRunAna::Instance()->GetField())
31 float tanXangle = std::tan(
fXangle * 3.14159265 / 180.);
32 float tanYangle = std::tan(
fYangle * 3.14159265 / 180.);
33 float Xmax = Z * tanXangle;
34 float Ymax = Z * tanYangle;
39 nofCellsX += nofCellsX;
40 nofCellsY += nofCellsY;
42 std::vector<std::vector<lit::parallel::LitFieldValue<fscal>>> field;
43 field.resize(nofCellsX + 1);
44 for (
unsigned int i = 0; i < nofCellsX + 1; i++) {
45 field[i].resize(nofCellsY + 1);
48 for (
int j = 0; j < nofCellsX + 1; j++) {
50 for (
int k = 0; k < nofCellsY + 1; k++) {
54 double pos[3] = {X, Y, Z};
66 grid.
SetField(field, -Xmax, Xmax, -Ymax, Ymax, nofCellsX, nofCellsY);
67 std::cout <<
"Grid created: " << grid <<
"\n";
Class creates grid with magnetic field values at a certain Z position.
Class stores a grid of magnetic field values in XY slice at Z position.
CbmLitFieldGridCreator()
Constructor.
virtual ~CbmLitFieldGridCreator()
Destructor.
void CreateGrid(fscal Z, lit::parallel::LitFieldGrid &grid)
Main function which creates grid with magnetic field values in (X, Y) slice.
Class stores a grid of magnetic field values in XY slice at Z position.
void SetZ(fscal Z)
Sets Z position of the grid.
void SetField(const vector< vector< LitFieldValue< fscal > > > &field, fscal xmin, fscal xmax, fscal ymin, fscal ymax, int nofBinsX, int nofBinsY)
Set field values for the grid.
Magnetic field value at a certain point in the space.