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

#include <G4DecayTable.hh>

Public Types

using G4VDecayChannelVector = std::vector<G4VDecayChannel*>
 

Public Member Functions

 G4DecayTable ()
 
 ~G4DecayTable ()
 
 G4DecayTable (const G4DecayTable &)=delete
 
G4DecayTableoperator= (const G4DecayTable &)=delete
 
G4bool operator== (const G4DecayTable &right) const
 
G4bool operator!= (const G4DecayTable &right) const
 
void Insert (G4VDecayChannel *aChannel)
 
G4int entries () const
 
G4VDecayChannelSelectADecayChannel (G4double parentMass=-1.)
 
G4VDecayChannelGetDecayChannel (G4int index) const
 
G4VDecayChanneloperator[] (G4int index)
 
void DumpInfo () const
 

Detailed Description

Definition at line 45 of file G4DecayTable.hh.

Member Typedef Documentation

◆ G4VDecayChannelVector

Definition at line 48 of file G4DecayTable.hh.

Constructor & Destructor Documentation

◆ G4DecayTable() [1/2]

G4DecayTable::G4DecayTable ( )

Definition at line 36 of file G4DecayTable.cc.

37{
38 channels = new G4VDecayChannelVector;
39}
std::vector< G4VDecayChannel * > G4VDecayChannelVector

◆ ~G4DecayTable()

G4DecayTable::~G4DecayTable ( )

Definition at line 41 of file G4DecayTable.cc.

42{
43 // remove and delete all contents
44 for (const auto channel : *channels) {
45 delete channel;
46 }
47 channels->clear();
48 delete channels;
49 channels = nullptr;
50 parent = nullptr;
51}

◆ G4DecayTable() [2/2]

G4DecayTable::G4DecayTable ( const G4DecayTable & )
delete

Member Function Documentation

◆ DumpInfo()

void G4DecayTable::DumpInfo ( ) const

Definition at line 111 of file G4DecayTable.cc.

112{
113 G4cout << "G4DecayTable: " << parent->GetParticleName() << G4endl;
114 G4int index = 0;
115 for (const auto channel : *channels) {
116 G4cout << index << ": ";
117 channel->DumpInfo();
118 index += 1;
119 }
120 G4cout << G4endl;
121}
int G4int
Definition G4Types.hh:85
#define G4endl
Definition G4ios.hh:67
G4GLOB_DLL std::ostream G4cout
const G4String & GetParticleName() const

Referenced by G4Radioactivation::DecayIt(), G4IsotopeProperty::DumpInfo(), G4ParticleDefinition::DumpTable(), G4RadioactiveDecay::LoadDecayTable(), and G4DecayTableMessenger::SetNewValue().

◆ entries()

◆ GetDecayChannel()

◆ Insert()

void G4DecayTable::Insert ( G4VDecayChannel * aChannel)

Definition at line 53 of file G4DecayTable.cc.

54{
55 if (parent == nullptr) {
56 parent = (G4ParticleDefinition*)(aChannel->GetParent());
57 }
58 if (parent != aChannel->GetParent()) {
59#ifdef G4VERBOSE
60 G4cout << " G4DecayTable::Insert :: bad G4VDecayChannel (mismatch parent) "
61 << " " << parent->GetParticleName()
62 << " input:" << aChannel->GetParent()->GetParticleName() << G4endl;
63#endif
64 }
65 else {
66 G4double br = aChannel->GetBR();
67 for (auto iCh = channels->cbegin(); iCh != channels->cend(); ++iCh) {
68 if (br > (*iCh)->GetBR()) {
69 channels->insert(iCh, aChannel);
70 return;
71 }
72 }
73 channels->push_back(aChannel);
74 }
75}
double G4double
Definition G4Types.hh:83
G4double GetBR() const
G4ParticleDefinition * GetParent()

