FairShip
Loading...
Searching...
No Matches
ShipBFieldMap Class Reference

Class that defines a (3d) magnetic field map (distances in cm, fields in tesla). More...

#include <ShipBFieldMap.h>

Inheritance diagram for ShipBFieldMap:
[legend]
Collaboration diagram for ShipBFieldMap:
[legend]

Public Types

typedef std::vector< std::array< Float_t, 3 > > floatArray

Public Member Functions

 ShipBFieldMap (const std::string &label, const std::string &mapFileName, Float_t xOffset=0.0, Float_t yOffset=0.0, Float_t zOffset=0.0, Float_t phi=0.0, Float_t theta=0.0, Float_t psi=0.0, Float_t scale=1.0, Bool_t isSymmetric=kFALSE)
 Constructor.
 ShipBFieldMap (const std::string &newName, const ShipBFieldMap &rhs, Float_t newXOffset, Float_t newYOffset, Float_t newZOffset, Float_t newPhi=0.0, Float_t newTheta=0.0, Float_t newPsi=0.0, Float_t newScale=1.0)
 ~ShipBFieldMap () override
 Destructor.
void Field (const Double_t *position, Double_t *B) override
 Implementation of evaluating the B field.
floatArray * getFieldMap () const
 Retrieve the field map.
void SetXOffset (Float_t xValue)
 Set the x global coordinate shift.
void SetYOffset (Float_t yValue)
 Set the y global coordinate shift.
void SetZOffset (Float_t zValue)
 Set the z global coordinate shift.
void SetPhi (Float_t phi)
 Set the first Euler rotation angle phi about the z axis.
void SetTheta (Float_t theta)
 Set the second Euler rotation angle theta about the new x axis.
void SetPsi (Float_t psi)
 Set the third Euler rotation angle psi about the new z axis.
void SetScale (Float_t scale)
 Set the field magnitude scaling factor.
void UseSymmetry (Bool_t flag)
 Set the boolean to specify if we have quadrant symmetry.
std::string GetMapFileName () const
 Get the name of the map file.
Int_t GetNx () const
 Get the number of bins along x.
Int_t GetNy () const
 Get the number of bins along y.
Int_t GetNz () const
 Get the number of bins along z.
Int_t GetNBins () const
 Get the total number of bins.
Float_t GetXMin () const
 Get the minimum value of x for the map.
Float_t GetXMax () const
 Get the maximum value of x for the map.
Float_t GetdX () const
 Get the bin width along x for the map.
Float_t GetXRange () const
 Get the x coordinate range for the map.
Float_t GetYMin () const
 Get the minimum value of y for the map.
Float_t GetYMax () const
 Get the maximum value of y for the map.
Float_t GetdY () const
 Get the bin width along y for the map.
Float_t GetYRange () const
 Get the y coordinate range for the map.
Float_t GetZMin () const
 Get the minimum value of z for the map.
Float_t GetZMax () const
 Get the maximum value of z for the map.
Float_t GetdZ () const
 Get the bin width along z for the map.
Float_t GetZRange () const
 Get the z coordinate range for the map.
Float_t GetXOffset () const
 Get the x offset coordinate of the map for global positioning.
Float_t GetYOffset () const
 Get the y offset coordinate of the map for global positioning.
Float_t GetZOffset () const
 Get the z offset coordinate of the map for global positioning.
Float_t GetPhi () const
 Get the first Euler rotation angle about the z axis for global positioning.
Float_t GetTheta () const
Float_t GetPsi () const
Float_t GetScale () const
 Get the field magnitude scaling factor.
Bool_t HasSymmetry () const
 Get the boolean flag to specify if we have quadrant symmetry.
Bool_t IsACopy () const
 Get the boolean flag to specify if we are a "copy".
 ClassDefOverride (ShipBFieldMap, 1)
 ClassDef for ROOT.

Private Types

enum  CoordAxis { xAxis = 0 , yAxis , zAxis }
 Enumeration to specify the coordinate type. More...
typedef std::pair< Int_t, Float_t > binPair
 Typedef for an int-double pair.

Private Member Functions

 ShipBFieldMap (const ShipBFieldMap &rhs)=delete
ShipBFieldMap & operator= (const ShipBFieldMap &rhs)=delete
void initialise ()
 Initialisation.
void readMapFile ()
 Read the field map data and store the information internally.
void readRootFile ()
 Process the ROOT file containing the field map data.
void readTextFile ()
 Process the text file containing the field map data.
void checkRootFileOrdering (TTree *dTree)
 Check that the ROOT map really uses the assumed data ordering.
void setLimits ()
Bool_t insideRange (Float_t x, Float_t y, Float_t z)
 Check to see if a point is within the map validity range.
binPair getBinInfo (Float_t x, CoordAxis theAxis)
 Get the bin number and fractional distance from the leftmost bin edge.
Int_t getMapBin (Int_t iX, Int_t iY, Int_t iZ)
 Find the vector entry of the field map data given the bins iX, iY and iZ.

Static Private Member Functions

static Float_t triLinearInterp (Float_t A, Float_t B, Float_t C, Float_t D, Float_t E, Float_t F, Float_t G, Float_t H, Float_t xFrac, Float_t xFrac1, Float_t yFrac, Float_t yFrac1, Float_t zFrac, Float_t zFrac1)

Private Attributes

floatArray * fieldMap_
std::string mapFileName_
 The name of the map file.
Bool_t initialised_
 Initialisation boolean.
Bool_t isCopy_
Int_t Nx_
 The number of bins along x.
Int_t Ny_
 The number of bins along y.
Int_t Nz_
 The number of bins along z.
Int_t N_
 The total number of bins.
Float_t xMin_
 The minimum value of x for the map.
Float_t xMax_
 The maximum value of x for the map.
Float_t dx_
 The bin width along x.
Float_t xRange_
 The coordinate range along x.
Float_t yMin_
 The minimum value of y for the map.
Float_t yMax_
 The maximum value of y for the map.
Float_t dy_
 The bin width along y.
Float_t yRange_
 The coordinate range along y.
Float_t zMin_
 The minimum value of z for the map.
Float_t zMax_
 The maximum value of z for the map.
Float_t dz_
 The bin width along z.
Float_t zRange_
 The coordinate range along z.
Float_t xOffset_
 The x value of the positional offset for the map.
Float_t yOffset_
 The y value of the positional offset for the map.
Float_t zOffset_
 The z value of the positional offset for the map.
Float_t phi_
 The first Euler rotation angle about the z axis.
Float_t theta_
 The second Euler rotation angle about the new x axis.
Float_t psi_
 The third Euler rotation angle about the new z axis.
Float_t scale_
 The B field magnitude scaling factor.
Bool_t isSymmetric_
 The boolean specifying if we have quadrant symmetry.
TGeoMatrix * theTrans_
 The combined translation and rotation transformation.
Float_t Tesla_
 Double converting Tesla to kiloGauss (for VMC/FairRoot B field units).

