ATLAS Offline Software
Public Member Functions | Protected Attributes | Private Attributes | List of all members
BFieldMesh< T > Class Template Reference

#include <BFieldMesh.h>

Collaboration diagram for BFieldMesh< T >:

Public Member Functions

 BFieldMesh ()=default
 
 BFieldMesh (const BFieldMesh &)=default
 
 BFieldMesh (BFieldMesh &&)=default
 
BFieldMeshoperator= (const BFieldMesh &)=default
 
BFieldMeshoperator= (BFieldMesh &&)=default
 
 ~BFieldMesh ()=default
 
 BFieldMesh (double zmin, double zmax, double rmin, double rmax, double phimin, double phimax, double bscale)
 constructor with mesh dimensions and scale More...
 
void setRange (double zmin, double zmax, double rmin, double rmax, double phimin, double phimax)
 set mesh range/dimensions More...
 
void setBscale (double bscale)
 set B scale More...
 
void scaleBscale (double factor)
 scale B scale by a factor More...
 
void reserve (int nz, int nr, int nphi, int nfield)
 allocate space to vectors More...
 
void reserve (int nz, int nr, int nphi)
 allocate space to vectors More...
 
void appendMesh (int axis, double value)
 add a position for a cell corner for an axis
More...
 
void appendField (const BFieldVector< T > &field)
 append a filed vector
More...
 
void buildLUT ()
 build Look Up Table More...
 
bool inside (double z, double r, double phi) const
 
void getCache (double z, double r, double phi, BFieldCache &cache, double scaleFactor=1.0) const
 
void getB (const double *ATH_RESTRICT xyz, double *ATH_RESTRICT B, double *ATH_RESTRICT deriv=nullptr) const
 get the bfield given a point in xyz More...
 
double min (size_t axis) const
 minimum for a particular axis = 0 (z), 1 (r), 2 (phi) More...
 
double max (size_t axis) const
 maximum or a particular axis = 0 (z), 1 (r), 2 (phi) More...
 
double zmin () const
 minimum in z More...
 
double zmax () const
 maximum in z More...
 
double rmin () const
 minimun in r More...
 
double rmax () const
 maximum in r More...
 
double phimin () const
 minimun in phi More...
 
double phimax () const
 maximum in phi More...
 
unsigned nmesh (size_t axis) const
 number of cells along each axis = 0 (z), 1 (r), 2 (phi) More...
 
double mesh (size_t axis, size_t index) const
 coordinate along axis (0 (z), 1 (r), 2 (phi)) of the cell at index (0 to nmesh-1) More...
 
unsigned nfield () const
 field entries in mesh More...
 
const BFieldVector< T > & field (size_t index) const
 field vector at cell corner at index More...
 
double bscale () const
 scale More...
 
int memSize () const
 memory size More...
 

Protected Attributes

std::array< double, 3 > m_min
 
std::array< double, 3 > m_max
 
std::array< std::vector< double >, 3 > m_mesh
 

Private Attributes

std::vector< BFieldVector< T > > m_field
 
double m_scale = 1.0
 
double m_nomScale
 
std::array< std::vector< int >, 3 > m_LUT
 
std::array< double, 3 > m_invUnit = {0, 0, 0}
 
int m_roff = 0
 
int m_zoff = 0
 

Detailed Description

template<class T>
class BFieldMesh< T >

A 3-d mesh (axes z,r,phi) representing a simple field map.

The mesh is made up from 'cells' We hold numz, numr , numphi positions defining the corners of the cells.

Then we have numz X numr X numphi field values at these corners

The field type is templated simalar to BFieldVector

It is short for both solenoid and toroid for the nominal case. There is a special case for BFieldSolenoid (not used in the nominal case) which allows a tilt between the nominal and 'tilted' solenoid fields and uses double.

Author
Masahiro Morii, Harvard University
RD Schaffer , Christos Anastopoulos (Athena MT)

Definition at line 42 of file BFieldMesh.h.

Constructor & Destructor Documentation

◆ BFieldMesh() [1/4]

template<class T >
BFieldMesh< T >::BFieldMesh ( )
default

◆ BFieldMesh() [2/4]

template<class T >
BFieldMesh< T >::BFieldMesh ( const BFieldMesh< T > &  )
default

◆ BFieldMesh() [3/4]

template<class T >
BFieldMesh< T >::BFieldMesh ( BFieldMesh< T > &&  )
default

◆ ~BFieldMesh()

template<class T >
BFieldMesh< T >::~BFieldMesh ( )
default

◆ BFieldMesh() [4/4]

template<class T >
BFieldMesh< T >::BFieldMesh ( double  zmin,
double  zmax,
double  rmin,
double  rmax,
double  phimin,
double  phimax,
double  bscale 
)

constructor with mesh dimensions and scale

Member Function Documentation

◆ appendField()

template<class T >
void BFieldMesh< T >::appendField ( const BFieldVector< T > &  field)

append a filed vector

◆ appendMesh()

template<class T >
void BFieldMesh< T >::appendMesh ( int  axis,
double  value 
)

add a position for a cell corner for an axis

◆ bscale()

template<class T >
double BFieldMesh< T >::bscale ( ) const