Referenced by G4ExcitedMesonConstructor::Add2EtaMode(), G4ExcitedMesonConstructor::Add2KMode(), G4ExcitedMesonConstructor::Add2KPiMode(), G4ExcitedMesonConstructor::Add2PiEtaMode(), G4ExcitedMesonConstructor::Add2PiMode(), G4ExcitedMesonConstructor::Add2PiOmegaMode(), G4ExcitedMesonConstructor::Add2PiRhoMode(), G4ExcitedMesonConstructor::Add3PiMode(), G4ExcitedMesonConstructor::Add4PiMode(), G4ExcitedMesonConstructor::AddKEtaMode(), G4ExcitedMesonConstructor::AddKKStarMode(), G4ExcitedMesonConstructor::AddKOmegaMode(), G4ExcitedMesonConstructor::AddKPiMode(), G4ExcitedMesonConstructor::AddKRhoMode(), G4ExcitedMesonConstructor::AddKStar2PiMode(), G4ExcitedMesonConstructor::AddKStarPiMode(), G4ExcitedMesonConstructor::AddKTwoPiMode(), G4ExcitedMesonConstructor::AddPiA2Mode(), G4ExcitedMesonConstructor::AddPiEtaMode(), G4ExcitedMesonConstructor::AddPiF0Mode(), G4ExcitedMesonConstructor::AddPiF2Mode(), G4ExcitedMesonConstructor::AddPiGammaMode(), G4ExcitedMesonConstructor::AddPiOmegaMode(), G4ExcitedMesonConstructor::AddPiRhoMode(), G4ExcitedMesonConstructor::AddRhoEtaMode(), G4ExcitedMesonConstructor::AddRhoGammaMode(), G4HadronicBuilder::BuildDecayTableForBCHadrons(), G4Radioactivation::CalculateChainsFromParent(), G4ShortLivedConstructor::ConstructBaryons(), G4ShortLivedConstructor::ConstructMesons(), and G4RadioactiveDecay::LoadDecayTable().

◆ operator!=()

G4bool G4DecayTable::operator!= ( const G4DecayTable & right) const
inline

Definition at line 90 of file G4DecayTable.hh.

91{
92 return (this != &right);
93}

◆ operator=()

G4DecayTable & G4DecayTable::operator= ( const G4DecayTable & )
delete

◆ operator==()

G4bool G4DecayTable::operator== ( const G4DecayTable & right) const
inline

Definition at line 85 of file G4DecayTable.hh.

86{
87 return (this == &right);
88}

◆ operator[]()

G4VDecayChannel * G4DecayTable::operator[] ( G4int index)
inline

Definition at line 100 of file G4DecayTable.hh.

101{
102 return (*channels)[index];
103}

◆ SelectADecayChannel()

G4VDecayChannel * G4DecayTable::SelectADecayChannel ( G4double parentMass = -1.)

Definition at line 77 of file G4DecayTable.cc.

78{
79 // check if contents exist
80 if (channels->empty()) return nullptr;
81
82 if (parentMass < 0.) parentMass = parent->GetPDGMass();
83
84 G4double sumBR = 0.;
85 for (const auto channel : *channels) {
86 if (!(channel->IsOKWithParentMass(parentMass))) continue;
87 sumBR += channel->GetBR();
88 }
89 if (sumBR <= 0.0) {
90#ifdef G4VERBOSE
91 G4cout << " G4DecayTable::SelectADecayChannel :: no possible DecayChannel"
92 << " " << parent->GetParticleName() << G4endl;
93#endif
94 return nullptr;
95 }
96
97 const std::size_t MAX_LOOP = 10000;
98 for (std::size_t loop_counter = 0; loop_counter < MAX_LOOP; ++loop_counter) {
99 G4double sum = 0.0;
100 G4double br = sumBR * G4UniformRand();
101 // select decay channel
102 for (const auto channel : *channels) {
103 sum += channel->GetBR();
104 if (!(channel->IsOKWithParentMass(parentMass))) continue;
105 if (br < sum) return channel;
106 }
107 }
108 return nullptr;
109}
#define G4UniformRand()
Definition Randomize.hh:52

Referenced by G4Decay::DecayIt(), G4IntraNucleiCascader::decayTrappedParticle(), and G4RadioactiveDecay::DoDecay().


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