Detailed Description

Class that defines a (3d) magnetic field map (distances in cm, fields in tesla).

Class that defines a (3d) magnetic field map.

Author
John Back J.J.B.nosp@m.ack@.nosp@m.warwi.nosp@m.ck.a.nosp@m.c.uk

Definition at line 23 of file ShipBFieldMap.h.

Member Typedef Documentation

◆ binPair

typedef std::pair<Int_t, Float_t> ShipBFieldMap::binPair
private

Typedef for an int-double pair.

Definition at line 347 of file ShipBFieldMap.h.

◆ floatArray

typedef std::vector<std::array<Float_t, 3> > ShipBFieldMap::floatArray

Typedef for the field-map storage: one contiguous (Bx, By, Bz) triple per grid node, giving cache-friendly access with no per-node heap allocation.

Definition at line 87 of file ShipBFieldMap.h.

Member Enumeration Documentation

◆ CoordAxis

Enumeration to specify the coordinate type.

Enumerator
xAxis 
yAxis 
zAxis 

Definition at line 313 of file ShipBFieldMap.h.

Constructor & Destructor Documentation

◆ ShipBFieldMap() [1/3]

ShipBFieldMap::ShipBFieldMap ( const std::string & label,
const std::string & mapFileName,
Float_t xOffset = 0.0,
Float_t yOffset = 0.0,
Float_t zOffset = 0.0,
Float_t phi = 0.0,
Float_t theta = 0.0,
Float_t psi = 0.0,
Float_t scale = 1.0,
Bool_t isSymmetric = kFALSE )

Constructor.

for FairLogger, MESSAGE_ORIGIN

Parameters
[in]labelA descriptive name/title/label for this field
[in]mapFileNameThe name of the field map file (distances in cm, fields in Tesla)
[in]xOffsetThe x global coordinate shift to position the field map (cm)
[in]yOffsetThe y global coordinate shift to position the field map (cm)
[in]zOffsetThe z global coordinate shift to position the field map (cm)
[in]phiThe first Euler rotation angle about the z axis (degrees)
[in]thetaThe second Euler rotation angle about the new x axis (degrees)
[in]psiThe third Euler rotation angle about the new z axis (degrees)
[in]scaleThe field magnitude scaling factor (default = 1.0)
[in]isSymmetricBoolean to specify if we have quadrant symmetry (default = false)

Definition at line 23 of file ShipBFieldMap.cxx.

28 : TVirtualMagField(label.c_str()),
29 fieldMap_(new floatArray()),
30 mapFileName_(mapFileName),
31 initialised_(kFALSE),
32 isCopy_(kFALSE),
33 Nx_(0),
34 Ny_(0),
35 Nz_(0),
36 N_(0),
37 xMin_(0.0),
38 xMax_(0.0),
39 dx_(0.0),
40 xRange_(0.0),
41 yMin_(0.0),
42 yMax_(0.0),
43 dy_(0.0),
44 yRange_(0.0),
45 zMin_(0.0),
46 zMax_(0.0),
47 dz_(0.0),
48 zRange_(0.0),
49 xOffset_(xOffset),
50 yOffset_(yOffset),
51 zOffset_(zOffset),
52 phi_(phi),
53 theta_(theta),
54 psi_(psi),
55 scale_(scale),
56 isSymmetric_(isSymmetric),
57 theTrans_(nullptr),
58 Tesla_(10.0) {
59 this->initialise();
60}
Float_t xMax_
The maximum value of x for the map.
Float_t dy_
The bin width along y.
Float_t psi_
The third Euler rotation angle about the new z axis.
Float_t dz_
The bin width along z.
Float_t zRange_
The coordinate range along z.
Int_t Nz_
The number of bins along z.
Float_t Tesla_
Double converting Tesla to kiloGauss (for VMC/FairRoot B field units).
Int_t N_
The total number of bins.
floatArray * fieldMap_
Float_t yMin_
The minimum value of y for the map.
Float_t zOffset_
The z value of the positional offset for the map.
std::string mapFileName_
The name of the map file.
Bool_t initialised_
Initialisation boolean.
Int_t Ny_
The number of bins along y.
Float_t theta_
The second Euler rotation angle about the new x axis.
Float_t xMin_
The minimum value of x for the map.
void initialise()
Initialisation.
Int_t Nx_
The number of bins along x.
Float_t xRange_
The coordinate range along x.
Float_t yOffset_
The y value of the positional offset for the map.
Float_t scale_
The B field magnitude scaling factor.
TGeoMatrix * theTrans_
The combined translation and rotation transformation.
std::vector< std::array< Float_t, 3 > > floatArray
Float_t yMax_
The maximum value of y for the map.
Float_t yRange_
The coordinate range along y.
Float_t zMax_
The maximum value of z for the map.
Float_t phi_
The first Euler rotation angle about the z axis.
Float_t zMin_
The minimum value of z for the map.
Float_t dx_
The bin width along x.
Bool_t isSymmetric_
The boolean specifying if we have quadrant symmetry.
Float_t xOffset_
The x value of the positional offset for the map.

◆ ShipBFieldMap() [2/3]

ShipBFieldMap::ShipBFieldMap ( const std::string & newName,
const ShipBFieldMap & rhs,
Float_t newXOffset,
Float_t newYOffset,
Float_t newZOffset,
Float_t newPhi = 0.0,
Float_t newTheta = 0.0,
Float_t newPsi = 0.0,
Float_t newScale = 1.0 )

Copy constructor with a new global transformation. Use this if you want to reuse the same field map information elsewhere in the geometry

Parameters
[in]rhsThe ShipBFieldMap object to be copied (retaining any symmetry)
[in]newNameThe new description or title of the field
[in]newXOffsetThe new global offset x coordinate (cm)
[in]newYOffsetThe new global offset y coordinate (cm)
[in]newZOffsetThe new global offset z coordinate (cm)
[in]newPhiThe first Euler rotation angle about the z axis (degrees)
[in]newThetaThe second Euler rotation angle about the new x axis (degrees)
[in]newPsiThe third Euler rotation angle about the new z axis (degrees)
[in]newScaleThe field magnitude scaling factor (default = 1.0)
Returns
a copy of the field map object "rhs", keeping the same fieldMap pointer

Definition at line 75 of file ShipBFieldMap.cxx.

80 : TVirtualMagField(newName.c_str()),
83 initialised_(kFALSE),
84 isCopy_(kTRUE),
85 Nx_(rhs.Nx_),
86 Ny_(rhs.Ny_),
87 Nz_(rhs.Nz_),
88 N_(rhs.N_),
89 xMin_(rhs.xMin_),
90 xMax_(rhs.xMax_),
91 dx_(rhs.dx_),
92 xRange_(rhs.xRange_),
93 yMin_(rhs.yMin_),
94 yMax_(rhs.yMax_),
95 dy_(rhs.dy_),
96 yRange_(rhs.yRange_),
97 zMin_(rhs.zMin_),
98 zMax_(rhs.zMax_),
99 dz_(rhs.dz_),
100 zRange_(rhs.zRange_),
101 xOffset_(newXOffset),
102 yOffset_(newYOffset),
103 zOffset_(newZOffset),
104 phi_(newPhi),
105 theta_(newTheta),
106 psi_(newPsi),
107 scale_(newScale),
109 theTrans_(nullptr),
110 Tesla_(10.0) {
111 // Copy constructor with new label and different global offset, which uses
112 // the same field map data (pointer) and distance units as the rhs object
113 this->initialise();
114}
std::string GetMapFileName() const
Get the name of the map file.

