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

#include <G4ParticleHPElementData.hh>

Public Member Functions

 G4ParticleHPElementData ()
 
 ~G4ParticleHPElementData ()
 
void Init (G4Element *theElement, G4ParticleDefinition *projectile, const char *dataDirVariable)
 
void UpdateData (G4int A, G4int Z, G4int index, G4double abundance, G4ParticleDefinition *projectile, const char *dataDirVariable)
 
void UpdateData (G4int A, G4int Z, G4int M, G4int index, G4double abundance, G4ParticleDefinition *projectile, const char *dataDirVariable)
 
void Harmonise (G4ParticleHPVector *&theStore, G4ParticleHPVector *theNew)
 
G4ParticleHPVectorGetData (G4ParticleHPFissionData *)
 
G4ParticleHPVectorGetData (G4ParticleHPCaptureData *)
 
G4ParticleHPVectorGetData (G4ParticleHPElasticData *)
 
G4ParticleHPVectorGetData (G4ParticleHPInelasticData *)
 
G4ParticleHPVectorMakePhysicsVector (G4Element *theElement, G4ParticleDefinition *projectile, G4ParticleHPFissionData *theSet, char *dataDirVariable)
 
G4ParticleHPVectorMakePhysicsVector (G4Element *theElement, G4ParticleDefinition *projectile, G4ParticleHPCaptureData *theSet, char *dataDirVariable)
 
G4ParticleHPVectorMakePhysicsVector (G4Element *theElement, G4ParticleDefinition *projectile, G4ParticleHPElasticData *theSet, char *dataDirVariable)
 
G4ParticleHPVectorMakePhysicsVector (G4Element *theElement, G4ParticleDefinition *projectile, G4ParticleHPInelasticData *theSet, char *dataDirVariable)
 

Detailed Description

Definition at line 55 of file G4ParticleHPElementData.hh.

Constructor & Destructor Documentation

◆ G4ParticleHPElementData()

G4ParticleHPElementData::G4ParticleHPElementData ( )

Definition at line 36 of file G4ParticleHPElementData.cc.

37 {
38 precision = 0.02;
39 theFissionData = new G4ParticleHPVector;
40 theCaptureData = new G4ParticleHPVector;
41 theElasticData = new G4ParticleHPVector;
42 theInelasticData = new G4ParticleHPVector;
43 theIsotopeWiseData = 0;
44 theBuffer = NULL;
45 }

◆ ~G4ParticleHPElementData()

G4ParticleHPElementData::~G4ParticleHPElementData ( )

Definition at line 47 of file G4ParticleHPElementData.cc.

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

Member Function Documentation

◆ GetData() [1/4]

G4ParticleHPVector * G4ParticleHPElementData::GetData ( G4ParticleHPCaptureData )
inline

Definition at line 75 of file G4ParticleHPElementData.hh.

76 {return theCaptureData;}

◆ GetData() [2/4]

G4ParticleHPVector * G4ParticleHPElementData::GetData ( G4ParticleHPElasticData )
inline

Definition at line 77 of file G4ParticleHPElementData.hh.

78 {return theElasticData;}

◆ GetData() [3/4]

G4ParticleHPVector * G4ParticleHPElementData::GetData ( G4ParticleHPFissionData )
inline

Definition at line 73 of file G4ParticleHPElementData.hh.

74 {return theFissionData;}

Referenced by MakePhysicsVector().

◆ GetData() [4/4]

G4ParticleHPVector * G4ParticleHPElementData::GetData ( G4ParticleHPInelasticData )
inline

Definition at line 79 of file G4ParticleHPElementData.hh.

80 {return theInelasticData;}

◆ Harmonise()

void G4ParticleHPElementData::Harmonise ( G4ParticleHPVector *&  theStore,
G4ParticleHPVector theNew 
)

Definition at line 144 of file G4ParticleHPElementData.cc.

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

Referenced by UpdateData().

◆ Init()

void G4ParticleHPElementData::Init ( G4Element theElement,
G4ParticleDefinition projectile,
const char *  dataDirVariable 
)

Definition at line 56 of file G4ParticleHPElementData.cc.

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

Referenced by MakePhysicsVector().

◆ MakePhysicsVector() [1/4]

G4ParticleHPVector * G4ParticleHPElementData::MakePhysicsVector ( G4Element theElement,
G4ParticleDefinition projectile,
G4ParticleHPCaptureData theSet,
char *  dataDirVariable 
)

Definition at line 208 of file G4ParticleHPElementData.cc.

212 {
213 if(projectile != G4Neutron::Neutron()) throw G4HadronicException(__FILE__, __LINE__, "not a neutron");
214 Init ( theElement, projectile, dataDirVariable );
215 return GetData(theSet);
216 }
G4ParticleHPVector * GetData(G4ParticleHPFissionData *)
void Init(G4Element *theElement, G4ParticleDefinition *projectile, const char *dataDirVariable)

◆ MakePhysicsVector() [2/4]

G4ParticleHPVector * G4ParticleHPElementData::MakePhysicsVector ( G4Element theElement,
G4ParticleDefinition projectile,
G4ParticleHPElasticData theSet,
char *  dataDirVariable 
)

Definition at line 217 of file G4ParticleHPElementData.cc.

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

◆ MakePhysicsVector() [3/4]

G4ParticleHPVector * G4ParticleHPElementData::MakePhysicsVector ( G4Element theElement,
G4ParticleDefinition projectile,
G4ParticleHPFissionData theSet,
char *  dataDirVariable 
)

Definition at line 199 of file G4ParticleHPElementData.cc.

203 {
204 if(projectile != G4Neutron::Neutron()) throw G4HadronicException(__FILE__, __LINE__, "not a neutron");
205 Init ( theElement, projectile, dataDirVariable );
206 return GetData(theSet);
207 }

◆ MakePhysicsVector() [4/4]

G4ParticleHPVector * G4ParticleHPElementData::MakePhysicsVector ( G4Element theElement,
G4ParticleDefinition projectile,
G4ParticleHPInelasticData theSet,
char *  dataDirVariable 
)

Definition at line 226 of file G4ParticleHPElementData.cc.

230 {
231 if(projectile != G4Neutron::Neutron()) throw G4HadronicException(__FILE__, __LINE__, "not a neutron");
232 Init ( theElement, projectile, dataDirVariable );
233 return GetData(theSet);
234 }

◆ UpdateData() [1/2]

void G4ParticleHPElementData::UpdateData ( G4int  A,
G4int  Z,
G4int  index,
G4double  abundance,
G4ParticleDefinition projectile,
const char *  dataDirVariable 
)
inline

Definition at line 68 of file G4ParticleHPElementData.hh.

68{ G4int M=0; UpdateData( A, Z, M, index, abundance, projectile, dataDirVariable); };

Referenced by Init(), and UpdateData().

◆ UpdateData() [2/2]

void G4ParticleHPElementData::UpdateData ( G4int  A,
G4int  Z,
G4int  M,
G4int  index,
G4double  abundance,
G4ParticleDefinition projectile,
const char *  dataDirVariable 
)

Definition at line 101 of file G4ParticleHPElementData.cc.

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

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