Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 43 of file G4GDecay3.hh.

Constructor & Destructor Documentation

G4GDecay3::G4GDecay3 ( )
inline

Definition at line 46 of file G4GDecay3.hh.

46 {;}
G4GDecay3::G4GDecay3 ( const G4double pMass,
const G4double dMass0,
const G4double dMass1,
const G4double dMass2 
)

Definition at line 43 of file G4GDecay3.cc.

45  : loopMax(100), parentMass(pMass), mDaughter0(dMass0), mDaughter1(dMass1),
46  mDaughter2(dMass2), pDaughter0(0.), pDaughter1(0.), pDaughter2(0.) {;}
G4GDecay3::~G4GDecay3 ( )
inline

Definition at line 49 of file G4GDecay3.hh.

49 {;}

Member Function Documentation

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

Definition at line 100 of file G4GDecay3.cc.

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

Here is the call graph for this function:


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