Geant4 11.1.1
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 50 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 = nullptr;
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 70 of file G4ParticleHPElementData.hh.

71 {return theCaptureData;}

◆ GetData() [2/4]

G4ParticleHPVector * G4ParticleHPElementData::GetData ( G4ParticleHPElasticData )
inline

Definition at line 72 of file G4ParticleHPElementData.hh.

73 {return theElasticData;}

◆ GetData() [3/4]

G4ParticleHPVector * G4ParticleHPElementData::GetData ( G4ParticleHPFissionData )
inline

Definition at line 68 of file G4ParticleHPElementData.hh.

69 {return theFissionData;}

Referenced by MakePhysicsVector().

◆ GetData() [4/4]

G4ParticleHPVector * G4ParticleHPElementData::GetData ( G4ParticleHPInelasticData )
inline

Definition at line 74 of file G4ParticleHPElementData.hh.

75 {return theInelasticData;}

◆ Harmonise()

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

Definition at line 119 of file G4ParticleHPElementData.cc.

120 {
121 if(theNew == 0) { return; }
122 G4int s_tmp = 0, n=0, m_tmp=0;
123 G4ParticleHPVector * theMerge = new G4ParticleHPVector(theStore->GetVectorLength());
124 while ( theStore->GetEnergy(s_tmp)<theNew->GetEnergy(0)&&s_tmp<theStore->GetVectorLength() ) // Loop checking, 11.05.2015, T. Koi
125 {
126 theMerge->SetData(m_tmp++, theStore->GetEnergy(s_tmp), theStore->GetXsec(s_tmp));
127 ++s_tmp;
128 }
129 G4ParticleHPVector *active = theStore;
130 G4ParticleHPVector * passive = theNew;
131 G4ParticleHPVector * tmp;
132 G4int a = s_tmp, p = n, t;
133 while (a<active->GetVectorLength()&&p<passive->GetVectorLength()) // Loop checking, 11.05.2015, T. Koi
134 {
135 if(active->GetEnergy(a) <= passive->GetEnergy(p))
136 {
137 theMerge->SetData(m_tmp, active->GetEnergy(a), active->GetXsec(a));
138 G4double x = theMerge->GetEnergy(m_tmp);
139 G4double y = std::max(0., passive->GetXsec(x));
140 theMerge->SetData(m_tmp, x, theMerge->GetXsec(m_tmp)+y);
141 ++m_tmp;
142 ++a;
143 }
144 else
145 {
146 tmp = active; t=a;
147 active = passive; a=p;
148 passive = tmp; p=t;
149 }
150 }
151 while (a!=active->GetVectorLength()) // Loop checking, 11.05.2015, T. Koi
152 {
153 theMerge->SetData(m_tmp++, active->GetEnergy(a), active->GetXsec(a));
154 ++a;
155 }
156 while (p!=passive->GetVectorLength()) // Loop checking, 11.05.2015, T. Koi
157 {
158 G4double x = passive->GetEnergy(p);
159 G4double y = std::max(0., active->GetXsec(x));
160 theMerge->SetData(m_tmp++, x, passive->GetXsec(p)+y);
161 ++p;
162 }
163 delete theStore;
164 theStore = theMerge;
165 }
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 = (G4int)theElement->GetNumberOfIsotopes();
59 if(count == 0)
60 count += theStableOnes.GetNumberOfIsotopes((G4int)theElement->GetZ());
61 theIsotopeWiseData = new G4ParticleHPIsoData[count];
62 // filename = ein data-set je isotope.
63 count = 0;
64 G4int nIso = (G4int)theElement->GetNumberOfIsotopes();
65 G4int Z = (G4int)theElement->GetZ();
66
67 if(nIso!=0)
68 {
69 for (G4int i1=0; i1<nIso; ++i1)
70 {
71 G4int A = theElement->GetIsotope(i1)->GetN();
72 G4int M = theElement->GetIsotope(i1)->Getm();
73 G4double frac = theElement->GetRelativeAbundanceVector()[i1]/CLHEP::perCent;
74 //UpdateData(A, Z, count++, frac);
75 UpdateData(A, Z, M, count++, frac, projectile, dataDirVariable);
76 }
77 }
78 else
79 {
80 G4int first = theStableOnes.GetFirstIsotope(Z);
81 for(G4int i1=0;
82 i1<theStableOnes.GetNumberOfIsotopes((G4int)theElement->GetZ()); ++i1)
83 {
84 G4int A = theStableOnes.GetIsotopeNucleonCount(first+i1);
85 G4double frac = theStableOnes.GetAbundance(first+i1);
86 UpdateData(A, Z, count++, frac, projectile, dataDirVariable);
87 }
88 }
89 theElasticData->ThinOut(precision);
90 if( projectile == G4Neutron::Neutron() ) theInelasticData->ThinOut(precision);
91
92 theCaptureData->ThinOut(precision);
93 theFissionData->ThinOut(precision);
94 }
#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)

Referenced by MakePhysicsVector().

◆ MakePhysicsVector() [1/4]

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

Definition at line 176 of file G4ParticleHPElementData.cc.

180 {
181 if(projectile != G4Neutron::Neutron()) throw G4HadronicException(__FILE__, __LINE__, "not a neutron");
182 Init ( theElement, projectile, dataDirVariable );
183 return GetData(theSet);
184 }
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 185 of file G4ParticleHPElementData.cc.

189 {
190 if(projectile != G4Neutron::Neutron()) throw G4HadronicException(__FILE__, __LINE__, "not a neutron");
191 Init ( theElement, projectile, dataDirVariable );
192 return GetData(theSet);
193 }

◆ MakePhysicsVector() [3/4]

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

Definition at line 167 of file G4ParticleHPElementData.cc.

171 {
172 if(projectile != G4Neutron::Neutron()) throw G4HadronicException(__FILE__, __LINE__, "not a neutron");
173 Init ( theElement, projectile, dataDirVariable );
174 return GetData(theSet);
175 }

◆ MakePhysicsVector() [4/4]

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

Definition at line 194 of file G4ParticleHPElementData.cc.

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

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

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 96 of file G4ParticleHPElementData.cc.

97 {
98 //Reads in the Data, using G4ParticleHPIsoData[], and its Init
99 //theIsotopeWiseData[index].Init(A, Z, abundance);
100 theIsotopeWiseData[index].Init(A, Z, M, abundance,projectile, dataDirVariable);
101
102 theBuffer = theIsotopeWiseData[index].MakeElasticData();
103 Harmonise(theElasticData, theBuffer);
104 delete theBuffer;
105
106 theBuffer = theIsotopeWiseData[index].MakeInelasticData();
107 Harmonise(theInelasticData, theBuffer);
108 delete theBuffer;
109
110 theBuffer = theIsotopeWiseData[index].MakeCaptureData();
111 Harmonise(theCaptureData, theBuffer);
112 delete theBuffer;
113
114 theBuffer = theIsotopeWiseData[index].MakeFissionData();
115 Harmonise(theFissionData, theBuffer);
116 delete theBuffer;
117 }
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: