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

#include <G4LENDElastic.hh>

Inheritance diagram for G4LENDElastic:
Collaboration diagram for G4LENDElastic:

Public Member Functions

 G4LENDElastic (G4ParticleDefinition *pd)
 
 ~G4LENDElastic ()
 
G4HadFinalStateApplyYourself (const G4HadProjectile &aTrack, G4Nucleus &aTargetNucleus)
 
- Public Member Functions inherited from G4LENDModel
 G4LENDModel (G4String name="LENDModel")
 
 ~G4LENDModel ()
 
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 ()
 

Additional Inherited Members

- Protected Member Functions inherited from G4LENDModel
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 inherited from G4LENDModel
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 44 of file G4LENDElastic.hh.

Constructor & Destructor Documentation

G4LENDElastic::G4LENDElastic ( G4ParticleDefinition pd)
inline

Definition at line 49 of file G4LENDElastic.hh.

50  :G4LENDModel( "LENDElastic" )
51  {
52  proj = pd;
53 
54  //theModelName = "LEND Elastic Model for ";
55  //theModelName += proj->GetParticleName();
57  };
G4ParticleDefinition * proj
Definition: G4LENDModel.hh:79
G4LENDModel(G4String name="LENDModel")
Definition: G4LENDModel.cc:47
void create_used_target_map()
Definition: G4LENDModel.cc:93

Here is the call graph for this function:

G4LENDElastic::~G4LENDElastic ( )
inline

Definition at line 59 of file G4LENDElastic.hh.

59 {;};

Member Function Documentation

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

Reimplemented from G4LENDModel.

Definition at line 37 of file G4LENDElastic.cc.

