Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions
G4DecayTable Class Reference

#include <G4DecayTable.hh>

Public Types

typedef std::vector
< G4VDecayChannel * > 
G4VDecayChannelVector
 

Public Member Functions

 G4DecayTable ()
 
 ~G4DecayTable ()
 
G4int operator== (const G4DecayTable &right) const
 
G4int operator!= (const G4DecayTable &right) const
 
void Insert (G4VDecayChannel *aChannel)
 
G4int entries () const
 
G4VDecayChannelSelectADecayChannel ()
 
G4VDecayChannelGetDecayChannel (G4int index) const
 
G4VDecayChanneloperator[] (G4int index)
 
void DumpInfo () const
 

Detailed Description

Definition at line 50 of file G4DecayTable.hh.

Member Typedef Documentation

Definition at line 58 of file G4DecayTable.hh.

Constructor & Destructor Documentation

G4DecayTable::G4DecayTable ( )

Definition at line 43 of file G4DecayTable.cc.

43  :parent(0)
44 {
45  channels = new G4VDecayChannelVector;
46 }
std::vector< G4VDecayChannel * > G4VDecayChannelVector
Definition: G4DecayTable.hh:58
G4DecayTable::~G4DecayTable ( )

Definition at line 48 of file G4DecayTable.cc.

49 {
50  // remove and delete all contents
51  G4VDecayChannelVector::iterator i;
52  for (i = channels->begin(); i!= channels->end(); ++i) {
53  delete (*i);
54  }
55  channels->clear();
56  delete channels;
57  channels = 0;
58 }

Member Function Documentation

void G4DecayTable::DumpInfo ( ) const

Definition at line 101 of file G4DecayTable.cc.

References G4cout, G4endl, and G4ParticleDefinition::GetParticleName().

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

102 {
103  G4cout << "G4DecayTable: " << parent->GetParticleName() << G4endl;
104  G4int index =0;
105  G4VDecayChannelVector::iterator i;
106  for (i = channels->begin(); i!= channels->end(); ++i) {
107  G4cout << index << ": ";
108  (*i)->DumpInfo();
109  index +=1;
110  }
111  G4cout << G4endl;
112 }
int G4int
Definition: G4Types.hh:78
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
G4int G4DecayTable::entries ( ) const
inline
G4VDecayChannel * G4DecayTable::GetDecayChannel ( G4int  index) const
inline
void G4DecayTable::Insert ( G4VDecayChannel aChannel)

Definition at line 60 of file G4DecayTable.cc.

References G4cout, G4endl, G4VDecayChannel::GetBR(), G4VDecayChannel::GetParent(), and G4ParticleDefinition::GetParticleName().

Referenced by G4ExcitedMesonConstructor::Add2EtaMode(), G4ExcitedMesonConstructor::Add2KMode(), G4ExcitedMesonConstructor::Add2KPiMode(), G4ExcitedMesonConstructor::Add2PiEtaMode(), G4ExcitedMesonConstructor::Add2PiMode(), G4ExcitedMesonConstructor::Add2PiOmegaMode(), G4ExcitedMesonConstructor::Add2PiRhoMode(), G4ExcitedMesonConstructor::Add3PiMode(), G4ExcitedMesonConstructor::Add4PiMode(), G4RadioactiveDecay::AddDecayRateTable(), 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(), G4ShortLivedConstructor::ConstructBaryons(), G4ShortLivedConstructor::ConstructMesons(), G4EtaPrime::Definition(), G4KaonZero::Definition(), G4AntiKaonZero::Definition(), G4SigmacPlus::Definition(), G4XiZero::Definition(), G4AntiXiZero::Definition(), G4TauMinus::Definition(), G4AntiSigmaZero::Definition(), G4XiMinus::Definition(), G4AntiSigmacPlus::Definition(), G4AntiNeutron::Definition(), G4Eta::Definition(), G4SigmaMinus::Definition(), G4SigmaPlus::Definition(), G4TauPlus::Definition(), G4SigmaZero::Definition(), G4AntiXiMinus::Definition(), G4PionZero::Definition(), G4SigmacZero::Definition(), G4MuonPlus::Definition(), G4PionMinus::Definition(), G4AntiSigmaPlus::Definition(), G4AntiSigmaMinus::Definition(), G4SigmacPlusPlus::Definition(), G4KaonPlus::Definition(), G4KaonMinus::Definition(), G4AntiSigmacPlusPlus::Definition(), G4AntiOmegaMinus::Definition(), G4AntiSigmacZero::Definition(), G4KaonZeroShort::Definition(), G4AntiLambda::Definition(), G4KaonZeroLong::Definition(), G4MuonMinus::Definition(), G4PionPlus::Definition(), G4OmegaMinus::Definition(), G4Lambda::Definition(), G4Neutron::Definition(), G4SigmabZero::Definition(), G4SigmabMinus::Definition(), G4AntiSigmabZero::Definition(), G4AntiSigmabPlus::Definition(), G4AntiSigmabMinus::Definition(), G4SigmabPlus::Definition(), G4RadioactiveDecay::LoadDecayTable(), F04PhysicsListMessenger::SetNewValue(), and WLSPhysicsListMessenger::SetNewValue().

60  {
61  if (parent == 0) { parent = (G4ParticleDefinition*)(aChannel->GetParent()); }
62  if (parent != aChannel->GetParent()) {
63 #ifdef G4VERBOSE
64  G4cout << " G4DecayTable::Insert :: bad G4VDecayChannel (mismatch parent) "
65  << " " << parent->GetParticleName()
66  << " input:" << aChannel->GetParent()->GetParticleName() << G4endl;
67 #endif
68  } else {
69  G4double r = aChannel->GetBR();
70  G4VDecayChannelVector::iterator i;
71  for (i = channels->begin(); i!= channels->end(); ++i) {
72  if (r > (*i)->GetBR()) {
73  channels->insert(i,aChannel);
74  return;
75  }
76  }
77  channels->push_back(aChannel);
78  }
79 }
G4double GetBR() const
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
G4ParticleDefinition * GetParent()
G4int G4DecayTable::operator!= ( const G4DecayTable right) const
inline

Definition at line 74 of file G4DecayTable.hh.

74 {return (this != &right);};
G4int G4DecayTable::operator== ( const G4DecayTable right) const
inline

Definition at line 73 of file G4DecayTable.hh.

73 {return (this == &right);};
G4VDecayChannel * G4DecayTable::operator[] ( G4int  index)
inline

Definition at line 106 of file G4DecayTable.hh.

107 {
108  return (*channels)[index];
109 }
G4VDecayChannel * G4DecayTable::SelectADecayChannel ( )

Definition at line 81 of file G4DecayTable.cc.

References G4UniformRand.

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

82 {
83  // check if contents exist
84  if (channels->size()<1) return 0;
85 
86  while (1) {
87  G4double sumBR = 0.0;
89  // select decay channel
90  G4VDecayChannelVector::iterator i;
91  for (i = channels->begin(); i!= channels->end(); ++i) {
92  sumBR += (*i)->GetBR();
93  if (r < sumBR) {
94  return (*i);
95  }
96  }
97  }
98  return 0;
99 }
#define G4UniformRand()
Definition: Randomize.hh:87
double G4double
Definition: G4Types.hh:76

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