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

#include <G4ParticleHPIsotropic.hh>

+ Inheritance diagram for G4ParticleHPIsotropic:

Public Member Functions

 G4ParticleHPIsotropic ()
 
 ~G4ParticleHPIsotropic ()
 
void Init (std::istream &aDataFile)
 
G4ReactionProductSample (G4double anEnergy, G4double massCode, G4double mass)
 
G4double MeanEnergyOfThisInteraction ()
 
- Public Member Functions inherited from G4VParticleHPEnergyAngular
 G4VParticleHPEnergyAngular ()
 
virtual ~G4VParticleHPEnergyAngular ()
 
virtual void Init (std::istream &aDataFile)=0
 
virtual G4ReactionProductSample (G4double anEnergy, G4double massCode, G4double mass)=0
 
virtual G4double MeanEnergyOfThisInteraction ()=0
 
void SetProjectileRP (G4ReactionProduct *aIncidentParticleRP)
 
void SetTarget (G4ReactionProduct *aTarget)
 
G4ReactionProductGetTarget ()
 
G4ReactionProductGetProjectileRP ()
 
G4ReactionProductGetCMS ()
 
void SetQValue (G4double aValue)
 
virtual void ClearHistories ()
 

Additional Inherited Members

- Protected Member Functions inherited from G4VParticleHPEnergyAngular
G4double GetQValue ()
 

Detailed Description

Definition at line 38 of file G4ParticleHPIsotropic.hh.

Constructor & Destructor Documentation

◆ G4ParticleHPIsotropic()

G4ParticleHPIsotropic::G4ParticleHPIsotropic ( )
inline

Definition at line 42 of file G4ParticleHPIsotropic.hh.

42{}

◆ ~G4ParticleHPIsotropic()

G4ParticleHPIsotropic::~G4ParticleHPIsotropic ( )
inline

Definition at line 44 of file G4ParticleHPIsotropic.hh.

44{}

Member Function Documentation

◆ Init()

void G4ParticleHPIsotropic::Init ( std::istream &  aDataFile)
virtual

Implements G4VParticleHPEnergyAngular.

Definition at line 48 of file G4ParticleHPIsotropic.cc.

49{
50}

◆ MeanEnergyOfThisInteraction()

G4double G4ParticleHPIsotropic::MeanEnergyOfThisInteraction ( )
inlinevirtual

Implements G4VParticleHPEnergyAngular.

Definition at line 50 of file G4ParticleHPIsotropic.hh.

51 {
52 return -1.;
53 }

◆ Sample()

G4ReactionProduct * G4ParticleHPIsotropic::Sample ( G4double  anEnergy,
G4double  massCode,
G4double  mass 
)
virtual

Implements G4VParticleHPEnergyAngular.

Definition at line 52 of file G4ParticleHPIsotropic.cc.

53{
55 G4int Z = static_cast<G4int>(massCode/1000);
56 G4int A = static_cast<G4int>(massCode-1000*Z);
57
58 if(massCode==0)
59 {
61 }
62 else if(A==0)
63 {
65 if(Z==1) result->SetDefinition(G4Positron::Positron());
66 }
67 else if(A==1)
68 {
70 if(Z==1) result->SetDefinition(G4Proton::Proton());
71 }
72 else if(A==2)
73 {
75 }
76 else if(A==3)
77 {
79 if(Z==2) result->SetDefinition(G4He3::He3());
80 }
81 else if(A==4)
82 {
84 //110607 TK modified following parts for migration to G4NDL3.15 (ENDF VII.r0)
85 //if(Z!=2) throw G4HadronicException(__FILE__, __LINE__, "Unknown ion case 1");
86 if(Z!=2)
87 {
88 result->SetDefinition( G4IonTable::GetIonTable()->GetIon ( Z , A , 0.0 ) );
89 }
90 }
91 else
92 {
93 //110607 TK modified following parts for migration to G4NDL3.15 (ENDF VII.r0)
94 result->SetDefinition( G4IonTable::GetIonTable()->GetIon ( Z , A , 0.0 ) );
95 //throw G4HadronicException(__FILE__, __LINE__, "G4ParticleHPIsotropic: Unknown ion case 2");
96 }
97
98 // Bug #1745 DHW G4double cosTh = G4UniformRand();
99 G4double cosTh = 2.*G4UniformRand()-1.;
100 G4double phi = twopi*G4UniformRand();
101 G4double theta = std::acos(cosTh);
102 G4double sinth = std::sin(theta);
103
104// we need the the Q value of the reaction
105 result->SetKineticEnergy(std::max(0.001*MeV, anEnergy+GetQValue()));
106 G4double mtot = result->GetTotalMomentum();
107 G4ThreeVector tempVector(mtot*sinth*std::cos(phi), mtot*sinth*std::sin(phi), mtot*cosTh);
108 result->SetMomentum(tempVector);
109
110 return result;
111}
double G4double
Definition: G4Types.hh:83
int G4int
Definition: G4Types.hh:85
const G4int Z[17]
const G4double A[17]
#define G4UniformRand()
Definition: Randomize.hh:52
static G4Alpha * Alpha()
Definition: G4Alpha.cc:88
static G4Deuteron * Deuteron()
Definition: G4Deuteron.cc:93
static G4Electron * Electron()
Definition: G4Electron.cc:93
static G4Gamma * Gamma()
Definition: G4Gamma.cc:85
static G4He3 * He3()
Definition: G4He3.cc:93
G4ParticleDefinition * GetIon(G4int Z, G4int A, G4int lvl=0)
Definition: G4IonTable.cc:522
static G4IonTable * GetIonTable()
Definition: G4IonTable.cc:170
static G4Neutron * Neutron()
Definition: G4Neutron.cc:103
static G4Positron * Positron()
Definition: G4Positron.cc:93
static G4Proton * Proton()
Definition: G4Proton.cc:92
void SetMomentum(const G4double x, const G4double y, const G4double z)
G4double GetTotalMomentum() const
void SetDefinition(const G4ParticleDefinition *aParticleDefinition)
void SetKineticEnergy(const G4double en)
static G4Triton * Triton()
Definition: G4Triton.cc:93

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