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

A map of station thickness in units of radiation length (X0) to the specific point in XY plane. More...

#include <KfMaterialMap.h>

Public Member Functions

 MaterialMap ()=default
 Default constructor.
 
 MaterialMap (int nBins, float xyMax, float zRef, float zMin, float zMax)
 Constructor from parameters.
 
 MaterialMap (const MaterialMap &other)=default
 Copy constructor.
 
 MaterialMap (MaterialMap &&other) noexcept=default
 Move constructor.
 
MaterialMapoperator= (const MaterialMap &other)=default
 Copy assignment operator.
 
MaterialMapoperator= (MaterialMap &&other) noexcept=default
 Move assignment operator.
 
 ~MaterialMap () noexcept=default
 Destructor.
 
void Add (const MaterialMap &other, float zTarg=defs::Undef< float >)
 Adds material layer.
 
int GetBin (float x, float y) const
 Gets bin index for (x,y). Returns -1 when outside of the map.
 
int GetNbins () const
 Gets number of bins (rows or columns) of the material table.
 
float GetXYmax () const
 Gets radius of the material table [cm].
 
float GetZref () const
 Gets reference Z of the material [cm].
 
float GetZmin () const
 Gets minimal Z of the collected material [cm].
 
float GetZmax () const
 Gets maximal Z of the collected material [cm].
 
template<typename I>
GetThicknessX0 (const I &x, const I &y) const
 Gets material thickness in units of radiational length X0.
 
template<typename I>
GetBinThicknessX0 (int iGlob) const
 Gets material thickness in units of radiational length X0.
 
template<typename I>
GetBinThicknessX0 (int iX, int iY) const
 Gets material thickness in units of radiational length X0.
 
bool IsUndefined () const
 Function to test the instance for NaN.
 
void Rebin (int factor)
 Reduces number of bins by a given factor.
 
void SetRadThickBin (int iBinX, int iBinY, float thickness)
 Sets value of material thickness in units of X0 for a given cell of the material table.
 
std::string ToString (int indentLevel=0, int verbose=1) const
 String representation of the object.
 

Private Member Functions

void CheckConsistency () const
 Checks the object consistency.
 
template<class Archive>
void serialize (Archive &ar, const unsigned int)
 

Private Attributes

int fNbins = defs::Undef<int>
 Number of rows (== N columns) in the material budget table.
 
float fXYmax = defs::Undef<float>
 Size of the station in x and y dimensions [cm].
 
float fFactor = defs::Undef<float>
 Util. var. for the conversion of point coordinates to row/column id.
 
float fZref = defs::Undef<float>
 Reference Z of the collected material [cm].
 
float fZmin = defs::Undef<float>
 Minimal Z of the collected material [cm].
 
float fZmax = defs::Undef<float>
 Minimal Z of the collected material [cm].
 
std::vector< float > fTable {}
 Material budget table.
 

Friends

class boost::serialization::access
 Serialization function.
 
bool operator< (const MaterialMap &lhs, const MaterialMap &rhs)
 Comparison operator (material map ordering by fZref)
 

Detailed Description

A map of station thickness in units of radiation length (X0) to the specific point in XY plane.

Definition at line 27 of file KfMaterialMap.h.

Constructor & Destructor Documentation

◆ MaterialMap() [1/4]

cbm::algo::kf::MaterialMap::MaterialMap ( )
default

Default constructor.

◆ MaterialMap() [2/4]

MaterialMap::MaterialMap ( int nBins,
float xyMax,
float zRef,
float zMin,
float zMax )

Constructor from parameters.

Parameters
nBinsNumber of rows or columns
xyMaxSize of station in x and y dimensions [cm]
zRefReference z-coordinate of the material layer [cm]
zMinLower boundary z-coordinate for the material layer [cm]
zMaxUpper boundary z-coordinate for the material layer [cm]

Definition at line 22 of file KfMaterialMap.cxx.

◆ MaterialMap() [3/4]

cbm::algo::kf::MaterialMap::MaterialMap ( const MaterialMap & other)
default

Copy constructor.

◆ MaterialMap() [4/4]

cbm::algo::kf::MaterialMap::MaterialMap ( MaterialMap && other)
defaultnoexcept

Move constructor.

◆ ~MaterialMap()

cbm::algo::kf::MaterialMap::~MaterialMap ( )
defaultnoexcept

Destructor.

Member Function Documentation

◆ Add()

void MaterialMap::Add ( const MaterialMap & other,
float zTarg = defs::Undef<float> )

Adds material layer.

Parameters
otherOther material layer
zTargz-coordinate of the target

Definition at line 36 of file KfMaterialMap.cxx.

◆ CheckConsistency()

void MaterialMap::CheckConsistency ( ) const
private

Checks the object consistency.

Exceptions
std::logic_errorIf the object is in non-valid mode

Definition at line 154 of file KfMaterialMap.cxx.

◆ GetBin()

int MaterialMap::GetBin ( float x,
float y ) const

Gets bin index for (x,y). Returns -1 when outside of the map.

Definition at line 71 of file KfMaterialMap.cxx.

◆ GetBinThicknessX0() [1/2]

template<typename I>
I cbm::algo::kf::MaterialMap::GetBinThicknessX0 ( int iGlob) const
inline

Gets material thickness in units of radiational length X0.

Template Parameters
IType of material thickness
Parameters
iGlobGlobal bin number: iGlob = iX + iY * fNbins

Definition at line 107 of file KfMaterialMap.h.

