Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 (G4double parentMass=-1.)
 
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 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 G4int
Definition: G4Types.hh:78
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

Here is the caller graph for this function:

G4int G4DecayTable::entries ( ) const
inline

Definition at line 100 of file G4DecayTable.hh.

101 {
102  return channels->size();
103 }

Here is the caller graph for this function:

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 G4int
Definition: G4Types.hh:78

Here is the caller graph for this function:

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 }
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()

Here is the call graph for this function:

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 ( 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
G4double GetPDGMass() const
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

Here is the caller graph for this function:


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