10#include "TVirtualMagField.h"
34 ShipBFieldMap(
const std::string& label,
const std::string& mapFileName,
35 Float_t xOffset = 0.0, Float_t yOffset = 0.0, Float_t zOffset = 0.0,
36 Float_t phi = 0.0, Float_t theta = 0.0, Float_t psi = 0.0,
37 Float_t scale = 1.0, Bool_t isSymmetric = kFALSE);
54 Float_t newXOffset, Float_t newYOffset, Float_t newZOffset,
55 Float_t newPhi = 0.0, Float_t newTheta = 0.0, Float_t newPsi = 0.0,
56 Float_t newScale = 1.0);
66 virtual void Field(
const Double_t* position, Double_t* B);
321 Bool_t
insideRange(Float_t x, Float_t y, Float_t z);
341 Int_t
getMapBin(Int_t iX, Int_t iY, Int_t iZ);
Class that defines a (3d) magnetic field map (distances in cm, fields in tesla)
Float_t zFrac_
Fractional bin distance along z.
Float_t xMax_
The maximum value of x for the map.
void SetZOffset(Float_t zValue)
Set the z global co-ordinate shift.
void SetScale(Float_t scale)
Set the field magnitude scaling factor.
ShipBFieldMap & operator=(const ShipBFieldMap &rhs)
Copy assignment operator not implemented.
Int_t binD_
Bin D for the trilinear interpolation.
Float_t GetZMin() const
Get the minimum value of z for the map.
Float_t dy_
The bin width along y.
Float_t GetXMax() const
Get the maximum value of x for the map.
Float_t psi_
The third Euler rotation angle about the new z axis.
Int_t GetNBins() const
Get the total numer of bins.
Float_t dz_
The bin width along z.
Float_t zRange_
The co-ordinate range along z.
std::pair< Int_t, Float_t > binPair
Typedef for an int-double pair.
std::vector< std::vector< Float_t > > floatArray
Typedef for a vector containing a vector of floats.
Bool_t HasSymmetry() const
Get the boolean flag to specify if we have quadrant symmetry.
Float_t GetYOffset() const
Get the y offset co-ordinate of the map for global positioning.
Float_t zFrac1_
Complimentary fractional bin distance along z.
Int_t binE_
Bin E for the trilinear interpolation.
Float_t BInterCalc(CoordAxis theAxis)
Int_t Nz_
The number of bins along z.
Float_t Tesla_
Double converting Tesla to kiloGauss (for VMC/FairRoot B field units)
Float_t GetXRange() const
Get the x co-ordinate range for the map.
Int_t N_
The total number of bins.
Float_t GetTheta() const
Get the second Euler rotation angle about the new x axis for global positioning.
Float_t yFrac1_
Complimentary fractional bin distance along y.
Float_t xFrac_
Fractional bin distance along x.
Int_t GetNy() const
Get the number of bins along y.
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.
void SetPhi(Float_t phi)
Set the first Euler rotation angle phi about the z axis.
Int_t Ny_
The number of bins along y.
Float_t GetdX() const
Get the bin width along x for the map.
std::string GetMapFileName() const
Get the name of the map file.
Float_t theta_
The second Euler rotation angle about the new x axis.
Float_t yFrac_
Fractional bin distance along y.
Bool_t isCopy_
Flag to specify if we are a copy of the field map (just a change of global offsets)
Int_t binC_
Bin C for the trilinear interpolation.
Bool_t IsACopy() const
Get the boolean flag to specify if we are a "copy".
virtual void Field(const Double_t *position, Double_t *B)
Implementation of evaluating the B field.
Int_t binG_
Bin G for the trilinear interpolation.
Int_t binH_
Bin H for the trilinear interpolation.
Float_t xMin_
The minimum value of x for the map.
void initialise()
Initialisation.
void SetYOffset(Float_t yValue)
Set the y global co-ordinate shift.
Int_t GetNz() const
Get the number of bins along z.
Int_t binB_
Bin B for the trilinear interpolation.
Int_t binF_
Bin F for the trilinear interpolation.
CoordAxis
Enumeration to specify the co-ordinate type.
void SetXOffset(Float_t xValue)
Set the x global co-ordinate shift.
Float_t GetYRange() const
Get the y co-ordinate range for the map.
Float_t GetScale() const
Get the field magnitude scaling factor.
void SetPsi(Float_t psi)
Set the third Euler rotation angle psi about the new z axis.
floatArray * getFieldMap() const
Retrieve the field map.
void UseSymmetry(Bool_t flag)
Set the boolean to specify if we have quadrant symmetry.
Float_t GetPsi() const
Get the third Euler rotation angle about the new z axis for global positioning.
ClassDef(ShipBFieldMap, 1)
ClassDef for ROOT.
Int_t Nx_
The number of bins along x.
Float_t GetdY() const
Get the bin width along y for the map.
Float_t xRange_
The co-ordinate range along x.
Float_t yOffset_
The y value of the positional offset for the map.
void readTextFile()
Process the text file containing the field map data.
Float_t scale_
The B field magnitude scaling factor.
TGeoMatrix * theTrans_
The combined translation and rotation transformation.
binPair getBinInfo(Float_t x, CoordAxis theAxis)
Get the bin number and fractional distance from the leftmost bin edge.
Float_t GetPhi() const
Get the first Euler rotation angle about the z axis for global positioning.
Bool_t insideRange(Float_t x, Float_t y, Float_t z)
Check to see if a point is within the map validity range.
void SetTheta(Float_t theta)
Set the second Euler rotation angle theta about the new x axis.
virtual ~ShipBFieldMap()
Destructor.
void readRootFile()
Process the ROOT file containing the field map data.
Float_t GetdZ() const
Get the bin width along z for the map.
Float_t xFrac1_
Complimentary fractional bin distance along x.
Int_t binA_
Bin A for the trilinear interpolation.
void readMapFile()
Read the field map data and store the information internally.
Float_t GetXOffset() const
Get the x offset co-ordinate of the map for global positioning.
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 yMax_
The maximum value of y for the map.
Float_t yRange_
The co-ordinate 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 GetZMax() const
Get the maximum value of z for the map.
Float_t GetYMax() const
Get the maximum value of y for the map.
Float_t zMin_
The minimum value of z for the map.
Float_t GetYMin() const
Get the minimum value of y for the map.
Float_t dx_
The bin width along x.
ShipBFieldMap(const ShipBFieldMap &rhs)
Copy constructor not implemented.
Float_t GetXMin() const
Get the minimum value of x for the map.
Bool_t isSymmetric_
The boolean specifying if we have quadrant symmetry.
Int_t GetNx() const
Get the number of bins along x.
Float_t xOffset_
The x value of the positional offset for the map.
Float_t GetZRange() const
Get the z co-ordinate range for the map.
Float_t GetZOffset() const
Get the z offset co-ordinate of the map for global positioning.