Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4LENDModel Class Reference

#include <G4LENDModel.hh>

Inheritance diagram for G4LENDModel:
Collaboration diagram for G4LENDModel:

Public Member Functions

 G4LENDModel (G4String name="LENDModel")
 
 ~G4LENDModel ()
 
virtual G4HadFinalStateApplyYourself (const G4HadProjectile &aTrack, G4Nucleus &aTargetNucleus)
 
void ChangeDefaultEvaluation (G4String name)
 
void AllowNaturalAbundanceTarget ()
 
void AllowAnyCandidateTarget ()
 
void BuildPhysicsTable (const G4ParticleDefinition &)
 
- Public Member Functions inherited from G4HadronicInteraction
 G4HadronicInteraction (const G4String &modelName="HadronicModel")
 
virtual ~G4HadronicInteraction ()
 
virtual G4double SampleInvariantT (const G4ParticleDefinition *p, G4double plab, G4int Z, G4int A)
 
virtual G4bool IsApplicable (const G4HadProjectile &aTrack, G4Nucleus &targetNucleus)
 
G4double GetMinEnergy () const
 
G4double GetMinEnergy (const G4Material *aMaterial, const G4Element *anElement) const
 
void SetMinEnergy (G4double anEnergy)
 
void SetMinEnergy (G4double anEnergy, const G4Element *anElement)
 
void SetMinEnergy (G4double anEnergy, const G4Material *aMaterial)
 
G4double GetMaxEnergy () const
 
G4double GetMaxEnergy (const G4Material *aMaterial, const G4Element *anElement) const
 
void SetMaxEnergy (const G4double anEnergy)
 
void SetMaxEnergy (G4double anEnergy, const G4Element *anElement)
 
void SetMaxEnergy (G4double anEnergy, const G4Material *aMaterial)
 
G4int GetVerboseLevel () const
 
void SetVerboseLevel (G4int value)
 
const G4StringGetModelName () const
 
void DeActivateFor (const G4Material *aMaterial)
 
void ActivateFor (const G4Material *aMaterial)
 
void DeActivateFor (const G4Element *anElement)
 
void ActivateFor (const G4Element *anElement)
 
G4bool IsBlocked (const G4Material *aMaterial) const
 
G4bool IsBlocked (const G4Element *anElement) const
 
void SetRecoilEnergyThreshold (G4double val)
 
G4double GetRecoilEnergyThreshold () const
 
virtual const std::pair
< G4double, G4double
GetFatalEnergyCheckLevels () const
 
virtual std::pair< G4double,
G4double
GetEnergyMomentumCheckLevels () const
 
void SetEnergyMomentumCheckLevels (G4double relativeLevel, G4double absoluteLevel)
 
virtual void ModelDescription (std::ostream &outFile) const
 
virtual void InitialiseModel ()
 

Protected Member Functions

void create_used_target_map ()
 
void recreate_used_target_map ()
 
- Protected Member Functions inherited from G4HadronicInteraction
void SetModelName (const G4String &nam)
 
G4bool IsBlocked () const
 
void Block ()
 

Protected Attributes

G4ParticleDefinitionproj
 
G4LENDManagerlend_manager
 
std::map< G4int,
G4LENDUsedTarget * > 
usedTarget_map
 
- Protected Attributes inherited from G4HadronicInteraction
G4HadFinalState theParticleChange
 
G4int verboseLevel
 
G4double theMinEnergy
 
G4double theMaxEnergy
 
G4bool isBlocked
 

Detailed Description

Definition at line 51 of file G4LENDModel.hh.

Constructor & Destructor Documentation

G4LENDModel::G4LENDModel ( G4String  name = "LENDModel")

Definition at line 47 of file G4LENDModel.cc.

