Geant4-11
Public Member Functions | Private Attributes
G4ParticleHPElementData Class Reference

#include <G4ParticleHPElementData.hh>

Public Member Functions

 G4ParticleHPElementData ()
 
G4ParticleHPVectorGetData (G4ParticleHPCaptureData *)
 
G4ParticleHPVectorGetData (G4ParticleHPElasticData *)
 
G4ParticleHPVectorGetData (G4ParticleHPFissionData *)
 
G4ParticleHPVectorGetData (G4ParticleHPInelasticData *)
 
void Harmonise (G4ParticleHPVector *&theStore, G4ParticleHPVector *theNew)
 
void Init (G4Element *theElement, G4ParticleDefinition *projectile, const 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, G4ParticleHPFissionData *theSet, char *dataDirVariable)
 
G4ParticleHPVectorMakePhysicsVector (G4Element *theElement, G4ParticleDefinition *projectile, G4ParticleHPInelasticData *theSet, 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)
 
 ~G4ParticleHPElementData ()
 

Private Attributes

G4String filename
 
G4double precision
 
G4ParticleHPVectortheBuffer
 
G4ParticleHPVectortheCaptureData
 
G4ParticleHPVectortheElasticData
 
G4ParticleHPVectortheFissionData
 
G4ParticleHPVectortheInelasticData
 
G4ParticleHPIsoDatatheIsotopeWiseData
 
G4StableIsotopes theStableOnes
 

Detailed Description

Definition at line 50 of file G4ParticleHPElementData.hh.

Constructor & Destructor Documentation

◆ G4ParticleHPElementData()

G4ParticleHPElementData::G4ParticleHPElementData ( )

◆ ~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 }

References theCaptureData, theElasticData, theFissionData, theInelasticData, and theIsotopeWiseData.

Member Function Documentation

◆ GetData() [1/4]

G4ParticleHPVector * G4ParticleHPElementData::GetData ( G4ParticleHPCaptureData )
inline

Definition at line 70 of file G4ParticleHPElementData.hh.

71 {return theCaptureData;}

References theCaptureData.

◆ GetData() [2/4]

G4ParticleHPVector * G4ParticleHPElementData::GetData ( G4ParticleHPElasticData )
inline

Definition at line 72 of file G4ParticleHPElementData.hh.

73 {return theElasticData;}

References theElasticData.

◆ GetData() [3/4]

G4ParticleHPVector * G4ParticleHPElementData::GetData ( G4ParticleHPFissionData )
inline

Definition at line 68 of file G4ParticleHPElementData.hh.

69 {return theFissionData;}

References theFissionData.

Referenced by MakePhysicsVector().

◆ GetData() [4/4]

G4ParticleHPVector * G4ParticleHPElementData::GetData ( G4ParticleHPInelasticData )
inline

Definition at line 74 of file G4ParticleHPElementData.hh.

75 {return theInelasticData;}

References 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
T max(const T t1, const T t2)
brief Return the largest of the two arguments

References G4ParticleHPVector::GetEnergy(), G4ParticleHPVector::GetVectorLength(), G4ParticleHPVector::GetXsec(), G4INCL::Math::max(), CLHEP::detail::n, and G4ParticleHPVector::SetData().

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()));
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;
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;
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 }
95
98 }
#define M(row, col)
const G4int Z[17]
const G4double A[17]
G4double * GetRelativeAbundanceVector() const
Definition: G4Element.hh:167
G4double GetZ() const
Definition: G4Element.hh:131
const G4Isotope * GetIsotope(G4int iso) const
Definition: G4Element.hh:170
size_t GetNumberOfIsotopes() const
Definition: G4Element.hh:159
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)
static constexpr double perCent

References A, G4StableIsotopes::GetAbundance(), G4StableIsotopes::GetFirstIsotope(), G4Element::GetIsotope(), G4StableIsotopes::GetIsotopeNucleonCount(), G4Isotope::Getm(), G4Isotope::GetN(), G4Element::GetNumberOfIsotopes(), G4StableIsotopes::GetNumberOfIsotopes(), G4Element::GetRelativeAbundanceVector(), G4Element::GetZ(), M, G4Neutron::Neutron(), CLHEP::perCent, precision, theCaptureData, theElasticData, theFissionData, theInelasticData, theIsotopeWiseData, theStableOnes, G4ParticleHPVector::ThinOut(), UpdateData(), and Z.

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)

References GetData(), Init(), and G4Neutron::Neutron().

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

References GetData(), Init(), and G4Neutron::Neutron().

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

References GetData(), Init(), and G4Neutron::Neutron().

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

References GetData(), Init(), and G4Neutron::Neutron().

◆ UpdateData() [1/2]

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

Definition at line 63 of file G4ParticleHPElementData.hh.

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

References A, M, UpdateData(), and Z.

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
110// G4cout << "ElementWiseData::UpdateData MakeElasticData finished: "
111// <<theBuffer->GetVectorLength()<<G4endl;
113// G4cout << "ElementWiseData::UpdateData Harmonise finished: "
114// <<theElasticData->GetVectorLength()<<G4endl;
115 delete theBuffer;
116
118 // G4cout << "ElementWiseData::UpdateData MakeInelasticData finished: "
119// <<theBuffer->GetVectorLength()<<G4endl;
121// G4cout << "ElementWiseData::UpdateData Harmonise finished: "
122// <<theInelasticData->GetVectorLength()<<G4endl;
123 delete theBuffer;
124
126// G4cout << "ElementWiseData::UpdateData MakeCaptureData finished: "
127// <<theBuffer->GetVectorLength()<<G4endl;
129// G4cout << "ElementWiseData::UpdateData Harmonise finished: "
130// <<theCaptureData->GetVectorLength()<<G4endl;
131 delete theBuffer;
132
134// G4cout << "ElementWiseData::UpdateData MakeFissionData finished: "
135// <<theBuffer->GetVectorLength()<<G4endl;
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()

References A, Harmonise(), G4ParticleHPIsoData::Init(), M, G4ParticleHPIsoData::MakeCaptureData(), G4ParticleHPIsoData::MakeElasticData(), G4ParticleHPIsoData::MakeFissionData(), G4ParticleHPIsoData::MakeInelasticData(), theBuffer, theCaptureData, theElasticData, theFissionData, theInelasticData, theIsotopeWiseData, and Z.

Field Documentation

◆ filename

G4String G4ParticleHPElementData::filename
private

Definition at line 111 of file G4ParticleHPElementData.hh.

◆ precision

G4double G4ParticleHPElementData::precision
private

Definition at line 103 of file G4ParticleHPElementData.hh.

Referenced by G4ParticleHPElementData(), and Init().

◆ theBuffer

G4ParticleHPVector* G4ParticleHPElementData::theBuffer
private

Definition at line 105 of file G4ParticleHPElementData.hh.

Referenced by G4ParticleHPElementData(), and UpdateData().

◆ theCaptureData

G4ParticleHPVector* G4ParticleHPElementData::theCaptureData
private

◆ theElasticData

G4ParticleHPVector* G4ParticleHPElementData::theElasticData
private

◆ theFissionData

G4ParticleHPVector* G4ParticleHPElementData::theFissionData
private

◆ theInelasticData

G4ParticleHPVector* G4ParticleHPElementData::theInelasticData
private

◆ theIsotopeWiseData

G4ParticleHPIsoData* G4ParticleHPElementData::theIsotopeWiseData
private

◆ theStableOnes

G4StableIsotopes G4ParticleHPElementData::theStableOnes
private

Definition at line 109 of file G4ParticleHPElementData.hh.

Referenced by Init().


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