Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4LENDModel Class Reference

#include <G4LENDModel.hh>

+ Inheritance 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 &)
 
void DumpLENDTargetInfo (G4bool force=false)
 
- Public Member Functions inherited from G4HadronicInteraction
 G4HadronicInteraction (const G4String &modelName="HadronicModel")
 
virtual ~G4HadronicInteraction ()
 
virtual G4HadFinalStateApplyYourself (const G4HadProjectile &aTrack, G4Nucleus &targetNucleus)
 
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, G4doubleGetFatalEnergyCheckLevels () const
 
virtual std::pair< G4double, G4doubleGetEnergyMomentumCheckLevels () const
 
void SetEnergyMomentumCheckLevels (G4double relativeLevel, G4double absoluteLevel)
 
virtual void ModelDescription (std::ostream &outFile) const
 
virtual void BuildPhysicsTable (const G4ParticleDefinition &)
 
virtual void InitialiseModel ()
 
 G4HadronicInteraction (const G4HadronicInteraction &right)=delete
 
const G4HadronicInteractionoperator= (const G4HadronicInteraction &right)=delete
 
G4bool operator== (const G4HadronicInteraction &right) const =delete
 
G4bool operator!= (const G4HadronicInteraction &right) const =delete
 

Protected Member Functions

void create_used_target_map ()
 
void recreate_used_target_map ()
 
G4GIDI_targetget_target_from_map (G4int nuclear_code)
 
G4HadFinalStatereturnUnchanged (const G4HadProjectile &aTrack, G4HadFinalState *theResult)
 
- 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::G4LENDModel ( G4String  name = "LENDModel")

Definition at line 47 of file G4LENDModel.cc.

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}
void SetMinEnergy(G4double anEnergy)
void SetMaxEnergy(const G4double anEnergy)
static G4LENDManager * GetInstance()
G4LENDManager * lend_manager
Definition: G4LENDModel.hh:84
G4ParticleDefinition * proj
Definition: G4LENDModel.hh:83

◆ ~G4LENDModel()

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:85

Member Function Documentation

◆ AllowAnyCandidateTarget()

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

◆ AllowNaturalAbundanceTarget()

void G4LENDModel::AllowNaturalAbundanceTarget ( )
inline

Definition at line 63 of file G4LENDModel.hh.

63{ allow_nat = true; recreate_used_target_map(); };

Referenced by G4NeutronLENDBuilder::Build(), and G4HadronElasticPhysicsLEND::ConstructProcess().

◆ ApplyYourself()

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

Reimplemented from G4HadronicInteraction.

Reimplemented in G4LENDorBERTModel, G4LENDCapture, G4LENDCombinedModel, G4LENDElastic, G4LENDFission, G4LENDGammaModel, and G4LENDInelastic.

Definition at line 158 of file G4LENDModel.cc.