48 :G4HadronicInteraction( name )
49 {
50 
51  proj = NULL; //will be set in an inherited class
52 
53  SetMinEnergy( 0.*eV );
54  SetMaxEnergy( 20.*MeV );
55 
56  //default_evaluation = "endl99";
57  //default_evaluation = "ENDF.B-VII.0";
58  default_evaluation = "ENDF/BVII.1";
59 
60  allow_nat = false;
61  allow_any = false;
62 
64 
65 }
G4ParticleDefinition * proj
Definition: G4LENDModel.hh:79
void SetMinEnergy(G4double anEnergy)
static constexpr double eV
Definition: G4SIunits.hh:215
G4HadronicInteraction(const G4String &modelName="HadronicModel")
static G4LENDManager * GetInstance()
void SetMaxEnergy(const G4double anEnergy)
static constexpr double MeV
Definition: G4SIunits.hh:214
G4LENDManager * lend_manager
Definition: G4LENDModel.hh:80

Here is the call graph for this function:

G4LENDModel::~G4LENDModel ( )

Definition at line 67 of file G4LENDModel.cc.

68 {
69  for ( std::map< G4int , G4LENDUsedTarget* >::iterator
70  it = usedTarget_map.begin() ; it != usedTarget_map.end() ; it ++ )
71  {
72  delete it->second;
73  }
74 }
std::map< G4int, G4LENDUsedTarget * > usedTarget_map
Definition: G4LENDModel.hh:81

Member Function Documentation

void G4LENDModel::AllowAnyCandidateTarget ( )
inline

Definition at line 64 of file G4LENDModel.hh.

64 { allow_any = true; recreate_used_target_map(); };
void recreate_used_target_map()
Definition: G4LENDModel.cc:77

Here is the call graph for this function:

Here is the caller graph for this function:

void G4LENDModel::AllowNaturalAbundanceTarget ( )
inline

Definition at line 63 of file G4LENDModel.hh.

63 { allow_nat = true; recreate_used_target_map(); };
void recreate_used_target_map()
Definition: G4LENDModel.cc:77

Here is the call graph for this function:

G4HadFinalState * G4LENDModel::ApplyYourself ( const G4HadProjectile aTrack,
G4Nucleus aTargetNucleus 
)
virtual

Implements G4HadronicInteraction.

Reimplemented in G4LENDInelastic, G4LENDFission, G4LENDCapture, and G4LENDElastic.

Definition at line 176 of file G4LENDModel.cc.

