35#define INCLXX_IN_GEANT4_MODE 1
57 recursiveDecay(c, &decayProducts);
82 switch(theDecayMode) {
84 ERROR(
"Unrecognized cluster-decay mode: " << theDecayMode << std::endl
94 twoBodyDecay(c, theDecayMode, decayProducts);
99 threeBodyDecay(c, theDecayMode, decayProducts);
104 phaseSpaceDecay(c, theDecayMode, decayProducts);
110 recursiveDecay(c,decayProducts);
115 DEBUG(
"Cluster is outside the decay-mode table." << c->
print() << std::endl);
117 DEBUG(
"Z==A, will decompose it in free protons." << std::endl);
120 DEBUG(
"Z==0, will decompose it in free neutrons." << std::endl);
127 Particle *decayParticle = 0;
128 const ThreeVector mom(0.0, 0.0, 0.0);
129 const ThreeVector pos = c->getPosition();
132 switch(theDecayMode) {
134 decayParticle =
new Particle(
Proton, mom, pos);
137 decayParticle =
new Particle(
Neutron, mom, pos);
140 decayParticle =
new Cluster(2,4);
143 ERROR(
"Unrecognized cluster-decay mode in two-body decay: " << theDecayMode << std::endl
147 decayParticle->makeParticipant();
148 decayParticle->setNumberOfDecays(1);
149 decayParticle->setPosition(c->getPosition());
150 decayParticle->setEmissionTime(c->getEmissionTime());
151 decayParticle->setTableMass();
155 const ThreeVector velocity = -c->boostVector();
158 const G4int daughterZ = c->getZ() - decayParticle->getZ();
159 const G4int daughterA = c->getA() - decayParticle->getA();
165 c->setMass(daughterMass);
166 c->setExcitationEnergy(0.);
169 const G4double decayMass = decayParticle->getMass();
172 if(motherMass-daughterMass-decayMass>0.)
175 c->setMomentum(momentum);
176 c->adjustEnergyFromMomentum();
177 decayParticle->setMomentum(-momentum);
178 decayParticle->adjustEnergyFromMomentum();
181 decayParticle->boost(velocity);
185 decayProducts->push_back(decayParticle);
189 Particle *decayParticle1 = 0;
190 Particle *decayParticle2 = 0;
191 const ThreeVector mom(0.0, 0.0, 0.0);
192 const ThreeVector pos = c->getPosition();
195 switch(theDecayMode) {
197 decayParticle1 =
new Particle(
Proton, mom, pos);
198 decayParticle2 =
new Particle(
Proton, mom, pos);
201 decayParticle1 =
new Particle(
Neutron, mom, pos);
202 decayParticle2 =
new Particle(
Neutron, mom, pos);
205 ERROR(
"Unrecognized cluster-decay mode in three-body decay: " << theDecayMode << std::endl
209 decayParticle1->makeParticipant();
210 decayParticle2->makeParticipant();
211 decayParticle1->setNumberOfDecays(1);
212 decayParticle2->setNumberOfDecays(1);
213 decayParticle1->setTableMass();
214 decayParticle2->setTableMass();
217 const G4double motherMass = c->getMass();
218 const ThreeVector velocity = -c->boostVector();
221 const G4int decayZ1 = decayParticle1->getZ();
222 const G4int decayA1 = decayParticle1->getA();
223 const G4int decayZ2 = decayParticle2->getZ();
224 const G4int decayA2 = decayParticle2->getA();
225 const G4int decayZ = decayZ1 + decayZ2;
226 const G4int decayA = decayA1 + decayA2;
227 const G4int daughterZ = c->getZ() - decayZ;
228 const G4int daughterA = c->getA() - decayA;
229 const G4double decayMass1 = decayParticle1->getMass();
230 const G4double decayMass2 = decayParticle2->getMass();
234 G4double qValue = motherMass - daughterMass - decayMass1 - decayMass2;
242 const G4double decayMass = decayMass1 + decayMass2 + qValueB;
249 c->setMass(daughterMass);
250 c->setExcitationEnergy(0.);
255 c->setMomentum(momentumA);
256 c->adjustEnergyFromMomentum();
257 const ThreeVector decayBoostVector = momentumA/std::sqrt(decayMass*decayMass + momentumA.mag2());
264 decayParticle1->setMomentum(momentumB);
265 decayParticle2->setMomentum(-momentumB);
266 decayParticle1->adjustEnergyFromMomentum();
267 decayParticle2->adjustEnergyFromMomentum();
270 decayParticle1->boost(decayBoostVector);
271 decayParticle2->boost(decayBoostVector);
274 decayParticle1->boost(velocity);
275 decayParticle2->boost(velocity);
279 decayProducts->push_back(decayParticle1);
280 decayProducts->push_back(decayParticle2);
284 const G4int theA = c->getA();
285 const G4int theZ = c->getZ();
286 const ThreeVector mom(0.0, 0.0, 0.0);
287 const ThreeVector pos = c->getPosition();
291 switch(theDecayMode) {
301 ERROR(
"Unrecognized cluster-decay mode in phase-space decay: " << theDecayMode << std::endl
308 G4int finalDaughterZ, finalDaughterA;
314 finalDaughterZ -= theZStep;
327 const G4int nSplits = theA-finalDaughterA;
330 G4double availableEnergy = c->getMass() - finalDaughterMass - nSplits*ejectileMass;
332 if(availableEnergy<0.)
337 G4double eMax = finalDaughterMass + availableEnergy;
338 G4double eMin = finalDaughterMass - ejectileMass;
339 for(
G4int iSplit=0; iSplit<nSplits; ++iSplit) {
340 eMax += ejectileMass;
341 eMin += ejectileMass;
347 std::vector<G4double> theCMMomenta;
348 std::vector<G4double> invariantMasses;
363 if(nTries++>maxTries) {
364 WARN(
"Phase-space decay exceeded the maximum number of rejections (" << maxTries
365 <<
"). Z=" << theZ <<
", A=" << theA <<
", E*=" << c->getExcitationEnergy()
366 <<
", availableEnergy=" << availableEnergy
367 <<
", nSplits=" << nSplits
373 std::vector<G4double> randomNumbers;
374 for(
G4int iSplit=0; iSplit<nSplits-1; ++iSplit)
376 std::sort(randomNumbers.begin(), randomNumbers.end());
379 invariantMasses.clear();
380 invariantMasses.push_back(finalDaughterMass);
381 for(
G4int iSplit=0; iSplit<nSplits-1; ++iSplit)
382 invariantMasses.push_back(finalDaughterMass + (iSplit+1)*ejectileMass + randomNumbers.at(iSplit)*availableEnergy);
383 invariantMasses.push_back(c->getMass());
386 theCMMomenta.clear();
387 for(
G4int iSplit=0; iSplit<nSplits; ++iSplit) {
388 G4double motherMass = invariantMasses.at(nSplits-iSplit);
389 const G4double daughterMass = invariantMasses.at(nSplits-iSplit-1);
392 if(motherMass-daughterMass-ejectileMass>0.)
394 theCMMomenta.push_back(pCM);
399 for(
G4int iSplit=0; iSplit<nSplits; ++iSplit) {
400 ThreeVector
const velocity = -c->boostVector();
402#if !defined(NDEBUG) && !defined(INCLXX_IN_GEANT4_MODE)
403 const G4double motherMass = c->getMass();
405 c->setA(c->getA() - 1);
406 c->setZ(c->getZ() - theZStep);
407 c->setMass(invariantMasses.at(nSplits-iSplit-1));
409 Particle *ejectile =
new Particle(theEjectileType, mom, pos);
410 ejectile->setTableMass();
413 ThreeVector momentum;
415 c->setMomentum(momentum);
416 c->adjustEnergyFromMomentum();
417 ejectile->setMomentum(-momentum);
418 ejectile->adjustEnergyFromMomentum();
422 ejectile->boost(velocity);
425 decayProducts->push_back(ejectile);
428 c->setExcitationEnergy(0.);
Static class for carrying out cluster decays.
static ParticleList decay(Cluster *const c)
Carries out a cluster decay.
void setExcitationEnergy(const G4double e)
Set the excitation energy of the cluster.
G4double getExcitationEnergy() const
Get the excitation energy of the cluster.
std::string print() const
static G4double momentumInCM(Particle const *const p1, Particle const *const p2)
gives the momentum in the CM frame of two particles.
static NuclearMassFn getTableMass
Static pointer to the mass function for nuclei.
static const G4int clusterTableZSize
static const G4int clusterTableASize
static const ClusterDecayType clusterDecayMode[clusterTableZSize][clusterTableASize]
G4int getZ() const
Returns the charge number.
void setType(ParticleType t)
void setTableMass()
Set the mass of the Particle to its table mass.
G4int getA() const
Returns the baryon number.
static ThreeVector normVector(G4double norm=1.)
std::list< G4INCL::Particle * > ParticleList