Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Functions
G4INCL::PhaseSpaceDecay Namespace Reference

Functions

void decay (G4double initialMass, const ThreeVector &theBoostVector, ParticleList &particles)
 Generate decay momenta according to a uniform phase-space model. More...
 

Function Documentation

void G4INCL::PhaseSpaceDecay::decay ( G4double  initialMass,
const ThreeVector &  theBoostVector,
ParticleList &  particles 
)

Generate decay momenta according to a uniform phase-space model.

This function will assign momenta to the particles in the list that is passed as an argument.

Parameters
initialMassmass of the decaying system
theBoostVectorboost vector of the decaying system
particleslist of decay particles

Definition at line 62 of file G4INCLPhaseSpaceDecay.cc.

References G4INCL::Particle::adjustEnergyFromMomentum(), G4INCL::Particle::boost(), G4INCL::Particle::boostVector(), G4INCL::Particle::getMass(), G4INCL::KinematicsUtils::momentumInCM(), N, G4INCL::Random::normVector(), G4INCL::Particle::setMass(), and G4INCL::Particle::setMomentum().

62  {
63 
64  size_t N = particles.size();
65  std::vector<G4double> masses(N);
66  std::vector<G4double> sumMasses(N);
67  std::transform(particles.begin(), particles.end(), masses.begin(), std::mem_fun(&Particle::getMass));
68  std::partial_sum(masses.begin(), masses.end(), sumMasses.begin());
69 
70  G4double PFragMagCM = 0.0;
71  G4double T = initialMass-sumMasses.back();
72 // assert(T>-1.e-5);
73  if(T<0.)
74  T=0.;
75 
76  ThreeVector PFragCM, PRestCM, PRestLab;
77 
78  // The first particle in the list will pick up all the recoil
79  Particle *restParticle = particles.front();
80  restParticle->setMass(initialMass);
81  restParticle->adjustEnergyFromMomentum();
82 
83  ThreeVector boostV;
84 
85  G4int k=N-1;
86  for (ParticleList::reverse_iterator p=particles.rbegin(); k>0; ++p, --k) {
87  const G4double mu = sumMasses[k-1];
88  T *= (k>1) ? betaKopylov(k) : 0.;
89 
90  const G4double restMass = mu + T;
91 
92  PFragMagCM = KinematicsUtils::momentumInCM(restParticle->getMass(), masses[k], restMass);
93  PFragCM = Random::normVector(PFragMagCM);
94  (*p)->setMomentum(PFragCM);
95  (*p)->adjustEnergyFromMomentum();
96  restParticle->setMass(restMass);
97  restParticle->setMomentum(-PFragCM);
98  restParticle->adjustEnergyFromMomentum();
99 
100  (*p)->boost(boostV);
101  (*p)->boost(theBoostVector);
102  restParticle->boost(boostV);
103 
104  boostV = -restParticle->boostVector();
105  }
106  restParticle->setMass(masses[0]);
107  restParticle->adjustEnergyFromMomentum();
108  restParticle->boost(theBoostVector);
109  }
const char * p
Definition: xmltok.h:285
G4double momentumInCM(Particle const *const p1, Particle const *const p2)
gives the momentum in the CM frame of two particles.
int G4int
Definition: G4Types.hh:78
ThreeVector normVector(G4double norm=1.)
**D E S C R I P T I O N
double G4double
Definition: G4Types.hh:76