Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4ParticleHPElementData Class Reference

#include <G4ParticleHPElementData.hh>

Inheritance diagram for G4ParticleHPElementData:
Collaboration diagram for G4ParticleHPElementData:

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)
 
- 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 ()
 

Detailed Description

Definition at line 54 of file G4ParticleHPElementData.hh.

Constructor & Destructor Documentation

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 ( )

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

G4ParticleHPVector* G4ParticleHPElementData::GetData ( G4ParticleHPFissionData )
inline

Definition at line 72 of file G4ParticleHPElementData.hh.

73  {return theFissionData;}

Here is the caller graph for this function:

G4ParticleHPVector* G4ParticleHPElementData::GetData ( G4ParticleHPCaptureData )
inline

Definition at line 74 of file G4ParticleHPElementData.hh.

75  {return theCaptureData;}
G4ParticleHPVector* G4ParticleHPElementData::GetData ( G4ParticleHPElasticData )
inline

Definition at line 76 of file G4ParticleHPElementData.hh.

77  {return theElasticData;}
G4ParticleHPVector* G4ParticleHPElementData::GetData ( G4ParticleHPInelasticData )
inline

Definition at line 78 of file G4ParticleHPElementData.hh.

79  {return theInelasticData;}
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  }
G4double GetEnergy(G4int i) const
G4int GetVectorLength() const
void SetData(G4int i, G4double x, G4double y)
const char * p
Definition: xmltok.h:285
int G4int
Definition: G4Types.hh:78
G4double GetXsec(G4int i)
T max(const T t1, const T t2)
brief Return the largest of the two arguments
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

Here is the caller graph for this function:

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  }
size_t GetNumberOfIsotopes() const
Definition: G4Element.hh:159
G4int GetFirstIsotope(G4int Z)
G4double GetZ() const
Definition: G4Element.hh:131
int G4int
Definition: G4Types.hh:78
G4int GetN() const
Definition: G4Isotope.hh:94
double A(double temperature)
G4int Getm() const
Definition: G4Isotope.hh:100
G4double * GetRelativeAbundanceVector() const
Definition: G4Element.hh:167
static constexpr double perCent
static G4Neutron * Neutron()
Definition: G4Neutron.cc:104
G4int GetNumberOfIsotopes(G4int Z)
G4int GetIsotopeNucleonCount(G4int number)
const G4Isotope * GetIsotope(G4int iso) const
Definition: G4Element.hh:170
void UpdateData(G4int A, G4int Z, G4int index, G4double abundance, G4ParticleDefinition *projectile, const char *dataDirVariable)
G4double GetAbundance(G4int number)
double G4double
Definition: G4Types.hh:76
void ThinOut(G4double precision)

Here is the call graph for this function:

Here is the caller graph for this function:

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  }
void Init(G4Element *theElement, G4ParticleDefinition *projectile, const char *dataDirVariable)
G4ParticleHPVector * GetData(G4ParticleHPFissionData *)
static G4Neutron * Neutron()
Definition: G4Neutron.cc:104

Here is the call graph for this function:

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  }
void Init(G4Element *theElement, G4ParticleDefinition *projectile, const char *dataDirVariable)
G4ParticleHPVector * GetData(G4ParticleHPFissionData *)
static G4Neutron * Neutron()
Definition: G4Neutron.cc:104

Here is the call graph for this function:

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  }
void Init(G4Element *theElement, G4ParticleDefinition *projectile, const char *dataDirVariable)
G4ParticleHPVector * GetData(G4ParticleHPFissionData *)
static G4Neutron * Neutron()
Definition: G4Neutron.cc:104

Here is the call graph for this function:

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  }
void Init(G4Element *theElement, G4ParticleDefinition *projectile, const char *dataDirVariable)
G4ParticleHPVector * GetData(G4ParticleHPFissionData *)
static G4Neutron * Neutron()
Definition: G4Neutron.cc:104

Here is the call graph for this function:

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

Definition at line 67 of file G4ParticleHPElementData.hh.

67 { G4int M=0; UpdateData( A, Z, M, index, abundance, projectile, dataDirVariable); };
int G4int
Definition: G4Types.hh:78
double A(double temperature)
void UpdateData(G4int A, G4int Z, G4int index, G4double abundance, G4ParticleDefinition *projectile, const char *dataDirVariable)

Here is the call graph for this function:

Here is the caller graph for this function:

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  }
G4ParticleHPVector * MakeFissionData()
G4ParticleHPVector * MakeInelasticData()
double A(double temperature)
G4ParticleHPVector * MakeElasticData()
G4ParticleHPVector * MakeCaptureData()
void Harmonise(G4ParticleHPVector *&theStore, G4ParticleHPVector *theNew)
G4bool Init(G4int A, G4int Z, G4double abun, G4String dirName, G4String aFSType)

Here is the call graph for this function:


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