ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
Acts::ElementFraction Class Reference

Memory-efficient storage of the relative fraction of an element. More...

#include <Acts/Material/MaterialComposition.hpp>

Public Member Functions

 ElementFraction ()=delete
 Must always be created with valid data.
 ElementFraction (const ElementFraction &)=default
 Copy constructor.
 ElementFraction (ElementFraction &&)=default
 Move constructor.
constexpr ElementFraction (unsigned int e, float f)
 Construct from atomic number and relative fraction.
constexpr ElementFraction (unsigned int e, unsigned int w)
 Construct from atomic number and integer weight.
 ~ElementFraction ()=default
constexpr std::uint8_t element () const
 The element atomic number.
constexpr float fraction () const
 The relative fraction of this element.
ElementFractionoperator= (const ElementFraction &)=default
 Copy assignment operator.
ElementFractionoperator= (ElementFraction &&)=default
 Move assignment operator.

Detailed Description

Memory-efficient storage of the relative fraction of an element.

This can be used to define materials that are compounds of multiple elements with varying fractions. The element is identified by its atomic number stored as a single byte (allows up to 256 elements; more than we need). Its fraction is also stored as a single byte with values between 0 and

  1. This gives an accuracy of 1/256 ~ 0.5 %.

The element fraction allows you to store element composition in merged materials with a large number of bins. Depending on the detector and the description granularity this can be a lot of information and thus requires the reduced memory footprint. This is really only needed for nuclear interaction in the fast simulation where the reduced fractional accuracy is not a problem. The fractional accuracy should be much better than the parametrization uncertainty for hadronic interactions.

Constructor & Destructor Documentation

◆ ElementFraction() [1/5]

Acts::ElementFraction::ElementFraction ( unsigned int e,
float f )
constexpr

Construct from atomic number and relative fraction.

Parameters
eis the atomic number of the element
fis the relative fraction and must be a value in [0,1]

◆ ElementFraction() [2/5]

Acts::ElementFraction::ElementFraction ( unsigned int e,
unsigned int w )
explicitconstexpr

Construct from atomic number and integer weight.

Parameters
eis the atomic number of the element
wis the integer weight and must be a value in [0,256)

◆ ElementFraction() [3/5]

Acts::ElementFraction::ElementFraction ( )
delete

Must always be created with valid data.

◆ ElementFraction() [4/5]

Acts::ElementFraction::ElementFraction ( ElementFraction && )
default

Move constructor.

◆ ElementFraction() [5/5]

Acts::ElementFraction::ElementFraction ( const ElementFraction & )
default

Copy constructor.

◆ ~ElementFraction()

Acts::ElementFraction::~ElementFraction ( )
default

Member Function Documentation

◆ element()

std::uint8_t Acts::ElementFraction::element ( ) const
constexpr

The element atomic number.

Returns
The atomic number of the element

◆ fraction()

float Acts::ElementFraction::fraction ( ) const
constexpr

The relative fraction of this element.

Returns
The relative fraction as a float in [0,1]

◆ operator=() [1/2]

ElementFraction & Acts::ElementFraction::operator= ( const ElementFraction & )
default

Copy assignment operator.

Returns
Reference to this element fraction after copy assignment

◆ operator=() [2/2]

ElementFraction & Acts::ElementFraction::operator= ( ElementFraction && )
default

Move assignment operator.

Returns
Reference to this element fraction after move assignment