CbmRoot
Loading...
Searching...
No Matches
LitFieldGrid Class Reference

Class stores a grid of magnetic field values in XY slice at Z position. More...

#include <LitFieldGrid.h>

Public Member Functions

 LitFieldGrid ()
 Constructor.
 
fscal GetZ () const
 Returns Z position of the grid.
 
void SetZ (fscal Z)
 Sets Z position of the grid.
 
void SetField (const vector< vector< LitFieldValue< fscal > > > &field, fscal xmin, fscal xmax, fscal ymin, fscal ymax, int nofBinsX, int nofBinsY)
 Set field values for the grid.
 
void GetFieldValue (fscal x, fscal y, LitFieldValue< fscal > &B) const
 Return field value for (X, Y) position (scalar version).
 
void GetFieldValue (fvec x, fvec y, LitFieldValue< fvec > &B) const
 Returns field value for (X, Y) position (SIMD version).
 
bool IsEmpty () const
 Check if field was set.
 
string ToString () const
 Returns string representation of the class.
 

Private Attributes

fscal fXMin
 
fscal fXMax
 
fscal fYMin
 
fscal fYMax
 
fscal fZ
 
unsigned short fNofBinsX
 
unsigned short fNofBinsY
 
fscal fBinSizeX
 
fscal fBinSizeY
 
vector< vector< LitFieldValue< fscal > > > fField
 

Friends

ostream & operator<< (ostream &strm, const LitFieldGrid &grid)
 Operator << for convenient output to ostream.
 

Detailed Description

Class stores a grid of magnetic field values in XY slice at Z position.

Author
Andrey Lebedev andre.nosp@m.y.le.nosp@m.bedev.nosp@m.@gsi.nosp@m..de
Date
2009

This approach is used as an alternative to parabolic field approximation. It is more precise - the same grid is used as in the full magnetic field map. However the access to the grid can not be SIMDized. And the values are accessed one by one and packed later to the vector. But it is still fast! The value of the field is calculated as a weighted mean of the four surrounding values.

Definition at line 51 of file LitFieldGrid.h.

Constructor & Destructor Documentation

◆ LitFieldGrid()

lit::parallel::LitFieldGrid::LitFieldGrid ( )
inline

Constructor.

Definition at line 56 of file LitFieldGrid.h.

Member Function Documentation

◆ GetFieldValue() [1/2]

void lit::parallel::LitFieldGrid::GetFieldValue ( fscal x,
fscal y,
LitFieldValue< fscal > & B ) const
inline

Return field value for (X, Y) position (scalar version).

Parameters
[in]xX position.
[in]yY position.
[out]BField value.

Definition at line 118 of file LitFieldGrid.h.

◆ GetFieldValue() [2/2]

void lit::parallel::LitFieldGrid::GetFieldValue ( fvec x,
fvec y,
LitFieldValue< fvec > & B ) const
inline

Returns field value for (X, Y) position (SIMD version).

Parameters
[in]xX position.
[in]yY position.
[out]BField value.

Definition at line 183 of file LitFieldGrid.h.

◆ GetZ()

fscal lit::parallel::LitFieldGrid::GetZ ( ) const
inline

Returns Z position of the grid.

Returns
Z position of the grid.

Definition at line 74 of file LitFieldGrid.h.

◆ IsEmpty()

bool lit::parallel::LitFieldGrid::IsEmpty ( ) const
inline

Check if field was set.

Definition at line 200 of file LitFieldGrid.h.

◆ SetField()

void lit::parallel::LitFieldGrid::SetField ( const vector< vector< LitFieldValue< fscal > > > & field,
fscal xmin,
fscal xmax,
fscal ymin,
fscal ymax,
int nofBinsX,
int nofBinsY )
inline

Set field values for the grid.

Grid is a rectangle with (xmin, ymax) as a top left corner and (xmax, ymin) as a bottom right corner and has a total number of bins nofBinsX*nofBinsY.

Parameters
[in]field2D vector of field values.
[in]xmaxMaximum X position.
[in]xminMinimum X position.
[in]ymaxMaximum Y position.
[in]yminMinimum Y position.
[in]nofBinsXNumber of bins in X.
[in]nofBinsYNumber of bins in Y.

Definition at line 98 of file LitFieldGrid.h.

◆ SetZ()

void lit::parallel::LitFieldGrid::SetZ ( fscal Z)
inline

Sets Z position of the grid.

Parameters
[in]Zposition of the grid.

Definition at line 80 of file LitFieldGrid.h.

◆ ToString()

string lit::parallel::LitFieldGrid::ToString ( ) const
inline

Returns string representation of the class.

Returns
String representation of the class.

Definition at line 206 of file LitFieldGrid.h.

Friends And Related Symbol Documentation

◆ operator<<

ostream & operator<< ( ostream & strm,
const LitFieldGrid & grid )
friend

Operator << for convenient output to ostream.

Returns
Insertion stream in order to be able to call a succession of insertion operations.

Definition at line 231 of file LitFieldGrid.h.

Member Data Documentation

◆ fBinSizeX

fscal lit::parallel::LitFieldGrid::fBinSizeX
private

Definition at line 243 of file LitFieldGrid.h.

◆ fBinSizeY

fscal lit::parallel::LitFieldGrid::fBinSizeY
private

Definition at line 244 of file LitFieldGrid.h.

◆ fField

vector<vector<LitFieldValue<fscal> > > lit::parallel::LitFieldGrid::fField
private

Definition at line 248 of file LitFieldGrid.h.

◆ fNofBinsX

unsigned short lit::parallel::LitFieldGrid::fNofBinsX
private

Definition at line 241 of file LitFieldGrid.h.

◆ fNofBinsY

unsigned short lit::parallel::LitFieldGrid::fNofBinsY
private

Definition at line 242 of file LitFieldGrid.h.

◆ fXMax

fscal lit::parallel::LitFieldGrid::fXMax
private

Definition at line 238 of file LitFieldGrid.h.

◆ fXMin

fscal lit::parallel::LitFieldGrid::fXMin
private

Definition at line 238 of file LitFieldGrid.h.

◆ fYMax

fscal lit::parallel::LitFieldGrid::fYMax
private

Definition at line 239 of file LitFieldGrid.h.

◆ fYMin

fscal lit::parallel::LitFieldGrid::fYMin
private

Definition at line 239 of file LitFieldGrid.h.

◆ fZ

fscal lit::parallel::LitFieldGrid::fZ
private

Definition at line 240 of file LitFieldGrid.h.


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