Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4ParticleHPLevel Class Reference

#include <G4ParticleHPLevel.hh>

Public Member Functions

 G4ParticleHPLevel ()
 
 ~G4ParticleHPLevel ()
 
void SetNumberOfGammas (G4int aGammas)
 
void SetGamma (G4int i, G4ParticleHPGamma *aGamma)
 
G4DynamicParticleVectorGetDecayGammas ()
 
void SetLevelEnergy (G4double anEnergy)
 
G4double GetLevelEnergy ()
 
G4double GetGammaEnergy (G4int i)
 

Detailed Description

Definition at line 40 of file G4ParticleHPLevel.hh.

Constructor & Destructor Documentation

G4ParticleHPLevel::G4ParticleHPLevel ( )
inline

Definition at line 44 of file G4ParticleHPLevel.hh.

45  {
46  nGammas = 0;
47  theGammas = 0;
48  levelEnergy = 0.0;
49  }
G4ParticleHPLevel::~G4ParticleHPLevel ( )

Definition at line 35 of file G4ParticleHPLevel.cc.

36  {
37  if(theGammas != 0)
38  {
39  for(G4int i=0; i<nGammas; i++) delete theGammas[i];
40  }
41  delete [] theGammas;
42  }
int G4int
Definition: G4Types.hh:78

Member Function Documentation

G4DynamicParticleVector * G4ParticleHPLevel::GetDecayGammas ( )

Definition at line 66 of file G4ParticleHPLevel.cc.

67  {
68  G4DynamicParticleVector * theResult;
69  G4double sum = 0;
70  G4double * running = new G4double[nGammas];
71  running[0] = 0;
72  G4int i;
73  for(i=0; i<nGammas; i++)
74  {
75  if(i!=0) running[i]=running[i-1];
76  running[i]+=theGammas[i]->GetWeight();
77  }
78  sum = running[nGammas-1];
79  G4int it(0);
80  G4double random = G4UniformRand();
81  for(i=0; i<nGammas; i++)
82  {
83  it = i;
84  if(random*sum < running[i]) break;
85  }
86  delete [] running;
87  theResult = theGammas[it]->GetDecayGammas();
88  return theResult;
89  }
int G4int
Definition: G4Types.hh:78
#define G4UniformRand()
Definition: Randomize.hh:97
std::vector< G4DynamicParticle * > G4DynamicParticleVector
G4DynamicParticleVector * GetDecayGammas()
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

Here is the caller graph for this function:

G4double G4ParticleHPLevel::GetGammaEnergy ( G4int  i)

Definition at line 61 of file G4ParticleHPLevel.cc.

62  {
63  return theGammas[i]->GetGammaEnergy();
64  }

Here is the call graph for this function:

G4double G4ParticleHPLevel::GetLevelEnergy ( )
inline

Definition at line 64 of file G4ParticleHPLevel.hh.

65  {
66  return levelEnergy;
67  }

Here is the caller graph for this function:

void G4ParticleHPLevel::SetGamma ( G4int  i,
G4ParticleHPGamma aGamma 
)

Definition at line 55 of file G4ParticleHPLevel.cc.

56  {
57  theGammas[i] = aGamma;
58  SetLevelEnergy(aGamma->GetLevelEnergy());
59  }
void SetLevelEnergy(G4double anEnergy)

Here is the call graph for this function:

Here is the caller graph for this function:

void G4ParticleHPLevel::SetLevelEnergy ( G4double  anEnergy)
inline

Definition at line 59 of file G4ParticleHPLevel.hh.

60  {
61  levelEnergy = anEnergy;
62  }

Here is the caller graph for this function:

void G4ParticleHPLevel::SetNumberOfGammas ( G4int  aGammas)

Definition at line 44 of file G4ParticleHPLevel.cc.

45  {
46  nGammas = aGammas;
47  if(theGammas != 0)
48  {
49  for(G4int i=0; i<nGammas; i++) delete theGammas[i];
50  }
51  delete [] theGammas;
52  theGammas = new G4ParticleHPGamma * [nGammas];
53  }
int G4int
Definition: G4Types.hh:78

Here is the caller graph for this function:


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