Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4FermiFragmentPoolAN Class Reference

#include <G4FermiFragmentPoolAN.hh>

Classes

class  DefaultPoolANSource
class  IteratorRange

Public Member Functions

std::size_t Count (G4FermiAtomicMass atomicMass, G4FermiChargeNumber chargeNumber) const
std::size_t Count (G4FermiNucleiData nuclei) const
IteratorRange GetFragments (G4FermiAtomicMass atomicMass, G4FermiChargeNumber chargeNumber) const
IteratorRange GetFragments (G4FermiNucleiData nuclei) const
template<typename DataSource>
void Initialize (const DataSource &dataSource)
template<typename Iter>
void Initialize (Iter begin, Iter end)
void AddFragment (const G4VFermiFragmentAN &fragment)

Static Public Member Functions

static G4FermiFragmentPoolANInstance ()

Detailed Description

Definition at line 38 of file G4FermiFragmentPoolAN.hh.

Member Function Documentation

◆ AddFragment()

void G4FermiFragmentPoolAN::AddFragment ( const G4VFermiFragmentAN & fragment)

Definition at line 93 of file G4FermiFragmentPoolAN.cc.

94{
95 const auto slot = GetSlot(fragment.GetAtomicMass(), fragment.GetChargeNumber());
96 if (slot >= fragments_.size()) {
97 fragments_.resize(slot + static_cast<std::uint32_t>(fragment.GetAtomicMass()));
98 }
99 fragments_[slot].push_back(&fragment);
100}
G4FermiChargeNumber GetChargeNumber() const
G4FermiAtomicMass GetAtomicMass() const

Referenced by Initialize().

◆ Count() [1/2]

std::size_t G4FermiFragmentPoolAN::Count ( G4FermiAtomicMass atomicMass,
G4FermiChargeNumber chargeNumber ) const

Definition at line 59 of file G4FermiFragmentPoolAN.cc.

61{
62 // if (unlikely(static_cast<std::uint32_t>(atomicMass) < static_cast<std::uint32_t>(chargeNumber)))
63 if (static_cast<std::uint32_t>(atomicMass) < static_cast<std::uint32_t>(chargeNumber)) {
64 return 0;
65 }
66
67 const auto slot = GetSlot(atomicMass, chargeNumber);
68 // if (unlikely(slot >= fragments_.size())) {
69 if (slot >= fragments_.size()) {
70 return 0;
71 }
72
73 return fragments_[slot].size();
74}

Referenced by Count().

◆ Count() [2/2]

std::size_t G4FermiFragmentPoolAN::Count ( G4FermiNucleiData nuclei) const
inline

Definition at line 77 of file G4FermiFragmentPoolAN.hh.

78 {
79 return Count(nuclei.atomicMass, nuclei.chargeNumber);
80 }
std::size_t Count(G4FermiAtomicMass atomicMass, G4FermiChargeNumber chargeNumber) const

◆ GetFragments() [1/2]

G4FermiFragmentPoolAN::IteratorRange G4FermiFragmentPoolAN::GetFragments ( G4FermiAtomicMass atomicMass,
G4FermiChargeNumber chargeNumber ) const

Definition at line 77 of file G4FermiFragmentPoolAN.cc.

79{
80 // if (unlikely(static_cast<std::uint32_t>(atomicMass) < static_cast<std::uint32_t>(chargeNumber)))
81 if (static_cast<std::uint32_t>(atomicMass) < static_cast<std::uint32_t>(chargeNumber)) {
82 return {EmptyContainer_.begin(), EmptyContainer_.end()};
83 }
84
85 const auto slot = GetSlot(atomicMass, chargeNumber);
86 if (slot >= fragments_.size()) {
87 return {EmptyContainer_.begin(), EmptyContainer_.end()};
88 }
89
90 return {fragments_[slot].begin(), fragments_[slot].end()};
91}

Referenced by GetFragments().

◆ GetFragments() [2/2]

IteratorRange G4FermiFragmentPoolAN::GetFragments ( G4FermiNucleiData nuclei) const
inline

Definition at line 85 of file G4FermiFragmentPoolAN.hh.

86 {
87 return GetFragments(nuclei.atomicMass, nuclei.chargeNumber);
88 }
IteratorRange GetFragments(G4FermiAtomicMass atomicMass, G4FermiChargeNumber chargeNumber) const

◆ Initialize() [1/2]

template<typename DataSource>
void G4FermiFragmentPoolAN::Initialize ( const DataSource & dataSource)
inline

Definition at line 91 of file G4FermiFragmentPoolAN.hh.

92 {
93 Initialize(dataSource.begin(), dataSource.end());
94 }
void Initialize(const DataSource &dataSource)

Referenced by G4FermiBreakUpAN::Initialise(), and Initialize().

◆ Initialize() [2/2]

template<typename Iter>
void G4FermiFragmentPoolAN::Initialize ( Iter begin,
Iter end )
inline

Definition at line 97 of file G4FermiFragmentPoolAN.hh.

98 {
99 fragments_.clear();
100 static_assert(
101 std::is_same_v<std::remove_const_t<typename Iter::value_type>, G4VFermiFragmentAN*>,
102 "invalid iterator");
103 for (auto it = begin; it != end; ++it) {
104 AddFragment(**it);
105 }
106 }
void AddFragment(const G4VFermiFragmentAN &fragment)

◆ Instance()

G4FermiFragmentPoolAN & G4FermiFragmentPoolAN::Instance ( )
inlinestatic

Definition at line 110 of file G4FermiFragmentPoolAN.hh.

111 {
112 static G4FermiFragmentPoolAN pool;
113 return pool;
114 }

Referenced by G4FermiBreakUpAN::Initialise().


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