51 :numberOfProducts(0),theParentParticle(0)
57 :numberOfProducts(0),theParentParticle(0)
85 theProductVector->push_back( pDaughter );
87 numberOfProducts = right.numberOfProducts;
97 if (theParentParticle != 0)
delete theParentParticle;
101 for (index=0; index < numberOfProducts; index++) {
102 delete theProductVector->at(index);
104 theProductVector->clear();
107 for (index=0; index < right.numberOfProducts; index++) {
119 theProductVector->push_back( pDaughter );
121 numberOfProducts = right.numberOfProducts;
130 if (theParentParticle != 0)
delete theParentParticle;
134 delete theProductVector->at(
index);
136 theProductVector->clear();
137 numberOfProducts = 0;
138 delete theProductVector;
143 if ( numberOfProducts >0 ) {
144 numberOfProducts -= 1;
146 theProductVector->pop_back();
155 theProductVector->push_back(aParticle);
156 numberOfProducts += 1;
157 return numberOfProducts;
162 if ((numberOfProducts > anIndex) && (anIndex >=0) ) {
163 return theProductVector->at(anIndex);
171 if (theParentParticle != 0)
delete theParentParticle;
181 if (totalEnergy > mass ) totalMomentum = std::sqrt( (totalEnergy - mass)*(totalEnergy + mass) );
182 G4double betax = momentumDirection.
x()*totalMomentum/totalEnergy;
183 G4double betay = momentumDirection.
y()*totalMomentum/totalEnergy;
184 G4double betaz = momentumDirection.
z()*totalMomentum/totalEnergy;
185 this->
Boost(betax, betay, betaz);
207 p4 = (theProductVector->at(
index))->Get4Momentum();
210 p4.
boost(betax, betay, betaz);
213 p4.
boost(newbetax, newbetay, newbetaz);
216 (theProductVector->at(
index))->Set4Momentum(p4);
221 p4 = (theProductVector->at(
index))->Get4Momentum();
224 p4.
boost(newbetax, newbetay, newbetaz);
227 (theProductVector->at(
index))->Set4Momentum(p4);
231 mass = theParentParticle->
GetMass();
235 parent4.
boost(newbetax, newbetay, newbetaz);
243 G4bool returnValue =
true;
250 if ( (parent_momentum.
mag() >0.0) && (std::fabs(direction.
mag()-1.0) >1.0e-6 ) ) {
252 G4cout <<
"G4DecayProducts::IsChecked():: "
253 <<
" Momentum Direction Vector of Parent is not normalized "
254 <<
" (=" << direction.
mag() <<
")" <<
G4endl;
257 parent_momentum = parent_momentum * (1./direction.
mag());
263 G4double total_energy = parent_energy;
273 if ( (momentum.
mag()>0.0) && (std::fabs(direction.
mag()-1.0) > 1.0e-6)) {
275 G4cout <<
"G4DecayProducts::IsChecked():: "
276 <<
" Momentum Direction Vector of Daughter [" <<
index
277 <<
"] is not normalized (=" << direction.
mag() <<
")" <<
G4endl;
280 momentum = momentum * (1./direction.
mag());
283 if (energy - mass <
DBL_MIN ) {
285 G4cout <<
"G4DecayProducts::IsChecked():: "
286 <<
" Daughter [" <<
index <<
"] has no kinetic energy "<<
G4endl;
291 total_momentum -= momentum;
294 if ( (std::fabs(total_energy) >1.0e-9*
MeV) || (total_momentum.
mag() >1.0e-9*
MeV ) ){
296 G4cout <<
"G4DecayProducts::IsChecked():: "
297 <<
" Energy/Momentum is not conserved "<<
G4endl;
298 G4cout <<
" difference between parent energy and sum of dughters' energy : "
299 << total_energy /
MeV <<
"[MeV] " <<
G4endl;
300 G4cout <<
" difference between parent momentum and sum of dughters' momentum : "
301 <<
" x:" << total_momentum.
getX()/
MeV
302 <<
" y:" << total_momentum.
getY()/
MeV
303 <<
" z:" << total_momentum.
getZ()/
MeV
313 G4cout <<
" ----- List of DecayProducts -----" <<
G4endl;
314 G4cout <<
" ------ Parent Particle ----------" <<
G4endl;
315 if (theParentParticle != 0) theParentParticle->
DumpInfo();
316 G4cout <<
" ------ Daughter Particles ------" <<
G4endl;
322 G4cout <<
" ----- End List of DecayProducts -----" <<
G4endl;
void SetPreAssignedDecayProperTime(G4double)
G4double GetTotalEnergy() const
G4int PushProducts(G4DynamicParticle *aParticle)
void DumpInfo(G4int mode=0) const
const G4DecayProducts * GetPreAssignedDecayProducts() const
G4DecayProducts & operator=(const G4DecayProducts &right)
void Boost(G4double totalEnergy, const G4ThreeVector &momentumDirection)
G4DynamicParticle * operator[](G4int anIndex) const
G4double GetTotalMomentum() const
G4GLOB_DLL std::ostream G4cout
const G4ThreeVector & GetMomentumDirection() const
HepLorentzVector & boost(double, double, double)
std::vector< G4DynamicParticle * > G4DecayProductVector
void Set4Momentum(const G4LorentzVector &momentum)
void SetParentParticle(const G4DynamicParticle &aParticle)
G4DynamicParticle * PopProducts()
void SetPreAssignedDecayProducts(G4DecayProducts *aDecayProducts)
G4double GetPreAssignedDecayProperTime() const