16#ifndef ALICEO2_FIELD_MAGNETICFIELD_H_
17#define ALICEO2_FIELD_MAGNETICFIELD_H_
34class MagneticWrapperChebyshev;
35class FieldOriginBiasParam;
61 MagneticField(
const char*
name,
const char* title, Double_t factorSol = 1., Double_t factorDip = 1.,
64 Double_t fmax = 15,
const std::string
path =
"$(O2_ROOT)/share/Common/maps/mfchebKGI_sym.root");
87 void rescaleField(
float l3Cur,
float diCur,
bool uniform,
int convention = 0);
92 Double_t
GetBx(Double_t
x, Double_t
y, Double_t
z)
override
94 double xyz[3] = {
x,
y,
z},
b[3];
100 Double_t
GetBy(Double_t
x, Double_t
y, Double_t
z)
override
102 double xyz[3] = {
x,
y,
z},
b[3];
108 Double_t
GetBz(Double_t
x, Double_t
y, Double_t
z)
override
110 double xyz[3] = {
x,
y,
z};
116 void Field(
const Double_t* __restrict__ point, Double_t* __restrict__ bField)
override;
120 double xyzd[3] = {xyz.X(), xyz.Y(), xyz.Z()}, bxyzd[3] = {0};
129 double xyzd[3] = {xyz.X(), xyz.Y(), xyz.Z()};
133 void field(
const double* __restrict__ point,
double* __restrict__ bField)
135 Field(point, bField);
138 void field(
const float* __restrict__ point,
float* __restrict__ bField)
140 double xyz[3] = {point[0], point[1], point[2]}, bxyz[3] = {0};
167 Double_t
getBz(
const Double_t* xyz)
const;
199 void MachineField(
const Double_t* __restrict__
x, Double_t* __restrict__
b)
const;
210 Double_t
Max()
const {
return mMaxField; }
212 Int_t
Integral()
const {
return mDefaultIntegration; }
227 void Print(Option_t* opt)
const override;
242 Bool_t uniform = kFALSE,
float beamenergy = 7000,
const Char_t* btype =
"pp",
243 const std::string
path = std::string(gSystem->Getenv(
"VMCWORKDIR")) +
244 std::string(
"/Common/maps/mfchebKGI_sym.root"));
256 std::unique_ptr<MagneticWrapperChebyshev> mMeasuredMap;
257 std::unique_ptr<MagFieldFast> mFastField;
261 Double_t mBeamEnergy;
263 Int_t mDefaultIntegration;
264 Int_t mPrecisionInteg;
265 Double_t mMultipicativeFactorSolenoid;
266 Double_t mMultipicativeFactorDipole;
268 Bool_t mDipoleOnOffFlag;
270 Double_t mQuadrupoleGradient;
271 Double_t mDipoleField;
272 Double_t mCompensatorField2C;
273 Double_t mCompensatorField1A;
274 Double_t mCompensatorField2A;
276 TNamed mParameterNames;
280 static const Double_t sSolenoidToDipoleZ;
281 static const UShort_t sPolarityConvention;
Definition of the fast magnetic field parametrization MagFieldFast.
Definition of the MagFieldParam: container for ALICE mag. field parameters.
void setBeamType(MagFieldParam::BeamType_t type)
const MagFieldFast * getFastField() const
get fast field direct pointer
static MagFieldParam::BMap_t getFieldMapScale(float &l3, float &dip, bool uniform, int convention=0)
Double_t getBz(const Double_t *xyz) const
Method to calculate the field at point xyz.
Double_t getFactorDipole() const
Return the sign*scale of the current in the Dipole according to sPolarityConventionthe.
Double_t GetBz(Double_t x, Double_t y, Double_t z) override
Z component.
Double_t GetBx(Double_t x, Double_t y, Double_t z) override
Virtual methods from FairField.
void getTPCRatIntegralCylindrical(const Double_t *rphiz, Double_t *b) const
void field(const math_utils::Point3D< double > xyz, double bxyz[3])
void MachineField(const Double_t *__restrict__ x, Double_t *__restrict__ b) const
const char * getBeamTypeText() const
Returns beam type in text form.
Bool_t loadParameterization()
void field(const math_utils::Point3D< float > xyz, float bxyz[3])
void getTPCRatIntegral(const Double_t *xyz, Double_t *b) const
Method to calculate the integral_0^z of br,bt,bz.
void rescaleField(float l3Cur, float diCur, bool uniform, int convention=0)
void getTPCIntegralCylindrical(const Double_t *rphiz, Double_t *b) const
Method to calculate the integral_0^z of br,bt,bz in cylindrical coordinates ( -pi<phi<pi convention )
Char_t * getDataFileName() const
void setDataFileName(const Char_t *nm)
static MagneticField * createFieldMap(float l3Current=-30000., float diCurrent=-6000., Int_t convention=0, Bool_t uniform=kFALSE, float beamenergy=7000, const Char_t *btype="pp", const std::string path=std::string(gSystem->Getenv("VMCWORKDIR"))+std::string("/Common/maps/mfchebKGI_sym.root"))
void setFactorDipole(float fc=1.)
Sets the sign*scale of the current in the Dipole according to sPolarityConvention.
MagneticField & operator=(const MagneticField &src)
void AllowFastField(bool v=true)
allow fast field param
Double_t GetBy(Double_t x, Double_t y, Double_t z) override
Y component, avoid using since slow.
Double_t getBeamEnergy() const
void setBeamEnergy(float energy)
Double_t getCurrentDipole() const
void field(const float *__restrict__ point, float *__restrict__ bField)
bool fastFieldExists() const
Int_t precIntegral() const
void FillParContainer() override
Fill Paramater.
Double_t getFactorSolenoid() const
Returns the sign*scale of the current in the Dipole according to sPolarityConventionthe.
Double_t getCurrentSolenoid() const
static Int_t getPolarityConvention()
void Field(const Double_t *__restrict__ point, Double_t *__restrict__ bField) override
MagFieldParam::BeamType_t getBeamType() const
MagFieldParam::BMap_t getMapType() const
void getTPCIntegral(const Double_t *xyz, Double_t *b) const
Method to calculate the integral_0^z of br,bt,bz.
void setParameterName(const Char_t *nm)
~MagneticField() override=default
Default destructor.
void Print(Option_t *opt) const override
Prints short or long info.
Char_t * getParameterName() const
MagneticField()
Default constructor.
void GetBxyz(const Double_t p[3], Double_t *b) override
3d field query alias for Alias Method to calculate the field at point xyz
void setFactorSolenoid(float fc=1.)
Sets the sign/scale of the current in the L3 according to sPolarityConvention.
void field(const double *__restrict__ point, double *__restrict__ bField)
MagneticWrapperChebyshev * getMeasuredMap() const
void CreateField()
real field creation is here
static MagneticField * createNominalField(int fld, bool uniform=false)
create field from rounded value, i.e. +-5 or +-2 kGauss
Double_t solenoidField() const
void initializeMachineField(MagFieldParam::BeamType_t btype, Double_t benergy)
GLuint const GLchar * name
GLboolean GLboolean GLboolean b
GLint GLint GLsizei GLint GLenum GLenum type
GLsizei const GLchar *const * path
GLdouble GLdouble GLdouble z
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...