Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4NeutronIsotopeProduction Class Reference

#include <G4NeutronIsotopeProduction.hh>

+ Inheritance diagram for G4NeutronIsotopeProduction:

Public Member Functions

 G4NeutronIsotopeProduction ()
 
 G4NeutronIsotopeProduction (const G4NeutronIsotopeProduction &nip)
 
virtual ~G4NeutronIsotopeProduction ()
 
G4IsoResultGetIsotope (const G4HadProjectile *aTrack, const G4Nucleus &aNucleus)
 
- Public Member Functions inherited from G4VIsotopeProduction
 G4VIsotopeProduction ()
 
virtual ~G4VIsotopeProduction ()
 
virtual G4IsoResultGetIsotope (const G4HadProjectile *aTrack, const G4Nucleus &aNucleus)=0
 
G4bool operator== (const G4VIsotopeProduction &aProd)
 

Detailed Description

Definition at line 44 of file G4NeutronIsotopeProduction.hh.

Constructor & Destructor Documentation

◆ G4NeutronIsotopeProduction() [1/2]

G4NeutronIsotopeProduction::G4NeutronIsotopeProduction ( )

Definition at line 29 of file G4NeutronIsotopeProduction.cc.

30{
31 numberOfElements = G4Element::GetNumberOfElements();
32 theData = new G4ElementIsoCrossSections<G4NeutronIsoIsoCrossSections>* [numberOfElements];
33 for (G4int i = 0; i < numberOfElements; i++) {
35 if((*(G4Element::GetElementTable()))[i]->GetZ() > 9 &&
36 (*(G4Element::GetElementTable()))[i]->GetZ() < 84) {
37 // Workaround to be fixed in G4NeutronHPNames.
38 theData[i]->Init((*(G4Element::GetElementTable()))[i]);
39 }
40 }
41 G4cout << "WARNING: G4NeutronIsotopeProduction is deprecated and will be removed with Geant4 version 10"
42 << G4endl;
43}
int G4int
Definition: G4Types.hh:66
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout
void Init(const G4Element *anElement)
static size_t GetNumberOfElements()
Definition: G4Element.cc:406
static const G4ElementTable * GetElementTable()
Definition: G4Element.cc:399

◆ G4NeutronIsotopeProduction() [2/2]

G4NeutronIsotopeProduction::G4NeutronIsotopeProduction ( const G4NeutronIsotopeProduction nip)

◆ ~G4NeutronIsotopeProduction()

G4NeutronIsotopeProduction::~G4NeutronIsotopeProduction ( )
virtual

Definition at line 46 of file G4NeutronIsotopeProduction.cc.

47{
48 for (G4int i = 0; i < numberOfElements; i++) delete theData[i];
49 if (theData) delete [] theData;
50}

Member Function Documentation

◆ GetIsotope()

G4IsoResult * G4NeutronIsotopeProduction::GetIsotope ( const G4HadProjectile aTrack,
const G4Nucleus aNucleus 
)
virtual

Implements G4VIsotopeProduction.

Definition at line 54 of file G4NeutronIsotopeProduction.cc.

56{
57 G4IsoResult* result = 0;
58 // is applicable?
59 if (aTrack->GetDefinition() != G4Neutron::Neutron()) return result;
60 G4double incidentKE = aTrack->GetKineticEnergy();
61 if (incidentKE > 100*MeV) return result;
62
63 // get the isotope
64 const G4Material* theMaterial = aTrack->GetMaterial();
65 G4int nEleInMat = theMaterial->GetNumberOfElements();
66 for (G4int check = 0; check < nEleInMat; check++) {
67 // Workaround to be fixed in G4NeutronHPNames
68 if (theMaterial->GetElement(check)->GetZ() < 10) return result;
69 // Workaround to be fixed in G4NeutronHPNames.
70 if (theMaterial->GetElement(check)->GetZ() > 83) return result;
71 }
72 G4int index(0);
73 G4double* xSec = new G4double[nEleInMat];
74 G4double sum = 0;
75
76 for (G4int i = 0; i < nEleInMat; i++) {
77 index = theMaterial->GetElement(i)->GetIndex();
78 xSec[i] = theData[index]->GetCrossSection(incidentKE);
79 sum += xSec[i];
80 }
81
82 G4double random = G4UniformRand();
83 G4double running = 0;
84
85 for (G4int i = 0; i < nEleInMat; i++) {
86 running += xSec[i];
87 index = theMaterial->GetElement(i)->GetIndex();
88 if (random <= running/sum) break;
89 }
90
91 delete [] xSec;
92 result = theData[index]->GetProductIsotope(incidentKE);
93 return result;
94}
double G4double
Definition: G4Types.hh:64
#define G4UniformRand()
Definition: Randomize.hh:53
G4double GetCrossSection(G4double anEnergy)
G4IsoResult * GetProductIsotope(G4double anEnergy)
G4double GetZ() const
Definition: G4Element.hh:131
size_t GetIndex() const
Definition: G4Element.hh:182
const G4Material * GetMaterial() const
const G4ParticleDefinition * GetDefinition() const
G4double GetKineticEnergy() const
const G4Element * GetElement(G4int iel) const
Definition: G4Material.hh:201
size_t GetNumberOfElements() const
Definition: G4Material.hh:185
static G4Neutron * Neutron()
Definition: G4Neutron.cc:104

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