159{
160
161 G4double temp = aTrack.GetMaterial()->GetTemperature();
162
163 //G4int iZ = int ( aTarg.GetZ() );
164 //G4int iA = int ( aTarg.GetN() );
165 //migrate to integer A and Z (GetN_asInt returns number of neutrons in the nucleus since this)
166 G4int iZ = aTarg.GetZ_asInt();
167 G4int iA = aTarg.GetA_asInt();
168 G4int iM = 0;
169 if ( aTarg.GetIsotope() != NULL ) {
170 iM = aTarg.GetIsotope()->Getm();
171 }
172
173 G4double ke = aTrack.GetKineticEnergy();
174
175 G4HadFinalState* theResult = new G4HadFinalState();
176
177 G4GIDI_target* aTarget = usedTarget_map.find( lend_manager->GetNucleusEncoding( iZ , iA , iM ) )->second->GetTarget();
178
179 G4double aMu = aTarget->getElasticFinalState( ke*MeV, temp, NULL, NULL );
180
181 G4double phi = twopi*G4UniformRand();
182 G4double theta = std::acos( aMu );
183 //G4double sinth = std::sin( theta );
184
185 G4ReactionProduct theNeutron( aTrack.GetDefinition() );
186 theNeutron.SetMomentum( aTrack.Get4Momentum().vect() );
187 theNeutron.SetKineticEnergy( ke );
188
189 G4ParticleDefinition* pd = G4IonTable::GetIonTable()->GetIon( iZ , iA , iM );
190 G4ReactionProduct theTarget( pd );
191
192 G4double mass = pd->GetPDGMass();
193
194// add Thermal motion
195 G4double kT = k_Boltzmann*temp;
196 G4ThreeVector v ( G4RandGauss::shoot() * std::sqrt( kT*mass )
197 , G4RandGauss::shoot() * std::sqrt( kT*mass )
198 , G4RandGauss::shoot() * std::sqrt( kT*mass ) );
199
200 theTarget.SetMomentum( v );
201
202
203 G4ThreeVector the3Neutron = theNeutron.GetMomentum();
204 G4double nEnergy = theNeutron.GetTotalEnergy();
205 G4ThreeVector the3Target = theTarget.GetMomentum();
206 G4double tEnergy = theTarget.GetTotalEnergy();
207 G4ReactionProduct theCMS;
208 G4double totE = nEnergy+tEnergy;
209 G4ThreeVector the3CMS = the3Target+the3Neutron;
210 theCMS.SetMomentum(the3CMS);
211 G4double cmsMom = std::sqrt(the3CMS*the3CMS);
212 G4double sqrts = std::sqrt((totE-cmsMom)*(totE+cmsMom));
213 theCMS.SetMass(sqrts);
214 theCMS.SetTotalEnergy(totE);
215
216 theNeutron.Lorentz(theNeutron, theCMS);
217 theTarget.Lorentz(theTarget, theCMS);
218 G4double en = theNeutron.GetTotalMomentum(); // already in CMS.
219 G4ThreeVector cms3Mom=theNeutron.GetMomentum(); // for neutron direction in CMS
220 G4double cms_theta=cms3Mom.theta();
221 G4double cms_phi=cms3Mom.phi();
222 G4ThreeVector tempVector;
223 tempVector.setX(std::cos(theta)*std::sin(cms_theta)*std::cos(cms_phi)
224 +std::sin(theta)*std::cos(phi)*std::cos(cms_theta)*std::cos(cms_phi)
225 -std::sin(theta)*std::sin(phi)*std::sin(cms_phi) );
226 tempVector.setY(std::cos(theta)*std::sin(cms_theta)*std::sin(cms_phi)
227 +std::sin(theta)*std::cos(phi)*std::cos(cms_theta)*std::sin(cms_phi)
228 +std::sin(theta)*std::sin(phi)*std::cos(cms_phi) );
229 tempVector.setZ(std::cos(theta)*std::cos(cms_theta)
230 -std::sin(theta)*std::cos(phi)*std::sin(cms_theta) );
231 tempVector *= en;
232 theNeutron.SetMomentum(tempVector);
233 theTarget.SetMomentum(-tempVector);
234 G4double tP = theTarget.GetTotalMomentum();
235 G4double tM = theTarget.GetMass();
236 theTarget.SetTotalEnergy(std::sqrt((tP+tM)*(tP+tM)-2.*tP*tM));
237 theNeutron.Lorentz(theNeutron, -1.*theCMS);
238 theTarget.Lorentz(theTarget, -1.*theCMS);
239
240 theResult->SetEnergyChange(theNeutron.GetKineticEnergy());
241 theResult->SetMomentumChange(theNeutron.GetMomentum().unit());
242 G4DynamicParticle* theRecoil = new G4DynamicParticle;
243
244 theRecoil->SetDefinition( G4IonTable::GetIonTable()->GetIon( iZ , iA , iM , iZ ) );
245 theRecoil->SetMomentum( theTarget.GetMomentum() );
246
247 theResult->AddSecondary( theRecoil );
248
249 return theResult;
250
251}
double G4double
Definition: G4Types.hh:83
int G4int
Definition: G4Types.hh:85
#define G4UniformRand()
Definition: Randomize.hh:52
double phi() const
double theta() const
void setY(double)
void setZ(double)
void setX(double)
Hep3Vector vect() const
void SetDefinition(const G4ParticleDefinition *aParticleDefinition)
void SetMomentum(const G4ThreeVector &momentum)
double getElasticFinalState(double e_in, double temperature, double(*rng)(void *), void *rngState)
void AddSecondary(G4DynamicParticle *aP, G4int mod=-1)
void SetEnergyChange(G4double anEnergy)
void SetMomentumChange(const G4ThreeVector &aV)
const G4Material * GetMaterial() const
const G4ParticleDefinition * GetDefinition() const
G4double GetKineticEnergy() const
const G4LorentzVector & Get4Momentum() const
G4ParticleDefinition * GetIon(G4int Z, G4int A, G4int lvl=0)
Definition: G4IonTable.cc:522
static G4IonTable * GetIonTable()
Definition: G4IonTable.cc:170
G4int GetNucleusEncoding(G4int iZ, G4int iA, G4int iM)
G4double GetTemperature() const
Definition: G4Material.hh:180
void SetMomentum(const G4double x, const G4double y, const G4double z)
void SetTotalEnergy(const G4double en)
void SetMass(const G4double mas)

Referenced by G4LENDCombinedModel::ApplyYourself(), and G4LENDGammaModel::ApplyYourself().

◆ BuildPhysicsTable()

void G4LENDModel::BuildPhysicsTable ( const G4ParticleDefinition )
inlinevirtual

Reimplemented from G4HadronicInteraction.

Definition at line 66 of file G4LENDModel.hh.

◆ ChangeDefaultEvaluation()

void G4LENDModel::ChangeDefaultEvaluation ( G4String  name)
inline

Definition at line 62 of file G4LENDModel.hh.

62{ default_evaluation = name; recreate_used_target_map(); };
const char * name(G4int ptype)

Referenced by G4NeutronLENDBuilder::Build(), and G4HadronElasticPhysicsLEND::ConstructProcess().

