Geant4  10.02.p03
G4DecayTable Class Reference

#include <G4DecayTable.hh>

Collaboration diagram for G4DecayTable:

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 (G4double parentMass=-1.)
 
G4VDecayChannelGetDecayChannel (G4int index) const
 
G4VDecayChanneloperator[] (G4int index)
 
void DumpInfo () const
 

Private Member Functions

 G4DecayTable (const G4DecayTable &)
 
G4DecayTableoperator= (const G4DecayTable &)
 

Private Attributes

G4ParticleDefinitionparent
 
G4VDecayChannelVectorchannels
 

Detailed Description

Definition at line 50 of file G4DecayTable.hh.

Member Typedef Documentation

◆ G4VDecayChannelVector

Definition at line 58 of file G4DecayTable.hh.

Constructor & Destructor Documentation

◆ G4DecayTable() [1/2]

G4DecayTable::G4DecayTable ( )

Definition at line 43 of file G4DecayTable.cc.

43  :parent(0)
44 {
46 }
G4VDecayChannelVector * channels
Definition: G4DecayTable.hh:96
std::vector< G4VDecayChannel * > G4VDecayChannelVector
Definition: G4DecayTable.hh:58
G4ParticleDefinition * parent
Definition: G4DecayTable.hh:95

◆ ~G4DecayTable()

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 }
G4VDecayChannelVector * channels
Definition: G4DecayTable.hh:96

◆ G4DecayTable() [2/2]

G4DecayTable::G4DecayTable ( const G4DecayTable )
inlineprivate

Definition at line 68 of file G4DecayTable.hh.

68 {};

Member Function Documentation

◆ DumpInfo()

void G4DecayTable::DumpInfo ( ) const

Definition at line 102 of file G4DecayTable.cc.

103 {
104  G4cout << "G4DecayTable: " << parent->GetParticleName() << G4endl;
105  G4int index =0;
106  G4VDecayChannelVector::iterator i;
107  for (i = channels->begin(); i!= channels->end(); ++i) {
108  G4cout << index << ": ";
109  (*i)->DumpInfo();
110  index +=1;
111  }
112  G4cout << G4endl;
113 }
Int_t index
int G4int
Definition: G4Types.hh:78
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
G4VDecayChannelVector * channels
Definition: G4DecayTable.hh:96
#define G4endl
Definition: G4ios.hh:61
G4ParticleDefinition * parent
Definition: G4DecayTable.hh:95
Here is the call graph for this function:
Here is the caller graph for this function:

◆ entries()

G4int G4DecayTable::entries ( ) const
inline

Definition at line 100 of file G4DecayTable.hh.

101 {
102  return channels->size();
103 }
G4VDecayChannelVector * channels
Definition: G4DecayTable.hh:96
Here is the caller graph for this function:

◆ GetDecayChannel()

G4VDecayChannel * G4DecayTable::GetDecayChannel ( G4int  index) const
inline

Definition at line 113 of file G4DecayTable.hh.

114 {
115  G4VDecayChannel* selectedChannel = 0;
116  if ( (index>=0) && (index<G4int(channels->size())) ){
117  selectedChannel = (*channels)[index];
118  }
119  return selectedChannel;
120 }
Int_t index
int G4int
Definition: G4Types.hh:78
G4VDecayChannelVector * channels
Definition: G4DecayTable.hh:96
Here is the caller graph for this function:

◆ Insert()

void G4DecayTable::Insert ( G4VDecayChannel aChannel)

Definition at line 60 of file G4DecayTable.cc.

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 }
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
G4VDecayChannelVector * channels
Definition: G4DecayTable.hh:96
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
G4ParticleDefinition * parent
Definition: G4DecayTable.hh:95
G4ParticleDefinition * GetParent()
G4double GetBR() const
Here is the call graph for this function:

◆ operator!=()

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

Definition at line 74 of file G4DecayTable.hh.

74 {return (this != &right);};
Here is the call graph for this function:

◆ operator=()

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

Definition at line 69 of file G4DecayTable.hh.

69 {return *this;};

◆ operator==()

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

Definition at line 73 of file G4DecayTable.hh.

73 {return (this == &right);};

◆ operator[]()

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

Definition at line 106 of file G4DecayTable.hh.

107 {
108  return (*channels)[index];
109 }
Int_t index
G4VDecayChannelVector * channels
Definition: G4DecayTable.hh:96
Here is the caller graph for this function:

◆ SelectADecayChannel()

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

Definition at line 81 of file G4DecayTable.cc.

82 {
83  // check if contents exist
84  if (channels->size()<1) return 0;
85 
86  if(parentMass<0.) parentMass=parent->GetPDGMass();
87  const size_t MAX_LOOP = 10000;
88  for (size_t loop_counter=0; loop_counter <MAX_LOOP; ++loop_counter){
89  G4double sumBR = 0.0;
91  // select decay channel
92  G4VDecayChannelVector::iterator i;
93  for (i = channels->begin(); i!= channels->end(); ++i) {
94  sumBR += (*i)->GetBR();
95  if ( !((*i)->IsOKWithParentMass(parentMass)) ) continue;
96  if (r < sumBR) return (*i);
97  }
98  }
99  return 0;
100 }
#define G4UniformRand()
Definition: Randomize.hh:97
G4VDecayChannelVector * channels
Definition: G4DecayTable.hh:96
double G4double
Definition: G4Types.hh:76
G4ParticleDefinition * parent
Definition: G4DecayTable.hh:95
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ channels

G4VDecayChannelVector* G4DecayTable::channels
private

Definition at line 96 of file G4DecayTable.hh.

◆ parent

G4ParticleDefinition* G4DecayTable::parent
private

Definition at line 95 of file G4DecayTable.hh.


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