Geant4 11.1.1
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 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 BuildPhysicsTable (const G4ParticleDefinition &)
 
virtual void DumpPhysicsTable (const G4ParticleDefinition &)
 
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 48 of file G4ParticleHPJENDLHEData.hh.

Constructor & Destructor Documentation

◆ G4ParticleHPJENDLHEData() [1/2]

G4ParticleHPJENDLHEData::G4ParticleHPJENDLHEData ( )

Definition at line 57 of file G4ParticleHPJENDLHEData.cc.

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

◆ G4ParticleHPJENDLHEData() [2/2]

G4ParticleHPJENDLHEData::G4ParticleHPJENDLHEData ( G4String  reaction,
G4ParticleDefinition pd 
)

Definition at line 79 of file G4ParticleHPJENDLHEData.cc.

80 : G4VCrossSectionDataSet( "JENDLHE"+reaction+"CrossSection" )
81{
82 reactionName = reaction;
83 BuildPhysicsTable( *pd );
84}
void BuildPhysicsTable(const G4ParticleDefinition &)

◆ ~G4ParticleHPJENDLHEData()

G4ParticleHPJENDLHEData::~G4ParticleHPJENDLHEData ( )

Definition at line 87 of file G4ParticleHPJENDLHEData.cc.

88{
89}

Member Function Documentation

◆ BuildPhysicsTable()

void G4ParticleHPJENDLHEData::BuildPhysicsTable ( const G4ParticleDefinition aP)
virtual

Reimplemented from G4VCrossSectionDataSet.

Definition at line 92 of file G4ParticleHPJENDLHEData.cc.

93{
94 particleName = aP.GetParticleName();
95
96 G4String baseName = G4FindDataDir( "G4NEUTRONHPDATA" );
97 G4String dirName = baseName+"/JENDL_HE/"+particleName+"/"+reactionName ;
98 G4String aFSType = "/CrossSection/";
99 G4ParticleHPNames theNames;
100
101 G4String filename;
102
103 // Create JENDL_HE data
104 // Create map element or isotope
105
106 std::size_t numberOfElements = G4Element::GetNumberOfElements();
107
108 // make a PhysicsVector for each element
109
110 static G4ThreadLocal G4ElementTable *theElementTable = 0 ; if (!theElementTable) theElementTable= G4Element::GetElementTable();
111 vElement.clear();
112 vElement.resize( numberOfElements );
113 for ( std::size_t i = 0; i < numberOfElements; ++i )
114 {
115 G4Element* theElement = (*theElementTable)[i];
116 vElement[i] = false;
117
118 // isotope
119 G4int nIso = (G4int)(*theElementTable)[i]->GetNumberOfIsotopes();
120 G4int Z = (G4int)(*theElementTable)[i]->GetZ();
121 if ( nIso!=0 )
122 {
123 G4bool found_at_least_one = false;
124 for ( G4int i1 = 0; i1 < nIso; ++i1 )
125 {
126 G4int A = theElement->GetIsotope(i1)->GetN();
127
128 if ( isThisNewIsotope( Z , A ) )
129 {
130 std::stringstream ss;
131 ss << dirName << aFSType << Z << "_" << A << "_" << theNames.GetName( Z-1 );
132 filename = ss.str();
133 std::fstream file;
134 file.open ( filename , std::fstream::in );
135 G4int dummy;
136 file >> dummy;
137 if ( file.good() )
138 {
139 found_at_least_one = true;
140
141 // read the file
142 G4PhysicsVector* aPhysVec = readAFile ( &file );
143 registAPhysicsVector( Z , A , aPhysVec );
144 }
145 else
146 {
147 //G4cout << "No file for "<< reactionType << " Z=" << Z << ", A=" << A << G4endl;
148 }
149 file.close();
150 }
151 else
152 {
153 found_at_least_one = TRUE;
154 }
155 }
156 if ( found_at_least_one ) vElement[i] = true;
157 }
158 else
159 {
160 G4StableIsotopes theStableOnes;
161 G4int first = theStableOnes.GetFirstIsotope( Z );
162 G4bool found_at_least_one = FALSE;
163 for ( G4int i1 = 0; i1 < theStableOnes.GetNumberOfIsotopes( static_cast<G4int>(theElement->GetZ() ) ); i1++)
164 {
165 G4int A = theStableOnes.GetIsotopeNucleonCount( first+i1 );
166 if ( isThisNewIsotope( Z , A ) )
167 {
168
169 std::stringstream ss;
170 ss << dirName << aFSType << Z << "_" << A << "_" << theNames.GetName( Z-1 );
171 filename = ss.str();
172
173 std::fstream file;
174 file.open ( filename , std::fstream::in );
175 G4int dummy;
176 file >> dummy;
177 if ( file.good() )
178 {
179 //G4cout << "Found file for Z=" << Z << ", A=" << A << ", as " << filename << G4endl;
180 found_at_least_one = TRUE;
181 //Read the file
182
183 G4PhysicsVector* aPhysVec = readAFile ( &file );
184
185 //Regist the PhysicsVector
186 registAPhysicsVector( Z , A , aPhysVec );
187 }
188 else
189 {
190 //G4cout << "No file for "<< reactionType << " Z=" << Z << ", A=" << A << G4endl;
191 }
192 file.close();
193 }
194 else
195 {
196 found_at_least_one = TRUE;
197 }
198 }
199
200 if ( found_at_least_one ) vElement[i] = true;
201 }
202 }
203}
std::vector< G4Element * > G4ElementTable
const char * G4FindDataDir(const char *)
bool G4bool
Definition: G4Types.hh:86
const G4int Z[17]
const G4double A[17]
static G4ElementTable * GetElementTable()
Definition: G4Element.cc:403
G4double GetZ() const
Definition: G4Element.hh:131
static size_t GetNumberOfElements()
Definition: G4Element.cc:410
const G4Isotope * GetIsotope(G4int iso) const
Definition: G4Element.hh:170
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 TRUE
Definition: globals.hh:41
#define FALSE
Definition: globals.hh:38
#define G4ThreadLocal
Definition: tls.hh:77

Referenced by G4ParticleHPJENDLHEData().

◆ DumpPhysicsTable()

void G4ParticleHPJENDLHEData::DumpPhysicsTable ( const G4ParticleDefinition aP)
virtual

Reimplemented from G4VCrossSectionDataSet.

Definition at line 206 of file G4ParticleHPJENDLHEData.cc.

207{
208 if(&aP!=G4Neutron::Neutron())
209 throw G4HadronicException(__FILE__, __LINE__, "Attempt to use NeutronHP data for particles other than neutrons!!!");
210}
static G4Neutron * Neutron()
Definition: G4Neutron.cc:103

◆ GetCrossSection()

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

Definition at line 213 of file G4ParticleHPJENDLHEData.cc.

215{
216 // Primary energy >20MeV
217 // Thus not taking into account of Doppler broadening
218 // also not taking into account of Target thermal motions
219
220 G4double result = 0;
221
222 G4double ek = aP->GetKineticEnergy();
223
224 G4int nIso = (G4int)anE->GetNumberOfIsotopes();
225 G4int Z = (G4int)anE->GetZ();
226 if ( nIso!=0 )
227 {
228 for ( G4int i1 = 0; i1 < nIso; ++i1 )
229 {
230 G4int A = anE->GetIsotope(i1)->GetN();
231 G4double frac = anE->GetRelativeAbundanceVector()[ i1 ]; // This case does NOT request "*perCent".
232 result += frac * getXSfromThisIsotope( Z , A , ek );
233 }
234 }
235 else
236 {
237 G4StableIsotopes theStableOnes;
238 G4int first = theStableOnes.GetFirstIsotope( Z );
239 for ( G4int i1 = 0; i1 < theStableOnes.GetNumberOfIsotopes( (G4int)anE->GetZ() ); ++i1)
240 {
241 G4int A = theStableOnes.GetIsotopeNucleonCount( first+i1 );
242 G4double frac = theStableOnes.GetAbundance( first+i1 )*perCent; // This case requests "*perCent".
243 result += frac * getXSfromThisIsotope( Z , A , ek );
244 }
245 }
246 return result;
247}
double G4double
Definition: G4Types.hh:83
G4double GetKineticEnergy() const
G4double * GetRelativeAbundanceVector() const
Definition: G4Element.hh:167
size_t GetNumberOfIsotopes() const
Definition: G4Element.hh:159
G4double GetAbundance(G4int number)

◆ IsApplicable()

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

Definition at line 41 of file G4ParticleHPJENDLHEData.cc.

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

◆ 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: