41 std::vector<double>
const& pFractions);
53 template <
typename TFunction>
67 template <
typename TFunction>
68 auto getWeightedSum(TFunction func)
const -> decltype(func(std::declval<Code>()));
80 double const getAverageMassNumber()
const;
83 Code sampleTarget(std::vector<CrossSectionType>
const& sigma,
84 TRNG&& randomStream)
const;
88 size_t getHash()
const;
96 std::vector<double>
const numberFractions_;
97 std::vector<Code>
const components_;
99 double const avgMassNumber_;
106 #include <corsika/detail/media/NuclearComposition.inl> std::vector< double > const & getFractions() const
Returns a const reference to the fraction.
Import and extend the phys::units package.
NuclearComposition(std::vector< Code > const &pComponents, std::vector< double > const &pFractions)
Constructor The constructore takes a list of elements and a list which describe the relative amount...
auto getWeightedSum(TFunction func) const -> decltype(func(std::declval< Code >()))
Sum all all relative composition weighted by func(element) This function sums all relative compositio...
`, since they are used everywhere as integral part of the framework.
std::vector< Code > const & getComponents() const
Returns a const reference to the fraction.
size_t getSize() const
Number of elements in the composition array.
bool operator==(NuclearComposition const &v) const
based on hash value
auto getWeighted(TFunction func) const
Returns a vector of the same length as elements in the material with the weighted return of "func"...
Describes the composition of matter Allowes and handles the creation of custom matter compositions...
Interface to particle properties.