#include <G4NeutronHPIsotropic.hh>
Inheritance diagram for G4NeutronHPIsotropic:
Public Member Functions | |
G4NeutronHPIsotropic () | |
~G4NeutronHPIsotropic () | |
void | Init (std::ifstream &aDataFile) |
G4ReactionProduct * | Sample (G4double anEnergy, G4double massCode, G4double mass) |
G4double | MeanEnergyOfThisInteraction () |
Definition at line 38 of file G4NeutronHPIsotropic.hh.
G4NeutronHPIsotropic::G4NeutronHPIsotropic | ( | ) | [inline] |
G4NeutronHPIsotropic::~G4NeutronHPIsotropic | ( | ) | [inline] |
void G4NeutronHPIsotropic::Init | ( | std::ifstream & | aDataFile | ) | [virtual] |
G4double G4NeutronHPIsotropic::MeanEnergyOfThisInteraction | ( | ) | [inline, virtual] |
G4ReactionProduct * G4NeutronHPIsotropic::Sample | ( | G4double | anEnergy, | |
G4double | massCode, | |||
G4double | mass | |||
) | [virtual] |
Implements G4VNeutronHPEnergyAngular.
Definition at line 50 of file G4NeutronHPIsotropic.cc.
References G4Alpha::Alpha(), G4Deuteron::Deuteron(), G4Electron::Electron(), G4UniformRand, G4Gamma::Gamma(), G4ParticleTable::GetParticleTable(), G4VNeutronHPEnergyAngular::GetQValue(), G4ReactionProduct::GetTotalMomentum(), G4He3::He3(), G4Neutron::Neutron(), G4Positron::Positron(), G4Proton::Proton(), G4ReactionProduct::SetDefinition(), G4ReactionProduct::SetKineticEnergy(), G4ReactionProduct::SetMomentum(), and G4Triton::Triton().
00051 { 00052 G4ReactionProduct * result = new G4ReactionProduct; 00053 G4int Z = static_cast<G4int>(massCode/1000); 00054 G4int A = static_cast<G4int>(massCode-1000*Z); 00055 00056 if(massCode==0) 00057 { 00058 result->SetDefinition(G4Gamma::Gamma()); 00059 } 00060 else if(A==0) 00061 { 00062 result->SetDefinition(G4Electron::Electron()); 00063 if(Z==1) result->SetDefinition(G4Positron::Positron()); 00064 } 00065 else if(A==1) 00066 { 00067 result->SetDefinition(G4Neutron::Neutron()); 00068 if(Z==1) result->SetDefinition(G4Proton::Proton()); 00069 } 00070 else if(A==2) 00071 { 00072 result->SetDefinition(G4Deuteron::Deuteron()); 00073 } 00074 else if(A==3) 00075 { 00076 result->SetDefinition(G4Triton::Triton()); 00077 if(Z==2) result->SetDefinition(G4He3::He3()); 00078 } 00079 else if(A==4) 00080 { 00081 result->SetDefinition(G4Alpha::Alpha()); 00082 //110607 TK modified following parts for migration to G4NDL3.15 (ENDF VII.r0) 00083 //if(Z!=2) throw G4HadronicException(__FILE__, __LINE__, "Unknown ion case 1"); 00084 if(Z!=2) 00085 { 00086 result->SetDefinition( G4ParticleTable::GetParticleTable()->GetIon ( Z , A , 0.0 ) ); 00087 } 00088 } 00089 else 00090 { 00091 //110607 TK modified following parts for migration to G4NDL3.15 (ENDF VII.r0) 00092 result->SetDefinition( G4ParticleTable::GetParticleTable()->GetIon ( Z , A , 0.0 ) ); 00093 //throw G4HadronicException(__FILE__, __LINE__, "G4NeutronHPIsotropic: Unknown ion case 2"); 00094 } 00095 00096 G4double cosTh = G4UniformRand(); 00097 G4double phi = twopi*G4UniformRand(); 00098 G4double theta = std::acos(cosTh); 00099 G4double sinth = std::sin(theta); 00100 00101 // we need the the Q value of the reaction 00102 result->SetKineticEnergy(std::max(0.001*MeV, anEnergy+GetQValue())); 00103 G4double mtot = result->GetTotalMomentum(); 00104 G4ThreeVector tempVector(mtot*sinth*std::cos(phi), mtot*sinth*std::sin(phi), mtot*std::cos(theta) ); 00105 result->SetMomentum(tempVector); 00106 00107 return result; 00108 }