69 if (pPreAssigned !=
nullptr)
107 if (pPreAssigned !=
nullptr)
183 if ( totalEnergy > mass )
185 totalMomentum = std::sqrt( (totalEnergy - mass)*(totalEnergy + mass) );
187 G4double betax = momentumDirection.
x()*totalMomentum/totalEnergy;
188 G4double betay = momentumDirection.
y()*totalMomentum/totalEnergy;
189 G4double betaz = momentumDirection.
z()*totalMomentum/totalEnergy;
190 Boost(betax, betay, betaz);
219 p4.
boost(betax, betay, betaz);
222 p4.
boost(newbetax, newbetay, newbetaz);
236 p4.
boost(newbetax, newbetay, newbetaz);
248 parent4.
boost(newbetax, newbetay, newbetaz);
256 G4bool returnValue =
true;
266 if ((parent_momentum.
mag() >0.0) && (std::fabs(direction.
mag()-1.0) >1.0e-6))
269 G4cout <<
"G4DecayProducts::IsChecked():: "
270 <<
" Momentum Direction Vector of Parent is not normalized "
271 <<
" (=" << direction.
mag() <<
")" <<
G4endl;
274 parent_momentum = parent_momentum * (1./direction.
mag());
280 G4double total_energy = parent_energy;
292 if ( (momentum.
mag()>0.0) && (std::fabs(direction.
mag()-1.0) > 1.0e-6))
295 G4cout <<
"G4DecayProducts::IsChecked():: "
296 <<
" Momentum Direction Vector of Daughter [" << index
297 <<
"] is not normalized (=" << direction.
mag() <<
")" <<
G4endl;
300 momentum = momentum * (1./direction.
mag());
306 G4cout <<
"G4DecayProducts::IsChecked():: "
307 <<
" Daughter [" << index <<
"] has no kinetic energy "<<
G4endl;
312 total_momentum -= momentum;
315 if ( (std::fabs(total_energy) >1.0e-9*
MeV)
316 || (total_momentum.
mag() >1.0e-9*
MeV ) )
319 G4cout <<
"G4DecayProducts::IsChecked():: "
320 <<
" Energy/Momentum is not conserved "<<
G4endl;
321 G4cout <<
" difference between parent energy & sum of daughters energy: "
322 << total_energy /
MeV <<
"[MeV] " <<
G4endl;
323 G4cout <<
" difference between parent momentum & sum of daughters momentum: "
324 <<
" x:" << total_momentum.
getX()/
MeV
325 <<
" y:" << total_momentum.
getY()/
MeV
326 <<
" z:" << total_momentum.
getZ()/
MeV
336 G4cout <<
" ----- List of DecayProducts -----" <<
G4endl;
337 G4cout <<
" ------ Parent Particle ----------" <<
G4endl;
339 G4cout <<
" ------ Daughter Particles ------" <<
G4endl;
342 G4cout <<
" ----------" << index+1 <<
" -------------" <<
G4endl;
345 G4cout <<
" ----- End List of DecayProducts -----" <<
G4endl;
static constexpr double MeV
G4GLOB_DLL std::ostream G4cout
HepLorentzVector & boost(double, double, double)
std::vector< G4DynamicParticle * > G4DecayProductVector
G4DecayProductVector * theProductVector
G4DynamicParticle * PopProducts()
G4int PushProducts(G4DynamicParticle *aParticle)
G4DecayProducts & operator=(const G4DecayProducts &right)
G4DynamicParticle * operator[](G4int anIndex) const
void SetParentParticle(const G4DynamicParticle &aParticle)
G4DynamicParticle * theParentParticle
void Boost(G4double totalEnergy, const G4ThreeVector &momentumDirection)
void SetPreAssignedDecayProducts(G4DecayProducts *aDecayProducts)
void DumpInfo(G4int mode=0) const
const G4ThreeVector & GetMomentumDirection() const
const G4DecayProducts * GetPreAssignedDecayProducts() const
G4double GetTotalEnergy() const
void Set4Momentum(const G4LorentzVector &momentum)
void SetPreAssignedDecayProperTime(G4double)
G4double GetPreAssignedDecayProperTime() const
G4double GetTotalMomentum() const
G4double energy(const ThreeVector &p, const G4double m)