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

#include <G4NeutronHPLevel.hh>

Public Member Functions

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

Detailed Description

Definition at line 39 of file G4NeutronHPLevel.hh.

Constructor & Destructor Documentation

G4NeutronHPLevel::G4NeutronHPLevel ( )
inline

Definition at line 43 of file G4NeutronHPLevel.hh.

44  {
45  nGammas = 0;
46  theGammas = 0;
47  }
G4NeutronHPLevel::~G4NeutronHPLevel ( )

Definition at line 33 of file G4NeutronHPLevel.cc.

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

Member Function Documentation

G4DynamicParticleVector * G4NeutronHPLevel::GetDecayGammas ( )

Definition at line 64 of file G4NeutronHPLevel.cc.

References G4UniformRand, G4NeutronHPGamma::GetDecayGammas(), and G4NeutronHPGamma::GetWeight().

Referenced by G4NeutronHPGamma::GetDecayGammas().

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

Definition at line 59 of file G4NeutronHPLevel.cc.

References G4NeutronHPGamma::GetGammaEnergy().

60  {
61  return theGammas[i]->GetGammaEnergy();
62  }
G4double GetGammaEnergy()
G4double G4NeutronHPLevel::GetLevelEnergy ( )
inline

Definition at line 62 of file G4NeutronHPLevel.hh.

Referenced by G4NeutronHPInelasticCompFS::CompositeApply(), G4NeutronHPDeExGammas::GetLevelEnergy(), and G4NeutronHPDeExGammas::Init().

63  {
64  return levelEnergy;
65  }
void G4NeutronHPLevel::SetGamma ( G4int  i,
G4NeutronHPGamma aGamma 
)

Definition at line 53 of file G4NeutronHPLevel.cc.

References G4NeutronHPGamma::GetLevelEnergy(), and SetLevelEnergy().

Referenced by G4NeutronHPDeExGammas::Init().

54  {
55  theGammas[i] = aGamma;
56  SetLevelEnergy(aGamma->GetLevelEnergy());
57  }
void SetLevelEnergy(G4double anEnergy)
G4double GetLevelEnergy()
void G4NeutronHPLevel::SetLevelEnergy ( G4double  anEnergy)
inline

Definition at line 57 of file G4NeutronHPLevel.hh.

Referenced by SetGamma().

58  {
59  levelEnergy = anEnergy;
60  }
void G4NeutronHPLevel::SetNumberOfGammas ( G4int  aGammas)

Definition at line 42 of file G4NeutronHPLevel.cc.

Referenced by G4NeutronHPDeExGammas::Init().

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

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