◆ ~ShipBFieldMap()

ShipBFieldMap::~ShipBFieldMap ( )
override

Destructor.

Definition at line 62 of file ShipBFieldMap.cxx.

62 {
63 // Delete the internal vector storing the field map values
64 if (fieldMap_ && isCopy_ == kFALSE) {
65 delete fieldMap_;
66 fieldMap_ = nullptr;
67 }
68
69 if (theTrans_) {
70 delete theTrans_;
71 theTrans_ = nullptr;
72 }
73}

◆ ShipBFieldMap() [3/3]

ShipBFieldMap::ShipBFieldMap ( const ShipBFieldMap & rhs)
privatedelete

Member Function Documentation

◆ checkRootFileOrdering()

void ShipBFieldMap::checkRootFileOrdering ( TTree * dTree)
private

Check that the ROOT map really uses the assumed data ordering.

Parameters
[in]dTreeThe Data tree of the map file. Its branch statuses and addresses are reset before returning

Definition at line 350 of file ShipBFieldMap.cxx.

350 {
351 // Entry (iX*Ny_ + iY)*Nz_ + iZ has to hold the field at grid node
352 // (iX, iY, iZ). Maps converted with the coordinates stored also carry the
353 // node position, so probe a few entries and check where they land. Nothing
354 // else can catch a permuted map: when Nx == Ny and the x and y ranges agree,
355 // the entry count above still matches and the field is silently mirrored
356 // about the x = y plane.
357 if (!dTree->GetBranch("x") || !dTree->GetBranch("y") ||
358 !dTree->GetBranch("z")) {
359 LOG(warn) << "ShipBFieldMap: " << mapFileName_
360 << " stores no x,y,z branches, so the assumed ascending z,y,x "
361 "ordering cannot be verified. Convert the map with the node "
362 "coordinates stored.";
363 return;
364 }
365
366 Float_t x(0.0), y(0.0), z(0.0);
367 dTree->SetBranchStatus("*", 0);
368 dTree->SetBranchStatus("x", 1);
369 dTree->SetBranchStatus("y", 1);
370 dTree->SetBranchStatus("z", 1);
371 dTree->SetBranchAddress("x", &x);
372 dTree->SetBranchAddress("y", &y);
373 dTree->SetBranchAddress("z", &z);
374
375 // The first node, its z, y and x neighbours, and the last node. Between them
376 // these five tell apart every permutation of the three axes.
377 const std::array<Int_t, 5> probes{0, 1, Nz_, Ny_ * Nz_, N_ - 1};
378
379 for (const Int_t entry : probes) {
380 const Int_t iX = entry / (Ny_ * Nz_);
381 const Int_t iY = (entry / Nz_) % Ny_;
382 const Int_t iZ = entry % Nz_;
383
384 dTree->GetEntry(entry);
385
386 // A NaN or infinite coordinate cannot be rounded to a node, so it says
387 // nothing about the ordering and would only produce a misleading report.
388 if (!std::isfinite(x) || !std::isfinite(y) || !std::isfinite(z)) {
389 LOG(fatal) << "ShipBFieldMap: field map " << mapFileName_ << " entry "
390 << entry << " holds a non-finite coordinate (" << x << ", "
391 << y << ", " << z << ") cm.";
392 break;
393 }
394
395 // Round to the nearest node rather than compare coordinates directly.
396 // Some maps sit slightly off the nominal grid, by up to an eighth of a
397 // bin, while a permuted ordering is off by tens of bins.
398 const Int_t nodeX = static_cast<Int_t>(std::lround((x - xMin_) / dx_));
399 const Int_t nodeY = static_cast<Int_t>(std::lround((y - yMin_) / dy_));
400 const Int_t nodeZ = static_cast<Int_t>(std::lround((z - zMin_) / dz_));
401
402 if (nodeX != iX || nodeY != iY || nodeZ != iZ) {
403 LOG(fatal) << "ShipBFieldMap: field map " << mapFileName_
404 << " is not stored in ascending z,y,x coordinate order. "
405 << "Entry " << entry << " should hold node (" << iX << ", "
406 << iY << ", " << iZ << ") at (" << xMin_ + iX * dx_ << ", "
407 << yMin_ + iY * dy_ << ", " << zMin_ + iZ * dz_
408 << ") cm but holds node (" << nodeX << ", " << nodeY << ", "
409 << nodeZ << ") at (" << x << ", " << y << ", " << z
410 << ") cm. Repack it with field/canonicaliseFieldMap.py.";
411 // Reporting every probe adds nothing once the first one has disagreed.
412 break;
413 }
414 }
415
416 // The addresses above are local, so the tree must not keep pointing at them.
417 dTree->ResetBranchAddresses();
418 dTree->SetBranchStatus("*", 1);
419}

◆ ClassDefOverride()

ShipBFieldMap::ClassDefOverride ( ShipBFieldMap ,
1  )

ClassDef for ROOT.

◆ Field()

void ShipBFieldMap::Field ( const Double_t * position,
Double_t * B )
override

Implementation of evaluating the B field.

Parameters
[in]positionThe x,y,z global coordinates of the point (cm)
[out]BThe x,y,z components of the magnetic field (kGauss = 0.1 tesla)

Definition at line 116 of file ShipBFieldMap.cxx.

