43 : loopMax(100), parentMass(pMass), mDaughter0(dMass0), mDaughter1(dMass1),
44 mDaughter2(dMass2), pDaughter0(0.), pDaughter1(0.), pDaughter2(0.) {;}
47 G4bool G4GDecay3::CalculateMomentumMagnitudes()
60 G4double availableE = parentMass - mDaughter0 - mDaughter1 - mDaughter2;
74 energy = rndm2*availableE;
75 pDaughter0 = std::sqrt(energy*energy + 2.0*energy*mDaughter0);
76 if (pDaughter0 > momentummax) momentummax = pDaughter0;
77 momentumsum += pDaughter0;
80 energy = (1.-rndm1)*availableE;
81 pDaughter1 = std::sqrt(energy*energy + 2.0*energy*mDaughter1);
82 if (pDaughter1 > momentummax) momentummax = pDaughter1;
83 momentumsum += pDaughter1;
86 energy = (rndm1-rndm2)*availableE;
87 pDaughter2 = std::sqrt(energy*energy + 2.0*energy*mDaughter2);
88 if (pDaughter2 > momentummax) momentummax = pDaughter2;
89 momentumsum += pDaughter2;
91 status = looper < loopMax;
92 }
while ((momentummax > momentumsum - momentummax) && status);
101 std::vector<G4ThreeVector> pVect;
103 if (CalculateMomentumMagnitudes() ) {
107 G4double sintheta = std::sqrt((1.0-costheta)*(1.0+costheta));
111 G4ThreeVector direction0(sintheta*cosphi, sintheta*sinphi, costheta);
113 G4double costhetan = (pDaughter1*pDaughter1 - pDaughter2*pDaughter2
114 - pDaughter0*pDaughter0)/(2.0*pDaughter2*pDaughter0);
115 G4double sinthetan = std::sqrt((1.0-costhetan)*(1.0+costhetan));
120 direction2.
setX(sinthetan*cosphin*costheta*cosphi -
121 sinthetan*sinphin*sinphi + costhetan*sintheta*cosphi);
122 direction2.
setY(sinthetan*cosphin*costheta*sinphi +
123 sinthetan*sinphin*cosphi + costhetan*sintheta*sinphi);
124 direction2.
setZ(-sinthetan*cosphin*sintheta + costhetan*costheta);
127 pVect.push_back(pDaughter0*direction0);
128 pVect.push_back(-direction0*pDaughter0 - direction2*pDaughter2);
129 pVect.push_back(pDaughter2*direction2);
132 G4cerr <<
"G4GDecay::GetThreeBodyMomenta: " << loopMax
133 <<
" or more loops in momentum magnitude calculation " <<
G4endl;
std::vector< G4ThreeVector > GetThreeBodyMomenta()
DOUBLE PRECISION function rndm(RDUMMY)
G4GLOB_DLL std::ostream G4cerr