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

#include <G4GDecay3.hh>

Public Member Functions

 G4GDecay3 ()
 
 G4GDecay3 (const G4double &pMass, const G4double &dMass0, const G4double &dMass1, const G4double &dMass2)
 
 ~G4GDecay3 ()
 
std::vector< G4ThreeVectorGetThreeBodyMomenta ()
 

Detailed Description

Definition at line 42 of file G4GDecay3.hh.

Constructor & Destructor Documentation

◆ G4GDecay3() [1/2]

G4GDecay3::G4GDecay3 ( )
inline

Definition at line 45 of file G4GDecay3.hh.

45{;}

◆ G4GDecay3() [2/2]

G4GDecay3::G4GDecay3 ( const G4double & pMass,
const G4double & dMass0,
const G4double & dMass1,
const G4double & dMass2 )

Definition at line 42 of file G4GDecay3.cc.

44 : loopMax(100), mDaughter0(dMass0), mDaughter1(dMass1),
45 mDaughter2(dMass2), pDaughter0(0.), pDaughter1(0.), pDaughter2(0.)
46{
47 parentMass = std::max(pMass, mDaughter0 + mDaughter1 + mDaughter2 + CLHEP::keV);
48}

◆ ~G4GDecay3()

G4GDecay3::~G4GDecay3 ( )
inline

Definition at line 48 of file G4GDecay3.hh.

48{;}

Member Function Documentation

◆ GetThreeBodyMomenta()

std::vector< G4ThreeVector > G4GDecay3::GetThreeBodyMomenta ( )

Definition at line 96 of file G4GDecay3.cc.

97{
98
99 std::vector<G4ThreeVector> pVect;
100
101 if (CalculateMomentumMagnitudes() ) {
102
103 // Calculate directions
104 G4double costheta = 2.*G4UniformRand()-1.;
105 G4double sintheta = std::sqrt((1.0-costheta)*(1.0+costheta));
106 G4double phi = twopi*G4UniformRand();
107 G4double sinphi = std::sin(phi);
108 G4double cosphi = std::cos(phi);
109 G4ThreeVector direction0(sintheta*cosphi, sintheta*sinphi, costheta);
110
111 G4double costhetan = (pDaughter1*pDaughter1 - pDaughter2*pDaughter2
112 - pDaughter0*pDaughter0)/(2.0*pDaughter2*pDaughter0);
113 G4double sinthetan = std::sqrt((1.0-costhetan)*(1.0+costhetan));
114 G4double phin = twopi*G4UniformRand();
115 G4double sinphin = std::sin(phin);
116 G4double cosphin = std::cos(phin);
117 G4ThreeVector direction2;
118 direction2.setX(sinthetan*cosphin*costheta*cosphi -
119 sinthetan*sinphin*sinphi + costhetan*sintheta*cosphi);
120 direction2.setY(sinthetan*cosphin*costheta*sinphi +
121 sinthetan*sinphin*cosphi + costhetan*sintheta*sinphi);
122 direction2.setZ(-sinthetan*cosphin*sintheta + costhetan*costheta);
123
124 // Return momentum vectors
125 pVect.push_back(pDaughter0*direction0);
126 pVect.push_back(-direction0*pDaughter0 - direction2*pDaughter2);
127 pVect.push_back(pDaughter2*direction2);
128
129 } else {
130 G4cerr << "G4GDecay3::GetThreeBodyMomenta: " << loopMax
131 << " or more loops in momentum magnitude calculation " << G4endl;
132 }
133
134 return pVect;
135}
double G4double
Definition G4Types.hh:83
G4GLOB_DLL std::ostream G4cerr
#define G4endl
Definition G4ios.hh:67
#define G4UniformRand()
Definition Randomize.hh:52
void setY(double)
void setZ(double)
void setX(double)

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