![]() |
FairShip
|
Class that defines a (3d) magnetic field map (distances in cm, fields in tesla). More...
#include <ShipBFieldMap.h>
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). | |
Class that defines a (3d) magnetic field map (distances in cm, fields in tesla).
Class that defines a (3d) magnetic field map.
Definition at line 23 of file ShipBFieldMap.h.
|
private |
Typedef for an int-double pair.
Definition at line 347 of file ShipBFieldMap.h.
| 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.
|
private |
Enumeration to specify the coordinate type.
| Enumerator | |
|---|---|
| xAxis | |
| yAxis | |
| zAxis | |
Definition at line 313 of file ShipBFieldMap.h.
| 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
| [in] | label | A descriptive name/title/label for this field |
| [in] | mapFileName | The name of the field map file (distances in cm, fields in Tesla) |
| [in] | xOffset | The x global coordinate shift to position the field map (cm) |
| [in] | yOffset | The y global coordinate shift to position the field map (cm) |
| [in] | zOffset | The z global coordinate shift to position the field map (cm) |
| [in] | phi | The first Euler rotation angle about the z axis (degrees) |
| [in] | theta | The second Euler rotation angle about the new x axis (degrees) |
| [in] | psi | The third Euler rotation angle about the new z axis (degrees) |
| [in] | scale | The field magnitude scaling factor (default = 1.0) |
| [in] | isSymmetric | Boolean to specify if we have quadrant symmetry (default = false) |
Definition at line 23 of file ShipBFieldMap.cxx.
| 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
| [in] | rhs | The ShipBFieldMap object to be copied (retaining any symmetry) |
| [in] | newName | The new description or title of the field |
| [in] | newXOffset | The new global offset x coordinate (cm) |
| [in] | newYOffset | The new global offset y coordinate (cm) |
| [in] | newZOffset | The new global offset z coordinate (cm) |
| [in] | newPhi | The first Euler rotation angle about the z axis (degrees) |
| [in] | newTheta | The second Euler rotation angle about the new x axis (degrees) |
| [in] | newPsi | The third Euler rotation angle about the new z axis (degrees) |
| [in] | newScale | The field magnitude scaling factor (default = 1.0) |
Definition at line 75 of file ShipBFieldMap.cxx.
|
override |
|
privatedelete |
|
private |
Check that the ROOT map really uses the assumed data ordering.
| [in] | dTree | The Data tree of the map file. Its branch statuses and addresses are reset before returning |
Definition at line 350 of file ShipBFieldMap.cxx.
| ShipBFieldMap::ClassDefOverride | ( | ShipBFieldMap | , |
| 1 | ) |
ClassDef for ROOT.
|
override |
Implementation of evaluating the B field.
| [in] | position | The x,y,z global coordinates of the point (cm) |
| [out] | B | The x,y,z components of the magnetic field (kGauss = 0.1 tesla) |
Definition at line 116 of file ShipBFieldMap.cxx.
|
private |
Get the bin number and fractional distance from the leftmost bin edge.
| [in] | x | The coordinate component of the point (cm) |
| [in] | theAxis | The coordinate axis (CoordAxis enumeration for x, y or z) |
Definition at line 534 of file ShipBFieldMap.cxx.
|
inline |
Get the bin width along x for the map.
Definition at line 191 of file ShipBFieldMap.h.
|
inline |
Get the bin width along y for the map.
Definition at line 215 of file ShipBFieldMap.h.
|
inline |
Get the bin width along z for the map.
Definition at line 239 of file ShipBFieldMap.h.
|
inline |
|
private |
Find the vector entry of the field map data given the bins iX, iY and iZ.
| [in] | iX | The bin along the x axis |
| [in] | iY | The bin along the y axis |
| [in] | iZ | The bin along the z axis |
Definition at line 588 of file ShipBFieldMap.cxx.
|
inline |
Get the name of the map file.
Definition at line 149 of file ShipBFieldMap.h.
|
inline |
Get the total number of bins.
Definition at line 173 of file ShipBFieldMap.h.
|
inline |
Get the number of bins along x.
Definition at line 155 of file ShipBFieldMap.h.
|
inline |
Get the number of bins along y.
Definition at line 161 of file ShipBFieldMap.h.
|
inline |
Get the number of bins along z.
Definition at line 167 of file ShipBFieldMap.h.
|
inline |
Get the first Euler rotation angle about the z axis for global positioning.
Definition at line 269 of file ShipBFieldMap.h.
|
inline |
Get the third Euler rotation angle about the new z axis for global positioning
Definition at line 284 of file ShipBFieldMap.h.
|
inline |
Get the field magnitude scaling factor.
Definition at line 290 of file ShipBFieldMap.h.
|
inline |
Get the second Euler rotation angle about the new x axis for global positioning
Definition at line 277 of file ShipBFieldMap.h.
|
inline |
Get the maximum value of x for the map.
Definition at line 185 of file ShipBFieldMap.h.
|
inline |
Get the minimum value of x for the map.
Definition at line 179 of file ShipBFieldMap.h.
|
inline |
Get the x offset coordinate of the map for global positioning.
Definition at line 251 of file ShipBFieldMap.h.
|
inline |
Get the x coordinate range for the map.
Definition at line 197 of file ShipBFieldMap.h.
|
inline |
Get the maximum value of y for the map.
Definition at line 209 of file ShipBFieldMap.h.
|
inline |
Get the minimum value of y for the map.
Definition at line 203 of file ShipBFieldMap.h.
|
inline |
Get the y offset coordinate of the map for global positioning.
Definition at line 257 of file ShipBFieldMap.h.
|
inline |
Get the y coordinate range for the map.
Definition at line 221 of file ShipBFieldMap.h.
|
inline |
Get the maximum value of z for the map.
Definition at line 233 of file ShipBFieldMap.h.
|
inline |
Get the minimum value of z for the map.
Definition at line 227 of file ShipBFieldMap.h.
|
inline |
Get the z offset coordinate of the map for global positioning.
Definition at line 263 of file ShipBFieldMap.h.
|
inline |
Get the z coordinate range for the map.
Definition at line 245 of file ShipBFieldMap.h.
|
inline |
Get the boolean flag to specify if we have quadrant symmetry.
Definition at line 296 of file ShipBFieldMap.h.
|
private |
Initialisation.
Definition at line 236 of file ShipBFieldMap.cxx.
|
private |
Check to see if a point is within the map validity range.
| [in] | x | The x coordinate of the point (cm) |
| [in] | y | The y coordinate of the point (cm) |
| [in] | z | The z coordinate of the point (cm) |
Definition at line 468 of file ShipBFieldMap.cxx.
|
inline |
Get the boolean flag to specify if we are a "copy".
Definition at line 302 of file ShipBFieldMap.h.
|
privatedelete |
|
private |
Read the field map data and store the information internally.
Definition at line 259 of file ShipBFieldMap.cxx.
|
private |
Process the ROOT file containing the field map data.
Definition at line 272 of file ShipBFieldMap.cxx.
|
private |
Process the text file containing the field map data.
Definition at line 421 of file ShipBFieldMap.cxx.
|
private |
Definition at line 479 of file ShipBFieldMap.cxx.
|
inline |
Set the first Euler rotation angle phi about the z axis.
| [in] | phi | The first Euler rotation angle about the z axis (degrees) |
Definition at line 117 of file ShipBFieldMap.h.
|
inline |
Set the third Euler rotation angle psi about the new z axis.
| [in] | psi | The third Euler rotation angle about the new z axis (degrees) |
Definition at line 131 of file ShipBFieldMap.h.
|
inline |
Set the field magnitude scaling factor.
| [in] | scale | The scaling factor for the field magnitude |
Definition at line 137 of file ShipBFieldMap.h.
|
inline |
Set the second Euler rotation angle theta about the new x axis.
| [in] | theta | The second Euler rotation angle about the new x axis (degrees) |
Definition at line 124 of file ShipBFieldMap.h.
|
inline |
Set the x global coordinate shift.
| [in] | xValue | The value of the x global coordinate shift (cm) |
Definition at line 99 of file ShipBFieldMap.h.
|
inline |
Set the y global coordinate shift.
| [in] | yValue | The value of the y global coordinate shift (cm) |
Definition at line 105 of file ShipBFieldMap.h.
|
inline |
Set the z global coordinate shift.
| [in] | zValue | The value of the z global coordinate shift (cm) |
Definition at line 111 of file ShipBFieldMap.h.
|
staticprivate |
Trilinear interpolation of one field component from its eight corner values A..H and the fractional bin distances (with their complements)
Definition at line 602 of file ShipBFieldMap.cxx.
|
inline |
Set the boolean to specify if we have quadrant symmetry.
| [in] | isSymmetric | Boolean to specify if we have quadrant symmetry |
Definition at line 143 of file ShipBFieldMap.h.
|
private |
The bin width along x.
Definition at line 411 of file ShipBFieldMap.h.
|
private |
The bin width along y.
Definition at line 423 of file ShipBFieldMap.h.
|
private |
The bin width along z.
Definition at line 435 of file ShipBFieldMap.h.
|
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.
|
private |
Initialisation boolean.
Definition at line 386 of file ShipBFieldMap.h.
|
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.
|
private |
The boolean specifying if we have quadrant symmetry.
Definition at line 462 of file ShipBFieldMap.h.
|
private |
The name of the map file.
Definition at line 383 of file ShipBFieldMap.h.
|
private |
The total number of bins.
Definition at line 402 of file ShipBFieldMap.h.
|
private |
The number of bins along x.
Definition at line 393 of file ShipBFieldMap.h.
|
private |
The number of bins along y.
Definition at line 396 of file ShipBFieldMap.h.
|
private |
The number of bins along z.
Definition at line 399 of file ShipBFieldMap.h.
|
private |
The first Euler rotation angle about the z axis.
Definition at line 450 of file ShipBFieldMap.h.
|
private |
The third Euler rotation angle about the new z axis.
Definition at line 456 of file ShipBFieldMap.h.
|
private |
The B field magnitude scaling factor.
Definition at line 459 of file ShipBFieldMap.h.
|
private |
Double converting Tesla to kiloGauss (for VMC/FairRoot B field units).
Definition at line 468 of file ShipBFieldMap.h.
|
private |
The second Euler rotation angle about the new x axis.
Definition at line 453 of file ShipBFieldMap.h.
|
private |
The combined translation and rotation transformation.
Definition at line 465 of file ShipBFieldMap.h.
|
private |
The maximum value of x for the map.
Definition at line 408 of file ShipBFieldMap.h.
|
private |
The minimum value of x for the map.
Definition at line 405 of file ShipBFieldMap.h.
|
private |
The x value of the positional offset for the map.
Definition at line 441 of file ShipBFieldMap.h.
|
private |
The coordinate range along x.
Definition at line 414 of file ShipBFieldMap.h.
|
private |
The maximum value of y for the map.
Definition at line 420 of file ShipBFieldMap.h.
|
private |
The minimum value of y for the map.
Definition at line 417 of file ShipBFieldMap.h.
|
private |
The y value of the positional offset for the map.
Definition at line 444 of file ShipBFieldMap.h.
|
private |
The coordinate range along y.
Definition at line 426 of file ShipBFieldMap.h.
|
private |
The maximum value of z for the map.
Definition at line 432 of file ShipBFieldMap.h.
|
private |
The minimum value of z for the map.
Definition at line 429 of file ShipBFieldMap.h.
|
private |
The z value of the positional offset for the map.
Definition at line 447 of file ShipBFieldMap.h.
|
private |
The coordinate range along z.
Definition at line 438 of file ShipBFieldMap.h.