177 {
178 
179  G4double temp = aTrack.GetMaterial()->GetTemperature();
180 
181  //G4int iZ = int ( aTarg.GetZ() );
182  //G4int iA = int ( aTarg.GetN() );
183  //migrate to integer A and Z (GetN_asInt returns number of neutrons in the nucleus since this)
184  G4int iZ = aTarg.GetZ_asInt();
185  G4int iA = aTarg.GetA_asInt();
186  G4int iM = 0;
187  if ( aTarg.GetIsotope() != NULL ) {
188  iM = aTarg.GetIsotope()->Getm();
189  }
190 
191  G4double ke = aTrack.GetKineticEnergy();
192 
193  G4HadFinalState* theResult = new G4HadFinalState();
194 
195  G4GIDI_target* aTarget = usedTarget_map.find( lend_manager->GetNucleusEncoding( iZ , iA , iM ) )->second->GetTarget();
196 
197  G4double aMu = aTarget->getElasticFinalState( ke*MeV, temp, NULL, NULL );
198 
199  G4double phi = twopi*G4UniformRand();
200  G4double theta = std::acos( aMu );
201  //G4double sinth = std::sin( theta );
202 
203  G4ReactionProduct theNeutron( aTrack.GetDefinition() );
204  theNeutron.SetMomentum( aTrack.Get4Momentum().vect() );
205  theNeutron.SetKineticEnergy( ke );
206 
207  G4ParticleDefinition* pd = G4IonTable::GetIonTable()->GetIon( iZ , iA , iM );
209 
210  G4double mass = pd->GetPDGMass();
211 
212 // add Thermal motion
213  G4double kT = k_Boltzmann*temp;
214  G4ThreeVector v ( G4RandGauss::shoot() * std::sqrt( kT*mass )
215  , G4RandGauss::shoot() * std::sqrt( kT*mass )
216  , G4RandGauss::shoot() * std::sqrt( kT*mass ) );
217 
218  theTarget.SetMomentum( v );
219 
220 
221  G4ThreeVector the3Neutron = theNeutron.GetMomentum();
222  G4double nEnergy = theNeutron.GetTotalEnergy();
223  G4ThreeVector the3Target = theTarget.GetMomentum();
224  G4double tEnergy = theTarget.GetTotalEnergy();
225  G4ReactionProduct theCMS;
226  G4double totE = nEnergy+tEnergy;
227  G4ThreeVector the3CMS = the3Target+the3Neutron;
228  theCMS.SetMomentum(the3CMS);
229  G4double cmsMom = std::sqrt(the3CMS*the3CMS);
230  G4double sqrts = std::sqrt((totE-cmsMom)*(totE+cmsMom));
231  theCMS.SetMass(sqrts);
232  theCMS.SetTotalEnergy(totE);
233 
234  theNeutron.Lorentz(theNeutron, theCMS);
235  theTarget.Lorentz(theTarget, theCMS);
236  G4double en = theNeutron.GetTotalMomentum(); // already in CMS.
237  G4ThreeVector cms3Mom=theNeutron.GetMomentum(); // for neutron direction in CMS
238  G4double cms_theta=cms3Mom.theta();
239  G4double cms_phi=cms3Mom.phi();
240  G4ThreeVector tempVector;
241  tempVector.setX(std::cos(theta)*std::sin(cms_theta)*std::cos(cms_phi)
242  +std::sin(theta)*std::cos(phi)*std::cos(cms_theta)*std::cos(cms_phi)
243  -std::sin(theta)*std::sin(phi)*std::sin(cms_phi) );
244  tempVector.setY(std::cos(theta)*std::sin(cms_theta)*std::sin(cms_phi)
245  +std::sin(theta)*std::cos(phi)*std::cos(cms_theta)*std::sin(cms_phi)
246  +std::sin(theta)*std::sin(phi)*std::cos(cms_phi) );
247  tempVector.setZ(std::cos(theta)*std::cos(cms_theta)
248  -std::sin(theta)*std::cos(phi)*std::sin(cms_theta) );
249  tempVector *= en;
250  theNeutron.SetMomentum(tempVector);
251  theTarget.SetMomentum(-tempVector);
252  G4double tP = theTarget.GetTotalMomentum();
253  G4double tM = theTarget.GetMass();
254  theTarget.SetTotalEnergy(std::sqrt((tP+tM)*(tP+tM)-2.*tP*tM));
255  theNeutron.Lorentz(theNeutron, -1.*theCMS);
256  theTarget.Lorentz(theTarget, -1.*theCMS);
257 
258  theResult->SetEnergyChange(theNeutron.GetKineticEnergy());
259  theResult->SetMomentumChange(theNeutron.GetMomentum().unit());
260  G4DynamicParticle* theRecoil = new G4DynamicParticle;
261 
262  theRecoil->SetDefinition( G4IonTable::GetIonTable()->GetIon( iZ , iA , iM , iZ ) );
263  theRecoil->SetMomentum( theTarget.GetMomentum() );
264 
265  theResult->AddSecondary( theRecoil );
266 
267  return theResult;
268 
269 }
ThreeVector shoot(const G4int Ap, const G4int Af)
void SetMomentum(const G4ThreeVector &momentum)
void SetMomentum(const G4double x, const G4double y, const G4double z)
G4ParticleDefinition * GetIon(G4int Z, G4int A, G4int lvl=0)
Definition: G4IonTable.cc:503
static constexpr double second
Definition: G4SIunits.hh:157
int G4int
Definition: G4Types.hh:78
void setY(double)
void setZ(double)
void setX(double)
static constexpr double twopi
Definition: G4SIunits.hh:76
G4int GetNucleusEncoding(G4int iZ, G4int iA, G4int iM)
void SetMass(const G4double mas)
Hep3Vector vect() const
#define G4UniformRand()
Definition: Randomize.hh:97
float k_Boltzmann
Definition: hepunit.py:299
const G4ParticleDefinition * GetDefinition() const
double getElasticFinalState(double e_in, double temperature, double(*rng)(void *), void *rngState)
std::map< G4int, G4LENDUsedTarget * > usedTarget_map
Definition: G4LENDModel.hh:81
G4double GetKineticEnergy() const
void SetTotalEnergy(const G4double en)
G4ErrorTarget * theTarget
Definition: errprop.cc:59
double phi() const
const G4LorentzVector & Get4Momentum() const
tuple v
Definition: test.py:18
static G4IonTable * GetIonTable()
Definition: G4IonTable.hh:78
double theta() const
void SetEnergyChange(G4double anEnergy)
G4double GetPDGMass() const
G4double GetTemperature() const
Definition: G4Material.hh:182
static constexpr double MeV
Definition: G4SIunits.hh:214
const G4Material * GetMaterial() const
void AddSecondary(G4DynamicParticle *aP, G4int mod=-1)
double G4double
Definition: G4Types.hh:76
void SetDefinition(const G4ParticleDefinition *aParticleDefinition)
G4LENDManager * lend_manager
Definition: G4LENDModel.hh:80
void SetMomentumChange(const G4ThreeVector &aV)