38 {
39 
40  G4double temp = aTrack.GetMaterial()->GetTemperature();
41 
42  //G4int iZ = int ( aTarg.GetZ() );
43  //G4int iA = int ( aTarg.GetN() );
44  //migrate to integer A and Z (GetN_asInt returns number of neutrons in the nucleus since this)
45  G4int iZ = aTarg.GetZ_asInt();
46  G4int iA = aTarg.GetA_asInt();
47  G4int iM = 0;
48  if ( aTarg.GetIsotope() != NULL ) {
49  iM = aTarg.GetIsotope()->Getm();
50  }
51 
52  G4double ke = aTrack.GetKineticEnergy();
53 
54  //G4HadFinalState* theResult = new G4HadFinalState();
55  G4HadFinalState* theResult = &theParticleChange;
56  theResult->Clear();
57 
58  G4GIDI_target* aTarget = usedTarget_map.find( lend_manager->GetNucleusEncoding( iZ , iA , iM ) )->second->GetTarget();
59  //G4double aMu = aTarget->getElasticFinalState( ke*MeV, temp, NULL, NULL );
60  G4double aMu = aTarget->getElasticFinalState( ke*MeV, temp, MyRNG , NULL );
61 
63  G4double theta = std::acos( aMu );
64  //G4double sinth = std::sin( theta );
65 
66  G4ReactionProduct theNeutron( aTrack.GetDefinition() );
67  theNeutron.SetMomentum( aTrack.Get4Momentum().vect() );
68  theNeutron.SetKineticEnergy( ke );
69 
70 //G4cout << "iZ " << iZ << " iA " << iA << G4endl;
71 
72  G4ParticleDefinition* pd = G4IonTable::GetIonTable()->GetIon( iZ , iA , iM );
73  G4ReactionProduct theTarget( pd );
74 
75  G4double mass = pd->GetPDGMass();
76 
77 // add Thermal motion
78  G4double kT = k_Boltzmann*temp;
79  G4ThreeVector v ( G4RandGauss::shoot() * std::sqrt( kT*mass )
80  , G4RandGauss::shoot() * std::sqrt( kT*mass )
81  , G4RandGauss::shoot() * std::sqrt( kT*mass ) );
82  theTarget.SetMomentum( v );
83 
84  G4ThreeVector the3Neutron = theNeutron.GetMomentum();
85  G4double nEnergy = theNeutron.GetTotalEnergy();
86  G4ThreeVector the3Target = theTarget.GetMomentum();
87  G4double tEnergy = theTarget.GetTotalEnergy();
88  G4ReactionProduct theCMS;
89  G4double totE = nEnergy+tEnergy;
90  G4ThreeVector the3CMS = the3Target+the3Neutron;
91  theCMS.SetMomentum(the3CMS);
92  G4double cmsMom = std::sqrt(the3CMS*the3CMS);
93  G4double sqrts = std::sqrt((totE-cmsMom)*(totE+cmsMom));
94  theCMS.SetMass(sqrts);
95  theCMS.SetTotalEnergy(totE);
96 
97  theNeutron.Lorentz(theNeutron, theCMS);
98  theTarget.Lorentz(theTarget, theCMS);
99  G4double en = theNeutron.GetTotalMomentum(); // already in CMS.
100  G4ThreeVector cms3Mom=theNeutron.GetMomentum(); // for neutron direction in CMS
101  G4double cms_theta=cms3Mom.theta();
102  G4double cms_phi=cms3Mom.phi();
103  G4ThreeVector tempVector;
104  tempVector.setX( std::cos(theta)*std::sin(cms_theta)*std::cos(cms_phi)
105  +std::sin(theta)*std::cos(phi)*std::cos(cms_theta)*std::cos(cms_phi)
106  -std::sin(theta)*std::sin(phi)*std::sin(cms_phi) );
107  tempVector.setY( std::cos(theta)*std::sin(cms_theta)*std::sin(cms_phi)
108  +std::sin(theta)*std::cos(phi)*std::cos(cms_theta)*std::sin(cms_phi)
109  +std::sin(theta)*std::sin(phi)*std::cos(cms_phi) );
110  tempVector.setZ( std::cos(theta)*std::cos(cms_theta)
111  -std::sin(theta)*std::cos(phi)*std::sin(cms_theta) );
112  tempVector *= en;
113  theNeutron.SetMomentum(tempVector);
114  theTarget.SetMomentum(-tempVector);
115  G4double tP = theTarget.GetTotalMomentum();
116  G4double tM = theTarget.GetMass();
117  theTarget.SetTotalEnergy(std::sqrt((tP+tM)*(tP+tM)-2.*tP*tM));
118 
119 
120  theNeutron.Lorentz(theNeutron, -1.*theCMS);
121 
122 //110913 Add Protection for very low energy (1e-6eV) scattering
123  if ( theNeutron.GetKineticEnergy() <= 0 )
124  {
125  theNeutron.SetTotalEnergy ( theNeutron.GetMass() * ( 1 + G4Pow::GetInstance()->powA( 10 , -15.65 ) ) );
126  }
127 
128  theTarget.Lorentz(theTarget, -1.*theCMS);
129  if ( theTarget.GetKineticEnergy() < 0 )
130  {
131  theTarget.SetTotalEnergy ( theTarget.GetMass() * ( 1 + G4Pow::GetInstance()->powA( 10 , -15.65 ) ) );
132  }
133 //110913 END
134 
135  theTarget.Lorentz(theTarget, -1.*theCMS);
136 
137  theResult->SetEnergyChange(theNeutron.GetKineticEnergy());
138  theResult->SetMomentumChange(theNeutron.GetMomentum().unit());
139  G4DynamicParticle* theRecoil = new G4DynamicParticle;
140 
141 // theRecoil->SetDefinition( ionTable->GetIon( iZ , iA ) );
142  theRecoil->SetDefinition( G4IonTable::GetIonTable()->GetIon( iZ, iA , iM ));
143  theRecoil->SetMomentum( theTarget.GetMomentum() );
144 
145  theResult->AddSecondary( theRecoil );
146 
147  return theResult;
148 
149 }
static G4Pow * GetInstance()
Definition: G4Pow.cc:55
G4double powA(G4double A, G4double y) const
Definition: G4Pow.hh:259
static constexpr double k_Boltzmann
ThreeVector shoot(const G4int Ap, const G4int Af)
void SetMomentum(const G4ThreeVector &momentum)
double MyRNG(void *)
Definition: G4LENDModel.cc:45
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
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)
double phi() const
const G4LorentzVector & Get4Momentum() const
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:


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