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

#include <G4LENDElastic.hh>

Inheritance diagram for G4LENDElastic:
G4LENDModel G4HadronicInteraction

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 &, G4Nucleus &)
 
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)
 
const G4HadronicInteractionGetMyPointer () const
 
virtual G4int GetVerboseLevel () const
 
virtual 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
 
G4bool operator== (const G4HadronicInteraction &right) const
 
G4bool operator!= (const G4HadronicInteraction &right) 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
 

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.

References G4LENDModel::create_used_target_map(), and G4LENDModel::proj.

50  :G4LENDModel( "LENDElastic" )
51  {
52  proj = pd;
53 
54  //theModelName = "LEND Elastic Model for ";
55  //theModelName += proj->GetParticleName();
57  };
G4ParticleDefinition * proj
Definition: G4LENDModel.hh:77
G4LENDModel(G4String name="LENDModel")
Definition: G4LENDModel.cc:45
void create_used_target_map()
Definition: G4LENDModel.cc:90
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 33 of file G4LENDElastic.cc.

References G4HadFinalState::AddSecondary(), G4HadFinalState::Clear(), G4ParticleTable::FindIon(), G4UniformRand, G4HadProjectile::Get4Momentum(), G4Nucleus::GetA_asInt(), G4HadProjectile::GetDefinition(), G4GIDI_target::getElasticFinalState(), G4Nucleus::GetIsotope(), G4HadProjectile::GetKineticEnergy(), G4ReactionProduct::GetKineticEnergy(), G4Isotope::Getm(), G4ReactionProduct::GetMass(), G4HadProjectile::GetMaterial(), G4ReactionProduct::GetMomentum(), G4LENDManager::GetNucleusEncoding(), G4ParticleTable::GetParticleTable(), G4ParticleDefinition::GetPDGMass(), G4Material::GetTemperature(), G4ReactionProduct::GetTotalEnergy(), G4ReactionProduct::GetTotalMomentum(), G4Nucleus::GetZ_asInt(), python.hepunit::k_Boltzmann, G4LENDModel::lend_manager, G4ReactionProduct::Lorentz(), python.hepunit::MeV, CLHEP::Hep3Vector::phi(), python.hepunit::second, G4DynamicParticle::SetDefinition(), G4HadFinalState::SetEnergyChange(), G4ReactionProduct::SetKineticEnergy(), G4ReactionProduct::SetMass(), G4ReactionProduct::SetMomentum(), G4DynamicParticle::SetMomentum(), G4HadFinalState::SetMomentumChange(), G4ReactionProduct::SetTotalEnergy(), CLHEP::Hep3Vector::setX(), CLHEP::Hep3Vector::setY(), CLHEP::Hep3Vector::setZ(), G4INCL::DeJongSpin::shoot(), G4HadronicInteraction::theParticleChange, CLHEP::Hep3Vector::theta(), theTarget, python.hepunit::twopi, CLHEP::Hep3Vector::unit(), G4LENDModel::usedTarget_map, test::v, and CLHEP::HepLorentzVector::vect().

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

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