Geant4-11
Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes
G4ParticleHPJENDLHEData Class Reference

#include <G4ParticleHPJENDLHEData.hh>

Inheritance diagram for G4ParticleHPJENDLHEData:
G4VCrossSectionDataSet G4ParticleHPJENDLHEElasticData G4ParticleHPJENDLHEInelasticData

Public Member Functions

void BuildPhysicsTable (const G4ParticleDefinition &)
 
G4double ComputeCrossSection (const G4DynamicParticle *, const G4Element *, const G4Material *mat=nullptr)
 
virtual void CrossSectionDescription (std::ostream &) const
 
void DumpPhysicsTable (const G4ParticleDefinition &)
 
bool ForAllAtomsAndEnergies () const
 
 G4ParticleHPJENDLHEData ()
 
 G4ParticleHPJENDLHEData (G4String, G4ParticleDefinition *)
 
G4double GetCrossSection (const G4DynamicParticle *, const G4Element *, const G4Material *mat=nullptr)
 
G4double GetCrossSection (const G4DynamicParticle *, const G4Element *, G4double aT)
 
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)
 
G4double GetMaxKinEnergy () const
 
G4double GetMinKinEnergy () const
 
const G4StringGetName () const
 
virtual G4int GetVerboseLevel () const
 
G4bool IsApplicable (const G4DynamicParticle *, const G4Element *)
 
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)
 
G4bool IsZAApplicable (const G4DynamicParticle *, G4double, G4double)
 
virtual const G4IsotopeSelectIsotope (const G4Element *, G4double kinEnergy, G4double logE)
 
void SetForAllAtomsAndEnergies (G4bool val)
 
void SetMaxKinEnergy (G4double value)
 
void SetMinKinEnergy (G4double value)
 
void SetName (const G4String &nam)
 
virtual void SetVerboseLevel (G4int value)
 
 ~G4ParticleHPJENDLHEData ()
 

Protected Attributes

G4String name
 
G4int verboseLevel
 

Private Member Functions

G4double getXSfromThisIsotope (G4int, G4int, G4double)
 
G4bool isThisInMap (G4int, G4int)
 
G4bool isThisNewIsotope (G4int z, G4int a)
 
G4PhysicsVectorreadAFile (std::fstream *)
 
void registAPhysicsVector (G4int, G4int, G4PhysicsVector *)
 

Private Attributes

G4bool isForAllAtomsAndEnergies
 
G4double maxKinEnergy
 
G4double minKinEnergy
 
std::map< G4int, std::map< G4int, G4PhysicsVector * > * > mIsotope
 
G4String particleName
 
G4String reactionName
 
G4CrossSectionDataSetRegistryregistry
 
std::vector< G4boolvElement
 

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
std::map< G4int, std::map< G4int, G4PhysicsVector * > * > mIsotope

References anonymous_namespace{G4QuasiElRatios.cc}::map, and mIsotope.

◆ 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 &)
G4VCrossSectionDataSet(const G4String &nam="")

References BuildPhysicsTable(), and reactionName.

◆ ~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!!!");
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}
std::vector< G4Element * > G4ElementTable
bool G4bool
Definition: G4Types.hh:86
const G4int Z[17]
const G4double A[17]
#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:131
static size_t GetNumberOfElements()
Definition: G4Element.cc:404
const G4Isotope * GetIsotope(G4int iso) const
Definition: G4Element.hh:170
G4int GetN() const
Definition: G4Isotope.hh:93
const G4String & GetParticleName() const
G4bool isThisNewIsotope(G4int z, G4int a)
void registAPhysicsVector(G4int, G4int, G4PhysicsVector *)
std::vector< G4bool > vElement
G4PhysicsVector * readAFile(std::fstream *)
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

References A, FALSE, geant4_check_module_cycles::file, G4ThreadLocal, G4Element::GetElementTable(), G4StableIsotopes::GetFirstIsotope(), G4Element::GetIsotope(), G4StableIsotopes::GetIsotopeNucleonCount(), G4Isotope::GetN(), G4ParticleHPNames::GetName(), G4Element::GetNumberOfElements(), G4StableIsotopes::GetNumberOfIsotopes(), G4ParticleDefinition::GetParticleName(), G4Element::GetZ(), isThisNewIsotope(), particleName, reactionName, readAFile(), registAPhysicsVector(), TRUE, vElement, and Z.

