Geant4  10.02.p03
G4ParticleHPLevel Class Reference

#include <G4ParticleHPLevel.hh>

Collaboration diagram for G4ParticleHPLevel:

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)
 

Private Attributes

G4double levelEnergy
 
G4int nGammas
 
G4ParticleHPGamma ** theGammas
 

Detailed Description

Definition at line 40 of file G4ParticleHPLevel.hh.

Constructor & Destructor Documentation

◆ G4ParticleHPLevel()

G4ParticleHPLevel::G4ParticleHPLevel ( )
inline

Definition at line 44 of file G4ParticleHPLevel.hh.

45  {
46  nGammas = 0;
47  theGammas = 0;
48  }
G4ParticleHPGamma ** theGammas
Here is the call graph for this function:

◆ ~G4ParticleHPLevel()

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  }
G4ParticleHPGamma ** theGammas
int G4int
Definition: G4Types.hh:78
Here is the caller graph for this function:

Member Function Documentation

◆ GetDecayGammas()

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  }
G4ParticleHPGamma ** theGammas
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:

◆ GetGammaEnergy()

G4double G4ParticleHPLevel::GetGammaEnergy ( G4int  i)

Definition at line 61 of file G4ParticleHPLevel.cc.

62  {
63  return theGammas[i]->GetGammaEnergy();
64  }
G4ParticleHPGamma ** theGammas
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetLevelEnergy()

G4double G4ParticleHPLevel::GetLevelEnergy ( )
inline

Definition at line 63 of file G4ParticleHPLevel.hh.

64  {
65  return levelEnergy;
66  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetGamma()

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  }
G4ParticleHPGamma ** theGammas
void SetLevelEnergy(G4double anEnergy)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetLevelEnergy()

void G4ParticleHPLevel::SetLevelEnergy ( G4double  anEnergy)
inline

Definition at line 58 of file G4ParticleHPLevel.hh.

59  {
60  levelEnergy = anEnergy;
61  }
Here is the caller graph for this function:

◆ SetNumberOfGammas()

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;
53  }
G4ParticleHPGamma ** theGammas
int G4int
Definition: G4Types.hh:78
Here is the caller graph for this function:

Member Data Documentation

◆ levelEnergy

G4double G4ParticleHPLevel::levelEnergy
private

Definition at line 72 of file G4ParticleHPLevel.hh.

◆ nGammas

G4int G4ParticleHPLevel::nGammas
private

Definition at line 74 of file G4ParticleHPLevel.hh.

◆ theGammas

G4ParticleHPGamma** G4ParticleHPLevel::theGammas
private

Definition at line 75 of file G4ParticleHPLevel.hh.


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