SND@LHC Software
|
Class that defines a (3d) magnetic field map (distances in cm, fields in tesla) More...
#include <ShipBFieldMap.h>
Public Types | |
typedef std::vector< std::vector< Float_t > > | floatArray |
Typedef for a vector containing a vector of floats. | |
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) | |
virtual | ~ShipBFieldMap () |
Destructor. | |
virtual void | Field (const Double_t *position, Double_t *B) |
Implementation of evaluating the B field. | |
floatArray * | getFieldMap () const |
Retrieve the field map. | |
void | SetXOffset (Float_t xValue) |
Set the x global co-ordinate shift. | |
void | SetYOffset (Float_t yValue) |
Set the y global co-ordinate shift. | |
void | SetZOffset (Float_t zValue) |
Set the z global co-ordinate 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 numer 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 co-ordinate 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 co-ordinate 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 co-ordinate range for the map. | |
Float_t | GetXOffset () const |
Get the x offset co-ordinate of the map for global positioning. | |
Float_t | GetYOffset () const |
Get the y offset co-ordinate of the map for global positioning. | |
Float_t | GetZOffset () const |
Get the z offset co-ordinate 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 |
Get the second Euler rotation angle about the new x axis for global positioning. | |
Float_t | GetPsi () const |
Get the third Euler rotation angle about the new z axis for global positioning. | |
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". | |
ClassDef (ShipBFieldMap, 1) | |
ClassDef for ROOT. | |
Private Types | |
enum | CoordAxis { xAxis = 0 , yAxis , zAxis } |
Enumeration to specify the co-ordinate type. More... | |
typedef std::pair< Int_t, Float_t > | binPair |
Typedef for an int-double pair. | |
Private Member Functions | |
ShipBFieldMap (const ShipBFieldMap &rhs) | |
Copy constructor not implemented. | |
ShipBFieldMap & | operator= (const ShipBFieldMap &rhs) |
Copy assignment operator not implemented. | |
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 | 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. | |
Float_t | BInterCalc (CoordAxis theAxis) |
Private Attributes | |
floatArray * | fieldMap_ |
std::string | mapFileName_ |
The name of the map file. | |
Bool_t | initialised_ |
Initialisation boolean. | |
Bool_t | isCopy_ |
Flag to specify if we are a copy of the field map (just a change of global offsets) | |
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 co-ordinate 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 co-ordinate 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 co-ordinate 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) | |
Int_t | binA_ |
Bin A for the trilinear interpolation. | |
Int_t | binB_ |
Bin B for the trilinear interpolation. | |
Int_t | binC_ |
Bin C for the trilinear interpolation. | |
Int_t | binD_ |
Bin D for the trilinear interpolation. | |
Int_t | binE_ |
Bin E for the trilinear interpolation. | |
Int_t | binF_ |
Bin F for the trilinear interpolation. | |
Int_t | binG_ |
Bin G for the trilinear interpolation. | |
Int_t | binH_ |
Bin H for the trilinear interpolation. | |
Float_t | xFrac_ |
Fractional bin distance along x. | |
Float_t | yFrac_ |
Fractional bin distance along y. | |
Float_t | zFrac_ |
Fractional bin distance along z. | |
Float_t | xFrac1_ |
Complimentary fractional bin distance along x. | |
Float_t | yFrac1_ |
Complimentary fractional bin distance along y. | |
Float_t | zFrac1_ |
Complimentary fractional bin distance along z. | |
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 16 of file ShipBFieldMap.h.
|
private |
Typedef for an int-double pair.
Definition at line 324 of file ShipBFieldMap.h.
typedef std::vector< std::vector<Float_t> > ShipBFieldMap::floatArray |
Typedef for a vector containing a vector of floats.
Definition at line 69 of file ShipBFieldMap.h.
|
private |
Enumeration to specify the co-ordinate type.
Enumerator | |
---|---|
xAxis | |
yAxis | |
zAxis |
Definition at line 297 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.
[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 co-ordinate shift to position the field map (cm) |
[in] | yOffset | The y global co-ordinate shift to position the field map (cm) |
[in] | zOffset | The z global co-ordinate 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 15 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 co-ordinate (cm) |
[in] | newYOffset | The new global offset y co-ordinate (cm) |
[in] | newZOffset | The new global offset z co-ordinate (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 63 of file ShipBFieldMap.cxx.
|
virtual |
|
private |
Copy constructor not implemented.
|
private |
Calculate the magnetic field component using trilinear interpolation. This function uses the various "binX" integers and "uFrac" variables
[in] | theAxis | The co-ordinate axis (CoordAxis enumeration for x, y or z) |
Definition at line 486 of file ShipBFieldMap.cxx.
ShipBFieldMap::ClassDef | ( | ShipBFieldMap | , |
1 | |||
) |
ClassDef for ROOT.
|
virtual |
Implementation of evaluating the B field.
[in] | position | The x,y,z global co-ordinates of the point (cm) |
[out] | B | The x,y,z components of the magnetic field (kGauss = 0.1 tesla) |
Definition at line 103 of file ShipBFieldMap.cxx.
|
private |
Get the bin number and fractional distance from the leftmost bin edge.
[in] | x | The co-ordinate component of the point (cm) |
[in] | theAxis | The co-ordinate axis (CoordAxis enumeration for x, y or z) |
Definition at line 430 of file ShipBFieldMap.cxx.
|
inline |
Get the bin width along x for the map.
Definition at line 172 of file ShipBFieldMap.h.
|
inline |
Get the bin width along y for the map.
Definition at line 196 of file ShipBFieldMap.h.
|
inline |
Get the bin width along z for the map.
Definition at line 220 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 469 of file ShipBFieldMap.cxx.
|
inline |
Get the name of the map file.
Definition at line 130 of file ShipBFieldMap.h.
|
inline |
Get the total numer of bins.
Definition at line 154 of file ShipBFieldMap.h.
|
inline |
Get the number of bins along x.
Definition at line 136 of file ShipBFieldMap.h.
|
inline |
Get the number of bins along y.
Definition at line 142 of file ShipBFieldMap.h.
|
inline |
Get the number of bins along z.
Definition at line 148 of file ShipBFieldMap.h.
|
inline |
Get the first Euler rotation angle about the z axis for global positioning.
Definition at line 250 of file ShipBFieldMap.h.
|
inline |
Get the third Euler rotation angle about the new z axis for global positioning.
Definition at line 262 of file ShipBFieldMap.h.
|
inline |
Get the field magnitude scaling factor.
Definition at line 268 of file ShipBFieldMap.h.
|
inline |
Get the second Euler rotation angle about the new x axis for global positioning.
Definition at line 256 of file ShipBFieldMap.h.
|
inline |
Get the maximum value of x for the map.
Definition at line 166 of file ShipBFieldMap.h.
|
inline |
Get the minimum value of x for the map.
Definition at line 160 of file ShipBFieldMap.h.
|
inline |
Get the x offset co-ordinate of the map for global positioning.
Definition at line 232 of file ShipBFieldMap.h.
|
inline |
Get the x co-ordinate range for the map.
Definition at line 178 of file ShipBFieldMap.h.
|
inline |
Get the maximum value of y for the map.
Definition at line 190 of file ShipBFieldMap.h.
|
inline |
Get the minimum value of y for the map.
Definition at line 184 of file ShipBFieldMap.h.
|
inline |
Get the y offset co-ordinate of the map for global positioning.
Definition at line 238 of file ShipBFieldMap.h.
|
inline |
Get the y co-ordinate range for the map.
Definition at line 202 of file ShipBFieldMap.h.
|
inline |
Get the maximum value of z for the map.
Definition at line 214 of file ShipBFieldMap.h.
|
inline |
Get the minimum value of z for the map.
Definition at line 208 of file ShipBFieldMap.h.
|
inline |
Get the z offset co-ordinate of the map for global positioning.
Definition at line 244 of file ShipBFieldMap.h.
|
inline |
Get the z co-ordinate range for the map.
Definition at line 226 of file ShipBFieldMap.h.
|
inline |
Get the boolean flag to specify if we have quadrant symmetry.
Definition at line 274 of file ShipBFieldMap.h.
|
private |
Initialisation.
Definition at line 200 of file ShipBFieldMap.cxx.
|
private |
Check to see if a point is within the map validity range.
[in] | x | The x co-ordinate of the point (cm) |
[in] | y | The y co-ordinate of the point (cm) |
[in] | z | The z co-ordinate of the point (cm) |
Definition at line 381 of file ShipBFieldMap.cxx.
|
inline |
Get the boolean flag to specify if we are a "copy".
Definition at line 280 of file ShipBFieldMap.h.
|
private |
Copy assignment operator not implemented.
|
private |
Read the field map data and store the information internally.
Definition at line 228 of file ShipBFieldMap.cxx.
|
private |
Process the ROOT file containing the field map data.
Definition at line 247 of file ShipBFieldMap.cxx.
|
private |
Process the text file containing the field map data.
Definition at line 332 of file ShipBFieldMap.cxx.
|
private |
Definition at line 393 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 99 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 111 of file ShipBFieldMap.h.
|
inline |
Set the field magnitude scaling factor.
[in] | scale | The scaling factor for the field magnitude |
Definition at line 117 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 105 of file ShipBFieldMap.h.
|
inline |
Set the x global co-ordinate shift.
[in] | xValue | The value of the x global co-ordinate shift (cm) |
Definition at line 81 of file ShipBFieldMap.h.
|
inline |
Set the y global co-ordinate shift.
[in] | yValue | The value of the y global co-ordinate shift (cm) |
Definition at line 87 of file ShipBFieldMap.h.
|
inline |
Set the z global co-ordinate shift.
[in] | zValue | The value of the z global co-ordinate shift (cm) |
Definition at line 93 of file ShipBFieldMap.h.
|
inline |
Set the boolean to specify if we have quadrant symmetry.
[in] | isSymmetric | Boolean to specify if we have quadrant symmetry |
Definition at line 123 of file ShipBFieldMap.h.
|
private |
Bin A for the trilinear interpolation.
Definition at line 443 of file ShipBFieldMap.h.
|
private |
Bin B for the trilinear interpolation.
Definition at line 446 of file ShipBFieldMap.h.
|
private |
Bin C for the trilinear interpolation.
Definition at line 449 of file ShipBFieldMap.h.
|
private |
Bin D for the trilinear interpolation.
Definition at line 452 of file ShipBFieldMap.h.
|
private |
Bin E for the trilinear interpolation.
Definition at line 455 of file ShipBFieldMap.h.
|
private |
Bin F for the trilinear interpolation.
Definition at line 458 of file ShipBFieldMap.h.
|
private |
Bin G for the trilinear interpolation.
Definition at line 461 of file ShipBFieldMap.h.
|
private |
Bin H for the trilinear interpolation.
Definition at line 464 of file ShipBFieldMap.h.
|
private |
The bin width along x.
Definition at line 383 of file ShipBFieldMap.h.
|
private |
The bin width along y.
Definition at line 395 of file ShipBFieldMap.h.
|
private |
The bin width along z.
Definition at line 407 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 353 of file ShipBFieldMap.h.
|
private |
Initialisation boolean.
Definition at line 359 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 362 of file ShipBFieldMap.h.
|
private |
The boolean specifying if we have quadrant symmetry.
Definition at line 434 of file ShipBFieldMap.h.
|
private |
The name of the map file.
Definition at line 356 of file ShipBFieldMap.h.
|
private |
The total number of bins.
Definition at line 374 of file ShipBFieldMap.h.
|
private |
The number of bins along x.
Definition at line 365 of file ShipBFieldMap.h.
|
private |
The number of bins along y.
Definition at line 368 of file ShipBFieldMap.h.
|
private |
The number of bins along z.
Definition at line 371 of file ShipBFieldMap.h.
|
private |
The first Euler rotation angle about the z axis.
Definition at line 422 of file ShipBFieldMap.h.
|
private |
The third Euler rotation angle about the new z axis.
Definition at line 428 of file ShipBFieldMap.h.
|
private |
The B field magnitude scaling factor.
Definition at line 431 of file ShipBFieldMap.h.
|
private |
Double converting Tesla to kiloGauss (for VMC/FairRoot B field units)
Definition at line 440 of file ShipBFieldMap.h.
|
private |
The second Euler rotation angle about the new x axis.
Definition at line 425 of file ShipBFieldMap.h.
|
private |
The combined translation and rotation transformation.
Definition at line 437 of file ShipBFieldMap.h.
|
private |
Complimentary fractional bin distance along x.
Definition at line 476 of file ShipBFieldMap.h.
|
private |
Fractional bin distance along x.
Definition at line 467 of file ShipBFieldMap.h.
|
private |
The maximum value of x for the map.
Definition at line 380 of file ShipBFieldMap.h.
|
private |
The minimum value of x for the map.
Definition at line 377 of file ShipBFieldMap.h.
|
private |
The x value of the positional offset for the map.
Definition at line 413 of file ShipBFieldMap.h.
|
private |
The co-ordinate range along x.
Definition at line 386 of file ShipBFieldMap.h.
|
private |
Complimentary fractional bin distance along y.
Definition at line 479 of file ShipBFieldMap.h.
|
private |
Fractional bin distance along y.
Definition at line 470 of file ShipBFieldMap.h.
|
private |
The maximum value of y for the map.
Definition at line 392 of file ShipBFieldMap.h.
|
private |
The minimum value of y for the map.
Definition at line 389 of file ShipBFieldMap.h.
|
private |
The y value of the positional offset for the map.
Definition at line 416 of file ShipBFieldMap.h.
|
private |
The co-ordinate range along y.
Definition at line 398 of file ShipBFieldMap.h.
|
private |
Complimentary fractional bin distance along z.
Definition at line 482 of file ShipBFieldMap.h.
|
private |
Fractional bin distance along z.
Definition at line 473 of file ShipBFieldMap.h.
|
private |
The maximum value of z for the map.
Definition at line 404 of file ShipBFieldMap.h.
|
private |
The minimum value of z for the map.
Definition at line 401 of file ShipBFieldMap.h.
|
private |
The z value of the positional offset for the map.
Definition at line 419 of file ShipBFieldMap.h.
|
private |
The co-ordinate range along z.
Definition at line 410 of file ShipBFieldMap.h.