Geant4 10.7.0
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 49 of file G4DecayTable.hh.

Constructor & Destructor Documentation

◆ G4DecayTable() [1/2]

G4DecayTable::G4DecayTable ( )

Definition at line 35 of file G4DecayTable.cc.

36{
37 channels = new G4VDecayChannelVector;
38}
std::vector< G4VDecayChannel * > G4VDecayChannelVector
Definition: G4DecayTable.hh:49

◆ ~G4DecayTable()

G4DecayTable::~G4DecayTable ( )

Definition at line 40 of file G4DecayTable.cc.

41{
42 // remove and delete all contents
43 for (auto iCh = channels->cbegin(); iCh!= channels->cend(); ++iCh)
44 {
45 delete (*iCh);
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 120 of file G4DecayTable.cc.

121{
122 G4cout << "G4DecayTable: " << parent->GetParticleName() << G4endl;
123 G4int index =0;
124 for (auto iCh = channels->cbegin(); iCh!= channels->cend(); ++iCh)
125 {
126 G4cout << index << ": ";
127 (*iCh)->DumpInfo();
128 index += 1;
129 }
130 G4cout << G4endl;
131}
int G4int
Definition: G4Types.hh:85
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
const G4String & GetParticleName() const

Referenced by G4Radioactivation::DecayIt(), G4RadioactiveDecay::DecayIt(), G4IsotopeProperty::DumpInfo(), G4ParticleDefinition::DumpTable(), G4RadioactiveDecay::LoadDecayTable(), G4RadioactiveDecayBase::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 {
57 parent = (G4ParticleDefinition*)(aChannel->GetParent());
58 }
59 if (parent != aChannel->GetParent())
60 {
61#ifdef G4VERBOSE
62 G4cout << " G4DecayTable::Insert :: bad G4VDecayChannel (mismatch parent) "
63 << " " << parent->GetParticleName()
64 << " input:" << aChannel->GetParent()->GetParticleName() << G4endl;
65#endif
66 }
67 else
68 {
69 G4double br = aChannel->GetBR();
70 for (auto iCh = channels->cbegin(); iCh!= channels->cend(); ++iCh)
71 {
72 if (br > (*iCh)->GetBR())
73 {
74 channels->insert(iCh,aChannel);
75 return;
76 }
77 }
78 channels->push_back(aChannel);
79 }
80}
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(), G4RadioactiveDecay::CalculateChainsFromParent(), G4ShortLivedConstructor::ConstructBaryons(), G4ShortLivedConstructor::ConstructMesons(), G4MuonicAtomHelper::ConstructMuonicAtom(), G4AntiLambda::Definition(), G4AntiNeutron::Definition(), G4AntiOmegaMinus::Definition(), G4AntiSigmabMinus::Definition(), G4AntiSigmabPlus::Definition(), G4AntiSigmabZero::Definition(), G4AntiSigmacPlus::Definition(), G4AntiSigmacPlusPlus::Definition(), G4AntiSigmacZero::Definition(), G4AntiSigmaMinus::Definition(), G4AntiSigmaPlus::Definition(), G4AntiSigmaZero::Definition(), G4AntiXiMinus::Definition(), G4AntiXiZero::Definition(), G4Lambda::Definition(), G4Neutron::Definition(), G4OmegaMinus::Definition(), G4SigmabMinus::Definition(), G4SigmabPlus::Definition(), G4SigmabZero::Definition(), G4SigmacPlus::Definition(), G4SigmacPlusPlus::Definition(), G4SigmacZero::Definition(), G4SigmaMinus::Definition(), G4SigmaPlus::Definition(), G4SigmaZero::Definition(), G4XiMinus::Definition(), G4XiZero::Definition(), G4AntiKaonZero::Definition(), G4Eta::Definition(), G4EtaPrime::Definition(), G4KaonMinus::Definition(), G4KaonPlus::Definition(), G4KaonZero::Definition(), G4KaonZeroLong::Definition(), G4KaonZeroShort::Definition(), G4PionMinus::Definition(), G4PionPlus::Definition(), G4PionZero::Definition(), G4MuonMinus::Definition(), G4MuonPlus::Definition(), G4TauMinus::Definition(), G4TauPlus::Definition(), G4RadioactiveDecay::LoadDecayTable(), and G4RadioactiveDecayBase::LoadDecayTable().

◆ operator!=()

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

Definition at line 94 of file G4DecayTable.hh.

95{
96 return (this != &right);
97}

◆ operator=()

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

◆ operator==()

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

Definition at line 88 of file G4DecayTable.hh.

89{
90 return (this == &right);
91}

◆ operator[]()

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

Definition at line 106 of file G4DecayTable.hh.

107{
108 return (*channels)[index];
109}

◆ SelectADecayChannel()

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

Definition at line 82 of file G4DecayTable.cc.

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

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


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