59 for (
G4int index = 0; index < right.numberOfProducts; ++index) {
64 if (properTime > 0.0) pDaughter->SetPreAssignedDecayProperTime(properTime);
67 if (pPreAssigned !=
nullptr) {
69 pDaughter->SetPreAssignedDecayProducts(pPA);
71 theProductVector->push_back(pDaughter);
73 numberOfProducts = right.numberOfProducts;
82 delete theParentParticle;
86 for (index = 0; index < numberOfProducts; ++index) {
87 delete theProductVector->at(index);
89 theProductVector->clear();
92 for (index = 0; index < right.numberOfProducts; ++index) {
97 if (properTime > 0.0) pDaughter->SetPreAssignedDecayProperTime(properTime);
100 if (pPreAssigned !=
nullptr) {
102 pDaughter->SetPreAssignedDecayProducts(pPA);
104 theProductVector->push_back(pDaughter);
106 numberOfProducts = right.numberOfProducts;
166 if (totalEnergy > mass) {
167 totalMomentum = std::sqrt((totalEnergy - mass) * (totalEnergy + mass));
169 G4double betax = momentumDirection.
x() * totalMomentum / totalEnergy;
170 G4double betay = momentumDirection.
y() * totalMomentum / totalEnergy;
171 G4double betaz = momentumDirection.
z() * totalMomentum / totalEnergy;
172 Boost(betax, betay, betaz);
188 G4double betax = -1.0 * direction.
x() * momentum / energy;
189 G4double betay = -1.0 * direction.
y() * momentum / energy;
190 G4double betaz = -1.0 * direction.
z() * momentum / energy;
192 for (
G4int index = 0; index < numberOfProducts; ++index) {
194 p4 = (theProductVector->at(index))->Get4Momentum();
197 p4.
boost(betax, betay, betaz);
200 p4.
boost(newbetax, newbetay, newbetaz);
203 (theProductVector->at(index))->Set4Momentum(p4);
207 for (
G4int index = 0; index < numberOfProducts; ++index) {
209 p4 = (theProductVector->at(index))->Get4Momentum();
212 p4.
boost(newbetax, newbetay, newbetaz);
215 (theProductVector->at(index))->Set4Momentum(p4);
220 mass = theParentParticle->
GetMass();
224 parent4.
boost(newbetax, newbetay, newbetaz);
232 G4bool returnValue =
true;
241 if ((parent_momentum.
mag() > 0.0) && (std::fabs(direction.
mag() - 1.0) > 1.0e-6)) {
243 G4cout <<
"G4DecayProducts::IsChecked():: "
244 <<
" Momentum Direction Vector of Parent is not normalized "
245 <<
" (=" << direction.
mag() <<
")" <<
G4endl;
248 parent_momentum = parent_momentum * (1. / direction.
mag());
254 G4double total_energy = parent_energy;
257 for (
G4int index = 0; index < numberOfProducts; ++index) {
265 if ((momentum.
mag() > 0.0) && (std::fabs(direction.
mag() - 1.0) > 1.0e-6)) {
267 G4cout <<
"G4DecayProducts::IsChecked():: "
268 <<
" Momentum Direction Vector of Daughter [" << index
269 <<
"] is not normalized (=" << direction.
mag() <<
")" <<
G4endl;
272 momentum = momentum * (1. / direction.
mag());
277 G4cout <<
"G4DecayProducts::IsChecked():: "
278 <<
" Daughter [" << index <<
"] has no kinetic energy " <<
G4endl;
282 total_energy -= energy;
283 total_momentum -= momentum;
286 if ((std::fabs(total_energy) > 1.0e-9 * MeV) || (total_momentum.
mag() > 1.0e-9 * MeV)) {
288 G4cout <<
"G4DecayProducts::IsChecked():: "
289 <<
" Energy/Momentum is not conserved " <<
G4endl;
290 G4cout <<
" difference between parent energy & sum of daughters energy: " << total_energy / MeV
292 G4cout <<
" difference between parent momentum & sum of daughters momentum: "
293 <<
" x:" << total_momentum.
getX() / MeV <<
" y:" << total_momentum.
getY() / MeV
294 <<
" z:" << total_momentum.
getZ() / MeV <<
G4endl;
void DumpInfo(G4int mode=0) const
const G4ThreeVector & GetMomentumDirection() const
const G4DecayProducts * GetPreAssignedDecayProducts() const
G4double GetTotalEnergy() const
void Set4Momentum(const G4LorentzVector &momentum)
G4double GetPreAssignedDecayProperTime() const
G4double GetTotalMomentum() const