Geant4-11
Public Member Functions | Protected Member Functions | Private Attributes
G4ParticleHPIsotropic Class Reference

#include <G4ParticleHPIsotropic.hh>

Inheritance diagram for G4ParticleHPIsotropic:
G4VParticleHPEnergyAngular

Public Member Functions

virtual void ClearHistories ()
 
 G4ParticleHPIsotropic ()
 
G4ReactionProductGetCMS ()
 
G4ReactionProductGetProjectileRP ()
 
G4ReactionProductGetTarget ()
 
void Init (std::istream &aDataFile)
 
G4double MeanEnergyOfThisInteraction ()
 
G4ReactionProductSample (G4double anEnergy, G4double massCode, G4double mass)
 
void SetProjectileRP (G4ReactionProduct *aIncidentParticleRP)
 
void SetQValue (G4double aValue)
 
void SetTarget (G4ReactionProduct *aTarget)
 
 ~G4ParticleHPIsotropic ()
 

Protected Member Functions

G4double GetQValue ()
 

Private Attributes

G4Cache< toBeCachedfCache
 
G4double theQValue
 

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

◆ ClearHistories()

virtual void G4VParticleHPEnergyAngular::ClearHistories ( )
inlinevirtualinherited

Reimplemented in G4ParticleHPContEnergyAngular.

Definition at line 106 of file G4VParticleHPEnergyAngular.hh.

107 {
108 }

Referenced by G4ParticleHPProduct::Sample().

◆ GetCMS()

G4ReactionProduct * G4VParticleHPEnergyAngular::GetCMS ( )
inlineinherited

Definition at line 94 of file G4VParticleHPEnergyAngular.hh.

95 {
96 *fCache.Get().theCMS = *fCache.Get().theProjectileRP
97 + *fCache.Get().theTarget;
98 return fCache.Get().theCMS;
99 }

References G4VParticleHPEnergyAngular::fCache.

◆ GetProjectileRP()

G4ReactionProduct * G4VParticleHPEnergyAngular::GetProjectileRP ( )
inlineinherited

◆ GetQValue()

G4double G4VParticleHPEnergyAngular::GetQValue ( )
inlineprotectedinherited

◆ GetTarget()

G4ReactionProduct * G4VParticleHPEnergyAngular::GetTarget ( void  )
inlineinherited

◆ 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.;
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}
static constexpr double twopi
Definition: G4SIunits.hh:56
static constexpr double MeV
Definition: G4SIunits.hh:200
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
T max(const T t1, const T t2)
brief Return the largest of the two arguments

References A, G4Alpha::Alpha(), G4Deuteron::Deuteron(), G4Electron::Electron(), G4UniformRand, G4Gamma::Gamma(), G4IonTable::GetIon(), G4IonTable::GetIonTable(), G4VParticleHPEnergyAngular::GetQValue(), G4ReactionProduct::GetTotalMomentum(), G4He3::He3(), G4INCL::Math::max(), MeV, G4Neutron::Neutron(), G4Positron::Positron(), G4Proton::Proton(), G4ReactionProduct::SetDefinition(), G4ReactionProduct::SetKineticEnergy(), G4ReactionProduct::SetMomentum(), G4Triton::Triton(), twopi, and Z.

◆ SetProjectileRP()

void G4VParticleHPEnergyAngular::SetProjectileRP ( G4ReactionProduct aIncidentParticleRP)
inlineinherited

Definition at line 74 of file G4VParticleHPEnergyAngular.hh.

75 {
76 fCache.Get().theProjectileRP = aIncidentParticleRP;
77 }

References G4VParticleHPEnergyAngular::fCache.

Referenced by G4ParticleHPInelasticBaseFS::BaseApply(), and G4ParticleHPProduct::Sample().

◆ SetQValue()

void G4VParticleHPEnergyAngular::SetQValue ( G4double  aValue)
inlineinherited

◆ SetTarget()

void G4VParticleHPEnergyAngular::SetTarget ( G4ReactionProduct aTarget)
inlineinherited

Definition at line 79 of file G4VParticleHPEnergyAngular.hh.

80 {
81 fCache.Get().theTarget = aTarget;
82 }

References G4VParticleHPEnergyAngular::fCache.

Referenced by G4ParticleHPInelasticBaseFS::BaseApply(), and G4ParticleHPProduct::Sample().

Field Documentation

◆ fCache

G4Cache<toBeCached> G4VParticleHPEnergyAngular::fCache
privateinherited

◆ theQValue

G4double G4VParticleHPEnergyAngular::theQValue
privateinherited

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