Project
Loading...
Searching...
No Matches
o2::field::MagneticField Class Reference

#include <MagneticField.h>

Inherits FairField.

Public Types

enum  PolarityConvention_t { kConvLHC , kConvDCS2008 , kConvMap2005 }
 
enum  { kOverrideGRP = BIT(14) }
 

Public Member Functions

 MagneticField ()
 Default constructor.
 
 MagneticField (const char *name, const char *title, Double_t factorSol=1., Double_t factorDip=1., MagFieldParam::BMap_t maptype=MagFieldParam::k5kG, MagFieldParam::BeamType_t btype=MagFieldParam::kBeamTypepp, Double_t benergy=-1, Int_t integ=2, Double_t fmax=15, const std::string path="$(O2_ROOT)/share/Common/maps/mfchebKGI_sym.root")
 
MagneticField & operator= (const MagneticField &src)
 
 ~MagneticField () override=default
 Default destructor.
 
void CreateField ()
 real field creation is here
 
void AllowFastField (bool v=true)
 allow fast field param
 
bool fastFieldExists () const
 
void rescaleField (float l3Cur, float diCur, bool uniform, int convention=0)
 
Double_t GetBx (Double_t x, Double_t y, Double_t z) override
 Virtual methods from FairField.
 
Double_t GetBy (Double_t x, Double_t y, Double_t z) override
 Y component, avoid using since slow.
 
Double_t GetBz (Double_t x, Double_t y, Double_t z) override
 Z component.
 
void Field (const Double_t *__restrict__ point, Double_t *__restrict__ bField) override
 
void field (const math_utils::Point3D< float > xyz, float bxyz[3])
 
void field (const math_utils::Point3D< double > xyz, double bxyz[3])
 
void field (const double *__restrict__ point, double *__restrict__ bField)
 
void field (const float *__restrict__ point, float *__restrict__ bField)
 
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 getTPCIntegral (const Double_t *xyz, Double_t *b) const
 Method to calculate the integral_0^z of br,bt,bz.
 
void getTPCRatIntegral (const Double_t *xyz, Double_t *b) const
 Method to calculate the integral_0^z of br,bt,bz.
 
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 )
 
void getTPCRatIntegralCylindrical (const Double_t *rphiz, Double_t *b) const
 
Double_t getBz (const Double_t *xyz) const
 Method to calculate the field at point xyz.
 
MagneticWrapperChebyshev * getMeasuredMap () const
 
const MagFieldFast * getFastField () const
 get fast field direct pointer
 
void setFactorSolenoid (float fc=1.)
 Sets the sign/scale of the current in the L3 according to sPolarityConvention.
 
void setFactorDipole (float fc=1.)
 Sets the sign*scale of the current in the Dipole according to sPolarityConvention.
 
Double_t getFactorSolenoid () const
 Returns the sign*scale of the current in the Dipole according to sPolarityConventionthe.
 
Double_t getFactorDipole () const
 Return the sign*scale of the current in the Dipole according to sPolarityConventionthe.
 
Double_t Factor () const
 
Double_t getCurrentSolenoid () const
 
Double_t getCurrentDipole () const
 
Bool_t IsUniform () const
 
void MachineField (const Double_t *__restrict__ x, Double_t *__restrict__ b) const
 
MagFieldParam::BMap_t getMapType () const
 
MagFieldParam::BeamType_t getBeamType () const
 
const char * getBeamTypeText () const
 Returns beam type in text form.
 
Double_t getBeamEnergy () const
 
Double_t Max () const
 
Int_t Integral () const
 
Int_t precIntegral () const
 
Double_t solenoidField () const
 
Char_t * getDataFileName () const
 
Char_t * getParameterName () const
 
void setDataFileName (const Char_t *nm)
 
void setParameterName (const Char_t *nm)
 
void Print (Option_t *opt) const override
 Prints short or long info.
 
Bool_t loadParameterization ()
 
- Public Member Functions inherited from FairField
 FairField ()
 
 FairField (const char *name, const char *title="FAIR Magnetic Field")
 
FairField & operator= (const FairField &)
 
virtual ~FairField ()
 
virtual void Init ()
 
Bool_t IsConst ()
 
Bool_t IsMap ()
 
