16#ifndef ALICEO2_FIELD_MAGNETICFIELD_H_
17#define ALICEO2_FIELD_MAGNETICFIELD_H_
34class MagneticWrapperChebyshev;
60 MagneticField(
const char*
name,
const char* title, Double_t factorSol = 1., Double_t factorDip = 1.,
63 Double_t fmax = 15,
const std::string
path =
"$(O2_ROOT)/share/Common/maps/mfchebKGI_sym.root");
86 void rescaleField(
float l3Cur,
float diCur,
bool uniform,
int convention = 0);
91 Double_t
GetBx(Double_t
x, Double_t
y, Double_t
z)
override
93 double xyz[3] = {
x,
y,
z},
b[3];
99 Double_t
GetBy(Double_t
x, Double_t
y, Double_t
z)
override
101 double xyz[3] = {
x,
y,
z},
b[3];
107 Double_t
GetBz(Double_t
x, Double_t
y, Double_t
z)
override
109 double xyz[3] = {
x,
y,
z};
115 void Field(
const Double_t* __restrict__ point, Double_t* __restrict__ bField)
override;
119 double xyzd[3] = {xyz.X(), xyz.Y(), xyz.Z()}, bxyzd[3] = {0};
128 double xyzd[3] = {xyz.X(), xyz.Y(), xyz.Z()};
132 void field(
const double* __restrict__ point,
double* __restrict__ bField)
134 Field(point, bField);
137 void field(
const float* __restrict__ point,
float* __restrict__ bField)
139 double xyz[3] = {point[0], point[1], point[2]}, bxyz[3] = {0};
166 Double_t
getBz(
const Double_t* xyz)
const;
198 void MachineField(
const Double_t* __restrict__
x, Double_t* __restrict__
b)
const;
209 Double_t
Max()
const {
return mMaxField; }
211 Int_t
Integral()
const {
return mDefaultIntegration; }
226 void Print(Option_t* opt)
const override;
241 Bool_t uniform = kFALSE,
float beamenergy = 7000,
const Char_t* btype =
"pp",
242 const std::string
path = std::string(gSystem->Getenv(
"VMCWORKDIR")) +
243 std::string(
"/Common/maps/mfchebKGI_sym.root"));
254 std::unique_ptr<MagneticWrapperChebyshev> mMeasuredMap;
255 std::unique_ptr<MagFieldFast> mFastField;
259 Double_t mBeamEnergy;
261 Int_t mDefaultIntegration;
262 Int_t mPrecisionInteg;
263 Double_t mMultipicativeFactorSolenoid;
264 Double_t mMultipicativeFactorDipole;
266 Bool_t mDipoleOnOffFlag;
268 Double_t mQuadrupoleGradient;
269 Double_t mDipoleField;
270 Double_t mCompensatorField2C;
271 Double_t mCompensatorField1A;
272 Double_t mCompensatorField2A;
274 TNamed mParameterNames;
276 static const Double_t sSolenoidToDipoleZ;
277 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 ...