Geant4 10.7.0
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 ()
 
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=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 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 const G4IsotopeSelectIsotope (const G4Element *, G4double kinEnergy, G4double logE)
 
virtual void BuildPhysicsTable (const G4ParticleDefinition &)
 
virtual void DumpPhysicsTable (const G4ParticleDefinition &)
 
virtual void CrossSectionDescription (std::ostream &) const
 
virtual G4int GetVerboseLevel () 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
 

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 48 of file G4ParticleHPJENDLHEData.hh.

Constructor & Destructor Documentation

◆ G4ParticleHPJENDLHEData() [1/2]

G4ParticleHPJENDLHEData::G4ParticleHPJENDLHEData ( )

Definition at line 60 of file G4ParticleHPJENDLHEData.cc.

61{
62 for ( std::map< G4int , std::map< G4int , G4PhysicsVector* >* >::iterator itZ = mIsotope.begin();
63 itZ != mIsotope.end(); ++itZ ) {
64 std::map< G4int , G4PhysicsVector* >* pointer_map = itZ->second;
65 if ( pointer_map ) {
66 for ( std::map< G4int , G4PhysicsVector* >::iterator itA = pointer_map->begin();
67 itA != pointer_map->end() ; ++itA ) {
68 G4PhysicsVector* pointerPhysicsVector = itA->second;
69 if ( pointerPhysicsVector ) {
70 delete pointerPhysicsVector;
71 itA->second = NULL;
72 }
73 }
74 delete pointer_map;
75 itZ->second = NULL;
76 }
77 }
78 mIsotope.clear();
79}
int G4int
Definition: G4Types.hh:85

◆ G4ParticleHPJENDLHEData() [2/2]

G4ParticleHPJENDLHEData::G4ParticleHPJENDLHEData ( G4String  reaction,
G4ParticleDefinition pd 
)

Definition at line 83 of file G4ParticleHPJENDLHEData.cc.

84:G4VCrossSectionDataSet( "JENDLHE"+reaction+"CrossSection" )
85{
86 reactionName = reaction;
87 BuildPhysicsTable( *pd );
88}
void BuildPhysicsTable(const G4ParticleDefinition &)

◆ ~G4ParticleHPJENDLHEData()

G4ParticleHPJENDLHEData::~G4ParticleHPJENDLHEData ( )

Definition at line 92 of file G4ParticleHPJENDLHEData.cc.

93{
94 ;
95 //delete theCrossSections;
96}

Member Function Documentation

◆ BuildPhysicsTable()

void G4ParticleHPJENDLHEData::BuildPhysicsTable ( const G4ParticleDefinition aP)
virtual

Reimplemented from G4VCrossSectionDataSet.

Definition at line 100 of file G4ParticleHPJENDLHEData.cc.

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

Referenced by G4ParticleHPJENDLHEData().

◆ DumpPhysicsTable()

void G4ParticleHPJENDLHEData::DumpPhysicsTable ( const G4ParticleDefinition aP)
virtual

Reimplemented from G4VCrossSectionDataSet.

Definition at line 237 of file G4ParticleHPJENDLHEData.cc.

238{
239 if(&aP!=G4Neutron::Neutron())
240 throw G4HadronicException(__FILE__, __LINE__, "Attempt to use NeutronHP data for particles other than neutrons!!!");
241// G4cout << "G4ParticleHPJENDLHEData::DumpPhysicsTable still to be implemented"<<G4endl;
242}
static G4Neutron * Neutron()
Definition: G4Neutron.cc:103

◆ GetCrossSection()

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

Definition at line 246 of file G4ParticleHPJENDLHEData.cc.

249{
250
251 // Primary energy >20MeV
252 // Thus
253 // Not take account of Doppler broadening
254 // also
255 // Not take account of Target thermal motions
256
257 G4double result = 0;
258
259 G4double ek = aP->GetKineticEnergy();
260
261 G4int nIso = anE->GetNumberOfIsotopes();
262 G4int Z = static_cast<G4int> ( anE->GetZ() );
263 if ( nIso!=0 )
264 {
265 for ( G4int i1 = 0; i1 < nIso; i1++ )
266 {
267
268 G4int A = anE->GetIsotope(i1)->GetN();
269 G4double frac = anE->GetRelativeAbundanceVector()[ i1 ]; // This case do NOT request "*perCent".
270
271 result += frac * getXSfromThisIsotope( Z , A , ek );
272 //G4cout << reactionType << " XS in barn " << Z << " " << A << " " << frac << " " << getXSfromThisIsotope( Z , A , ek )/barn << G4endl;
273
274 }
275 }
276 else
277 {
278
279 G4StableIsotopes theStableOnes;
280 G4int first = theStableOnes.GetFirstIsotope( Z );
281 for ( G4int i1 = 0; i1 < theStableOnes.GetNumberOfIsotopes( static_cast<G4int>(anE->GetZ() ) ); i1++)
282 {
283
284 G4int A = theStableOnes.GetIsotopeNucleonCount( first+i1 );
285 G4double frac = theStableOnes.GetAbundance( first+i1 )*perCent; // This case request "*perCent".
286
287 result += frac * getXSfromThisIsotope( Z , A , ek );
288 //G4cout << reactionType << " XS in barn " << Z << " " << A << " " << frac << " " << getXSfromThisIsotope( Z , A , ek )/barn << G4endl;
289
290 }
291 }
292 return result;
293
294}
double G4double
Definition: G4Types.hh:83
G4double GetKineticEnergy() const
G4double * GetRelativeAbundanceVector() const
Definition: G4Element.hh:166
size_t GetNumberOfIsotopes() const
Definition: G4Element.hh:158
G4double GetAbundance(G4int number)

◆ IsApplicable()

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

Definition at line 41 of file G4ParticleHPJENDLHEData.cc.

42{
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 {
49 result = false;
50 }
51// Element Check
52 else if ( !(vElement[ anE->GetIndex() ]) ) result = false;
53
54 return result;
55
56}
size_t GetIndex() const
Definition: G4Element.hh:181

◆ IsZAApplicable()

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

Definition at line 60 of file G4ParticleHPJENDLHEData.hh.

61 { return false; }

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