EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Acts::ElementFraction Class Reference

#include <acts/blob/sPHENIX/Core/include/Acts/Material/MaterialComposition.hpp>

Public Member Functions

constexpr ElementFraction (unsigned int e, float f)
 
constexpr ElementFraction (unsigned int e, unsigned int w)
 
 ElementFraction ()=delete
 Must always be created with valid data.
 
 ElementFraction (ElementFraction &&)=default
 
 ElementFraction (const ElementFraction &)=default
 
 ~ElementFraction ()=default
 
ElementFractionoperator= (ElementFraction &&)=default
 
ElementFractionoperator= (const ElementFraction &)=default
 
constexpr uint8_t element () const
 The element atomic number.
 
constexpr float fraction () const
 The relative fraction of this element.
 

Private Attributes

uint8_t m_element
 
uint8_t m_fraction
 

Friends

class MaterialComposition
 
constexpr bool operator== (ElementFraction lhs, ElementFraction rhs)
 
constexpr bool operator< (ElementFraction lhs, ElementFraction rhs)
 Sort by fraction for fastest access to the most probable element.
 

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.

Definition at line 32 of file MaterialComposition.hpp.

View newest version in sPHENIX GitHub at line 32 of file MaterialComposition.hpp

Constructor & Destructor Documentation

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

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]

Definition at line 38 of file MaterialComposition.hpp.

View newest version in sPHENIX GitHub at line 38 of file MaterialComposition.hpp

References Acts::UnitConstants::u.

constexpr Acts::ElementFraction::ElementFraction ( unsigned int  e,
unsigned int  w 
)
inlineexplicit

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)

Definition at line 49 of file MaterialComposition.hpp.

View newest version in sPHENIX GitHub at line 49 of file MaterialComposition.hpp

References Acts::UnitConstants::u.

Acts::ElementFraction::ElementFraction ( )
delete

Must always be created with valid data.

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

Member Function Documentation

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

The element atomic number.

Definition at line 65 of file MaterialComposition.hpp.

View newest version in sPHENIX GitHub at line 65 of file MaterialComposition.hpp

References m_element.

Referenced by Acts::Test::BOOST_AUTO_TEST_CASE().

+ Here is the caller graph for this function:

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

The relative fraction of this element.

Definition at line 67 of file MaterialComposition.hpp.

View newest version in sPHENIX GitHub at line 67 of file MaterialComposition.hpp

References m_fraction.

Referenced by Acts::Test::BOOST_AUTO_TEST_CASE().

+ Here is the caller graph for this function:

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

Friends And Related Function Documentation

friend class MaterialComposition
friend

Definition at line 85 of file MaterialComposition.hpp.

View newest version in sPHENIX GitHub at line 85 of file MaterialComposition.hpp

constexpr bool operator< ( ElementFraction  lhs,
ElementFraction  rhs 
)
friend

Sort by fraction for fastest access to the most probable element.

Definition at line 82 of file MaterialComposition.hpp.

View newest version in sPHENIX GitHub at line 82 of file MaterialComposition.hpp

constexpr bool operator== ( ElementFraction  lhs,
ElementFraction  rhs 
)
friend

Definition at line 77 of file MaterialComposition.hpp.

View newest version in sPHENIX GitHub at line 77 of file MaterialComposition.hpp

Member Data Documentation

uint8_t Acts::ElementFraction::m_element
private

Definition at line 73 of file MaterialComposition.hpp.

View newest version in sPHENIX GitHub at line 73 of file MaterialComposition.hpp

Referenced by element().

uint8_t Acts::ElementFraction::m_fraction
private

Definition at line 75 of file MaterialComposition.hpp.

View newest version in sPHENIX GitHub at line 75 of file MaterialComposition.hpp

Referenced by fraction().


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