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 (const MagFieldParam &param)
 
MagneticFieldoperator= (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 FillParContainer () override
 Fill Paramater.
 
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.
 
MagneticWrapperChebyshevgetMeasuredMap () const
 
const MagFieldFastgetFastField () 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 chargetBeamTypeText () 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 ()
 

Static Public Member Functions

static MagneticFieldcreateNominalField (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 MagneticFieldcreateFieldMap (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)
 

Detailed Description

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

Definition at line 45 of file MagneticField.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
kOverrideGRP 

Definition at line 52 of file MagneticField.h.

◆ PolarityConvention_t

Enumerator
kConvLHC 
kConvDCS2008 
kConvMap2005 

Definition at line 49 of file MagneticField.h.

Constructor & Destructor Documentation

◆ MagneticField() [1/3]

MagneticField::MagneticField ( )

Default constructor.

Definition at line 65 of file MagneticField.cxx.

◆ MagneticField() [2/3]

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 92 of file MagneticField.cxx.

◆ MagneticField() [3/3]

MagneticField::MagneticField ( const MagFieldParam param)

Definition at line 123 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 719 of file MagneticField.cxx.

◆ CreateField()

void MagneticField::CreateField ( )

real field creation is here

Definition at line 181 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 635 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 152 of file MagneticField.cxx.

◆ Factor()

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

Definition at line 187 of file MagneticField.h.

◆ fastFieldExists()

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

Definition at line 81 of file MagneticField.h.

◆ field() [1/4]

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

Definition at line 132 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 262 of file MagneticField.cxx.

◆ field() [2/4]

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

Definition at line 137 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 126 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 117 of file MagneticField.h.

◆ FillParContainer()

void MagneticField::FillParContainer ( )
override

Fill Paramater.

Definition at line 708 of file MagneticField.cxx.

◆ getBeamEnergy()

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

Definition at line 207 of file MagneticField.h.

◆ getBeamType()

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

Definition at line 202 of file MagneticField.h.

◆ getBeamTypeText()

const char * MagneticField::getBeamTypeText ( ) const

Returns beam type in text form.

Definition at line 670 of file MagneticField.cxx.

◆ GetBx()

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

Virtual methods from FairField.

X component, avoid using since slow

Definition at line 91 of file MagneticField.h.

◆ GetBxyz()

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

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

Definition at line 147 of file MagneticField.h.

◆ GetBy()

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

Y component, avoid using since slow.

Definition at line 99 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 289 of file MagneticField.cxx.

◆ GetBz()

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

Z component.

Definition at line 107 of file MagneticField.h.

◆ getCurrentDipole()

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

Definition at line 194 of file MagneticField.h.

◆ getCurrentSolenoid()

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

Definition at line 189 of file MagneticField.h.

◆ getDataFileName()

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

Definition at line 217 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 524 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 512 of file MagneticField.cxx.

◆ getFastField()

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

get fast field direct pointer

Definition at line 171 of file MagneticField.h.

◆ getFieldMapScale()

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

Definition at line 549 of file MagneticField.cxx.

◆ getMapType()

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

Definition at line 200 of file MagneticField.h.

◆ getMeasuredMap()

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

Definition at line 168 of file MagneticField.h.

◆ getParameterName()

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

Definition at line 219 of file MagneticField.h.

◆ getPolarityConvention()

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

Definition at line 230 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 439 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 459 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 450 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 470 of file MagneticField.cxx.

◆ initializeMachineField()

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

Definition at line 336 of file MagneticField.cxx.

◆ Integral()

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

Definition at line 211 of file MagneticField.h.

◆ IsUniform()

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

Definition at line 196 of file MagneticField.h.

◆ loadParameterization()

Bool_t MagneticField::loadParameterization ( )

Definition at line 235 of file MagneticField.cxx.

◆ MachineField()

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

Definition at line 361 of file MagneticField.cxx.

◆ Max()

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

Definition at line 209 of file MagneticField.h.

◆ operator=()

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

Definition at line 310 of file MagneticField.cxx.

◆ precIntegral()

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

Definition at line 213 of file MagneticField.h.

◆ Print()

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

Prints short or long info.

Definition at line 692 of file MagneticField.cxx.

◆ rescaleField()

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

Definition at line 536 of file MagneticField.cxx.

◆ setBeamEnergy()

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

Definition at line 251 of file MagneticField.h.

◆ setBeamType()

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

Definition at line 249 of file MagneticField.h.

◆ setDataFileName()

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

Definition at line 221 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 497 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 479 of file MagneticField.cxx.

◆ setParameterName()

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

Definition at line 223 of file MagneticField.h.

◆ solenoidField()

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

Definition at line 215 of file MagneticField.h.


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