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

#include <G4NeutronHPElementData.hh>

+ Inheritance diagram for G4NeutronHPElementData:

Public Member Functions

 G4NeutronHPElementData ()
 
 ~G4NeutronHPElementData ()
 
void Init (G4Element *theElement)
 
void UpdateData (G4int A, G4int Z, G4int index, G4double abundance)
 
void UpdateData (G4int A, G4int Z, G4int M, G4int index, G4double abundance)
 
void Harmonise (G4NeutronHPVector *&theStore, G4NeutronHPVector *theNew)
 
G4NeutronHPVectorGetData (G4NeutronHPFissionData *)
 
G4NeutronHPVectorGetData (G4NeutronHPCaptureData *)
 
G4NeutronHPVectorGetData (G4NeutronHPElasticData *)
 
G4NeutronHPVectorGetData (G4NeutronHPInelasticData *)
 
G4NeutronHPVectorMakePhysicsVector (G4Element *theElement, G4ParticleDefinition *theP, G4NeutronHPFissionData *theSet)
 
G4NeutronHPVectorMakePhysicsVector (G4Element *theElement, G4ParticleDefinition *theP, G4NeutronHPCaptureData *theSet)
 
G4NeutronHPVectorMakePhysicsVector (G4Element *theElement, G4ParticleDefinition *theP, G4NeutronHPElasticData *theSet)
 
G4NeutronHPVectorMakePhysicsVector (G4Element *theElement, G4ParticleDefinition *theP, G4NeutronHPInelasticData *theSet)
 
- Public Member Functions inherited from G4HadronCrossSections
 G4HadronCrossSections ()
 
 ~G4HadronCrossSections ()
 
G4bool IsApplicable (const G4DynamicParticle *aParticle)
 
G4double GetElasticCrossSection (const G4DynamicParticle *, G4int, G4int)
 
G4double GetInelasticCrossSection (const G4DynamicParticle *, G4int, G4int)
 
G4double GetCaptureCrossSection (const G4DynamicParticle *, G4int)
 
G4double GetFissionCrossSection (const G4DynamicParticle *, G4int, G4int)
 
void SetVerboseLevel (G4int value)
 
G4int GetVerboseLevel ()
 

Additional Inherited Members

- Static Public Member Functions inherited from G4HadronCrossSections
static G4HadronCrossSectionsInstance ()
 
static void SetCorrectInelasticNearZero (G4bool value)
 
static G4bool GetCorrectInelasticNearZero ()
 

Detailed Description

Definition at line 53 of file G4NeutronHPElementData.hh.

Constructor & Destructor Documentation

◆ G4NeutronHPElementData()

G4NeutronHPElementData::G4NeutronHPElementData ( )

Definition at line 35 of file G4NeutronHPElementData.cc.

36 {
37 precision = 0.02;
38 theFissionData = new G4NeutronHPVector;
39 theCaptureData = new G4NeutronHPVector;
40 theElasticData = new G4NeutronHPVector;
41 theInelasticData = new G4NeutronHPVector;
42 theIsotopeWiseData = 0;
43 }

◆ ~G4NeutronHPElementData()

G4NeutronHPElementData::~G4NeutronHPElementData ( )

Definition at line 45 of file G4NeutronHPElementData.cc.

46 {
47 delete theFissionData;
48 delete theCaptureData;
49 delete theElasticData;
50 delete theInelasticData;
51 delete [] theIsotopeWiseData;
52 }

Member Function Documentation

◆ GetData() [1/4]

G4NeutronHPVector * G4NeutronHPElementData::GetData ( G4NeutronHPCaptureData )
inline

Definition at line 71 of file G4NeutronHPElementData.hh.

72 {return theCaptureData;}

◆ GetData() [2/4]

G4NeutronHPVector * G4NeutronHPElementData::GetData ( G4NeutronHPElasticData )
inline

Definition at line 73 of file G4NeutronHPElementData.hh.

74 {return theElasticData;}

◆ GetData() [3/4]

G4NeutronHPVector * G4NeutronHPElementData::GetData ( G4NeutronHPFissionData )
inline

Definition at line 69 of file G4NeutronHPElementData.hh.

70 {return theFissionData;}

Referenced by G4NeutronHPorLEInelasticData::BuildPhysicsTable(), and MakePhysicsVector().

◆ GetData() [4/4]

G4NeutronHPVector * G4NeutronHPElementData::GetData ( G4NeutronHPInelasticData )
inline

Definition at line 75 of file G4NeutronHPElementData.hh.

76 {return theInelasticData;}

◆ Harmonise()

void G4NeutronHPElementData::Harmonise ( G4NeutronHPVector *&  theStore,
G4NeutronHPVector theNew 
)

Definition at line 141 of file G4NeutronHPElementData.cc.

142 {
143 if(theNew == 0) { return; }
144 G4int s_tmp = 0, n=0, m_tmp=0;
145 G4NeutronHPVector * theMerge = new G4NeutronHPVector(theStore->GetVectorLength());
146// G4cout << "Harmonise 1: "<<theStore->GetEnergy(s)<<" "<<theNew->GetEnergy(0)<<G4endl;
147 while ( theStore->GetEnergy(s_tmp)<theNew->GetEnergy(0)&&s_tmp<theStore->GetVectorLength() )
148 {
149 theMerge->SetData(m_tmp++, theStore->GetEnergy(s_tmp), theStore->GetXsec(s_tmp));
150 s_tmp++;
151 }
152 G4NeutronHPVector *active = theStore;
153 G4NeutronHPVector * passive = theNew;
154 G4NeutronHPVector * tmp;
155 G4int a = s_tmp, p = n, t;
156// G4cout << "Harmonise 2: "<<active->GetVectorLength()<<" "<<passive->GetVectorLength()<<G4endl;
157 while (a<active->GetVectorLength()&&p<passive->GetVectorLength())
158 {
159 if(active->GetEnergy(a) <= passive->GetEnergy(p))
160 {
161 theMerge->SetData(m_tmp, active->GetEnergy(a), active->GetXsec(a));
162 G4double x = theMerge->GetEnergy(m_tmp);
163 G4double y = std::max(0., passive->GetXsec(x));
164 theMerge->SetData(m_tmp, x, theMerge->GetXsec(m_tmp)+y);
165 m_tmp++;
166 a++;
167 } else {
168// G4cout << "swapping in Harmonise"<<G4endl;
169 tmp = active; t=a;
170 active = passive; a=p;
171 passive = tmp; p=t;
172 }
173 }
174// G4cout << "Harmonise 3: "<< a <<" "<<active->GetVectorLength()<<" "<<m<<G4endl;
175 while (a!=active->GetVectorLength())
176 {
177 theMerge->SetData(m_tmp++, active->GetEnergy(a), active->GetXsec(a));
178 a++;
179 }
180// G4cout << "Harmonise 4: "<< p <<" "<<passive->GetVectorLength()<<" "<<m<<G4endl;
181 while (p!=passive->GetVectorLength())
182 {
183 // Modified by T. KOI
184 //theMerge->SetData(m++, passive->GetEnergy(p), passive->GetXsec(p));
185 G4double x = passive->GetEnergy(p);
186 G4double y = std::max(0., active->GetXsec(x));
187 theMerge->SetData(m_tmp++, x, passive->GetXsec(p)+y);
188 p++;
189 }
190// G4cout <<"Harmonise 5: "<< theMerge->GetVectorLength() << " " << m << G4endl;
191 delete theStore;
192 theStore = theMerge;
193// G4cout <<"Harmonise 6: "<< theStore->GetVectorLength() << " " << m << G4endl;
194 }
double G4double
Definition: G4Types.hh:64
int G4int
Definition: G4Types.hh:66
G4int GetVectorLength() const
G4double GetEnergy(G4int i) const
G4double GetXsec(G4int i)
void SetData(G4int i, G4double x, G4double y)

Referenced by UpdateData().

◆ Init()

void G4NeutronHPElementData::Init ( G4Element theElement)

Definition at line 54 of file G4NeutronHPElementData.cc.

55 {
56 G4int count = theElement->GetNumberOfIsotopes();
57 if(count == 0) count +=
58 theStableOnes.GetNumberOfIsotopes(static_cast<G4int>(theElement->GetZ()));
59 theIsotopeWiseData = new G4NeutronHPIsoData[count];
60 // filename = ein data-set je isotope.
61 count = 0;
62 G4int nIso = theElement->GetNumberOfIsotopes();
63 G4int Z = static_cast<G4int> (theElement->GetZ());
64 //G4int i1;
65 if(nIso!=0)
66 {
67 for (G4int i1=0; i1<nIso; i1++)
68 {
69// G4cout <<" Init: normal case"<<G4endl;
70 G4int A = theElement->GetIsotope(i1)->GetN();
71 G4int M = theElement->GetIsotope(i1)->Getm();
72 G4double frac = theElement->GetRelativeAbundanceVector()[i1]/perCent;
73 //UpdateData(A, Z, count++, frac);
74 UpdateData(A, Z, M, count++, frac);
75 }
76 }else{
77// G4cout <<" Init: theStableOnes case: Z="<<Z<<G4endl;
78 G4int first = theStableOnes.GetFirstIsotope(Z);
79// G4cout <<"first="<<first<<" "<<theStableOnes.GetNumberOfIsotopes(theElement->GetZ())<<G4endl;
80 for(G4int i1=0;
81 i1<theStableOnes.GetNumberOfIsotopes(static_cast<G4int>(theElement->GetZ()) );
82 i1++)
83 {
84// G4cout <<" Init: theStableOnes in the loop"<<G4endl;
85 G4int A = theStableOnes.GetIsotopeNucleonCount(first+i1);
86 G4double frac = theStableOnes.GetAbundance(first+i1);
87// G4cout <<" Init: theStableOnes in the loop: "<<A<<G4endl;
88 UpdateData(A, Z, count++, frac);
89 }
90 }
91 theElasticData->ThinOut(precision);
92 theInelasticData->ThinOut(precision);
93 theCaptureData->ThinOut(precision);
94 theFissionData->ThinOut(precision);
95 }
G4double * GetRelativeAbundanceVector() const
Definition: G4Element.hh:166
G4double GetZ() const
Definition: G4Element.hh:131
const G4Isotope * GetIsotope(G4int iso) const
Definition: G4Element.hh:169
size_t GetNumberOfIsotopes() const
Definition: G4Element.hh:158
G4int Getm() const
Definition: G4Isotope.hh:100
G4int GetN() const
Definition: G4Isotope.hh:94
void UpdateData(G4int A, G4int Z, G4int index, G4double abundance)
void ThinOut(G4double precision)
G4double GetAbundance(G4int number)
G4int GetFirstIsotope(G4int Z)
G4int GetNumberOfIsotopes(G4int Z)
G4int GetIsotopeNucleonCount(G4int number)

Referenced by G4NeutronHPorLEInelasticData::BuildPhysicsTable(), and MakePhysicsVector().

◆ MakePhysicsVector() [1/4]

G4NeutronHPVector * G4NeutronHPElementData::MakePhysicsVector ( G4Element theElement,
G4ParticleDefinition theP,
G4NeutronHPCaptureData theSet 
)

Definition at line 204 of file G4NeutronHPElementData.cc.

207 {
208 if(theP != G4Neutron::Neutron()) throw G4HadronicException(__FILE__, __LINE__, "not a neutron");
209 Init ( theElement );
210 return GetData(theSet);
211 }
void Init(G4Element *theElement)
G4NeutronHPVector * GetData(G4NeutronHPFissionData *)
static G4Neutron * Neutron()
Definition: G4Neutron.cc:104

◆ MakePhysicsVector() [2/4]

G4NeutronHPVector * G4NeutronHPElementData::MakePhysicsVector ( G4Element theElement,
G4ParticleDefinition theP,
G4NeutronHPElasticData theSet 
)

Definition at line 212 of file G4NeutronHPElementData.cc.

215 {
216 if(theP != G4Neutron::Neutron()) throw G4HadronicException(__FILE__, __LINE__, "not a neutron");
217 Init ( theElement );
218 return GetData(theSet);
219 }

◆ MakePhysicsVector() [3/4]

G4NeutronHPVector * G4NeutronHPElementData::MakePhysicsVector ( G4Element theElement,
G4ParticleDefinition theP,
G4NeutronHPFissionData theSet 
)

Definition at line 196 of file G4NeutronHPElementData.cc.

199 {
200 if(theP != G4Neutron::Neutron()) throw G4HadronicException(__FILE__, __LINE__, "not a neutron");
201 Init ( theElement );
202 return GetData(theSet);
203 }

◆ MakePhysicsVector() [4/4]

G4NeutronHPVector * G4NeutronHPElementData::MakePhysicsVector ( G4Element theElement,
G4ParticleDefinition theP,
G4NeutronHPInelasticData theSet 
)

Definition at line 220 of file G4NeutronHPElementData.cc.

223 {
224 if(theP != G4Neutron::Neutron()) throw G4HadronicException(__FILE__, __LINE__, "not a neutron");
225 Init ( theElement );
226 return GetData(theSet);
227 }

◆ UpdateData() [1/2]

void G4NeutronHPElementData::UpdateData ( G4int  A,
G4int  Z,
G4int  index,
G4double  abundance 
)
inline

Definition at line 64 of file G4NeutronHPElementData.hh.

64{ G4int M=0; UpdateData( A, Z, M, index, abundance); };

Referenced by Init(), and UpdateData().

◆ UpdateData() [2/2]

void G4NeutronHPElementData::UpdateData ( G4int  A,
G4int  Z,
G4int  M,
G4int  index,
G4double  abundance 
)

Definition at line 98 of file G4NeutronHPElementData.cc.

99 {
100 //Reads in the Data, using G4NeutronHPIsoData[], and its Init
101// G4cout << "entered: ElementWiseData::UpdateData"<<G4endl;
102 //theIsotopeWiseData[index].Init(A, Z, abundance);
103 theIsotopeWiseData[index].Init(A, Z, M, abundance);
104// G4cout << "ElementWiseData::UpdateData Init finished"<<G4endl;
105
106 theBuffer = theIsotopeWiseData[index].MakeElasticData();
107// G4cout << "ElementWiseData::UpdateData MakeElasticData finished: "
108// <<theBuffer->GetVectorLength()<<G4endl;
109 Harmonise(theElasticData, theBuffer);
110// G4cout << "ElementWiseData::UpdateData Harmonise finished: "
111// <<theElasticData->GetVectorLength()<<G4endl;
112 delete theBuffer;
113
114 theBuffer = theIsotopeWiseData[index].MakeInelasticData();
115// G4cout << "ElementWiseData::UpdateData MakeInelasticData finished: "
116// <<theBuffer->GetVectorLength()<<G4endl;
117 Harmonise(theInelasticData, theBuffer);
118// G4cout << "ElementWiseData::UpdateData Harmonise finished: "
119// <<theInelasticData->GetVectorLength()<<G4endl;
120 delete theBuffer;
121
122 theBuffer = theIsotopeWiseData[index].MakeCaptureData();
123// G4cout << "ElementWiseData::UpdateData MakeCaptureData finished: "
124// <<theBuffer->GetVectorLength()<<G4endl;
125 Harmonise(theCaptureData, theBuffer);
126// G4cout << "ElementWiseData::UpdateData Harmonise finished: "
127// <<theCaptureData->GetVectorLength()<<G4endl;
128 delete theBuffer;
129
130 theBuffer = theIsotopeWiseData[index].MakeFissionData();
131// G4cout << "ElementWiseData::UpdateData MakeFissionData finished: "
132// <<theBuffer->GetVectorLength()<<G4endl;
133 Harmonise(theFissionData, theBuffer);
134// G4cout << "ElementWiseData::UpdateData Harmonise finished: "
135// <<theFissionData->GetVectorLength()<<G4endl;
136 delete theBuffer;
137
138// G4cout << "ElementWiseData::UpdateData finished"<endl;
139 }
void Harmonise(G4NeutronHPVector *&theStore, G4NeutronHPVector *theNew)
G4NeutronHPVector * MakeFissionData()
G4NeutronHPVector * MakeElasticData()
G4bool Init(G4int A, G4int Z, G4double abun, G4String dirName, G4String aFSType)
G4NeutronHPVector * MakeCaptureData()
G4NeutronHPVector * MakeInelasticData()

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