Referenced by G4ParticleHPJENDLHEData().

◆ ComputeCrossSection()

G4double G4VCrossSectionDataSet::ComputeCrossSection ( const G4DynamicParticle part,
const G4Element elm,
const G4Material mat = nullptr 
)
inherited

Definition at line 81 of file G4VCrossSectionDataSet.cc.

84{
85 G4int Z = elm->GetZasInt();
86
87 if (IsElementApplicable(part, Z, mat)) {
88 return GetElementCrossSection(part, Z, mat);
89 }
90
91 // isotope-wise cross section making sum over available
92 // isotope cross sections, which may be incomplete, so
93 // the result is corrected
94 size_t nIso = elm->GetNumberOfIsotopes();
95 G4double fact = 0.0;
96 G4double xsec = 0.0;
97
98 // user-defined isotope abundances
99 const G4IsotopeVector* isoVector = elm->GetIsotopeVector();
100 const G4double* abundVector = elm->GetRelativeAbundanceVector();
101
102 for (size_t j=0; j<nIso; ++j) {
103 const G4Isotope* iso = (*isoVector)[j];
104 G4int A = iso->GetN();
105 if(abundVector[j] > 0.0 && IsIsoApplicable(part, Z, A, elm, mat)) {
106 fact += abundVector[j];
107 xsec += abundVector[j]*GetIsoCrossSection(part, Z, A, iso, elm, mat);
108 }
109 }
110 return (fact > 0.0) ? xsec/fact : 0.0;
111}
std::vector< G4Isotope * > G4IsotopeVector
double G4double
Definition: G4Types.hh:83
G4double * GetRelativeAbundanceVector() const
Definition: G4Element.hh:167
size_t GetNumberOfIsotopes() const
Definition: G4Element.hh:159
G4int GetZasInt() const
Definition: G4Element.hh:132
G4IsotopeVector * GetIsotopeVector() const
Definition: G4Element.hh:163
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 G4bool IsIsoApplicable(const G4DynamicParticle *, G4int Z, G4int A, const G4Element *elm=nullptr, const G4Material *mat=nullptr)
virtual G4bool IsElementApplicable(const G4DynamicParticle *, G4int Z, const G4Material *mat=nullptr)

References A, G4VCrossSectionDataSet::GetElementCrossSection(), G4VCrossSectionDataSet::GetIsoCrossSection(), G4Element::GetIsotopeVector(), G4Isotope::GetN(), G4Element::GetNumberOfIsotopes(), G4Element::GetRelativeAbundanceVector(), G4Element::GetZasInt(), G4VCrossSectionDataSet::IsElementApplicable(), G4VCrossSectionDataSet::IsIsoApplicable(), and Z.

Referenced by G4VCrossSectionDataSet::GetCrossSection().

◆ CrossSectionDescription()

void G4VCrossSectionDataSet::CrossSectionDescription ( std::ostream &  outFile) const
virtualinherited

◆ 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

References G4Neutron::Neutron().

◆ ForAllAtomsAndEnergies()

bool G4VCrossSectionDataSet::ForAllAtomsAndEnergies ( ) const
inlineinherited

◆ GetCrossSection() [1/2]

G4double G4VCrossSectionDataSet::GetCrossSection ( const G4DynamicParticle dp,
const G4Element elm,
const G4Material mat = nullptr 
)
inlineinherited

Definition at line 187 of file G4VCrossSectionDataSet.hh.

190{
191 return ComputeCrossSection(dp, elm, mat);
192}
G4double ComputeCrossSection(const G4DynamicParticle *, const G4Element *, const G4Material *mat=nullptr)

References G4VCrossSectionDataSet::ComputeCrossSection().

◆ GetCrossSection() [2/2]

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}
static constexpr double perCent
Definition: G4SIunits.hh:325
G4double GetKineticEnergy() const
G4double getXSfromThisIsotope(G4int, G4int, G4double)
G4double GetAbundance(G4int number)

References A, G4StableIsotopes::GetAbundance(), G4StableIsotopes::GetFirstIsotope(), G4Element::GetIsotope(), G4StableIsotopes::GetIsotopeNucleonCount(), G4DynamicParticle::GetKineticEnergy(), G4Isotope::GetN(), G4Element::GetNumberOfIsotopes(), G4StableIsotopes::GetNumberOfIsotopes(), G4Element::GetRelativeAbundanceVector(), getXSfromThisIsotope(), G4Element::GetZ(), perCent, and Z.

◆ GetElementCrossSection()

G4double G4VCrossSectionDataSet::GetElementCrossSection ( const G4DynamicParticle dynPart,
G4int  Z,
const G4Material mat = nullptr 
)
virtualinherited

Reimplemented in G4EMDissociationCrossSection, G4IonsShenCrossSection, G4NeutrinoElectronCcXsc, G4NeutrinoElectronNcXsc, G4NeutrinoElectronTotXsc, G4NeutronElectronElXsc, G4PhotoNuclearCrossSection, G4NeutronCaptureXS, G4NeutronElasticXS, G4NeutronInelasticXS, G4ElectroNuclearCrossSection, G4BGGNucleonElasticXS, G4BGGPionElasticXS, G4BGGPionInelasticXS, G4BGGNucleonInelasticXS, G4CrossSectionElastic, G4CrossSectionInelastic, G4GammaNuclearXS, G4ParticleInelasticXS, G4ZeroXS, G4NucleonNuclearCrossSection, G4MuNeutrinoNucleusTotXsc, and G4KokoulinMuonNuclearXS.

Definition at line 114 of file G4VCrossSectionDataSet.cc.

117{
119 ed << "GetElementCrossSection is not implemented in <" << name << ">\n"
120 << "Particle: " << dynPart->GetDefinition()->GetParticleName()
121 << " Ekin(MeV)= " << dynPart->GetKineticEnergy()/MeV;
122 if(mat) { ed << " material: " << mat->GetName(); }
123 ed << " target Z= " << Z << G4endl;
124 G4Exception("G4VCrossSectionDataSet::GetElementCrossSection", "had001",
125 FatalException, ed);
126 return 0.0;
127}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:35
std::ostringstream G4ExceptionDescription
Definition: G4Exception.hh:40
static constexpr double MeV
Definition: G4SIunits.hh:200
#define G4endl
Definition: G4ios.hh:57
G4ParticleDefinition * GetDefinition() const
const G4String & GetName() const
Definition: G4Material.hh:173

References FatalException, G4endl, G4Exception(), G4DynamicParticle::GetDefinition(), G4DynamicParticle::GetKineticEnergy(), G4Material::GetName(), G4ParticleDefinition::GetParticleName(), MeV, G4VCrossSectionDataSet::name, and Z.

Referenced by G4QMDReaction::ApplyYourself(), G4VCrossSectionDataSet::ComputeCrossSection(), G4GammaNuclearXS::GetElementCrossSection(), G4GammaNuclearXS::GetIsoCrossSection(), and G4GammaNuclearXS::Initialise().

◆ GetIsoCrossSection()

G4double G4VCrossSectionDataSet::GetIsoCrossSection ( const G4DynamicParticle dynPart,
G4int  Z,
G4int  A,
const G4Isotope iso = nullptr,
const G4Element elm = nullptr,
const G4Material mat = nullptr 
)
virtualinherited

Reimplemented in G4ChipsAntiBaryonElasticXS, G4ChipsAntiBaryonInelasticXS, G4ChipsHyperonElasticXS, G4ChipsHyperonInelasticXS, G4ChipsKaonMinusElasticXS, G4ChipsKaonMinusInelasticXS, G4ChipsKaonPlusElasticXS, G4ChipsKaonPlusInelasticXS, G4ChipsKaonZeroElasticXS, G4ChipsKaonZeroInelasticXS, G4ChipsNeutronElasticXS, G4ChipsNeutronInelasticXS, G4ChipsPionMinusElasticXS, G4ChipsPionMinusInelasticXS, G4ChipsPionPlusElasticXS, G4ChipsPionPlusInelasticXS, G4ChipsProtonElasticXS, G4ChipsProtonInelasticXS, G4NeutronCaptureXS, G4NeutronElasticXS, G4NeutronInelasticXS, G4IonsShenCrossSection, G4ElNucleusSFcs, G4BGGNucleonElasticXS, G4BGGPionElasticXS, G4BGGPionInelasticXS, G4GammaNuclearXS, G4ParticleInelasticXS, G4BGGNucleonInelasticXS, G4LENDCombinedCrossSection, G4LENDCrossSection, G4LENDGammaCrossSection, G4ParticleHPCaptureData, G4ParticleHPElasticData, G4ParticleHPFissionData, G4ParticleHPInelasticData, G4ParticleHPThermalScatteringData, G4MuNeutrinoNucleusTotXsc, G4ElNeutrinoNucleusTotXsc, and G4PhotoNuclearCrossSection.

Definition at line 130 of file G4VCrossSectionDataSet.cc.

135{
137 ed << "GetIsoCrossSection is not implemented in <" << name << ">\n"
138 << "Particle: " << dynPart->GetDefinition()->GetParticleName()
139 << " Ekin(MeV)= " << dynPart->GetKineticEnergy()/MeV;
140 if(mat) { ed << " material: " << mat->GetName(); }
141 if(elm) { ed << " element: " << elm->GetName(); }
142 ed << " target Z= " << Z << " A= " << A << G4endl;
143 G4Exception("G4VCrossSectionDataSet::GetIsoCrossSection", "had001",
144 FatalException, ed);
145 return 0.0;
146}
const G4String & GetName() const
Definition: G4Element.hh:127

References A, FatalException, G4endl, G4Exception(), G4DynamicParticle::GetDefinition(), G4DynamicParticle::GetKineticEnergy(), G4Element::GetName(), G4Material::GetName(), G4ParticleDefinition::GetParticleName(), MeV, G4VCrossSectionDataSet::name, and Z.

Referenced by G4VCrossSectionDataSet::ComputeCrossSection(), G4GammaNuclearXS::GetIsoCrossSection(), and G4GammaNuclearXS::Initialise().

◆ GetMaxKinEnergy()

G4double G4VCrossSectionDataSet::GetMaxKinEnergy ( ) const
inlineinherited

◆ GetMinKinEnergy()

G4double G4VCrossSectionDataSet::GetMinKinEnergy ( ) const
inlineinherited

◆ GetName()

const G4String & G4VCrossSectionDataSet::GetName ( ) const
inlineinherited

◆ GetVerboseLevel()

G4int G4VCrossSectionDataSet::GetVerboseLevel ( ) const
inlinevirtualinherited

◆ getXSfromThisIsotope()

G4double G4ParticleHPJENDLHEData::getXSfromThisIsotope ( G4int  Z,
G4int  A,
G4double  ek 
)
private

Definition at line 364 of file G4ParticleHPJENDLHEData.cc.

365{
366
367 G4double aXSection = 0.0;
368 G4bool outOfRange;
369
370 G4PhysicsVector* aPhysVec;
371 if ( mIsotope.find ( Z )->second->find ( A ) != mIsotope.find ( Z )->second->end() )
372 {
373
374 aPhysVec = mIsotope.find ( Z )->second->find ( A )->second;
375 aXSection = aPhysVec->GetValue( ek , outOfRange );
376
377 }
378 else
379 {
380
381 //Select closest one in the same Z
382 std::map < G4int , G4PhysicsVector* >::iterator it;
383 G4int delta0 = 99; // no mean for 99
384 for ( it = mIsotope.find ( Z )->second->begin() ; it != mIsotope.find ( Z )->second->end() ; it++ )
385 {
386 G4int delta = std::abs( A - it->first );
387 if ( delta < delta0 ) delta0 = delta;
388 }
389
390 // Randomize of selection larger or smaller than A
391 if ( G4UniformRand() < 0.5 ) delta0 *= -1;
392 G4int A1 = A + delta0;
393 if ( mIsotope.find ( Z )->second->find ( A1 ) != mIsotope.find ( Z )->second->end() )
394 {
395 aPhysVec = mIsotope.find ( Z )->second->find ( A1 )->second;
396 }
397 else
398 {
399 A1 = A - delta0;
400 aPhysVec = mIsotope.find ( Z )->second->find ( A1 )->second;
401 }
402
403 aXSection = aPhysVec->GetValue( ek , outOfRange );
404 // X^(2/3) factor
405 //aXSection *= std::pow ( 1.0*A/ A1 , 2.0 / 3.0 );
406 aXSection *= G4Pow::GetInstance()->A23( 1.0*A/ A1 );
407
408 }
409
410 return aXSection;
411}
#define G4UniformRand()
Definition: Randomize.hh:52
G4double GetValue(const G4double energy, G4bool &isOutRange) const
static G4Pow * GetInstance()
Definition: G4Pow.cc:41
G4double A23(G4double A) const
Definition: G4Pow.hh:131

References A, G4Pow::A23(), G4UniformRand, G4Pow::GetInstance(), G4PhysicsVector::GetValue(), mIsotope, and Z.

Referenced by GetCrossSection().

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

References G4Element::GetIndex(), G4DynamicParticle::GetKineticEnergy(), MeV, G4Neutron::Neutron(), and vElement.

◆ IsElementApplicable()

G4bool G4VCrossSectionDataSet::IsElementApplicable ( const G4DynamicParticle ,
G4int  Z,
const G4Material mat = nullptr 
)
virtualinherited

◆ IsIsoApplicable()

G4bool G4VCrossSectionDataSet::IsIsoApplicable ( const G4DynamicParticle ,
G4int  Z,
G4int  A,
const G4Element elm = nullptr,
const G4Material mat = nullptr 
)
virtualinherited

◆ isThisInMap()

G4bool G4ParticleHPJENDLHEData::isThisInMap ( G4int  z,
G4int  a 
)
private

Definition at line 333 of file G4ParticleHPJENDLHEData.cc.

334{
335 if ( mIsotope.find ( z ) == mIsotope.end() ) return false;
336 if ( mIsotope.find ( z ) -> second->find ( a ) == mIsotope.find ( z ) -> second->end() ) return false;
337 return true;
338}
static constexpr double second
Definition: G4SIunits.hh:137

References mIsotope, and second.

Referenced by isThisNewIsotope().

◆ isThisNewIsotope()

G4bool G4ParticleHPJENDLHEData::isThisNewIsotope ( G4int  z,
G4int  a 
)
inlineprivate

Definition at line 76 of file G4ParticleHPJENDLHEData.hh.

76{ return !( isThisInMap( z , a ) ); };
G4bool isThisInMap(G4int, G4int)

References isThisInMap().

Referenced by BuildPhysicsTable().

◆ IsZAApplicable()

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

Definition at line 60 of file G4ParticleHPJENDLHEData.hh.

61 { return false; }

◆ readAFile()

G4PhysicsVector * G4ParticleHPJENDLHEData::readAFile ( std::fstream *  file)
private

Definition at line 298 of file G4ParticleHPJENDLHEData.cc.

299{
300
301 G4int dummy;
302 G4int len;
303 *file >> dummy;
304 *file >> len;
305
306 std::vector< G4double > v_e;
307 std::vector< G4double > v_xs;
308
309 for ( G4int i = 0 ; i < len ; i++ )
310 {
311 G4double e;
312 G4double xs;
313
314 *file >> e;
315 *file >> xs;
316 // data are written in eV and barn.
317 v_e.push_back( e*eV );
318 v_xs.push_back( xs*barn );
319 }
320
321 G4PhysicsFreeVector* aPhysVec = new G4PhysicsFreeVector( static_cast< size_t >( len ) , v_e.front() , v_e.back() );
322
323 for ( G4int i = 0 ; i < len ; i++ )
324 {
325 aPhysVec->PutValues( static_cast< size_t >( i ) , v_e[ i ] , v_xs[ i ] );
326 }
327
328 return aPhysVec;
329}
static constexpr double barn
Definition: G4SIunits.hh:85
static constexpr double eV
Definition: G4SIunits.hh:201
void PutValues(const std::size_t index, const G4double energy, const G4double value)

References barn, eV, geant4_check_module_cycles::file, and G4PhysicsFreeVector::PutValues().

Referenced by BuildPhysicsTable().

◆ registAPhysicsVector()

void G4ParticleHPJENDLHEData::registAPhysicsVector ( G4int  Z,
G4int  A,
G4PhysicsVector aPhysVec 
)
private

Definition at line 342 of file G4ParticleHPJENDLHEData.cc.

343{
344
345 std::pair< G4int , G4PhysicsVector* > aPair = std::pair < G4int , G4PhysicsVector* > ( A , aPhysVec );
346
347 std::map < G4int , std::map< G4int , G4PhysicsVector* >* >::iterator itm;
348 itm = mIsotope.find ( Z );
349 if ( itm != mIsotope.end() )
350 {
351 itm->second->insert ( aPair );
352 }
353 else
354 {
355 std::map< G4int , G4PhysicsVector* >* aMap = new std::map< G4int , G4PhysicsVector* >;
356 aMap->insert ( aPair );
357 mIsotope.insert( std::pair< G4int , std::map< G4int , G4PhysicsVector* >* > ( Z , aMap ) );
358 }
359
360}

References A, mIsotope, and Z.

Referenced by BuildPhysicsTable().

◆ SelectIsotope()

const G4Isotope * G4VCrossSectionDataSet::SelectIsotope ( const G4Element anElement,
G4double  kinEnergy,
G4double  logE 
)
virtualinherited

Reimplemented in G4GammaNuclearXS, G4NeutronCaptureXS, G4NeutronElasticXS, G4NeutronInelasticXS, and G4ParticleInelasticXS.

Definition at line 149 of file G4VCrossSectionDataSet.cc.

151{
152 size_t nIso = anElement->GetNumberOfIsotopes();
153 const G4Isotope* iso = anElement->GetIsotope(0);
154
155 // more than 1 isotope
156 if(1 < nIso) {
157 const G4double* abundVector = anElement->GetRelativeAbundanceVector();
158 G4double sum = 0.0;
160 for (size_t j=0; j<nIso; ++j) {
161 sum += abundVector[j];
162 if(q <= sum) {
163 iso = anElement->GetIsotope(j);
164 break;
165 }
166 }
167 }
168 return iso;
169}

References G4UniformRand, G4Element::GetIsotope(), G4Element::GetNumberOfIsotopes(), and G4Element::GetRelativeAbundanceVector().

◆ SetForAllAtomsAndEnergies()

void G4VCrossSectionDataSet::SetForAllAtomsAndEnergies ( G4bool  val)
inlineinherited

◆ SetMaxKinEnergy()

void G4VCrossSectionDataSet::SetMaxKinEnergy ( G4double  value)
inlineinherited

◆ SetMinKinEnergy()

void G4VCrossSectionDataSet::SetMinKinEnergy ( G4double  value)
inlineinherited

◆ SetName()

void G4VCrossSectionDataSet::SetName ( const G4String nam)
inlineinherited

Definition at line 240 of file G4VCrossSectionDataSet.hh.

241{
242 name = nam;
243}

References G4VCrossSectionDataSet::name.

Referenced by G4ParticleHPInelasticData::G4ParticleHPInelasticData().

◆ SetVerboseLevel()

void G4VCrossSectionDataSet::SetVerboseLevel ( G4int  value)
inlinevirtualinherited

Field Documentation

◆ isForAllAtomsAndEnergies

G4bool G4VCrossSectionDataSet::isForAllAtomsAndEnergies
privateinherited

◆ maxKinEnergy

G4double G4VCrossSectionDataSet::maxKinEnergy
privateinherited

◆ minKinEnergy

G4double G4VCrossSectionDataSet::minKinEnergy
privateinherited

◆ mIsotope

std::map< G4int , std::map< G4int , G4PhysicsVector* >* > G4ParticleHPJENDLHEData::mIsotope
private

◆ name

G4String G4VCrossSectionDataSet::name
protectedinherited

◆ particleName

G4String G4ParticleHPJENDLHEData::particleName
private

Definition at line 83 of file G4ParticleHPJENDLHEData.hh.

Referenced by BuildPhysicsTable().

◆ reactionName

G4String G4ParticleHPJENDLHEData::reactionName
private

Definition at line 82 of file G4ParticleHPJENDLHEData.hh.

Referenced by BuildPhysicsTable(), and G4ParticleHPJENDLHEData().

◆ registry

G4CrossSectionDataSetRegistry* G4VCrossSectionDataSet::registry
privateinherited

◆ vElement

std::vector< G4bool > G4ParticleHPJENDLHEData::vElement
private

Definition at line 71 of file G4ParticleHPJENDLHEData.hh.

Referenced by BuildPhysicsTable(), and IsApplicable().

◆ verboseLevel

G4int G4VCrossSectionDataSet::verboseLevel
protectedinherited

Definition at line 168 of file G4VCrossSectionDataSet.hh.

Referenced by G4BGGNucleonElasticXS::BuildPhysicsTable(), G4BGGPionElasticXS::BuildPhysicsTable(), G4BGGPionInelasticXS::BuildPhysicsTable(), G4GammaNuclearXS::BuildPhysicsTable(), G4NeutronCaptureXS::BuildPhysicsTable(), G4NeutronElasticXS::BuildPhysicsTable(), G4NeutronInelasticXS::BuildPhysicsTable(), G4ParticleInelasticXS::BuildPhysicsTable(), G4BGGNucleonInelasticXS::BuildPhysicsTable(), G4LENDCrossSection::create_used_target_map(), G4BGGNucleonElasticXS::G4BGGNucleonElasticXS(), G4BGGNucleonInelasticXS::G4BGGNucleonInelasticXS(), G4BGGPionElasticXS::G4BGGPionElasticXS(), G4BGGPionInelasticXS::G4BGGPionInelasticXS(), G4GammaNuclearXS::G4GammaNuclearXS(), G4NeutronCaptureXS::G4NeutronCaptureXS(), G4NeutronElasticXS::G4NeutronElasticXS(), G4NeutronInelasticXS::G4NeutronInelasticXS(), G4ParticleInelasticXS::G4ParticleInelasticXS(), G4NeutronCaptureXS::GetElementCrossSection(), G4NeutronElasticXS::GetElementCrossSection(), G4NeutronInelasticXS::GetElementCrossSection(), G4BGGNucleonElasticXS::GetElementCrossSection(), G4BGGPionElasticXS::GetElementCrossSection(), G4BGGPionInelasticXS::GetElementCrossSection(), G4BGGNucleonInelasticXS::GetElementCrossSection(), G4GammaNuclearXS::GetElementCrossSection(), G4ParticleInelasticXS::GetElementCrossSection(), G4BGGNucleonElasticXS::GetIsoCrossSection(), G4BGGPionElasticXS::GetIsoCrossSection(), G4BGGPionInelasticXS::GetIsoCrossSection(), G4GammaNuclearXS::GetIsoCrossSection(), G4BGGNucleonInelasticXS::GetIsoCrossSection(), G4VCrossSectionDataSet::GetVerboseLevel(), G4NeutronElasticXS::Initialise(), G4ParticleInelasticXS::IsoCrossSection(), G4NeutronCaptureXS::IsoCrossSection(), G4NeutronInelasticXS::IsoCrossSection(), G4GammaNuclearXS::RetrieveVector(), G4NeutronCaptureXS::RetrieveVector(), G4NeutronInelasticXS::RetrieveVector(), G4ParticleInelasticXS::RetrieveVector(), and G4VCrossSectionDataSet::SetVerboseLevel().


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