◆ GetBinThicknessX0() [2/2]

template<typename I>
I cbm::algo::kf::MaterialMap::GetBinThicknessX0 ( int iX,
int iY ) const
inline

Gets material thickness in units of radiational length X0.

Template Parameters
IType of material thickness
Parameters
iXBin number along x axis
iYBin number along y axis

Definition at line 126 of file KfMaterialMap.h.

◆ GetNbins()

int cbm::algo::kf::MaterialMap::GetNbins ( ) const
inline

Gets number of bins (rows or columns) of the material table.

Definition at line 64 of file KfMaterialMap.h.

◆ GetThicknessX0()

template<typename I>
I cbm::algo::kf::MaterialMap::GetThicknessX0 ( const I & x,
const I & y ) const
inline

Gets material thickness in units of radiational length X0.

Template Parameters
IType of the x and y (floating point)
Parameters
xX coordinate of the point [cm]
yY coordinate of the point [cm]

Definition at line 83 of file KfMaterialMap.h.

◆ GetXYmax()

float cbm::algo::kf::MaterialMap::GetXYmax ( ) const
inline

Gets radius of the material table [cm].

Definition at line 67 of file KfMaterialMap.h.

◆ GetZmax()

float cbm::algo::kf::MaterialMap::GetZmax ( ) const
inline

Gets maximal Z of the collected material [cm].

Definition at line 76 of file KfMaterialMap.h.

◆ GetZmin()

float cbm::algo::kf::MaterialMap::GetZmin ( ) const
inline

Gets minimal Z of the collected material [cm].

Definition at line 73 of file KfMaterialMap.h.

◆ GetZref()

float cbm::algo::kf::MaterialMap::GetZref ( ) const
inline

Gets reference Z of the material [cm].

Definition at line 70 of file KfMaterialMap.h.

◆ IsUndefined()

bool cbm::algo::kf::MaterialMap::IsUndefined ( ) const
inline

Function to test the instance for NaN.

Definition at line 132 of file KfMaterialMap.h.

◆ operator=() [1/2]

MaterialMap & cbm::algo::kf::MaterialMap::operator= ( const MaterialMap & other)
default

Copy assignment operator.

◆ operator=() [2/2]

MaterialMap & cbm::algo::kf::MaterialMap::operator= ( MaterialMap && other)
defaultnoexcept

Move assignment operator.

◆ Rebin()

void MaterialMap::Rebin ( int factor)

Reduces number of bins by a given factor.

Parameters
factorNumber of bins in a new bin

Definition at line 83 of file KfMaterialMap.cxx.

◆ serialize()

template<class Archive>
void cbm::algo::kf::MaterialMap::serialize ( Archive & ar,
const unsigned int  )
inlineprivate

Definition at line 175 of file KfMaterialMap.h.

◆ SetRadThickBin()

void cbm::algo::kf::MaterialMap::SetRadThickBin ( int iBinX,
int iBinY,
float thickness )
inline

Sets value of material thickness in units of X0 for a given cell of the material table.

Parameters
iBinXIndex of table column
iBinYIndex of table row
thicknessThickness of the material in units of X0
Note
Indices of rows and columns in the table runs from 0 to nBins-1 inclusively, where nBins is the number both of rows and columns. One should be careful while reading and storing the table from ROOT-file, because iBinX = 0 and iBinY = 0 in the TH1::SetBinContent method of usually defines the underflow bin.

Definition at line 148 of file KfMaterialMap.h.

◆ ToString()

std::string MaterialMap::ToString ( int indentLevel = 0,
int verbose = 1 ) const

String representation of the object.

Parameters
indentLevelIndent level of the string output
verboseVerbosity level

Definition at line 118 of file KfMaterialMap.cxx.

Friends And Related Symbol Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Serialization function.

Definition at line 173 of file KfMaterialMap.h.

◆ operator<

bool operator< ( const MaterialMap & lhs,
const MaterialMap & rhs )
friend

Comparison operator (material map ordering by fZref)

Definition at line 156 of file KfMaterialMap.h.

Member Data Documentation

◆ fFactor

float cbm::algo::kf::MaterialMap::fFactor = defs::Undef<float>
private

Util. var. for the conversion of point coordinates to row/column id.

Definition at line 166 of file KfMaterialMap.h.

◆ fNbins

int cbm::algo::kf::MaterialMap::fNbins = defs::Undef<int>
private

Number of rows (== N columns) in the material budget table.

Definition at line 164 of file KfMaterialMap.h.

◆ fTable

std::vector<float> cbm::algo::kf::MaterialMap::fTable {}
private

Material budget table.

Definition at line 170 of file KfMaterialMap.h.

◆ fXYmax

float cbm::algo::kf::MaterialMap::fXYmax = defs::Undef<float>
private

Size of the station in x and y dimensions [cm].

Definition at line 165 of file KfMaterialMap.h.

◆ fZmax

float cbm::algo::kf::MaterialMap::fZmax = defs::Undef<float>
private

Minimal Z of the collected material [cm].

Definition at line 169 of file KfMaterialMap.h.

◆ fZmin

float cbm::algo::kf::MaterialMap::fZmin = defs::Undef<float>
private

Minimal Z of the collected material [cm].

Definition at line 168 of file KfMaterialMap.h.

◆ fZref

float cbm::algo::kf::MaterialMap::fZref = defs::Undef<float>
private

Reference Z of the collected material [cm].

Definition at line 167 of file KfMaterialMap.h.


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