scale

◆ buildLUT()

template<class T >
void BFieldMesh< T >::buildLUT ( )

build Look Up Table

◆ field()

template<class T >
const BFieldVector<T>& BFieldMesh< T >::field ( size_t  index) const

field vector at cell corner at index

◆ getB()

template<class T >
void BFieldMesh< T >::getB ( const double *ATH_RESTRICT  xyz,
double *ATH_RESTRICT  B,
double *ATH_RESTRICT  deriv = nullptr 
) const

get the bfield given a point in xyz

◆ getCache()

template<class T >
void BFieldMesh< T >::getCache ( double  z,
double  r,
double  phi,
BFieldCache cache,
double  scaleFactor = 1.0 
) const

◆ inside()

template<class T >
bool BFieldMesh< T >::inside ( double  z,
double  r,
double  phi 
) const

◆ max()

template<class T >
double BFieldMesh< T >::max ( size_t  axis) const

maximum or a particular axis = 0 (z), 1 (r), 2 (phi)

◆ memSize()

template<class T >
int BFieldMesh< T >::memSize ( ) const

memory size

◆ mesh()

template<class T >
double BFieldMesh< T >::mesh ( size_t  axis,
size_t  index 
) const

coordinate along axis (0 (z), 1 (r), 2 (phi)) of the cell at index (0 to nmesh-1)

◆ min()

template<class T >
double BFieldMesh< T >::min ( size_t  axis) const

minimum for a particular axis = 0 (z), 1 (r), 2 (phi)

◆ nfield()

template<class T >
unsigned BFieldMesh< T >::nfield ( ) const

field entries in mesh

◆ nmesh()

template<class T >
unsigned BFieldMesh< T >::nmesh ( size_t  axis) const

number of cells along each axis = 0 (z), 1 (r), 2 (phi)

◆ operator=() [1/2]

template<class T >
BFieldMesh& BFieldMesh< T >::operator= ( BFieldMesh< T > &&  )
default

◆ operator=() [2/2]

template<class T >
BFieldMesh& BFieldMesh< T >::operator= ( const BFieldMesh< T > &  )
default

◆ phimax()

template<class T >
double BFieldMesh< T >::phimax ( ) const

maximum in phi

◆ phimin()

template<class T >
double BFieldMesh< T >::phimin ( ) const

minimun in phi

◆ reserve() [1/2]

template<class T >
void BFieldMesh< T >::reserve ( int  nz,
int  nr,
int  nphi 
)

allocate space to vectors

◆ reserve() [2/2]

template<class T >
void BFieldMesh< T >::reserve ( int  nz,
int  nr,
int  nphi,
int  nfield 
)

allocate space to vectors

◆ rmax()

template<class T >
double BFieldMesh< T >::rmax ( ) const

maximum in r

◆ rmin()

template<class T >
double BFieldMesh< T >::rmin ( ) const

minimun in r

◆ scaleBscale()

template<class T >
void BFieldMesh< T >::scaleBscale ( double  factor)

scale B scale by a factor

◆ setBscale()

template<class T >
void BFieldMesh< T >::setBscale ( double  bscale)

set B scale

◆ setRange()

template<class T >
void BFieldMesh< T >::setRange ( double  zmin,
double  zmax,
double  rmin,
double  rmax,
double  phimin,
double  phimax 
)

set mesh range/dimensions

◆ zmax()

template<class T >
double BFieldMesh< T >::zmax ( ) const

maximum in z

◆ zmin()

template<class T >
double BFieldMesh< T >::zmin ( ) const

minimum in z

Member Data Documentation

◆ m_field

template<class T >
std::vector<BFieldVector<T> > BFieldMesh< T >::m_field
private

Definition at line 133 of file BFieldMesh.h.

◆ m_invUnit

template<class T >
std::array<double, 3> BFieldMesh< T >::m_invUnit = {0, 0, 0}
private

Definition at line 139 of file BFieldMesh.h.

◆ m_LUT

template<class T >
std::array<std::vector<int>, 3> BFieldMesh< T >::m_LUT
private

Definition at line 138 of file BFieldMesh.h.

◆ m_max

template<class T >
std::array<double, 3> BFieldMesh< T >::m_max
protected

Definition at line 129 of file BFieldMesh.h.

◆ m_mesh

template<class T >
std::array<std::vector<double>, 3> BFieldMesh< T >::m_mesh
protected

Definition at line 130 of file BFieldMesh.h.

◆ m_min

template<class T >
std::array<double, 3> BFieldMesh< T >::m_min
protected

Definition at line 128 of file BFieldMesh.h.

◆ m_nomScale

template<class T >
double BFieldMesh< T >::m_nomScale
private

Definition at line 135 of file BFieldMesh.h.

◆ m_roff

template<class T >
int BFieldMesh< T >::m_roff = 0
private

Definition at line 140 of file BFieldMesh.h.

◆ m_scale

template<class T >
double BFieldMesh< T >::m_scale = 1.0
private

Definition at line 134 of file BFieldMesh.h.

◆ m_zoff

template<class T >
int BFieldMesh< T >::m_zoff = 0
private

Definition at line 140 of file BFieldMesh.h.


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