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

#include <G4NeutronHPJENDLHEData.hh>

+ Inheritance diagram for G4NeutronHPJENDLHEData:

Public Member Functions

 G4NeutronHPJENDLHEData ()
 
 G4NeutronHPJENDLHEData (G4String, G4ParticleDefinition *)
 
 ~G4NeutronHPJENDLHEData ()
 
G4bool IsApplicable (const G4DynamicParticle *, const G4Element *)
 
G4bool IsZAApplicable (const G4DynamicParticle *, G4double, G4double)
 
G4double GetCrossSection (const G4DynamicParticle *, const G4Element *, G4double aT)
 
void BuildPhysicsTable (const G4ParticleDefinition &)
 
void DumpPhysicsTable (const G4ParticleDefinition &)
 
- Public Member Functions inherited from G4VCrossSectionDataSet
 G4VCrossSectionDataSet (const G4String &nam="")
 
virtual ~G4VCrossSectionDataSet ()
 
virtual G4bool IsElementApplicable (const G4DynamicParticle *, G4int Z, const G4Material *mat=0)
 
virtual G4bool IsIsoApplicable (const G4DynamicParticle *, G4int Z, G4int A, const G4Element *elm=0, const G4Material *mat=0)
 
G4double GetCrossSection (const G4DynamicParticle *, const G4Element *, const G4Material *mat=0)
 
G4double ComputeCrossSection (const G4DynamicParticle *, const G4Element *, const G4Material *mat=0)
 
virtual G4double GetElementCrossSection (const G4DynamicParticle *, G4int Z, const G4Material *mat=0)
 
virtual G4double GetIsoCrossSection (const G4DynamicParticle *, G4int Z, G4int A, const G4Isotope *iso=0, const G4Element *elm=0, const G4Material *mat=0)
 
virtual G4IsotopeSelectIsotope (const G4Element *, G4double kinEnergy)
 
virtual void BuildPhysicsTable (const G4ParticleDefinition &)
 
virtual void DumpPhysicsTable (const G4ParticleDefinition &)
 
virtual void CrossSectionDescription (std::ostream &) const
 
void SetVerboseLevel (G4int value)
 
G4double GetMinKinEnergy () const
 
void SetMinKinEnergy (G4double value)
 
G4double GetMaxKinEnergy () const
 
void SetMaxKinEnergy (G4double value)
 
const G4StringGetName () const
 

Additional Inherited Members

- Protected Member Functions inherited from G4VCrossSectionDataSet
void SetName (const G4String &)
 
- Protected Attributes inherited from G4VCrossSectionDataSet
G4int verboseLevel
 

Detailed Description

Definition at line 46 of file G4NeutronHPJENDLHEData.hh.

Constructor & Destructor Documentation

◆ G4NeutronHPJENDLHEData() [1/2]

G4NeutronHPJENDLHEData::G4NeutronHPJENDLHEData ( )

Definition at line 58 of file G4NeutronHPJENDLHEData.cc.

59{
60 ;
61}

◆ G4NeutronHPJENDLHEData() [2/2]

G4NeutronHPJENDLHEData::G4NeutronHPJENDLHEData ( G4String  reaction,
G4ParticleDefinition pd 
)

Definition at line 65 of file G4NeutronHPJENDLHEData.cc.

66:G4VCrossSectionDataSet( "JENDLHE"+reaction+"CrossSection" )
67{
68 reactionName = reaction;
69 BuildPhysicsTable( *pd );
70}
void BuildPhysicsTable(const G4ParticleDefinition &)

◆ ~G4NeutronHPJENDLHEData()

G4NeutronHPJENDLHEData::~G4NeutronHPJENDLHEData ( )

Definition at line 74 of file G4NeutronHPJENDLHEData.cc.

75{
76 ;
77 //delete theCrossSections;
78}

Member Function Documentation

◆ BuildPhysicsTable()

void G4NeutronHPJENDLHEData::BuildPhysicsTable ( const G4ParticleDefinition aP)
virtual

Reimplemented from G4VCrossSectionDataSet.

Definition at line 82 of file G4NeutronHPJENDLHEData.cc.

