33 #define INCLXX_IN_GEANT4_MODE 1
55 recursiveDecay(c, &decayProducts);
80 switch(theDecayMode) {
82 ERROR(
"Unrecognized cluster-decay mode: " << theDecayMode << std::endl
92 twoBodyDecay(c, theDecayMode, decayProducts);
97 threeBodyDecay(c, theDecayMode, decayProducts);
102 phaseSpaceDecay(c, theDecayMode, decayProducts);
108 recursiveDecay(c,decayProducts);
113 DEBUG(
"Cluster is outside the decay-mode table." << c->
print() << std::endl);
115 DEBUG(
"Z==A, will decompose it in free protons." << std::endl);
118 DEBUG(
"Z==0, will decompose it in free neutrons." << std::endl);
125 Particle *decayParticle = 0;
126 const ThreeVector mom(0.0, 0.0, 0.0);
127 const ThreeVector pos = c->getPosition();
130 switch(theDecayMode) {
132 decayParticle =
new Particle(
Proton, mom, pos);
135 decayParticle =
new Particle(
Neutron, mom, pos);
138 decayParticle =
new Cluster(2,4);
141 ERROR(
"Unrecognized cluster-decay mode in two-body decay: " << theDecayMode << std::endl
145 decayParticle->makeParticipant();
146 decayParticle->setNumberOfDecays(1);
147 decayParticle->setPosition(c->getPosition());
148 decayParticle->setEmissionTime(c->getEmissionTime());
149 decayParticle->setTableMass();
153 const ThreeVector velocity = -c->boostVector();
156 const G4int daughterZ = c->getZ() - decayParticle->getZ();
157 const G4int daughterA = c->getA() - decayParticle->getA();
163 c->setMass(daughterMass);
164 c->setExcitationEnergy(0.);
167 const G4double decayMass = decayParticle->getMass();
170 if(motherMass-daughterMass-decayMass>0.)
173 c->setMomentum(momentum);
174 c->adjustEnergyFromMomentum();
175 decayParticle->setMomentum(-momentum);
176 decayParticle->adjustEnergyFromMomentum();
179 decayParticle->boost(velocity);
183 decayProducts->push_back(decayParticle);
187 Particle *decayParticle1 = 0;
188 Particle *decayParticle2 = 0;
189 const ThreeVector mom(0.0, 0.0, 0.0);
190 const ThreeVector pos = c->getPosition();
193 switch(theDecayMode) {
195 decayParticle1 =
new Particle(
Proton, mom, pos);
196 decayParticle2 =
new Particle(
Proton, mom, pos);
199 decayParticle1 =
new Particle(
Neutron, mom, pos);
200 decayParticle2 =
new Particle(
Neutron, mom, pos);
203 ERROR(
"Unrecognized cluster-decay mode in three-body decay: " << theDecayMode << std::endl
207 decayParticle1->makeParticipant();
208 decayParticle2->makeParticipant();
209 decayParticle1->setNumberOfDecays(1);
210 decayParticle2->setNumberOfDecays(1);
211 decayParticle1->setTableMass();
212 decayParticle2->setTableMass();
215 const G4double motherMass = c->getMass();
216 const ThreeVector velocity = -c->boostVector();
219 const G4int decayZ1 = decayParticle1->getZ();
220 const G4int decayA1 = decayParticle1->getA();
221 const G4int decayZ2 = decayParticle2->getZ();
222 const G4int decayA2 = decayParticle2->getA();
223 const G4int decayZ = decayZ1 + decayZ2;
224 const G4int decayA = decayA1 + decayA2;
225 const G4int daughterZ = c->getZ() - decayZ;
226 const G4int daughterA = c->getA() - decayA;
227 const G4double decayMass1 = decayParticle1->getMass();
228 const G4double decayMass2 = decayParticle2->getMass();
232 G4double qValue = motherMass - daughterMass - decayMass1 - decayMass2;
240 const G4double decayMass = decayMass1 + decayMass2 + qValueB;
247 c->setMass(daughterMass);
248 c->setExcitationEnergy(0.);
253 c->setMomentum(momentumA);
254 c->adjustEnergyFromMomentum();
255 const ThreeVector decayBoostVector = momentumA/std::sqrt(decayMass*decayMass + momentumA.mag2());
262 decayParticle1->setMomentum(momentumB);
263 decayParticle2->setMomentum(-momentumB);
264 decayParticle1->adjustEnergyFromMomentum();
265 decayParticle2->adjustEnergyFromMomentum();
268 decayParticle1->boost(decayBoostVector);
269 decayParticle2->boost(decayBoostVector);
272 decayParticle1->boost(velocity);
273 decayParticle2->boost(velocity);
277 decayProducts->push_back(decayParticle1);
278 decayProducts->push_back(decayParticle2);
282 const G4int theA = c->getA();
283 const G4int theZ = c->getZ();
284 const ThreeVector mom(0.0, 0.0, 0.0);
285 const ThreeVector pos = c->getPosition();
289 switch(theDecayMode) {
299 ERROR(
"Unrecognized cluster-decay mode in phase-space decay: " << theDecayMode << std::endl
306 G4int finalDaughterZ, finalDaughterA;
312 finalDaughterZ -= theZStep;
325 const G4int nSplits = theA-finalDaughterA;
328 G4double availableEnergy = c->getMass() - finalDaughterMass - nSplits*ejectileMass;
330 if(availableEnergy<0.)
335 G4double eMax = finalDaughterMass + availableEnergy;
336 G4double eMin = finalDaughterMass - ejectileMass;
337 for(
G4int iSplit=0; iSplit<nSplits; ++iSplit) {
338 eMax += ejectileMass;
339 eMin += ejectileMass;
345 std::vector<G4double> theCMMomenta;
346 std::vector<G4double> invariantMasses;
361 if(nTries++>maxTries) {
362 WARN(
"Phase-space decay exceeded the maximum number of rejections (" << maxTries
363 <<
"). Z=" << theZ <<
", A=" << theA <<
", E*=" << c->getExcitationEnergy()
364 <<
", availableEnergy=" << availableEnergy
365 <<
", nSplits=" << nSplits
371 std::vector<G4double> randomNumbers;
372 for(
G4int iSplit=0; iSplit<nSplits-1; ++iSplit)
374 std::sort(randomNumbers.begin(), randomNumbers.end());
377 invariantMasses.clear();
378 invariantMasses.push_back(finalDaughterMass);
379 for(
G4int iSplit=0; iSplit<nSplits-1; ++iSplit)
380 invariantMasses.push_back(finalDaughterMass + (iSplit+1)*ejectileMass + randomNumbers.at(iSplit)*availableEnergy);
381 invariantMasses.push_back(c->getMass());
384 theCMMomenta.clear();
385 for(
G4int iSplit=0; iSplit<nSplits; ++iSplit) {
386 G4double motherMass = invariantMasses.at(nSplits-iSplit);
387 const G4double daughterMass = invariantMasses.at(nSplits-iSplit-1);
390 if(motherMass-daughterMass-ejectileMass>0.)
392 theCMMomenta.push_back(pCM);
397 for(
G4int iSplit=0; iSplit<nSplits; ++iSplit) {
398 ThreeVector
const velocity = -c->boostVector();
400 #if !defined(NDEBUG) && !defined(INCLXX_IN_GEANT4_MODE)
401 const G4double motherMass = c->getMass();
403 c->setA(c->getA() - 1);
404 c->setZ(c->getZ() - theZStep);
405 c->setMass(invariantMasses.at(nSplits-iSplit-1));
407 Particle *ejectile =
new Particle(theEjectileType, mom, pos);
408 ejectile->setTableMass();
411 ThreeVector momentum;
413 c->setMomentum(momentum);
414 c->adjustEnergyFromMomentum();
415 ejectile->setMomentum(-momentum);
416 ejectile->adjustEnergyFromMomentum();
420 ejectile->boost(velocity);
423 decayProducts->push_back(ejectile);
426 c->setExcitationEnergy(0.);