◆ create_used_target_map()

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
152}
std::vector< G4Element * > G4ElementTable
static G4ElementTable * GetElementTable()
Definition: G4Element.cc:397
G4double GetZ() const
Definition: G4Element.hh:130
static size_t GetNumberOfElements()
Definition: G4Element.cc:404
const G4Isotope * GetIsotope(G4int iso) const
Definition: G4Element.hh:169
size_t GetNumberOfIsotopes() const
Definition: G4Element.hh:158
G4int GetZ() const
Definition: G4Isotope.hh:90
G4int Getm() const
Definition: G4Isotope.hh:99
G4int GetN() const
Definition: G4Isotope.hh:93
G4bool RequestChangeOfVerboseLevel(G4int)
G4NistElementBuilder * GetNistElementBuilder()
void DumpLENDTargetInfo(G4bool force=false)
Definition: G4LENDModel.cc:275
G4int GetNumberOfNistIsotopes(G4int Z) const
G4double GetIsotopeAbundance(G4int Z, G4int N) const
G4int GetNistFirstIsotopeN(G4int Z) const

Referenced by G4LENDorBERTModel::BuildPhysicsTable(), G4LENDCombinedModel::BuildPhysicsTable(), G4LENDGammaModel::BuildPhysicsTable(), DumpLENDTargetInfo(), G4LENDCapture::G4LENDCapture(), G4LENDElastic::G4LENDElastic(), G4LENDFission::G4LENDFission(), G4LENDInelastic::G4LENDInelastic(), and recreate_used_target_map().

◆ DumpLENDTargetInfo()

void G4LENDModel::DumpLENDTargetInfo ( G4bool  force = false)

Definition at line 275 of file G4LENDModel.cc.

275 {
276
277 if ( lend_manager->GetVerboseLevel() >= 1 || force ) {
278 if ( usedTarget_map.size() == 0 ) create_used_target_map();
279 G4cout << "Dumping UsedTarget of " << GetModelName() << " for " << proj->GetParticleName() << G4endl;
280 G4cout << "Requested Evaluation, Z , A -> Actual Evaluation, Z , A(0=Nat) " << G4endl;
281 for ( std::map< G4int , G4LENDUsedTarget* >::iterator
282 it = usedTarget_map.begin() ; it != usedTarget_map.end() ; it ++ ) {
283 G4cout
284 << " " << it->second->GetWantedEvaluation()
285 << ", " << it->second->GetWantedZ()
286 << ", " << it->second->GetWantedA()
287 << " -> " << it->second->GetActualEvaluation()
288 << ", " << it->second->GetActualZ()
289 << ", " << it->second->GetActualA()
290 << G4endl;
291 }
292 }
293}
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
const G4String & GetModelName() const
G4int GetVerboseLevel()
void create_used_target_map()
Definition: G4LENDModel.cc:93
const G4String & GetParticleName() const

Referenced by G4LENDBertiniGammaElectroNuclearBuilder::Build(), G4HadronElasticPhysicsLEND::ConstructProcess(), and create_used_target_map().

◆ get_target_from_map()

G4GIDI_target * G4LENDModel::get_target_from_map ( G4int  nuclear_code)
protected

Definition at line 267 of file G4LENDModel.cc.

267 {
268 G4GIDI_target* target = NULL;
269 if ( usedTarget_map.find( nuclear_code ) != usedTarget_map.end() ) {
270 target = usedTarget_map.find( nuclear_code )->second->GetTarget();
271 }
272 return target;
273}

Referenced by G4LENDCapture::ApplyYourself(), G4LENDElastic::ApplyYourself(), G4LENDFission::ApplyYourself(), G4LENDInelastic::ApplyYourself(), G4LENDCombinedModel::HasData(), and G4LENDGammaModel::HasData().

◆ recreate_used_target_map()

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}

Referenced by AllowAnyCandidateTarget(), AllowNaturalAbundanceTarget(), BuildPhysicsTable(), and ChangeDefaultEvaluation().

◆ returnUnchanged()

G4HadFinalState * G4LENDModel::returnUnchanged ( const G4HadProjectile aTrack,
G4HadFinalState theResult 
)
protected

Definition at line 253 of file G4LENDModel.cc.

253 {
254 if ( lend_manager->GetVerboseLevel() >= 1 ) {
255 G4String message;
256 message = "Produce unchanged final state is requested in ";
257 message += this->GetModelName();
258 message += ". Cross section and model likely have an inconsistency.";
259 G4Exception( "G4LENDModel::returnUnchanged(,)" , "LENDModel-01" , JustWarning ,
260 message );
261 }
262 theResult->SetEnergyChange( aTrack.GetKineticEnergy() );
263 theResult->SetMomentumChange( aTrack.Get4Momentum().getV().unit() );
264 return theResult;
265}
@ JustWarning
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:35
Hep3Vector unit() const
Hep3Vector getV() const

Referenced by G4LENDCapture::ApplyYourself(), G4LENDElastic::ApplyYourself(), and G4LENDFission::ApplyYourself().

Member Data Documentation

◆ lend_manager

◆ proj

◆ usedTarget_map

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

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