116 {
117 // Set the B field components given the global position coordinates
118
119 // Convert the global position into a local one for the volume field.
120 // Initialise the local co-ords, which will get overwritten if the
121 // coordinate transformation exists. For a global field, any local
122 // volume transformation is ignored
123 Double_t localCoords[3] = {position[0], position[1], position[2]};
124
125 if (theTrans_) {
126 theTrans_->MasterToLocal(position, localCoords);
127 }
128
129 // The local position coordinates
130 Float_t x = localCoords[0];
131 Float_t y = localCoords[1];
132 Float_t z = localCoords[2];
133
134 // Now check to see if we have x-y quadrant symmetry (z has no symmetry):
135 // Bx is antisymmetric in both x and y, By is symmetric in both, while Bz is
136 // symmetric in x but antisymmetric in y (dipole physics). So Bx can change
137 // sign for x < 0 or y < 0, and Bz can change sign for y < 0:
138 // 1. x > 0, y > 0: Bx = +Bx, Bz = +Bz
139 // 2. x > 0, y < 0: Bx = -Bx, Bz = -Bz
140 // 3. x < 0, y > 0: Bx = -Bx, Bz = +Bz
141 // 4. x < 0, y < 0: Bx = +Bx, Bz = -Bz
142
143 Float_t BxSign(1.0);
144 Float_t BzSign = 1;
145
146 if (isSymmetric_) {
147 // The map stores only the x > 0, y > 0 quadrant; fold negative
148 // coordinates in and track the induced signs of Bx and Bz.
149 if (x < 0.0) {
150 x = -x;
151 BxSign *= -1.0;
152 }
153
154 if (y < 0.0) {
155 y = -y;
156 BxSign *= -1.0;
157 BzSign = -1.0;
158 }
159 }
160
161 // Initialise the B field components to zero
162 B[0] = 0.0;
163 B[1] = 0.0;
164 B[2] = 0.0;
165
166 // First check to see if we are inside the field map range
167 Bool_t inside = this->insideRange(x, y, z);
168 if (inside == kFALSE) {
169 return;
170 }
171
172 // Find the neighbouring bins for the given point
173 binPair xBinInfo = this->getBinInfo(x, ShipBFieldMap::xAxis);
174 binPair yBinInfo = this->getBinInfo(y, ShipBFieldMap::yAxis);
175 binPair zBinInfo = this->getBinInfo(z, ShipBFieldMap::zAxis);
176
177 Int_t iX = xBinInfo.first;
178 Int_t iY = yBinInfo.first;
179 Int_t iZ = zBinInfo.first;
180
181 // Check that the bins are valid
182 if (iX == -1 || iY == -1 || iZ == -1) {
183 return;
184 }
185
186 // Get the various neighbouring bin entries
187 Int_t iX1(iX + 1);
188 Int_t iY1(iY + 1);
189 Int_t iZ1(iZ + 1);
190
191 const Int_t binA = this->getMapBin(iX, iY, iZ);
192 const Int_t binB = this->getMapBin(iX1, iY, iZ);
193 const Int_t binC = this->getMapBin(iX, iY1, iZ);
194 const Int_t binD = this->getMapBin(iX1, iY1, iZ);
195 const Int_t binE = this->getMapBin(iX, iY, iZ1);
196 const Int_t binF = this->getMapBin(iX1, iY, iZ1);
197 const Int_t binG = this->getMapBin(iX, iY1, iZ1);
198 const Int_t binH = this->getMapBin(iX1, iY1, iZ1);
199
200 // Retrieve the fractional bin distances and their complements
201 const Float_t xFrac = xBinInfo.second;
202 const Float_t yFrac = yBinInfo.second;
203 const Float_t zFrac = zBinInfo.second;
204 const Float_t xFrac1 = 1.0 - xFrac;
205 const Float_t yFrac1 = 1.0 - yFrac;
206 const Float_t zFrac1 = 1.0 - zFrac;
207
208 if (!fieldMap_) {
209 return;
210 }
211
212 // Fetch each of the eight corner triples once and interpolate all three
213 // field components in a single pass (trilinear interpolation), then scale
214 // with the appropriate multiplication factor (default = 1.0).
215 const floatArray& fm = *fieldMap_;
216 const std::array<Float_t, 3>& cA = fm[binA];
217 const std::array<Float_t, 3>& cB = fm[binB];
218 const std::array<Float_t, 3>& cC = fm[binC];
219 const std::array<Float_t, 3>& cD = fm[binD];
220 const std::array<Float_t, 3>& cE = fm[binE];
221 const std::array<Float_t, 3>& cF = fm[binF];
222 const std::array<Float_t, 3>& cG = fm[binG];
223 const std::array<Float_t, 3>& cH = fm[binH];
224
225 Float_t Bc[3];
226 for (Int_t i = 0; i < 3; ++i) {
227 Bc[i] = triLinearInterp(cA[i], cB[i], cC[i], cD[i], cE[i], cF[i], cG[i],
228 cH[i], xFrac, xFrac1, yFrac, yFrac1, zFrac, zFrac1);
229 }
230
231 B[0] = Bc[0] * scale_ * BxSign;
232 B[1] = Bc[1] * scale_;
233 B[2] = Bc[2] * scale_ * BzSign;
234}
static Float_t triLinearInterp(Float_t A, Float_t B, Float_t C, Float_t D, Float_t E, Float_t F, Float_t G, Float_t H, Float_t xFrac, Float_t xFrac1, Float_t yFrac, Float_t yFrac1, Float_t zFrac, Float_t zFrac1)
std::pair< Int_t, Float_t > binPair
Typedef for an int-double pair.
binPair getBinInfo(Float_t x, CoordAxis theAxis)
Get the bin number and fractional distance from the leftmost bin edge.
Bool_t insideRange(Float_t x, Float_t y, Float_t z)
Check to see if a point is within the map validity range.
Int_t getMapBin(Int_t iX, Int_t iY, Int_t iZ)
Find the vector entry of the field map data given the bins iX, iY and iZ.
int i
Definition ShipAna.py:108

◆ getBinInfo()

ShipBFieldMap::binPair ShipBFieldMap::getBinInfo ( Float_t x,
ShipBFieldMap::CoordAxis theAxis )
private

Get the bin number and fractional distance from the leftmost bin edge.

Parameters
[in]xThe coordinate component of the point (cm)
[in]theAxisThe coordinate axis (CoordAxis enumeration for x, y or z)
Returns
the bin number and fractional distance from the leftmost bin edge as a pair

Definition at line 534 of file ShipBFieldMap.cxx.

535 {
536 Float_t du(0.0), uMin(0.0);
537 Int_t Nu(0);
538
539 if (theAxis == ShipBFieldMap::xAxis) {
540 du = dx_;
541 uMin = xMin_;
542 Nu = Nx_;
543 } else if (theAxis == ShipBFieldMap::yAxis) {
544 du = dy_;
545 uMin = yMin_;
546 Nu = Ny_;
547 } else if (theAxis == ShipBFieldMap::zAxis) {
548 du = dz_;
549 uMin = zMin_;
550 Nu = Nz_;
551 }
552
553 Int_t iBin(-1);
554 Float_t fracL(0.0);
555
556 if (du > 1e-10) {
557 // Get the number of fractional bin widths the point is from the first
558 // volume bin
559 Float_t dist = (u - uMin) / du;
560 // Get the integer equivalent of this distance, which is the bin number
561 iBin = static_cast<Int_t>(dist);
562 // Get the actual fractional distance of the point from the leftmost bin
563 // edge
564 fracL = (dist - iBin * 1.0);
565 }
566
567 // Check that the bin number is valid
568 if (iBin < 0 || iBin >= Nu) {
569 iBin = -1;
570 fracL = 0.0;
571 } else if (iBin >= Nu - 1) {
572 // The point lies in the last bin along this axis. The trilinear
573 // interpolation uses the iBin+1 neighbour, which would fall outside the
574 // axis here, so clamp to the last valid cell (Nu-2) and use a fractional
575 // weight of 1 so the upper-edge (last valid) slice is used without reading
576 // the next, non-existent slice.
577 iBin = Nu - 2;
578 fracL = 1.0;
579 }
580
581 // Return the bin number and fractional distance of the point from the
582 // leftmost bin edge
583 binPair binInfo(iBin, fracL);
584
585 return binInfo;
586}

