ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
BFieldMeshZR Class Reference

#include <BFieldMeshZR.h>

Collaboration diagram for BFieldMeshZR:

Public Member Functions

 BFieldMeshZR ()=delete
 
 BFieldMeshZR (double zmin, double zmax, double rmin, double rmax)
 
void reserve (int nz, int nr)
 
void appendMesh (int i, double mesh)
 
void appendField (const BFieldVectorZR &field)
 
void buildLUT ()
 
bool inside (double z, double r) const
 
void getCache (double z, double r, BFieldCacheZR &cache, double scaleFactor=1.0) const
 
double min (size_t i) const
 
double max (size_t i) const
 
double zmin () const
 
double zmax () const
 
double rmin () const
 
double rmax () const
 
unsigned nmesh (size_t i) const
 
double mesh (size_t i, size_t j) const
 
unsigned nfield () const
 
const BFieldVectorZRfield (size_t i) const
 
int memSize () const
 

Private Attributes

std::array< double, 2 > m_min
 
std::array< double, 2 > m_max
 
std::array< std::vector< double >, 2 > m_mesh
 
std::vector< BFieldVectorZRm_field
 
std::array< std::vector< int >, 2 > m_LUT
 
std::array< double, 2 > m_invUnit = {1}
 
int m_zoff {0}
 

Detailed Description

Definition at line 23 of file BFieldMeshZR.h.

Constructor & Destructor Documentation

◆ BFieldMeshZR() [1/2]

BFieldMeshZR::BFieldMeshZR ( )
delete

◆ BFieldMeshZR() [2/2]

BFieldMeshZR::BFieldMeshZR ( double  zmin,
double  zmax,
double  rmin,
double  rmax 
)

Member Function Documentation

◆ appendField()

void BFieldMeshZR::appendField ( const BFieldVectorZR field)

◆ appendMesh()

void BFieldMeshZR::appendMesh ( int  i,
double  mesh 
)

◆ buildLUT()

void BFieldMeshZR::buildLUT ( )

Definition at line 18 of file BFieldMeshZR.cxx.

19 {
20  for (int j = 0; j < 2; j++) { // z, r
21  // determine the unit size, q, to be used in the LUTs
22  double width = m_mesh[j].back() - m_mesh[j].front();
23  double q(width);
24  for (unsigned i = 0; i < m_mesh[j].size() - 1; i++) {
25  q = std::min(q, m_mesh[j][i + 1] - m_mesh[j][i]);
26  }
27  // find the number of units in the LUT
28  int n = int(width / q) + 1;
29  q = width / (n + 0.5);
30  m_invUnit[j] = 1.0 / q; // new unit size
31  n++;
32  int m = 0; // mesh number
33  m_LUT[j].reserve(n);
34  for (int i = 0; i < n; i++) { // LUT index
35  if (i * q + m_mesh[j].front() > m_mesh[j][m + 1]) {
36  m++;
37  }
38  m_LUT[j].push_back(m);
39  }
40  }
41  m_zoff = m_mesh[1].size(); // index offset for incrementing z by 1
42 }

◆ field()

const BFieldVectorZR& BFieldMeshZR::field ( size_t  i) const

◆ getCache()

void BFieldMeshZR::getCache ( double  z,
double  r,
BFieldCacheZR cache,
double  scaleFactor = 1.0 
) const
inline

◆ inside()

bool BFieldMeshZR::inside ( double  z,
double  r 
) const

◆ max()

double BFieldMeshZR::max ( size_t  i) const

◆ memSize()

int BFieldMeshZR::memSize ( ) const

Definition at line 45 of file BFieldMeshZR.cxx.

46 {
47  int size = 0;
48  size += sizeof(double) * 6;
49  size += sizeof(int) * 1;
50  for (int i = 0; i < 2; i++) {
51  size += sizeof(double) * m_mesh[i].capacity();
52  size += sizeof(int) * m_LUT[i].capacity();
53  }
54  size += sizeof(BFieldVectorZR) * m_field.capacity();
55  return size;
56 }

◆ mesh()

double BFieldMeshZR::mesh ( size_t  i,
size_t  j 
) const

◆ min()

double BFieldMeshZR::min ( size_t  i) const

◆ nfield()

unsigned BFieldMeshZR::nfield ( ) const

◆ nmesh()

unsigned BFieldMeshZR::nmesh ( size_t  i) const

◆ reserve()

void BFieldMeshZR::reserve ( int  nz,
int  nr 
)

◆ rmax()

double BFieldMeshZR::rmax ( ) const

◆ rmin()

double BFieldMeshZR::rmin ( ) const

◆ zmax()

double BFieldMeshZR::zmax ( ) const

◆ zmin()

double BFieldMeshZR::zmin ( ) const

Member Data Documentation

◆ m_field

std::vector<BFieldVectorZR> BFieldMeshZR::m_field
private

Definition at line 61 of file BFieldMeshZR.h.

◆ m_invUnit

std::array<double, 2> BFieldMeshZR::m_invUnit = {1}
private

Definition at line 64 of file BFieldMeshZR.h.

◆ m_LUT

std::array<std::vector<int>, 2> BFieldMeshZR::m_LUT
private

Definition at line 63 of file BFieldMeshZR.h.

◆ m_max

std::array<double, 2> BFieldMeshZR::m_max
private

Definition at line 59 of file BFieldMeshZR.h.

◆ m_mesh

std::array<std::vector<double>, 2> BFieldMeshZR::m_mesh
private

Definition at line 60 of file BFieldMeshZR.h.

◆ m_min

std::array<double, 2> BFieldMeshZR::m_min
private

Definition at line 58 of file BFieldMeshZR.h.

◆ m_zoff

int BFieldMeshZR::m_zoff {0}
private

Definition at line 65 of file BFieldMeshZR.h.


The documentation for this class was generated from the following files:
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
min
constexpr double min()
Definition: ap_fixedTest.cxx:26
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
BFieldMeshZR::m_zoff
int m_zoff
Definition: BFieldMeshZR.h:65
BFieldMeshZR::m_LUT
std::array< std::vector< int >, 2 > m_LUT
Definition: BFieldMeshZR.h:63
BFieldMeshZR::m_mesh
std::array< std::vector< double >, 2 > m_mesh
Definition: BFieldMeshZR.h:60
lumiFormat.i
int i
Definition: lumiFormat.py:85
beamspotman.n
n
Definition: beamspotman.py:731
xAOD::double
double
Definition: CompositeParticle_v1.cxx:159
BFieldMeshZR::m_field
std::vector< BFieldVectorZR > m_field
Definition: BFieldMeshZR.h:61
Base_Fragment.width
width
Definition: Sherpa_i/share/common/Base_Fragment.py:59
BFieldMeshZR::m_invUnit
std::array< double, 2 > m_invUnit
Definition: BFieldMeshZR.h:64
extractSporadic.q
list q
Definition: extractSporadic.py:98
BFieldVectorZR
Definition: BFieldVectorZR.h:19