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

#include <G4ParticleHPJENDLHEData.hh>

+ Inheritance diagram for G4ParticleHPJENDLHEData:

Public Member Functions

 G4ParticleHPJENDLHEData ()
 
 G4ParticleHPJENDLHEData (G4String, G4ParticleDefinition *)
 
 ~G4ParticleHPJENDLHEData () override
 
G4bool IsApplicable (const G4DynamicParticle *, const G4Element *)
 
G4bool IsZAApplicable (const G4DynamicParticle *, G4double, G4double)
 
G4double GetCrossSection (const G4DynamicParticle *, const G4Element *, G4double aT)
 
void BuildPhysicsTable (const G4ParticleDefinition &) override
 
void DumpPhysicsTable (const G4ParticleDefinition &) override
 
- Public Member Functions inherited from G4VCrossSectionDataSet
 G4VCrossSectionDataSet (const G4String &nam="")
 
virtual ~G4VCrossSectionDataSet ()
 
virtual G4bool IsElementApplicable (const G4DynamicParticle *, G4int Z, const G4Material *mat=nullptr)
 
virtual G4bool IsIsoApplicable (const G4DynamicParticle *, G4int Z, G4int A, const G4Element *elm=nullptr, const G4Material *mat=nullptr)
 
G4double GetCrossSection (const G4DynamicParticle *, const G4Element *, const G4Material *mat=nullptr)
 
G4double ComputeCrossSection (const G4DynamicParticle *, const G4Element *, const G4Material *mat=nullptr)
 
virtual G4double ComputeCrossSectionPerElement (G4double kinEnergy, G4double loge, const G4ParticleDefinition *, const G4Element *, const G4Material *mat=nullptr)
 
virtual G4double GetElementCrossSection (const G4DynamicParticle *, G4int Z, const G4Material *mat=nullptr)
 
virtual G4double GetIsoCrossSection (const G4DynamicParticle *, G4int Z, G4int A, const G4Isotope *iso=nullptr, const G4Element *elm=nullptr, const G4Material *mat=nullptr)
 
virtual G4double ComputeIsoCrossSection (G4double kinEnergy, G4double loge, const G4ParticleDefinition *, G4int Z, G4int A, const G4Isotope *iso=nullptr, const G4Element *elm=nullptr, const G4Material *mat=nullptr)
 
virtual const G4IsotopeSelectIsotope (const G4Element *, G4double kinEnergy, G4double logE)
 
virtual void CrossSectionDescription (std::ostream &) const
 
virtual void SetVerboseLevel (G4int value)
 
G4double GetMinKinEnergy () const
 
void SetMinKinEnergy (G4double value)
 
G4double GetMaxKinEnergy () const
 
void SetMaxKinEnergy (G4double value)
 
bool ForAllAtomsAndEnergies () const
 
void SetForAllAtomsAndEnergies (G4bool val)
 
const G4StringGetName () const
 
void SetName (const G4String &nam)
 
G4VCrossSectionDataSetoperator= (const G4VCrossSectionDataSet &right)=delete
 
 G4VCrossSectionDataSet (const G4VCrossSectionDataSet &)=delete
 

Additional Inherited Members

- Protected Attributes inherited from G4VCrossSectionDataSet
G4int verboseLevel
 
G4String name
 

Detailed Description

Definition at line 49 of file G4ParticleHPJENDLHEData.hh.

Constructor & Destructor Documentation

◆ G4ParticleHPJENDLHEData() [1/2]

G4ParticleHPJENDLHEData::G4ParticleHPJENDLHEData ( )

Definition at line 57 of file G4ParticleHPJENDLHEData.cc.

58{
59 for (auto& itZ : mIsotope) {
60 std::map<G4int, G4PhysicsVector*>* pointer_map = itZ.second;
61 if (pointer_map != nullptr) {
62 for (auto& itA : *pointer_map) {
63 G4PhysicsVector* pointerPhysicsVector = itA.second;
64 if (pointerPhysicsVector != nullptr) {
65 delete pointerPhysicsVector;
66 itA.second = NULL;
67 }
68 }
69 delete pointer_map;
70 itZ.second = NULL;
71 }
72 }
73 mIsotope.clear();
74}

◆ G4ParticleHPJENDLHEData() [2/2]

G4ParticleHPJENDLHEData::G4ParticleHPJENDLHEData ( G4String reaction,
G4ParticleDefinition * pd )

Definition at line 76 of file G4ParticleHPJENDLHEData.cc.

77 : G4VCrossSectionDataSet("JENDLHE" + reaction + "CrossSection")
78{
79 reactionName = reaction;
81}
void BuildPhysicsTable(const G4ParticleDefinition &) override
G4VCrossSectionDataSet(const G4String &nam="")

◆ ~G4ParticleHPJENDLHEData()

G4ParticleHPJENDLHEData::~G4ParticleHPJENDLHEData ( )
overridedefault

Member Function Documentation

◆ BuildPhysicsTable()

void G4ParticleHPJENDLHEData::BuildPhysicsTable ( const G4ParticleDefinition & aP)
overridevirtual

Reimplemented from G4VCrossSectionDataSet.

Definition at line 85 of file G4ParticleHPJENDLHEData.cc.

