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 40 of file G4NeutronHPLevel.hh.


Constructor & Destructor Documentation

G4NeutronHPLevel::G4NeutronHPLevel (  )  [inline]

Definition at line 44 of file G4NeutronHPLevel.hh.

00045   {
00046     nGammas = 0;
00047     theGammas = 0;
00048   }

G4NeutronHPLevel::~G4NeutronHPLevel (  ) 

Definition at line 33 of file G4NeutronHPLevel.cc.

00034   {
00035     if(theGammas != 0)
00036     {
00037       for(G4int i=0; i<nGammas; i++) delete theGammas[i];
00038     }
00039     delete [] theGammas;
00040   }


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

00065   {
00066     G4DynamicParticleVector * theResult;
00067     G4double sum = 0;
00068     G4double * running = new G4double[nGammas];
00069     running[0] = 0;
00070     G4int i;
00071     for(i=0; i<nGammas; i++)
00072     {
00073       if(i!=0) running[i]=running[i-1];
00074       running[i]+=theGammas[i]->GetWeight();
00075     }
00076     sum = running[nGammas-1];
00077     G4int it(0);
00078     G4double random = G4UniformRand();
00079     for(i=0; i<nGammas; i++)
00080     {
00081       it = i;
00082       if(random*sum < running[i]) break;
00083     }
00084     delete [] running;
00085     theResult = theGammas[it]->GetDecayGammas();
00086     return theResult;
00087   }

G4double G4NeutronHPLevel::GetGammaEnergy ( G4int  i  ) 

Definition at line 59 of file G4NeutronHPLevel.cc.

References G4NeutronHPGamma::GetGammaEnergy().

00060   {
00061     return theGammas[i]->GetGammaEnergy();
00062   }

G4double G4NeutronHPLevel::GetLevelEnergy (  )  [inline]

Definition at line 63 of file G4NeutronHPLevel.hh.

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

00064   {
00065     return levelEnergy;
00066   }

void G4NeutronHPLevel::SetGamma ( G4int  i,
G4NeutronHPGamma aGamma 
)

Definition at line 53 of file G4NeutronHPLevel.cc.

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

00054   {
00055     theGammas[i] = aGamma;
00056     SetLevelEnergy(aGamma->GetLevelEnergy());
00057   }

void G4NeutronHPLevel::SetLevelEnergy ( G4double  anEnergy  )  [inline]

Definition at line 58 of file G4NeutronHPLevel.hh.

Referenced by SetGamma().

00059   {
00060     levelEnergy = anEnergy;
00061   }

void G4NeutronHPLevel::SetNumberOfGammas ( G4int  aGammas  ) 

Definition at line 42 of file G4NeutronHPLevel.cc.

00043   {
00044     nGammas = aGammas;
00045     if(theGammas != 0)
00046     {
00047       for(G4int i=0; i<nGammas; i++) delete theGammas[i];
00048     }
00049     delete [] theGammas; 
00050     theGammas = new G4NeutronHPGamma * [nGammas];
00051   }


The documentation for this class was generated from the following files:
Generated on Mon May 27 17:52:39 2013 for Geant4 by  doxygen 1.4.7