◆ GetdX()

Float_t ShipBFieldMap::GetdX ( ) const
inline

Get the bin width along x for the map.

Returns
the bin width along x (cm)

Definition at line 191 of file ShipBFieldMap.h.

191{ return dx_; }

◆ GetdY()

Float_t ShipBFieldMap::GetdY ( ) const
inline

Get the bin width along y for the map.

Returns
the bin width along y (cm)

Definition at line 215 of file ShipBFieldMap.h.

215{ return dy_; }

◆ GetdZ()

Float_t ShipBFieldMap::GetdZ ( ) const
inline

Get the bin width along z for the map.

Returns
the bin width along z (cm)

Definition at line 239 of file ShipBFieldMap.h.

239{ return dz_; }

◆ getFieldMap()

floatArray * ShipBFieldMap::getFieldMap ( ) const
inline

Retrieve the field map.

Returns
the field map

Definition at line 93 of file ShipBFieldMap.h.

93{ return fieldMap_; }

◆ getMapBin()

Int_t ShipBFieldMap::getMapBin ( Int_t iX,
Int_t iY,
Int_t iZ )
private

Find the vector entry of the field map data given the bins iX, iY and iZ.

Parameters
[in]iXThe bin along the x axis
[in]iYThe bin along the y axis
[in]iZThe bin along the z axis
Returns
the index entry for the field map data vector

Definition at line 588 of file ShipBFieldMap.cxx.

588 {
589 // Get the index of the map entry corresponding to the x,y,z bins.
590 // Remember that the map is ordered in ascending z, y, then x
591
592 Int_t index = (iX * Ny_ + iY) * Nz_ + iZ;
593 if (index < 0) {
594 index = 0;
595 } else if (index >= N_) {
596 index = N_ - 1;
597 }
598
599 return index;
600}

◆ GetMapFileName()

std::string ShipBFieldMap::GetMapFileName ( ) const
inline

Get the name of the map file.

Returns
the name of the map file as an STL string

Definition at line 149 of file ShipBFieldMap.h.

149{ return mapFileName_; }

◆ GetNBins()

Int_t ShipBFieldMap::GetNBins ( ) const
inline

Get the total number of bins.

Returns
the total number of bins

Definition at line 173 of file ShipBFieldMap.h.

173{ return N_; }

◆ GetNx()

Int_t ShipBFieldMap::GetNx ( ) const
inline

Get the number of bins along x.

Returns
the number of bins along x

Definition at line 155 of file ShipBFieldMap.h.

155{ return Nx_; }

◆ GetNy()

Int_t ShipBFieldMap::GetNy ( ) const
inline

Get the number of bins along y.

Returns
the number of bins along y

Definition at line 161 of file ShipBFieldMap.h.

161{ return Ny_; }

◆ GetNz()

Int_t ShipBFieldMap::GetNz ( ) const
inline

Get the number of bins along z.

Returns
the number of bins along z

Definition at line 167 of file ShipBFieldMap.h.

167{ return Nz_; }

◆ GetPhi()

Float_t ShipBFieldMap::GetPhi ( ) const
inline

Get the first Euler rotation angle about the z axis for global positioning.

Returns
the map's first Euler rotation angle about the z axis (degrees)

Definition at line 269 of file ShipBFieldMap.h.

269{ return phi_; }

◆ GetPsi()

Float_t ShipBFieldMap::GetPsi ( ) const
inline

Get the third Euler rotation angle about the new z axis for global positioning

Returns
the map's third Euler rotation angle about the new z axis (degrees)

Definition at line 284 of file ShipBFieldMap.h.

284{ return psi_; }

◆ GetScale()

Float_t ShipBFieldMap::GetScale ( ) const
inline

Get the field magnitude scaling factor.

Returns
the scaling factor for the field magnitude

Definition at line 290 of file ShipBFieldMap.h.

290{ return scale_; }

◆ GetTheta()

Float_t ShipBFieldMap::GetTheta ( ) const
inline

Get the second Euler rotation angle about the new x axis for global positioning

Returns
the map's second Euler rotation angle about the new x axis (degrees)

Definition at line 277 of file ShipBFieldMap.h.

277{ return theta_; }

◆ GetXMax()

Float_t ShipBFieldMap::GetXMax ( ) const
inline

Get the maximum value of x for the map.

Returns
the maximum x coordinate (cm)

Definition at line 185 of file ShipBFieldMap.h.

185{ return xMax_; }

◆ GetXMin()

Float_t ShipBFieldMap::GetXMin ( ) const
inline

Get the minimum value of x for the map.

Returns
the minimum x coordinate (cm)

Definition at line 179 of file ShipBFieldMap.h.

179{ return xMin_; }

◆ GetXOffset()

Float_t ShipBFieldMap::GetXOffset ( ) const
inline

Get the x offset coordinate of the map for global positioning.

Returns
the map's x offset coordinate for global positioning (cm)

Definition at line 251 of file ShipBFieldMap.h.

251{ return xOffset_; }

◆ GetXRange()

Float_t ShipBFieldMap::GetXRange ( ) const
inline

Get the x coordinate range for the map.

Returns
the x coordinate range (cm)

Definition at line 197 of file ShipBFieldMap.h.

197{ return xRange_; }

◆ GetYMax()

Float_t ShipBFieldMap::GetYMax ( ) const
inline

Get the maximum value of y for the map.

Returns
the maximum y coordinate (cm)

Definition at line 209 of file ShipBFieldMap.h.

209{ return yMax_; }

◆ GetYMin()

Float_t ShipBFieldMap::GetYMin ( ) const
inline

Get the minimum value of y for the map.

Returns
the minimum y coordinate (cm)

Definition at line 203 of file ShipBFieldMap.h.

203{ return yMin_; }

◆ GetYOffset()

Float_t ShipBFieldMap::GetYOffset ( ) const
inline

Get the y offset coordinate of the map for global positioning.

Returns
the map's y offset coordinate for global positioning (cm)

Definition at line 257 of file ShipBFieldMap.h.

257{ return yOffset_; }

◆ GetYRange()

Float_t ShipBFieldMap::GetYRange ( ) const
inline

Get the y coordinate range for the map.

Returns
the y coordinate range (cm)

Definition at line 221 of file ShipBFieldMap.h.

221{ return yRange_; }

◆ GetZMax()

Float_t ShipBFieldMap::GetZMax ( ) const
inline

Get the maximum value of z for the map.

Returns
the maximum z coordinate (cm)

Definition at line 233 of file ShipBFieldMap.h.

233{ return zMax_; }

◆ GetZMin()

Float_t ShipBFieldMap::GetZMin ( ) const
inline

Get the minimum value of z for the map.

Returns
the minimum z coordinate (cm)

Definition at line 227 of file ShipBFieldMap.h.

227{ return zMin_; }

◆ GetZOffset()

Float_t ShipBFieldMap::GetZOffset ( ) const
inline

Get the z offset coordinate of the map for global positioning.

Returns
the map's z offset coordinate for global positioning (cm)

Definition at line 263 of file ShipBFieldMap.h.

263{ return zOffset_; }

◆ GetZRange()

Float_t ShipBFieldMap::GetZRange ( ) const
inline

Get the z coordinate range for the map.

Returns
the z coordinate range (cm)

Definition at line 245 of file ShipBFieldMap.h.

245{ return zRange_; }

◆ HasSymmetry()

Bool_t ShipBFieldMap::HasSymmetry ( ) const
inline

Get the boolean flag to specify if we have quadrant symmetry.

Returns
the boolean specifying if we have quadrant symmetry

Definition at line 296 of file ShipBFieldMap.h.

296{ return isSymmetric_; }

◆ initialise()

void ShipBFieldMap::initialise ( )
private

Initialisation.

Definition at line 236 of file ShipBFieldMap.cxx.

236 {
237 if (initialised_ == kFALSE) {
238 if (isCopy_ == kFALSE) {
239 this->readMapFile();
240 }
241
242 // Set the global coordinate translation and rotation info
243 if (fabs(phi_) > 1e-6 || fabs(theta_) > 1e-6 || fabs(psi_) > 1e-6) {
244 // We have non-zero rotation angles. Create a combined translation and
245 // rotation
246 TGeoTranslation tr("offsets", xOffset_, yOffset_, zOffset_);
247 TGeoRotation rot("angles", phi_, theta_, psi_);
248 theTrans_ = new TGeoCombiTrans(tr, rot);
249
250 } else {
251 // We only need a translation
252 theTrans_ = new TGeoTranslation("offsets", xOffset_, yOffset_, zOffset_);
253 }
254
255 initialised_ = kTRUE;
256 }
257}
void readMapFile()
Read the field map data and store the information internally.

◆ insideRange()

Bool_t ShipBFieldMap::insideRange ( Float_t x,
Float_t y,
Float_t z )
private

Check to see if a point is within the map validity range.

Parameters
[in]xThe x coordinate of the point (cm)
[in]yThe y coordinate of the point (cm)
[in]zThe z coordinate of the point (cm)
Returns
true/false if the point is inside the field map range

Definition at line 468 of file ShipBFieldMap.cxx.

468 {
469 Bool_t inside(kFALSE);
470
471 if (x >= xMin_ && x <= xMax_ && y >= yMin_ && y <= yMax_ && z >= zMin_ &&
472 z <= zMax_) {
473 inside = kTRUE;
474 }
475
476 return inside;
477}

◆ IsACopy()

Bool_t ShipBFieldMap::IsACopy ( ) const
inline

Get the boolean flag to specify if we are a "copy".

Returns
the boolean copy flag status

Definition at line 302 of file ShipBFieldMap.h.

302{ return isCopy_; }

◆ operator=()

ShipBFieldMap & ShipBFieldMap::operator= ( const ShipBFieldMap & rhs)
privatedelete

◆ readMapFile()

void ShipBFieldMap::readMapFile ( )
private

Read the field map data and store the information internally.

Definition at line 259 of file ShipBFieldMap.cxx.

259 {
260 LOG(info) << "ShipBFieldMap::readMapFile() creating field " << this->GetName()
261 << " using file " << mapFileName_;
262
263 // Check to see if we have a ROOT file
264 if (mapFileName_.find(".root") != std::string::npos) {
265 this->readRootFile();
266
267 } else {
268 this->readTextFile();
269 }
270}
void readTextFile()
Process the text file containing the field map data.
void readRootFile()
Process the ROOT file containing the field map data.

◆ readRootFile()

void ShipBFieldMap::readRootFile ( )
private

Process the ROOT file containing the field map data.

Definition at line 272 of file ShipBFieldMap.cxx.

272 {
273 TFile* theFile = TFile::Open(mapFileName_.c_str());
274
275 if (!theFile) {
276 LOG(fatal) << "ShipBFieldMap: could not find the file " << mapFileName_;
277 }
278
279 // Coordinate ranges
280 TTree* rTree = dynamic_cast<TTree*>(theFile->Get("Range"));
281 if (!rTree) {
282 LOG(fatal) << "ShipBFieldMap: could not find Range tree in "
283 << mapFileName_;
284 }
285
286 rTree->SetBranchAddress("xMin", &xMin_);
287 rTree->SetBranchAddress("xMax", &xMax_);
288 rTree->SetBranchAddress("dx", &dx_);
289 rTree->SetBranchAddress("yMin", &yMin_);
290 rTree->SetBranchAddress("yMax", &yMax_);
291 rTree->SetBranchAddress("dy", &dy_);
292 rTree->SetBranchAddress("zMin", &zMin_);
293 rTree->SetBranchAddress("zMax", &zMax_);
294 rTree->SetBranchAddress("dz", &dz_);
295
296 // Fill the ranges
297 rTree->GetEntry(0);
298
299 this->setLimits();
300
301 // Make sure we don't have a copy
302 if (isCopy_ == kFALSE) {
303 // The data is expected to contain Bx,By,Bz data values
304 // in ascending z,y,x coordinate order
305
306 TTree* dTree = dynamic_cast<TTree*>(theFile->Get("Data"));
307 if (!dTree) {
308 LOG(fatal) << "ShipBFieldMap: could not find Data tree in "
309 << mapFileName_;
310 }
311
312 const Int_t nEntries = dTree->GetEntries();
313 if (nEntries != N_) {
314 LOG(fatal) << "Expected " << N_ << " field map entries but found "
315 << nEntries;
316 }
317
318 this->checkRootFileOrdering(dTree);
319
320 Float_t Bx, By, Bz;
321 // Only enable the field components
322 dTree->SetBranchStatus("*", 0);
323 dTree->SetBranchStatus("Bx", 1);
324 dTree->SetBranchStatus("By", 1);
325 dTree->SetBranchStatus("Bz", 1);
326
327 dTree->SetBranchAddress("Bx", &Bx);
328 dTree->SetBranchAddress("By", &By);
329 dTree->SetBranchAddress("Bz", &Bz);
330
331 fieldMap_->reserve(nEntries);
332
333 for (Int_t i = 0; i < nEntries; i++) {
334 dTree->GetEntry(i);
335
336 // B field values are in Tesla. This means these values are multiplied
337 // by a factor of ten since both FairRoot and the VMC interface use kGauss
338 Bx *= Tesla_;
339 By *= Tesla_;
340 Bz *= Tesla_;
341
342 // Store the B field 3-vector
343 fieldMap_->push_back({Bx, By, Bz});
344 }
345 }
346
347 theFile->Close();
348}
void checkRootFileOrdering(TTree *dTree)
Check that the ROOT map really uses the assumed data ordering.