86{
87 particleName = aP.GetParticleName();
88
89 G4String baseName = G4FindDataDir("G4NEUTRONHPDATA");
90 G4String dirName = baseName + "/JENDL_HE/" + particleName + "/" + reactionName;
91 G4String aFSType = "/CrossSection/";
92 G4ParticleHPNames theNames;
93
94 G4String filename;
95
96 // Create JENDL_HE data
97 // Create map element or isotope
98
99 std::size_t numberOfElements = G4Element::GetNumberOfElements();
100
101 // make a PhysicsVector for each element
102
103 auto theElementTable = G4Element::GetElementTable();
104 vElement.clear();
105 vElement.resize(numberOfElements);
106 for (std::size_t i = 0; i < numberOfElements; ++i) {
107 G4Element* theElement = (*theElementTable)[i];
108 vElement[i] = false;
109
110 // isotope
111 auto nIso = (G4int)(*theElementTable)[i]->GetNumberOfIsotopes();
112 auto Z = (G4int)(*theElementTable)[i]->GetZ();
113 for (G4int i1 = 0; i1 < nIso; ++i1) {
114 G4int A = theElement->GetIsotope(i1)->GetN();
115
116 if (isThisNewIsotope(Z, A)) {
117 std::stringstream ss;
118 ss << dirName << aFSType << Z << "_" << A << "_" << theNames.GetName(Z - 1);
119 filename = ss.str();
120 std::fstream file;
121 file.open(filename, std::fstream::in);
122 G4int dummy;
123 file >> dummy;
124 if (file.good()) {
125 vElement[i] = true;
126
127 // read the file
128 G4PhysicsVector* aPhysVec = readAFile(&file);
129 registAPhysicsVector(Z, A, aPhysVec);
130 }
131 file.close();
132 }
133 }
134 }
135}
const char * G4FindDataDir(const char *)
int G4int
Definition G4Types.hh:85
const G4double A[17]
static G4ElementTable * GetElementTable()
Definition G4Element.cc:389
static size_t GetNumberOfElements()
Definition G4Element.cc:393
const G4Isotope * GetIsotope(G4int iso) const
Definition G4Element.hh:151
G4int GetN() const
Definition G4Isotope.hh:83
const G4String & GetParticleName() const
G4ParticleHPDataUsed GetName(G4int A, G4int Z, const G4String &base, const G4String &rest, G4bool &active)

Referenced by G4ParticleHPJENDLHEData().

◆ DumpPhysicsTable()

void G4ParticleHPJENDLHEData::DumpPhysicsTable ( const G4ParticleDefinition & )
overridevirtual

Reimplemented from G4VCrossSectionDataSet.

Definition at line 137 of file G4ParticleHPJENDLHEData.cc.

138{}

◆ GetCrossSection()

G4double G4ParticleHPJENDLHEData::GetCrossSection ( const G4DynamicParticle * aP,
const G4Element * anE,
G4double aT )

Definition at line 140 of file G4ParticleHPJENDLHEData.cc.

142{
143 // Primary energy >20MeV
144 // Thus not taking into account of Doppler broadening
145 // also not taking into account of Target thermal motions
146
147 G4double result = 0;
148
149 G4double ek = aP->GetKineticEnergy();
150
151 auto nIso = (G4int)anE->GetNumberOfIsotopes();
152 auto Z = (G4int)anE->GetZ();
153 for (G4int i1 = 0; i1 < nIso; ++i1) {
154 G4int A = anE->GetIsotope(i1)->GetN();
155 G4double frac = anE->GetRelativeAbundanceVector()[i1];
156 // This case does NOT request "*perCent".
157 result += frac * getXSfromThisIsotope(Z, A, ek);
158 }
159 return result;
160}
double G4double
Definition G4Types.hh:83
G4double GetKineticEnergy() const
G4double * GetRelativeAbundanceVector() const
Definition G4Element.hh:149
G4double GetZ() const
Definition G4Element.hh:119
size_t GetNumberOfIsotopes() const
Definition G4Element.hh:143

◆ IsApplicable()

G4bool G4ParticleHPJENDLHEData::IsApplicable ( const G4DynamicParticle * aP,
const G4Element * anE )

Definition at line 42 of file G4ParticleHPJENDLHEData.cc.

43{
44 G4bool result = true;
45 G4double eKin = aP->GetKineticEnergy();
46 // if(eKin>20*MeV||aP->GetDefinition()!=G4Neutron::Neutron()) result = false;
47 if (eKin < 20 * MeV || 3 * GeV < eKin || aP->GetDefinition() != G4Neutron::Neutron()) {
48 result = false;
49 }
50 // Element Check
51 else if (!(vElement[anE->GetIndex()]))
52 result = false;
53
54 return result;
55}
bool G4bool
Definition G4Types.hh:86
size_t GetIndex() const
Definition G4Element.hh:159
static G4Neutron * Neutron()
Definition G4Neutron.cc:101

◆ IsZAApplicable()

G4bool G4ParticleHPJENDLHEData::IsZAApplicable ( const G4DynamicParticle * ,
G4double ,
G4double  )
inline

Definition at line 59 of file G4ParticleHPJENDLHEData.hh.

60 {
61 return false;
62 }

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