Here is the call graph for this function:

void G4LENDModel::BuildPhysicsTable ( const G4ParticleDefinition )
inlinevirtual

Reimplemented from G4HadronicInteraction.

Definition at line 66 of file G4LENDModel.hh.

void recreate_used_target_map()
Definition: G4LENDModel.cc:77

Here is the call graph for this function:

void G4LENDModel::ChangeDefaultEvaluation ( G4String  name)
inline

Definition at line 62 of file G4LENDModel.hh.

62 { default_evaluation = name; recreate_used_target_map(); };
const XML_Char * name
Definition: expat.h:151
void recreate_used_target_map()
Definition: G4LENDModel.cc:77

Here is the call graph for this function:

Here is the caller graph for this function:

void G4LENDModel::create_used_target_map ( )
protected

Definition at line 93 of file G4LENDModel.cc.

94 {
95 
97 
98  size_t numberOfElements = G4Element::GetNumberOfElements();
99  static const G4ElementTable* theElementTable = G4Element::GetElementTable();
100 
101  for ( size_t i = 0 ; i < numberOfElements ; ++i )
102  {
103 
104  const G4Element* anElement = (*theElementTable)[i];
105  G4int numberOfIsotope = anElement->GetNumberOfIsotopes();
106 
107  if ( numberOfIsotope > 0 )
108  {
109  // User Defined Abundances
110  for ( G4int i_iso = 0 ; i_iso < numberOfIsotope ; i_iso++ )
111  {
112  G4int iZ = anElement->GetIsotope( i_iso )->GetZ();
113  G4int iA = anElement->GetIsotope( i_iso )->GetN();
114  G4int iIsomer = anElement->GetIsotope( i_iso )->Getm();
115 
116  G4LENDUsedTarget* aTarget = new G4LENDUsedTarget ( proj , default_evaluation , iZ , iA , iIsomer );
117  if ( allow_nat == true ) aTarget->AllowNat();
118  if ( allow_any == true ) aTarget->AllowAny();
119  usedTarget_map.insert( std::pair< G4int , G4LENDUsedTarget* > ( lend_manager->GetNucleusEncoding( iZ , iA , iIsomer ) , aTarget ) );
120  }
121  }
122  else
123  {
124  // Natural Abundances
126  G4int iZ = int ( anElement->GetZ() );
127  //G4cout << nistElementBuild->GetNumberOfNistIsotopes( int ( anElement->GetZ() ) ) << G4endl;
128  G4int numberOfNistIso = nistElementBuild->GetNumberOfNistIsotopes( int ( anElement->GetZ() ) );
129 
130  for ( G4int ii = 0 ; ii < numberOfNistIso ; ii++ )
131  {
132  //G4cout << nistElementBuild->GetIsotopeAbundance( iZ , nistElementBuild->GetNistFirstIsotopeN( iZ ) + i ) << G4endl;
133  if ( nistElementBuild->GetIsotopeAbundance( iZ , nistElementBuild->GetNistFirstIsotopeN( iZ ) + ii ) > 0 )
134  {
135  G4int iMass = nistElementBuild->GetNistFirstIsotopeN( iZ ) + ii;
136  //G4cout << iZ << " " << nistElementBuild->GetNistFirstIsotopeN( iZ ) + i << " " << nistElementBuild->GetIsotopeAbundance ( iZ , iMass ) << G4endl;
137  G4int iIsomer = 0;
138 
139  G4LENDUsedTarget* aTarget = new G4LENDUsedTarget ( proj , default_evaluation , iZ , iMass );
140  if ( allow_nat == true ) aTarget->AllowNat();
141  if ( allow_any == true ) aTarget->AllowAny();
142  usedTarget_map.insert( std::pair< G4int , G4LENDUsedTarget* > ( lend_manager->GetNucleusEncoding( iZ , iMass , iIsomer ) , aTarget ) );
143 
144  }
145 
146  }
147 
148  }
149  }
150 
151 
152 
153  G4cout << "Dump UsedTarget for " << GetModelName() << G4endl;
154  //G4cout << "Requested Evaluation, Z , A -> Actual Evaluation, Z , A(0=Nat) , Pointer of Target" << G4endl;
155  G4cout << "Requested Evaluation, Z , A -> Actual Evaluation, Z , A(0=Nat) " << G4endl;
156  for ( std::map< G4int , G4LENDUsedTarget* >::iterator
157  it = usedTarget_map.begin() ; it != usedTarget_map.end() ; it ++ )
158  {
159  G4cout
160  << " " << it->second->GetWantedEvaluation()
161  << ", " << it->second->GetWantedZ()
162  << ", " << it->second->GetWantedA()
163  << " -> " << it->second->GetActualEvaluation()
164  << ", " << it->second->GetActualZ()
165  << ", " << it->second->GetActualA()
166  //<< ", " << it->second->GetTarget()
167  << G4endl;
168  }
169 
170 }
size_t GetNumberOfIsotopes() const
Definition: G4Element.hh:159
G4NistElementBuilder * GetNistElementBuilder()
G4double GetZ() const
Definition: G4Element.hh:131
G4double GetIsotopeAbundance(G4int Z, G4int N) const
G4int GetNumberOfNistIsotopes(G4int Z) const
G4ParticleDefinition * proj
Definition: G4LENDModel.hh:79
const G4String & GetModelName() const
int G4int
Definition: G4Types.hh:78
G4int GetNucleusEncoding(G4int iZ, G4int iA, G4int iM)
G4int GetN() const
Definition: G4Isotope.hh:94
G4GLOB_DLL std::ostream G4cout
static size_t GetNumberOfElements()
Definition: G4Element.cc:405
G4int Getm() const
Definition: G4Isotope.hh:100
std::map< G4int, G4LENDUsedTarget * > usedTarget_map
Definition: G4LENDModel.hh:81
G4int GetNistFirstIsotopeN(G4int Z) const
typedef int(XMLCALL *XML_NotStandaloneHandler)(void *userData)
G4int GetZ() const
Definition: G4Isotope.hh:91
const G4Isotope * GetIsotope(G4int iso) const
Definition: G4Element.hh:170
#define G4endl
Definition: G4ios.hh:61
std::vector< G4Element * > G4ElementTable
G4bool RequestChangeOfVerboseLevel(G4int)
G4LENDManager * lend_manager
Definition: G4LENDModel.hh:80
static G4ElementTable * GetElementTable()
Definition: G4Element.cc:398

Here is the call graph for this function:

Here is the caller graph for this function:

void G4LENDModel::recreate_used_target_map ( )
protected

Definition at line 77 of file G4LENDModel.cc.

78 {
79 
80  for ( std::map< G4int , G4LENDUsedTarget* >::iterator
81  it = usedTarget_map.begin() ; it != usedTarget_map.end() ; it ++ )
82  {
83  delete it->second;
84  }
85  usedTarget_map.clear();
86 
88 
89 }
std::map< G4int, G4LENDUsedTarget * > usedTarget_map
Definition: G4LENDModel.hh:81
void create_used_target_map()
Definition: G4LENDModel.cc:93

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

G4LENDManager* G4LENDModel::lend_manager
protected

Definition at line 80 of file G4LENDModel.hh.

G4ParticleDefinition* G4LENDModel::proj
protected

Definition at line 79 of file G4LENDModel.hh.

std::map< G4int , G4LENDUsedTarget* > G4LENDModel::usedTarget_map
protected

Definition at line 81 of file G4LENDModel.hh.


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