◆ readTextFile()

void ShipBFieldMap::readTextFile ( )
private

Process the text file containing the field map data.

Definition at line 421 of file ShipBFieldMap.cxx.

421 {
422 std::ifstream getData(mapFileName_.c_str());
423
424 if (!getData.is_open()) {
425 LOG(fatal) << "Error: Cannot open magnetic field map file: "
426 << mapFileName_;
427 }
428
429 std::string tmpString("");
430
431 getData >> tmpString >> xMin_ >> xMax_ >> dx_ >> yMin_ >> yMax_ >> dy_ >>
432 zMin_ >> zMax_ >> dz_;
433
434 this->setLimits();
435
436 // Check to see if this object is a "copy"
437 if (isCopy_ == kFALSE) {
438 // Read the field map and store the magnetic field components
439
440 // Second line can be ignored since they are
441 // just labels for the data columns for readability
442 getData >> tmpString >> tmpString >> tmpString;
443
444 // The remaining lines contain Bx,By,Bz data values
445 // in ascending z,y,x co-ord order. Unlike the ROOT format the text one
446 // carries no coordinates, so that ordering cannot be verified here.
447 fieldMap_->reserve(N_);
448
449 Float_t Bx(0.0), By(0.0), Bz(0.0);
450
451 for (Int_t i = 0; i < N_; i++) {
452 getData >> Bx >> By >> Bz;
453
454 // B field values are in Tesla. This means these values are multiplied
455 // by a factor of ten since both FairRoot and the VMC interface use kGauss
456 Bx *= Tesla_;
457 By *= Tesla_;
458 Bz *= Tesla_;
459
460 // Store the B field 3-vector
461 fieldMap_->push_back({Bx, By, Bz});
462 }
463 }
464
465 getData.close();
466}

◆ setLimits()

void ShipBFieldMap::setLimits ( )
private

Definition at line 479 of file ShipBFieldMap.cxx.

479 {
480 // Since the default SHIP distance unit is cm, we do not need to convert
481 // these map limits, i.e. cm = 1 already
482
483 xRange_ = xMax_ - xMin_;
484 yRange_ = yMax_ - yMin_;
485 zRange_ = zMax_ - zMin_;
486
487 // Find the number of bins using the limits and bin sizes. The number of bins
488 // includes both the minimum and maximum values. To ensure correct rounding
489 // up to the nearest integer we need to add 1.5 not 1.0.
490 if (dx_ > 0.0) {
491 Nx_ = static_cast<Int_t>(((xMax_ - xMin_) / dx_) + 1.5);
492 }
493 if (dy_ > 0.0) {
494 Ny_ = static_cast<Int_t>(((yMax_ - yMin_) / dy_) + 1.5);
495 }
496 if (dz_ > 0.0) {
497 Nz_ = static_cast<Int_t>(((zMax_ - zMin_) / dz_) + 1.5);
498 }
499
500 // Trilinear interpolation needs at least two bins per axis; a smaller map
501 // would silently be treated as out of range for every point.
502 if (Nx_ < 2 || Ny_ < 2 || Nz_ < 2) {
503 LOG(fatal) << "ShipBFieldMap: field map needs at least 2 bins per axis; "
504 << "got Nx = " << Nx_ << ", Ny = " << Ny_ << ", Nz = " << Nz_;
505 }
506
507 // The rounding above hides limits that are not a whole number of bins apart.
508 // Left alone, every node beyond the first would sit away from where the
509 // interpolation looks for it.
510 const Float_t tolerance(1e-2);
511 if (fabs((Nx_ - 1) * dx_ - xRange_) > tolerance * dx_ ||
512 fabs((Ny_ - 1) * dy_ - yRange_) > tolerance * dy_ ||
513 fabs((Nz_ - 1) * dz_ - zRange_) > tolerance * dz_) {
514 LOG(fatal) << "ShipBFieldMap: field map extents are not whole multiples of "
515 << "the bin widths: " << xRange_ << " / " << dx_ << ", "
516 << yRange_ << " / " << dy_ << ", " << zRange_ << " / " << dz_;
517 }
518
519 N_ = Nx_ * Ny_ * Nz_;
520
521 LOG(info) << "x limits: " << xMin_ << ", " << xMax_ << ", dx = " << dx_;
522 LOG(info) << "y limits: " << yMin_ << ", " << yMax_ << ", dy = " << dy_;
523 LOG(info) << "z limits: " << zMin_ << ", " << zMax_ << ", dz = " << dz_;
524
525 LOG(info) << "Offsets: x = " << xOffset_ << ", y = " << yOffset_
526 << ", z = " << zOffset_;
527 LOG(info) << "Angles : phi = " << phi_ << ", theta = " << theta_
528 << ", psi = " << psi_;
529
530 LOG(info) << "Total number of bins = " << N_ << "; Nx = " << Nx_
531 << ", Ny = " << Ny_ << ", Nz = " << Nz_;
532}

◆ SetPhi()

void ShipBFieldMap::SetPhi ( Float_t phi)
inline

Set the first Euler rotation angle phi about the z axis.

Parameters
[in]phiThe first Euler rotation angle about the z axis (degrees)

Definition at line 117 of file ShipBFieldMap.h.

117{ phi_ = phi; }

◆ SetPsi()

void ShipBFieldMap::SetPsi ( Float_t psi)
inline

Set the third Euler rotation angle psi about the new z axis.

Parameters
[in]psiThe third Euler rotation angle about the new z axis (degrees)

Definition at line 131 of file ShipBFieldMap.h.

131{ psi_ = psi; }

◆ SetScale()

void ShipBFieldMap::SetScale ( Float_t scale)
inline

Set the field magnitude scaling factor.

Parameters
[in]scaleThe scaling factor for the field magnitude

Definition at line 137 of file ShipBFieldMap.h.

137{ scale_ = scale; }

◆ SetTheta()

void ShipBFieldMap::SetTheta ( Float_t theta)
inline

Set the second Euler rotation angle theta about the new x axis.

Parameters
[in]thetaThe second Euler rotation angle about the new x axis (degrees)

Definition at line 124 of file ShipBFieldMap.h.

124{ theta_ = theta; }

◆ SetXOffset()

void ShipBFieldMap::SetXOffset ( Float_t xValue)
inline

Set the x global coordinate shift.

Parameters
[in]xValueThe value of the x global coordinate shift (cm)

Definition at line 99 of file ShipBFieldMap.h.

99{ xOffset_ = xValue; }

◆ SetYOffset()

void ShipBFieldMap::SetYOffset ( Float_t yValue)
inline

Set the y global coordinate shift.

Parameters
[in]yValueThe value of the y global coordinate shift (cm)

Definition at line 105 of file ShipBFieldMap.h.

105{ yOffset_ = yValue; }

◆ SetZOffset()

void ShipBFieldMap::SetZOffset ( Float_t zValue)
inline

Set the z global coordinate shift.

Parameters
[in]zValueThe value of the z global coordinate shift (cm)

Definition at line 111 of file ShipBFieldMap.h.

111{ zOffset_ = zValue; }

◆ triLinearInterp()

Float_t ShipBFieldMap::triLinearInterp ( Float_t A,
Float_t B,
Float_t C,
Float_t D,
Float_t E,
Float_t F,
Float_t G,
Float_t H,
Float_t xFrac,
Float_t xFrac1,
Float_t yFrac,
Float_t yFrac1,
Float_t zFrac,
Float_t zFrac1 )
staticprivate

Trilinear interpolation of one field component from its eight corner values A..H and the fractional bin distances (with their complements)

Returns
the interpolated field component

Definition at line 602 of file ShipBFieldMap.cxx.

607 {
608 // Trilinear interpolation of a single component from its eight corner
609 // values A..H.
610 // Linear interpolation along x
611 const Float_t F00 = A * xFrac1 + B * xFrac;
612 const Float_t F10 = C * xFrac1 + D * xFrac;
613 const Float_t F01 = E * xFrac1 + F * xFrac;
614 const Float_t F11 = G * xFrac1 + H * xFrac;
615
616 // Linear interpolation along y
617 const Float_t F0 = F00 * yFrac1 + F10 * yFrac;
618 const Float_t F1 = F01 * yFrac1 + F11 * yFrac;
619
620 // Linear interpolation along z
621 return F0 * zFrac1 + F1 * zFrac;
622}
H(p, theta, mDarkPhoton)

◆ UseSymmetry()

void ShipBFieldMap::UseSymmetry ( Bool_t flag)
inline

Set the boolean to specify if we have quadrant symmetry.

Parameters
[in]isSymmetricBoolean to specify if we have quadrant symmetry

Definition at line 143 of file ShipBFieldMap.h.

143{ isSymmetric_ = flag; }

Member Data Documentation

◆ dx_

Float_t ShipBFieldMap::dx_
private

The bin width along x.

Definition at line 411 of file ShipBFieldMap.h.

◆ dy_

Float_t ShipBFieldMap::dy_
private

The bin width along y.

Definition at line 423 of file ShipBFieldMap.h.

◆ dz_

Float_t ShipBFieldMap::dz_
private

The bin width along z.

Definition at line 435 of file ShipBFieldMap.h.

◆ fieldMap_

floatArray* ShipBFieldMap::fieldMap_
private

Store the field map information as a vector of 3 floats. Map data ordering is given by first incrementing z, then y, then x

Definition at line 380 of file ShipBFieldMap.h.

◆ initialised_

Bool_t ShipBFieldMap::initialised_
private

Initialisation boolean.

Definition at line 386 of file ShipBFieldMap.h.

◆ isCopy_

Bool_t ShipBFieldMap::isCopy_
private

Flag to specify if we are a copy of the field map (just a change of global offsets)

Definition at line 390 of file ShipBFieldMap.h.

◆ isSymmetric_

Bool_t ShipBFieldMap::isSymmetric_
private

The boolean specifying if we have quadrant symmetry.

Definition at line 462 of file ShipBFieldMap.h.

◆ mapFileName_

std::string ShipBFieldMap::mapFileName_
private

The name of the map file.

Definition at line 383 of file ShipBFieldMap.h.

◆ N_

Int_t ShipBFieldMap::N_
private

The total number of bins.

Definition at line 402 of file ShipBFieldMap.h.

◆ Nx_

Int_t ShipBFieldMap::Nx_
private

The number of bins along x.

Definition at line 393 of file ShipBFieldMap.h.

◆ Ny_

Int_t ShipBFieldMap::Ny_
private

The number of bins along y.

Definition at line 396 of file ShipBFieldMap.h.

◆ Nz_

Int_t ShipBFieldMap::Nz_
private

The number of bins along z.

Definition at line 399 of file ShipBFieldMap.h.

◆ phi_

Float_t ShipBFieldMap::phi_
private

The first Euler rotation angle about the z axis.

Definition at line 450 of file ShipBFieldMap.h.

◆ psi_

Float_t ShipBFieldMap::psi_
private

The third Euler rotation angle about the new z axis.

Definition at line 456 of file ShipBFieldMap.h.

◆ scale_

Float_t ShipBFieldMap::scale_
private

The B field magnitude scaling factor.

Definition at line 459 of file ShipBFieldMap.h.

◆ Tesla_

Float_t ShipBFieldMap::Tesla_
private

Double converting Tesla to kiloGauss (for VMC/FairRoot B field units).

Definition at line 468 of file ShipBFieldMap.h.

◆ theta_

Float_t ShipBFieldMap::theta_
private

The second Euler rotation angle about the new x axis.

Definition at line 453 of file ShipBFieldMap.h.

◆ theTrans_

TGeoMatrix* ShipBFieldMap::theTrans_
private

The combined translation and rotation transformation.

Definition at line 465 of file ShipBFieldMap.h.

◆ xMax_

Float_t ShipBFieldMap::xMax_
private

The maximum value of x for the map.

Definition at line 408 of file ShipBFieldMap.h.

◆ xMin_

Float_t ShipBFieldMap::xMin_
private

The minimum value of x for the map.

Definition at line 405 of file ShipBFieldMap.h.

◆ xOffset_

Float_t ShipBFieldMap::xOffset_
private

The x value of the positional offset for the map.

Definition at line 441 of file ShipBFieldMap.h.

◆ xRange_

Float_t ShipBFieldMap::xRange_
private

The coordinate range along x.

Definition at line 414 of file ShipBFieldMap.h.

◆ yMax_

Float_t ShipBFieldMap::yMax_
private

The maximum value of y for the map.

Definition at line 420 of file ShipBFieldMap.h.

◆ yMin_

Float_t ShipBFieldMap::yMin_
private

The minimum value of y for the map.

Definition at line 417 of file ShipBFieldMap.h.

◆ yOffset_

Float_t ShipBFieldMap::yOffset_
private

The y value of the positional offset for the map.

Definition at line 444 of file ShipBFieldMap.h.

◆ yRange_

Float_t ShipBFieldMap::yRange_
private

The coordinate range along y.

Definition at line 426 of file ShipBFieldMap.h.

◆ zMax_

Float_t ShipBFieldMap::zMax_
private

The maximum value of z for the map.

Definition at line 432 of file ShipBFieldMap.h.

◆ zMin_

Float_t ShipBFieldMap::zMin_
private

The minimum value of z for the map.

Definition at line 429 of file ShipBFieldMap.h.

◆ zOffset_

Float_t ShipBFieldMap::zOffset_
private

The z value of the positional offset for the map.

Definition at line 447 of file ShipBFieldMap.h.

◆ zRange_

Float_t ShipBFieldMap::zRange_
private

The coordinate range along z.

Definition at line 438 of file ShipBFieldMap.h.


The documentation for this class was generated from the following files: