Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
G4NeutronHPElementData Class Reference

#include <G4NeutronHPElementData.hh>

Inheritance diagram for G4NeutronHPElementData:
G4HadronCrossSections

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

Detailed Description

Definition at line 52 of file G4NeutronHPElementData.hh.

Constructor & Destructor Documentation

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  theBuffer = NULL;
44  }
G4NeutronHPElementData::~G4NeutronHPElementData ( )

Definition at line 46 of file G4NeutronHPElementData.cc.

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

Member Function Documentation

G4NeutronHPVector* G4NeutronHPElementData::GetData ( G4NeutronHPFissionData )
inline

Definition at line 68 of file G4NeutronHPElementData.hh.

Referenced by MakePhysicsVector().

69  {return theFissionData;}
G4NeutronHPVector* G4NeutronHPElementData::GetData ( G4NeutronHPCaptureData )
inline

Definition at line 70 of file G4NeutronHPElementData.hh.

71  {return theCaptureData;}
G4NeutronHPVector* G4NeutronHPElementData::GetData ( G4NeutronHPElasticData )
inline

Definition at line 72 of file G4NeutronHPElementData.hh.

73  {return theElasticData;}
G4NeutronHPVector* G4NeutronHPElementData::GetData ( G4NeutronHPInelasticData )
inline

Definition at line 74 of file G4NeutronHPElementData.hh.

75  {return theInelasticData;}
void G4NeutronHPElementData::Harmonise ( G4NeutronHPVector *&  theStore,
G4NeutronHPVector theNew 
)

Definition at line 142 of file G4NeutronHPElementData.cc.

References test::a, active, G4NeutronHPVector::GetEnergy(), G4NeutronHPVector::GetVectorLength(), G4NeutronHPVector::GetXsec(), G4INCL::Math::max(), n, G4NeutronHPVector::SetData(), and test::x.

Referenced by UpdateData().

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

Definition at line 55 of file G4NeutronHPElementData.cc.

References G4StableIsotopes::GetAbundance(), G4StableIsotopes::GetFirstIsotope(), G4Element::GetIsotope(), G4StableIsotopes::GetIsotopeNucleonCount(), G4Isotope::Getm(), G4Isotope::GetN(), G4StableIsotopes::GetNumberOfIsotopes(), G4Element::GetNumberOfIsotopes(), G4Element::GetRelativeAbundanceVector(), G4Element::GetZ(), python.hepunit::perCent, G4NeutronHPVector::ThinOut(), and UpdateData().

Referenced by MakePhysicsVector().

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

Definition at line 197 of file G4NeutronHPElementData.cc.

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

200  {
201  if(theP != G4Neutron::Neutron()) throw G4HadronicException(__FILE__, __LINE__, "not a neutron");
202  Init ( theElement );
203  return GetData(theSet);
204  }
static G4Neutron * Neutron()
Definition: G4Neutron.cc:104
G4NeutronHPVector * GetData(G4NeutronHPFissionData *)
void Init(G4Element *theElement)
G4NeutronHPVector * G4NeutronHPElementData::MakePhysicsVector ( G4Element theElement,
G4ParticleDefinition theP,
G4NeutronHPCaptureData theSet 
)

Definition at line 205 of file G4NeutronHPElementData.cc.

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

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

Definition at line 213 of file G4NeutronHPElementData.cc.

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

216  {
217  if(theP != G4Neutron::Neutron()) throw G4HadronicException(__FILE__, __LINE__, "not a neutron");
218  Init ( theElement );
219  return GetData(theSet);
220  }
static G4Neutron * Neutron()
Definition: G4Neutron.cc:104
G4NeutronHPVector * GetData(G4NeutronHPFissionData *)
void Init(G4Element *theElement)
G4NeutronHPVector * G4NeutronHPElementData::MakePhysicsVector ( G4Element theElement,
G4ParticleDefinition theP,
G4NeutronHPInelasticData theSet 
)

Definition at line 221 of file G4NeutronHPElementData.cc.

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

224  {
225  if(theP != G4Neutron::Neutron()) throw G4HadronicException(__FILE__, __LINE__, "not a neutron");
226  Init ( theElement );
227  return GetData(theSet);
228  }
static G4Neutron * Neutron()
Definition: G4Neutron.cc:104
G4NeutronHPVector * GetData(G4NeutronHPFissionData *)
void Init(G4Element *theElement)
void G4NeutronHPElementData::UpdateData ( G4int  A,
G4int  Z,
G4int  index,
G4double  abundance 
)
inline

Definition at line 63 of file G4NeutronHPElementData.hh.

References UpdateData().

Referenced by Init(), and UpdateData().

63 { G4int M=0; UpdateData( A, Z, M, index, abundance); };
void UpdateData(G4int A, G4int Z, G4int index, G4double abundance)
int G4int
Definition: G4Types.hh:78
void G4NeutronHPElementData::UpdateData ( G4int  A,
G4int  Z,
G4int  M,
G4int  index,
G4double  abundance 
)

Definition at line 99 of file G4NeutronHPElementData.cc.

References Harmonise(), G4NeutronHPIsoData::Init(), G4NeutronHPIsoData::MakeCaptureData(), G4NeutronHPIsoData::MakeElasticData(), G4NeutronHPIsoData::MakeFissionData(), and G4NeutronHPIsoData::MakeInelasticData().

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

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