Int_t GetType () const
 
virtual void GetFieldValue (const Double_t point[3], Double_t *bField)
 
void Field (const Double_t point[3], Double_t *B)
 

Static Public Member Functions

static MagneticField * createNominalField (int fld, bool uniform=false)
 create field from rounded value, i.e. +-5 or +-2 kGauss
 
static Int_t getPolarityConvention ()
 
static MagFieldParam::BMap_t getFieldMapScale (float &l3, float &dip, bool uniform, int convention=0)
 
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"))
 

Protected Member Functions

void initializeMachineField (MagFieldParam::BeamType_t btype, Double_t benergy)
 
void setBeamType (MagFieldParam::BeamType_t type)
 
void setBeamEnergy (float energy)
 
void checkOriginBias ()
 

Additional Inherited Members

- Protected Attributes inherited from FairField
Int_t fType
 

Detailed Description

Interface between the TVirtualMagField and MagneticWrapperChebyshev: wrapper to the set of magnetic field data + Tosca parametrization by Chebyshev polynomials

Definition at line 44 of file MagneticField.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
kOverrideGRP 

Definition at line 51 of file MagneticField.h.

◆ PolarityConvention_t

Enumerator
kConvLHC 
kConvDCS2008 
kConvMap2005 

Definition at line 48 of file MagneticField.h.

Constructor & Destructor Documentation

◆ MagneticField() [1/2]

MagneticField::MagneticField ( )

Default constructor.

Definition at line 66 of file MagneticField.cxx.

◆ MagneticField() [2/2]

MagneticField::MagneticField ( const char *  name,
const char *  title,
Double_t  factorSol = 1.,
Double_t  factorDip = 1.,
MagFieldParam::BMap_t  maptype = MagFieldParam::k5kG,
MagFieldParam::BeamType_t  btype = MagFieldParam::kBeamTypepp,
Double_t  benergy = -1,
Int_t  integ = 2,
Double_t  fmax = 15,
const std::string  path = "$(O2_ROOT)/share/Common/maps/mfchebKGI_sym.root" 
)

Initialize the field with Geant integration option "integ" and max field "fmax", Impose scaling of parameterized L3 field by factorSol and of dipole by factorDip. The "be" is the energy of the beam in GeV/nucleon

Definition at line 96 of file MagneticField.cxx.

◆ ~MagneticField()

o2::field::MagneticField::~MagneticField ( )
overridedefault

Default destructor.

Member Function Documentation

◆ AllowFastField()

void MagneticField::AllowFastField ( bool  v = true)

allow fast field param

Definition at line 692 of file MagneticField.cxx.

◆ checkOriginBias()

void MagneticField::checkOriginBias ( )
protected

Definition at line 704 of file MagneticField.cxx.

◆ CreateField()

void MagneticField::CreateField ( )

real field creation is here

Definition at line 160 of file MagneticField.cxx.

◆ createFieldMap()

MagneticField * 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") 
)
static

The magnetic field map, defined externally... L3 current 30000 A -> 0.5 T L3 current 12000 A -> 0.2 T dipole current 6000 A The polarities must match the convention (LHC or DCS2008) unless the special uniform map was used for MC

Definition at line 618 of file MagneticField.cxx.

◆ createNominalField()

MagneticField * MagneticField::createNominalField ( int  fld,
bool  uniform = false 
)
static

create field from rounded value, i.e. +-5 or +-2 kGauss

Definition at line 131 of file MagneticField.cxx.

◆ Factor()

Double_t o2::field::MagneticField::Factor ( ) const
inline

Definition at line 181 of file MagneticField.h.

◆ fastFieldExists()

bool o2::field::MagneticField::fastFieldExists ( ) const
inline

Definition at line 78 of file MagneticField.h.

◆ field() [1/4]

void o2::field::MagneticField::field ( const double *__restrict__  point,
double *__restrict__  bField 
)
inline

Definition at line 129 of file MagneticField.h.

◆ Field()

void MagneticField::Field ( const Double_t *__restrict__  point,
Double_t *__restrict__  bField 
)
override

Method to calculate the field at point xyz Main interface from TVirtualMagField used in simulation

Definition at line 245 of file MagneticField.cxx.

◆ field() [2/4]

void o2::field::MagneticField::field ( const float *__restrict__  point,
float *__restrict__  bField 
)
inline

Definition at line 134 of file MagneticField.h.

◆ field() [3/4]

void o2::field::MagneticField::field ( const math_utils::Point3D< double >  xyz,
double  bxyz[3] 
)
inline

Definition at line 123 of file MagneticField.h.

◆ field() [4/4]

void o2::field::MagneticField::field ( const math_utils::Point3D< float >  xyz,
float  bxyz[3] 
)
inline

Definition at line 114 of file MagneticField.h.

◆ getBeamEnergy()

Double_t o2::field::MagneticField::getBeamEnergy ( ) const
inline

Definition at line 201 of file MagneticField.h.

◆ getBeamType()

MagFieldParam::BeamType_t o2::field::MagneticField::getBeamType ( ) const
inline

Definition at line 196 of file MagneticField.h.

◆ getBeamTypeText()

const char * MagneticField::getBeamTypeText ( ) const

Returns beam type in text form.

Definition at line 653 of file MagneticField.cxx.

◆ GetBx()

Double_t o2::field::MagneticField::GetBx ( Double_t  x,
Double_t  y,
Double_t  z 
)
inlineoverridevirtual

Virtual methods from FairField.

X component, avoid using since slow

Reimplemented from FairField.

Definition at line 88 of file MagneticField.h.

◆ GetBxyz()

void o2::field::MagneticField::GetBxyz ( const Double_t  p[3],
Double_t *  b 
)
inlineoverridevirtual

3d field query alias for Alias Method to calculate the field at point xyz

Reimplemented from FairField.

Definition at line 144 of file MagneticField.h.

◆ GetBy()

Double_t o2::field::MagneticField::GetBy ( Double_t  x,
Double_t  y,
Double_t  z 
)
inlineoverridevirtual

Y component, avoid using since slow.

Reimplemented from FairField.

Definition at line 96 of file MagneticField.h.

◆ getBz()

Double_t MagneticField::getBz ( const Double_t *  xyz) const

Method to calculate the field at point xyz.

Definition at line 272 of file MagneticField.cxx.

◆ GetBz()

Double_t o2::field::MagneticField::GetBz ( Double_t  x,
Double_t  y,
Double_t  z 
)
inlineoverridevirtual

Z component.

Reimplemented from FairField.

Definition at line 104 of file MagneticField.h.

◆ getCurrentDipole()

Double_t o2::field::MagneticField::getCurrentDipole ( ) const
inline

Definition at line 188 of file MagneticField.h.

◆ getCurrentSolenoid()

Double_t o2::field::MagneticField::getCurrentSolenoid ( ) const
inline

Definition at line 183 of file MagneticField.h.

◆ getDataFileName()

Char_t * o2::field::MagneticField::getDataFileName ( ) const
inline

Definition at line 211 of file MagneticField.h.

◆ getFactorDipole()

Double_t MagneticField::getFactorDipole ( ) const

Return the sign*scale of the current in the Dipole according to sPolarityConventionthe.

Definition at line 507 of file MagneticField.cxx.

◆ getFactorSolenoid()

Double_t MagneticField::getFactorSolenoid ( ) const

Returns the sign*scale of the current in the Dipole according to sPolarityConventionthe.

Definition at line 495 of file MagneticField.cxx.

◆ getFastField()

const MagFieldFast * o2::field::MagneticField::getFastField ( ) const
inline

get fast field direct pointer

Definition at line 165 of file MagneticField.h.

◆ getFieldMapScale()

MagFieldParam::BMap_t MagneticField::getFieldMapScale ( float &  l3,
float &  dip,
bool  uniform,
int  convention = 0 
)
static

Definition at line 532 of file MagneticField.cxx.

◆ getMapType()

MagFieldParam::BMap_t o2::field::MagneticField::getMapType ( ) const
inline

Definition at line 194 of file MagneticField.h.

◆ getMeasuredMap()

MagneticWrapperChebyshev * o2::field::MagneticField::getMeasuredMap ( ) const
inline

Definition at line 162 of file MagneticField.h.

◆ getParameterName()

Char_t * o2::field::MagneticField::getParameterName ( ) const
inline

Definition at line 213 of file MagneticField.h.

◆ getPolarityConvention()

static Int_t o2::field::MagneticField::getPolarityConvention ( )
inlinestatic

Definition at line 224 of file MagneticField.h.

◆ getTPCIntegral()

void MagneticField::getTPCIntegral ( const Double_t *  xyz,
Double_t *  b 
) const

Method to calculate the integral_0^z of br,bt,bz.

Definition at line 422 of file MagneticField.cxx.

◆ getTPCIntegralCylindrical()

void MagneticField::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 )

Definition at line 442 of file MagneticField.cxx.

◆ getTPCRatIntegral()

void MagneticField::getTPCRatIntegral ( const Double_t *  xyz,
Double_t *  b 
) const

Method to calculate the integral_0^z of br,bt,bz.

Definition at line 433 of file MagneticField.cxx.

◆ getTPCRatIntegralCylindrical()

void MagneticField::getTPCRatIntegralCylindrical ( const Double_t *  rphiz,
Double_t *  b 
) const

Method to calculate the integral_0^z of bx/bz,by/bz and (bx/bz)^2+(by/bz)^2 in cylindrical coordinates ( -pi<phi<pi convention )

Definition at line 453 of file MagneticField.cxx.

◆ initializeMachineField()

void MagneticField::initializeMachineField ( MagFieldParam::BeamType_t  btype,
Double_t  benergy 
)
protected

Definition at line 319 of file MagneticField.cxx.

◆ Integral()

Int_t o2::field::MagneticField::Integral ( ) const
inline

Definition at line 205 of file MagneticField.h.

◆ IsUniform()

Bool_t o2::field::MagneticField::IsUniform ( ) const
inline

Definition at line 190 of file MagneticField.h.

◆ loadParameterization()

Bool_t MagneticField::loadParameterization ( )

Definition at line 217 of file MagneticField.cxx.

◆ MachineField()

void MagneticField::MachineField ( const Double_t *__restrict__  x,
Double_t *__restrict__  b 
) const

Definition at line 344 of file MagneticField.cxx.

◆ Max()

Double_t o2::field::MagneticField::Max ( ) const
inline

Definition at line 203 of file MagneticField.h.

◆ operator=()

MagneticField & MagneticField::operator= ( const MagneticField &  src)

Definition at line 293 of file MagneticField.cxx.

◆ precIntegral()

Int_t o2::field::MagneticField::precIntegral ( ) const
inline

Definition at line 207 of file MagneticField.h.

◆ Print()

void MagneticField::Print ( Option_t *  opt) const
overridevirtual

Prints short or long info.

Reimplemented from FairField.

Definition at line 675 of file MagneticField.cxx.

◆ rescaleField()

void MagneticField::rescaleField ( float  l3Cur,
float  diCur,
bool  uniform,
int  convention = 0 
)

Definition at line 519 of file MagneticField.cxx.

◆ setBeamEnergy()

void o2::field::MagneticField::setBeamEnergy ( float  energy)
inlineprotected

Definition at line 245 of file MagneticField.h.

◆ setBeamType()

void o2::field::MagneticField::setBeamType ( MagFieldParam::BeamType_t  type)
inlineprotected

Definition at line 243 of file MagneticField.h.

◆ setDataFileName()

void o2::field::MagneticField::setDataFileName ( const Char_t *  nm)
inline

Definition at line 215 of file MagneticField.h.

◆ setFactorDipole()

void MagneticField::setFactorDipole ( float  fc = 1.)

Sets the sign*scale of the current in the Dipole according to sPolarityConvention.

Definition at line 480 of file MagneticField.cxx.

◆ setFactorSolenoid()

void MagneticField::setFactorSolenoid ( float  fc = 1.)

Sets the sign/scale of the current in the L3 according to sPolarityConvention.

Definition at line 462 of file MagneticField.cxx.

◆ setParameterName()

void o2::field::MagneticField::setParameterName ( const Char_t *  nm)
inline

Definition at line 217 of file MagneticField.h.

◆ solenoidField()

Double_t o2::field::MagneticField::solenoidField ( ) const
inline

Definition at line 209 of file MagneticField.h.


The documentation for this class was generated from the following files: