CbmRoot
lit::parallel::LitFieldGrid Class Reference

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

#include <LitFieldGrid.h>

Collaboration diagram for lit::parallel::LitFieldGrid:
[legend]

Public Member Functions

 LitFieldGrid ()
 Constructor. More...
 
fscal GetZ () const
 Returns Z position of the grid. More...
 
void SetZ (fscal Z)
 Sets Z position of the grid. More...
 
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. More...
 
void GetFieldValue (fscal x, fscal y, LitFieldValue< fscal > &B) const
 Return field value for (X, Y) position (scalar version). More...
 
void GetFieldValue (fvec x, fvec y, LitFieldValue< fvec > &B) const
 Returns field value for (X, Y) position (SIMD version). More...
 
bool IsEmpty () const
 Check if field was set. More...
 
string ToString () const
 Returns string representation of the class. More...
 

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. More...
 

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 44 of file LitFieldGrid.h.

Constructor & Destructor Documentation

◆ LitFieldGrid()

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

Constructor.

Definition at line 49 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 113 of file LitFieldGrid.h.

References lit::parallel::LitFieldValue< T >::Bx, lit::parallel::LitFieldValue< T >::By, lit::parallel::LitFieldValue< T >::Bz, fBinSizeX, fBinSizeY, fField, fNofBinsX, fNofBinsY, fXMax, fXMin, fYMin, x, and y.

Referenced by lit::parallel::LitStationGroupMuon< T >::GetFieldRegion(), GetFieldValue(), and lit::parallel::LitRK4Extrapolation().

◆ 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 177 of file LitFieldGrid.h.

References lit::parallel::LitFieldValue< T >::Bx, lit::parallel::LitFieldValue< T >::By, lit::parallel::LitFieldValue< T >::Bz, fvecLen, GetFieldValue(), i, v, x, and y.

◆ GetZ()

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

Returns Z position of the grid.

Returns
Z position of the grid.

Definition at line 65 of file LitFieldGrid.h.

References fZ.

Referenced by lit::parallel::LitStationGroupMuon< T >::GetFieldRegion().

◆ IsEmpty()

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

◆ 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 89 of file LitFieldGrid.h.

References fBinSizeX, fBinSizeY, fField, fNofBinsX, fNofBinsY, fXMax, fXMin, fYMax, and fYMin.

Referenced by CbmLitFieldGridCreator::CreateGrid().

◆ SetZ()

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

Sets Z position of the grid.

Parameters
[in]Zposition of the grid.

Definition at line 71 of file LitFieldGrid.h.

References fZ.

Referenced by CbmLitFieldGridCreator::CreateGrid().

◆ ToString()

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

Returns string representation of the class.

Returns
String representation of the class.

Definition at line 199 of file LitFieldGrid.h.

References fBinSizeX, fBinSizeY, fField, fNofBinsX, fNofBinsY, fXMax, fXMin, fYMax, fYMin, and fZ.

Referenced by lit::parallel::LitVirtualStation< T >::ToString().

Friends And Related Function 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 225 of file LitFieldGrid.h.

Member Data Documentation

◆ fBinSizeX

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

Definition at line 236 of file LitFieldGrid.h.

Referenced by GetFieldValue(), SetField(), and ToString().

◆ fBinSizeY

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

Definition at line 237 of file LitFieldGrid.h.

Referenced by GetFieldValue(), SetField(), and ToString().

◆ fField

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

Definition at line 241 of file LitFieldGrid.h.

Referenced by GetFieldValue(), IsEmpty(), SetField(), and ToString().

◆ fNofBinsX

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

Definition at line 234 of file LitFieldGrid.h.

Referenced by GetFieldValue(), SetField(), and ToString().

◆ fNofBinsY

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

Definition at line 235 of file LitFieldGrid.h.

Referenced by GetFieldValue(), SetField(), and ToString().

◆ fXMax

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

Definition at line 231 of file LitFieldGrid.h.

Referenced by GetFieldValue(), SetField(), and ToString().

◆ fXMin

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

Definition at line 231 of file LitFieldGrid.h.

Referenced by GetFieldValue(), SetField(), and ToString().

◆ fYMax

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

Definition at line 232 of file LitFieldGrid.h.

Referenced by SetField(), and ToString().

◆ fYMin

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

Definition at line 232 of file LitFieldGrid.h.

Referenced by GetFieldValue(), SetField(), and ToString().

◆ fZ

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

Definition at line 233 of file LitFieldGrid.h.

Referenced by GetZ(), SetZ(), and ToString().


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