83{
84
85// if ( &aP != G4Neutron::Neutron() )
86// throw G4HadronicException(__FILE__, __LINE__, "Attempt to use NeutronHP data for particles other than neutrons!!!");
87 particleName = aP.GetParticleName();
88
89 G4String baseName = getenv( "G4NEUTRONHPDATA" );
90 G4String dirName = baseName+"/JENDL_HE/"+particleName+"/"+reactionName ;
91 G4String aFSType = "/CrossSection/";
92 G4NeutronHPNames theNames;
93
94 G4String filename;
95
96// Create JENDL_HE data
97// Create map element or isotope
98
99 size_t numberOfElements = G4Element::GetNumberOfElements();
100 //theCrossSections = new G4PhysicsTable( numberOfElements );
101
102 // make a PhysicsVector for each element
103
104 static const G4ElementTable *theElementTable = G4Element::GetElementTable();
105 vElement.clear();
106 vElement.resize( numberOfElements );
107 for ( size_t i = 0; i < numberOfElements; ++i )
108 {
109
110 G4Element* theElement = (*theElementTable)[i];
111 vElement[i] = false;
112
113 // isotope
114 G4int nIso = (*theElementTable)[i]->GetNumberOfIsotopes();
115 G4int Z = static_cast<G4int> ((*theElementTable)[i]->GetZ());
116 if ( nIso!=0 )
117 {
118 G4bool found_at_least_one = false;
119 for ( G4int i1 = 0; i1 < nIso; i1++ )
120 {
121 G4int A = theElement->GetIsotope(i1)->GetN();
122
123 if ( isThisNewIsotope( Z , A ) )
124 {
125
126 std::stringstream ss;
127 ss << dirName << aFSType << Z << "_" << A << "_" << theNames.GetName( Z-1 );
128 filename = ss.str();
129 std::fstream file;
130 file.open ( filename , std::fstream::in );
131 G4int dummy;
132 file >> dummy;
133 if ( file.good() )
134 {
135
136 //G4cout << "Found file for Z=" << Z << ", A=" << A << ", as " << filename << G4endl;
137 found_at_least_one = true;
138
139 // read the file
140 G4PhysicsVector* aPhysVec = readAFile ( &file );
141
142 //Regist
143
144 registAPhysicsVector( Z , A , aPhysVec );
145
146 }
147 else
148 {
149 //G4cout << "No file for "<< reactionType << " Z=" << Z << ", A=" << A << G4endl;
150 }
151
152 file.close();
153
154 }
155 else
156 {
157 found_at_least_one = TRUE;
158 }
159 }
160
161 if ( found_at_least_one ) vElement[i] = true;
162
163 }
164 else
165 {
166 G4StableIsotopes theStableOnes;
167 G4int first = theStableOnes.GetFirstIsotope( Z );
168 G4bool found_at_least_one = FALSE;
169 for ( G4int i1 = 0; i1 < theStableOnes.GetNumberOfIsotopes( static_cast<G4int>(theElement->GetZ() ) ); i1++)
170 {
171 G4int A = theStableOnes.GetIsotopeNucleonCount( first+i1 );
172
173 if ( isThisNewIsotope( Z , A ) )
174 {
175
176 std::stringstream ss;
177 ss << dirName << aFSType << Z << "_" << A << "_" << theNames.GetName( Z-1 );
178 filename = ss.str();
179
180 std::fstream file;
181 file.open ( filename , std::fstream::in );
182 G4int dummy;
183 file >> dummy;
184 if ( file.good() )
185 {
186 //G4cout << "Found file for Z=" << Z << ", A=" << A << ", as " << filename << G4endl;
187 found_at_least_one = TRUE;
188 //Read the file
189
190 G4PhysicsVector* aPhysVec = readAFile ( &file );
191
192 //Regist the PhysicsVector
193 registAPhysicsVector( Z , A , aPhysVec );
194
195 }
196 else
197 {
198 //G4cout << "No file for "<< reactionType << " Z=" << Z << ", A=" << A << G4endl;
199 }
200
201 file.close();
202 }
203 else
204 {
205 found_at_least_one = TRUE;
206 }
207 }
208
209 if ( found_at_least_one ) vElement[i] = true;
210
211 }
212
213 }
214
215}
std::vector< G4Element * > G4ElementTable
int G4int
Definition: G4Types.hh:66
bool G4bool
Definition: G4Types.hh:67
G4double GetZ() const
Definition: G4Element.hh:131
static size_t GetNumberOfElements()
Definition: G4Element.cc:406
const G4Isotope * GetIsotope(G4int iso) const
Definition: G4Element.hh:169
static const G4ElementTable * GetElementTable()
Definition: G4Element.cc:399
G4int GetN() const
Definition: G4Isotope.hh:94
G4NeutronHPDataUsed GetName(G4int A, G4int Z, G4String base, G4String rest, G4bool &active)
const G4String & GetParticleName() const
G4int GetFirstIsotope(G4int Z)
G4int GetNumberOfIsotopes(G4int Z)
G4int GetIsotopeNucleonCount(G4int number)
#define TRUE
Definition: globals.hh:55
#define FALSE
Definition: globals.hh:52

Referenced by G4NeutronHPJENDLHEData().

◆ DumpPhysicsTable()

void G4NeutronHPJENDLHEData::DumpPhysicsTable ( const G4ParticleDefinition aP)
virtual

Reimplemented from G4VCrossSectionDataSet.

Definition at line 219 of file G4NeutronHPJENDLHEData.cc.

220{
221 if(&aP!=G4Neutron::Neutron())
222 throw G4HadronicException(__FILE__, __LINE__, "Attempt to use NeutronHP data for particles other than neutrons!!!");
223// G4cout << "G4NeutronHPJENDLHEData::DumpPhysicsTable still to be implemented"<<G4endl;
224}
static G4Neutron * Neutron()
Definition: G4Neutron.cc:104

◆ GetCrossSection()

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

Definition at line 228 of file G4NeutronHPJENDLHEData.cc.

231{
232
233 // Primary energy >20MeV
234 // Thus
235 // Not take account of Doppler broadening
236 // also
237 // Not take account of Target thermal motions
238
239 G4double result = 0;
240
241 G4double ek = aP->GetKineticEnergy();
242
243 G4int nIso = anE->GetNumberOfIsotopes();
244 G4int Z = static_cast<G4int> ( anE->GetZ() );
245 if ( nIso!=0 )
246 {
247 for ( G4int i1 = 0; i1 < nIso; i1++ )
248 {
249
250 G4int A = anE->GetIsotope(i1)->GetN();
251 G4double frac = anE->GetRelativeAbundanceVector()[ i1 ]; // This case do NOT request "*perCent".
252
253 result += frac * getXSfromThisIsotope( Z , A , ek );
254 //G4cout << reactionType << " XS in barn " << Z << " " << A << " " << frac << " " << getXSfromThisIsotope( Z , A , ek )/barn << G4endl;
255
256 }
257 }
258 else
259 {
260
261 G4StableIsotopes theStableOnes;
262 G4int first = theStableOnes.GetFirstIsotope( Z );
263 for ( G4int i1 = 0; i1 < theStableOnes.GetNumberOfIsotopes( static_cast<G4int>(anE->GetZ() ) ); i1++)
264 {
265
266 G4int A = theStableOnes.GetIsotopeNucleonCount( first+i1 );
267 G4double frac = theStableOnes.GetAbundance( first+i1 )*perCent; // This case request "*perCent".
268
269 result += frac * getXSfromThisIsotope( Z , A , ek );
270 //G4cout << reactionType << " XS in barn " << Z << " " << A << " " << frac << " " << getXSfromThisIsotope( Z , A , ek )/barn << G4endl;
271
272 }
273 }
274 return result;
275
276}
double G4double
Definition: G4Types.hh:64
G4double GetKineticEnergy() const
G4double * GetRelativeAbundanceVector() const
Definition: G4Element.hh:166
size_t GetNumberOfIsotopes() const
Definition: G4Element.hh:158
G4double GetAbundance(G4int number)

◆ IsApplicable()

G4bool G4NeutronHPJENDLHEData::IsApplicable ( const G4DynamicParticle aP,
const G4Element anE 
)

Definition at line 39 of file G4NeutronHPJENDLHEData.cc.

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

◆ IsZAApplicable()

G4bool G4NeutronHPJENDLHEData::IsZAApplicable ( const G4DynamicParticle ,
G4double  ,
G4double   
)
inline

Definition at line 58 of file G4NeutronHPJENDLHEData.hh.

59 { return false; }

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