34#define INCLXX_IN_GEANT4_MODE 1
83 :propagationModel(0), theA(208), theZ(82), theS(0),
84 targetInitSuccess(false),
85 maxImpactParameter(0.),
86 maxUniverseRadius(0.),
87 maxInteractionDistance(0.),
88 fixedImpactParameter(0.),
91 forceTransparent(false),
95#ifdef INCLXX_IN_GEANT4_MODE
98 Logger::initialize(theConfig);
142 cascadeAction->beforeRunAction(theConfig);
147 theGlobalInfo.rootSelection = theConfig->getROOTSelectionString();
150#ifndef INCLXX_IN_GEANT4_MODE
156 theGlobalInfo.
Ap = theSpecies.
theA;
157 theGlobalInfo.
Zp = theSpecies.
theZ;
158 theGlobalInfo.
Sp = theSpecies.
theS;
168#ifndef INCLXX_IN_GEANT4_MODE
169 NuclearMassTable::deleteTable();
177#ifndef INCLXX_IN_GEANT4_MODE
178 Logger::deleteLoggerSlave();
182 cascadeAction->afterRunAction();
183 delete cascadeAction;
184 delete propagationModel;
190 INCL_ERROR(
"Unsupported target: A = " <<
A <<
" Z = " << Z <<
" S = " <<
S <<
'\n'
191 <<
"Target configuration rejected." <<
'\n');
195 (projectileSpecies.
theZ==projectileSpecies.
theA || projectileSpecies.
theZ==0)) {
196 INCL_ERROR(
"Unsupported projectile: A = " << projectileSpecies.
theA <<
" Z = " << projectileSpecies.
theZ <<
" S = " << projectileSpecies.
theS <<
'\n'
197 <<
"Projectile configuration rejected." <<
'\n');
202 forceTransparent =
false;
205 initUniverseRadius(projectileSpecies, kineticEnergy,
A, Z);
210 G4bool ProtonIsTheVictim =
false;
211 G4bool NeutronIsTheVictim =
false;
216 if(projectileSpecies.
theType ==
antiProton && kineticEnergy <= theConfig->getAtrestThreshold()){
223 neutronprob = (theA + 1 - Z)/(theA + 1 - Z + SpOverSn*Z);
227 neutronprob = (
A - Z)/(
A - Z + SpOverSn*Z);
233 if(rndm >= neutronprob){
236 ProtonIsTheVictim =
true;
242 NeutronIsTheVictim =
true;
255 if(ProtonIsTheVictim ==
true && NeutronIsTheVictim ==
false)
257 if(NeutronIsTheVictim ==
true && ProtonIsTheVictim ==
false)
266 INCL_DEBUG(
"Maximum impact parameter initialised: " << maxImpactParameter <<
'\n');
269 initMaxInteractionDistance(projectileSpecies, kineticEnergy);
271 if(projectileSpecies.
theType ==
antiProton && kineticEnergy <= theConfig->getAtrestThreshold()){
276 G4double kineticEnergy2=kineticEnergy;
277 if (kineticEnergy2 <= 0.) kineticEnergy2=0.001;
279 Math::pi*std::pow((1.840 + 1.120*std::pow(currentA,(1./3.))),2)*
289 if(projectileSpecies.
theA > 0)
290 minRemnantSize = std::min(theA, 4);
292 minRemnantSize = std::min(theA-1, 4);
303 nucleus =
new Nucleus(
A, Z,
S, theConfig, newmaxUniverseRadius, theAType);
306 nucleus =
new Nucleus(
A, Z,
S, theConfig, maxUniverseRadius, theAType);
324 if (projectileSpecies.
theType==
antiProton && (targetA==1 || targetA==2) && targetZ==1 && targetS==0) {
327 preCascade_pbarH1(projectileSpecies, kineticEnergy);
329 preCascade_pbarH2(projectileSpecies, kineticEnergy);
337 if (rndm <= SpOverSn) {
340 starlistH2.push_back(p2);
345 starlistH2.push_back(p2);
351#ifdef INCLXX_IN_GEANT4_MODE
354 ed <<
" Data missing: set environment variable G4INCLDATA\n"
355 <<
" to point to the directory containing data files needed\n"
356 <<
" by the INCL++ model" <<
G4endl;
360 G4String dataPathppbar(dataPath0 +
"/rawppbarFS.dat");
361 G4String dataPathnpbar(dataPath0 +
"/rawnpbarFS.dat");
362 G4String dataPathppbark(dataPath0 +
"/rawppbarFSkaonic.dat");
363 G4String dataPathnpbark(dataPath0 +
"/rawnpbarFSkaonic.dat");
367 G4String dataPathppbar(path +
"/rawppbarFS.dat");
368 INCL_DEBUG(
"Reading https://doi.org/10.1016/0375-9474(92)90362-N ppbar final states" << dataPathppbar <<
'\n');
369 G4String dataPathnpbar(path +
"/rawnpbarFS.dat");
370 INCL_DEBUG(
"Reading https://doi.org/10.1016/0375-9474(92)90362-N npbar final states" << dataPathnpbar <<
'\n');
371 G4String dataPathppbark(path +
"/rawppbarFSkaonic.dat");
372 INCL_DEBUG(
"Reading https://doi.org/10.1016/j.physrep.2005.03.002 ppbar kaonic final states" << dataPathppbark <<
'\n');
373 G4String dataPathnpbark(path +
"/rawnpbarFSkaonic.dat");
374 INCL_DEBUG(
"Reading https://doi.org/10.1007/BF02818764 and https://link.springer.com/article/10.1007/BF02754930 npbar kaonic final states" << dataPathnpbark <<
'\n');
378 std::vector<G4double> probabilities;
379 std::vector<std::vector<G4String>> particle_types;
388 if (rdm < (1.-kaonicFSprob)) {
389 INCL_DEBUG(
"pionic pp final state chosen" <<
'\n');
390 sum = read_file(dataPathppbar, probabilities, particle_types);
391 rdm = (rdm/(1.-kaonicFSprob))*sum;
393 G4int n = findStringNumber(rdm, probabilities)-1;
394 if ( n < 0 )
return theEventInfo;
395 for (
G4int j = 0; j < static_cast<G4int>(particle_types[n].size()); j++) {
396 if (particle_types[n][j] ==
"pi0") {
398 starlist.push_back(p);
399 }
else if (particle_types[n][j] ==
"pi-") {
401 starlist.push_back(p);
402 }
else if (particle_types[n][j] ==
"pi+") {
404 starlist.push_back(p);
405 }
else if (particle_types[n][j] ==
"omega") {
407 starlist.push_back(p);
408 }
else if (particle_types[n][j] ==
"eta") {
410 starlist.push_back(p);
411 }
else if (particle_types[n][j] ==
"rho-") {
413 starlist.push_back(p);
415 starlist.push_back(pp);
416 }
else if (particle_types[n][j] ==
"rho+") {
418 starlist.push_back(p);
420 starlist.push_back(pp);
421 }
else if (particle_types[n][j] ==
"rho0") {
423 starlist.push_back(p);
425 starlist.push_back(pp);
427 INCL_ERROR(
"Some non-existing FS particle detected when reading pbar FS files");
428 for (
G4int jj = 0; jj < static_cast<G4int>(particle_types[n].size()); jj++) {
429#ifdef INCLXX_IN_GEANT4_MODE
430 G4cout <<
"gotcha! " << particle_types[n][jj] <<
G4endl;
432 std::cout <<
"gotcha! " << particle_types[n][jj] << std::endl;
435#ifdef INCLXX_IN_GEANT4_MODE
436 G4cout <<
"Some non-existing FS particle detected when reading pbar FS files" <<
G4endl;
438 std::cout <<
"Some non-existing FS particle detected when reading pbar FS files" << std::endl;
443 INCL_DEBUG(
"kaonic pp final state chosen" <<
'\n');
444 sum = read_file(dataPathppbark, probabilities, particle_types);
445 rdm = ((1.-rdm)/kaonicFSprob)*sum;
447 G4int n = findStringNumber(rdm, probabilities)-1;
448 if ( n < 0 )
return theEventInfo;
449 for (
G4int j = 0; j < static_cast<G4int>(particle_types[n].size()); j++) {
450 if (particle_types[n][j] ==
"pi0") {
452 starlist.push_back(p);
453 }
else if (particle_types[n][j] ==
"pi-") {
455 starlist.push_back(p);
456 }
else if (particle_types[n][j] ==
"pi+") {
458 starlist.push_back(p);
459 }
else if (particle_types[n][j] ==
"omega") {
461 starlist.push_back(p);
462 }
else if (particle_types[n][j] ==
"eta") {
464 starlist.push_back(p);
465 }
else if (particle_types[n][j] ==
"K-") {
467 starlist.push_back(p);
468 }
else if (particle_types[n][j] ==
"K+") {
470 starlist.push_back(p);
471 }
else if (particle_types[n][j] ==
"K0") {
473 starlist.push_back(p);
474 }
else if (particle_types[n][j] ==
"K0b") {
476 starlist.push_back(p);
478 INCL_ERROR(
"Some non-existing FS particle detected when reading pbar FS files");
479 for (
G4int jj = 0; jj < static_cast<G4int>(particle_types[n].size()); jj++) {
480#ifdef INCLXX_IN_GEANT4_MODE
481 G4cout <<
"gotcha! " << particle_types[n][jj] <<
G4endl;
483 std::cout <<
"gotcha! " << particle_types[n][jj] << std::endl;
486#ifdef INCLXX_IN_GEANT4_MODE
487 G4cout <<
"Some non-existing FS particle detected when reading pbar FS files" <<
G4endl;
489 std::cout <<
"Some non-existing FS particle detected when reading pbar FS files" << std::endl;
497 if (starlist.size() < 2) {
498 INCL_ERROR(
"should never happen, at least 2 final state particles!" <<
'\n');
499 }
else if (starlist.size() == 2) {
504 G4double s = energyOfMesonStar*energyOfMesonStar;
505 G4double mom1 = std::sqrt(s/4. - (std::pow(m1,2) + std::pow(m2,2))/2. - std::pow(m1,2)*std::pow(m2,2)/s + (std::pow(m1,4) + 2.*std::pow(m1*m2,2) + std::pow(m2,4))/(4.*s));
507 (*first)->setMomentum(momentello);
508 (*first)->adjustEnergyFromMomentum();
509 (*last)->setMomentum(-momentello);
510 (*last)->adjustEnergyFromMomentum();
515 if (targetA==1) postCascade_pbarH1(starlist);
516 else postCascade_pbarH2(starlist,starlistH2);
528 targetInitSuccess =
prepareReaction(projectileSpecies, kineticEnergy, targetA, targetZ, targetS);
530 if(!targetInitSuccess) {
531 INCL_WARN(
"Target initialisation failed for A=" << targetA <<
", Z=" << targetZ <<
", S=" << targetS <<
'\n');
536 cascadeAction->beforeCascadeAction(propagationModel);
538 const G4bool canRunCascade = preCascade(projectileSpecies, kineticEnergy);
541 postCascade(projectileSpecies, kineticEnergy);
542 cascadeAction->afterCascadeAction(nucleus);
550 theEventInfo.
reset();
558 theEventInfo.
Sp = (
Short_t)projectileSpecies.theS;
559 theEventInfo.
Ep = kineticEnergy;
577 if(maxImpactParameter<=0.) {
581 if(projectileSpecies.theType ==
antiProton && kineticEnergy <= theConfig->getAtrestThreshold()){
594 if(fixedImpactParameter<0.) {
595 impactParameter = maxImpactParameter * std::sqrt(
Random::shoot0());
598 impactParameter = fixedImpactParameter;
601 INCL_DEBUG(
"Selected impact parameter: " << impactParameter <<
'\n');
606 const G4double effectiveImpactParameter = propagationModel->
shoot(projectileSpecies, kineticEnergy, impactParameter, phi);
607 if(effectiveImpactParameter < 0.) {
620 void INCL::cascade() {
621 FinalState *finalState =
new FinalState;
623 unsigned long loopCounter = 0;
624 const unsigned long maxLoopCounter = 10000000;
627 cascadeAction->beforePropagationAction(propagationModel);
631 IAvatar *avatar = propagationModel->
propagate(finalState);
636 cascadeAction->afterPropagationAction(propagationModel, avatar);
638 if(avatar == 0)
break;
641 cascadeAction->beforeAvatarAction(avatar, nucleus);
650 avatar->fillFinalState(finalState);
652 cascadeAction->afterAvatarAction(avatar, nucleus, finalState);
661 }
while(continueCascade() && loopCounter<maxLoopCounter);
666 void INCL::postCascade(
const ParticleSpecies &projectileSpecies,
const G4double kineticEnergy) {
674 if(!(projectileSpecies.theType==
antiProton && kineticEnergy<=theConfig->getAtrestThreshold())){
676 INCL_DEBUG(
"Trying compound nucleus" <<
'\n');
677 makeCompoundNucleus();
680#ifndef INCLXX_IN_GEANT4_MODE
681 if(!theEventInfo.
transparent) globalConservationChecks(
true);
687 if(!(projectileSpecies.theType==
antiProton && kineticEnergy<=theConfig->getAtrestThreshold())){
693 if(projectileRemnant) {
715#ifdef INCLXX_IN_GEANT4_MODE
745 INCL_DEBUG(
"Cascade resulted in complete fusion, using realistic fusion kinematics" <<
'\n');
751 INCL_WARN(
"Complete-fusion kinematics yields negative excitation energy, returning a transparent!" <<
'\n');
766 if(nucleus->
getA()==1 && minRemnantSize>1) {
767 INCL_ERROR(
"Computing one-nucleon recoil kinematics. We should never be here nowadays, cascade should stop earlier than this." <<
'\n');
771#ifndef INCLXX_IN_GEANT4_MODE
773 globalConservationChecks(
false);
778 if(nucleus->
hasRemnant()) rescaleOutgoingForRecoil();
785#ifndef INCLXX_IN_GEANT4_MODE
787 globalConservationChecks(
true);
796 void INCL::makeCompoundNucleus() {
803 forceTransparent =
true;
811 nucleus->
setA(theEventInfo.
At);
812 nucleus->
setZ(theEventInfo.
Zt);
820 G4int theCNA=theEventInfo.
At, theCNZ=theEventInfo.
Zt, theCNS=theEventInfo.
St;
825 ParticleList
const &initialProjectileComponents = theProjectileRemnant->getParticles();
826 std::vector<Particle *> shuffledComponents(initialProjectileComponents.begin(), initialProjectileComponents.end());
828 std::shuffle(shuffledComponents.begin(), shuffledComponents.end(),
Random::getAdapter());
831 G4bool atLeastOneNucleonEntering =
false;
832 for(std::vector<Particle*>::const_iterator p=shuffledComponents.begin(), e=shuffledComponents.end(); p!=e; ++p) {
836 (*p)->getPropagationVelocity(),
837 maxInteractionDistance));
838 if(!intersectionInteractionDistance.exists)
842 atLeastOneNucleonEntering =
true;
843 ParticleEntryAvatar *theAvatar =
new ParticleEntryAvatar(0.0, nucleus, *p);
845 FinalState *fs = theAvatar->getFinalState();
855 theCNZ += (*p)->getZ();
856 theCNS += (*p)->getS();
866 if(!success || !atLeastOneNucleonEntering) {
867 INCL_DEBUG(
"No nucleon entering in forced CN, forcing a transparent" <<
'\n');
868 forceTransparent =
true;
878 theCNEnergy -= theProjectileRemnant->getEnergy();
879 theCNMomentum -= theProjectileRemnant->getMomentum();
886 theCNSpin -= theProjectileRemnant->getAngularMomentum();
890 const G4double theCNInvariantMassSquared = theCNEnergy*theCNEnergy-theCNMomentum.mag2();
891 if(theCNInvariantMassSquared<0.) {
893 forceTransparent =
true;
896 const G4double theCNExcitationEnergy = std::sqrt(theCNInvariantMassSquared) - theCNMass;
897 if(theCNExcitationEnergy<0.) {
899 INCL_DEBUG(
"CN excitation energy is negative, forcing a transparent" <<
'\n'
900 <<
" theCNA = " << theCNA <<
'\n'
901 <<
" theCNZ = " << theCNZ <<
'\n'
902 <<
" theCNS = " << theCNS <<
'\n'
903 <<
" theCNEnergy = " << theCNEnergy <<
'\n'
904 <<
" theCNMomentum = (" << theCNMomentum.getX() <<
", "<< theCNMomentum.getY() <<
", " << theCNMomentum.getZ() <<
")" <<
'\n'
905 <<
" theCNExcitationEnergy = " << theCNExcitationEnergy <<
'\n'
906 <<
" theCNSpin = (" << theCNSpin.getX() <<
", "<< theCNSpin.getY() <<
", " << theCNSpin.getZ() <<
")" <<
'\n'
908 forceTransparent =
true;
912 INCL_DEBUG(
"CN excitation energy is positive, forcing a CN" <<
'\n'
913 <<
" theCNA = " << theCNA <<
'\n'
914 <<
" theCNZ = " << theCNZ <<
'\n'
915 <<
" theCNS = " << theCNS <<
'\n'
916 <<
" theCNEnergy = " << theCNEnergy <<
'\n'
917 <<
" theCNMomentum = (" << theCNMomentum.getX() <<
", "<< theCNMomentum.getY() <<
", " << theCNMomentum.getZ() <<
")" <<
'\n'
918 <<
" theCNExcitationEnergy = " << theCNExcitationEnergy <<
'\n'
919 <<
" theCNSpin = (" << theCNSpin.getX() <<
", "<< theCNSpin.getY() <<
", " << theCNSpin.getZ() <<
")" <<
'\n'
921 nucleus->
setA(theCNA);
922 nucleus->
setZ(theCNZ);
923 nucleus->
setS(theCNS);
927 nucleus->
setMass(theCNMass+theCNExcitationEnergy);
948 void INCL::rescaleOutgoingForRecoil() {
949 RecoilCMFunctor theRecoilFunctor(nucleus, theEventInfo);
952 const RootFinder::Solution theSolution =
RootFinder::solve(&theRecoilFunctor, 1.0);
953 if(theSolution.success) {
954 theRecoilFunctor(theSolution.x);
956 INCL_WARN(
"Couldn't accommodate remnant recoil while satisfying energy conservation, root-finding algorithm failed." <<
'\n');
960#ifndef INCLXX_IN_GEANT4_MODE
961 void INCL::globalConservationChecks(
G4bool afterRecoil) {
966 const G4double pTransBalance = theBalance.momentum.perp();
967 if(theBalance.Z != 0) {
968 INCL_ERROR(
"Violation of charge conservation! ZBalance = " << theBalance.Z <<
" eventNumber=" << theEventInfo.
eventNumber <<
'\n');
970 if(theBalance.A != 0) {
971 INCL_ERROR(
"Violation of baryon-number conservation! ABalance = " << theBalance.A <<
" Emit Lambda=" << theEventInfo.
emitLambda <<
" eventNumber=" << theEventInfo.
eventNumber <<
'\n');
973 if(theBalance.S != 0) {
974 INCL_ERROR(
"Violation of strange-number conservation! SBalance = " << theBalance.S <<
" eventNumber=" << theEventInfo.
eventNumber <<
'\n');
976 G4double EThreshold, pLongThreshold, pTransThreshold;
981 pTransThreshold = 1.;
985 pLongThreshold = 0.1;
986 pTransThreshold = 0.1;
988 if(std::abs(theBalance.energy)>EThreshold) {
989 INCL_WARN(
"Violation of energy conservation > " << EThreshold <<
" MeV. EBalance = " << theBalance.energy <<
" Emit Lambda=" << theEventInfo.
emitLambda <<
" afterRecoil = " << afterRecoil <<
" eventNumber=" << theEventInfo.
eventNumber <<
'\n');
991 if(std::abs(pLongBalance)>pLongThreshold) {
992 INCL_WARN(
"Violation of longitudinal momentum conservation > " << pLongThreshold <<
" MeV/c. pLongBalance = " << pLongBalance <<
" afterRecoil = " << afterRecoil <<
" eventNumber=" << theEventInfo.
eventNumber <<
'\n');
994 if(std::abs(pTransBalance)>pTransThreshold) {
995 INCL_WARN(
"Violation of transverse momentum conservation > " << pTransThreshold <<
" MeV/c. pTransBalance = " << pTransBalance <<
" afterRecoil = " << afterRecoil <<
" eventNumber=" << theEventInfo.
eventNumber <<
'\n');
999 theEventInfo.
EBalance = theBalance.energy;
1005 G4bool INCL::continueCascade() {
1009 <<
") exceeded stopping time (" << propagationModel->
getStoppingTime()
1010 <<
"), stopping cascade" <<
'\n');
1016 INCL_DEBUG(
"No participants in the nucleus and no incoming particles left, stopping cascade" <<
'\n');
1020 if(nucleus->
getA() <= minRemnantSize) {
1022 <<
") smaller than or equal to minimum (" << minRemnantSize
1023 <<
"), stopping cascade" <<
'\n');
1029 INCL_DEBUG(
"Trying to make a compound nucleus, stopping cascade" <<
'\n');
1064 G4int INCL::makeProjectileRemnant() {
1073 G4int nUnmergedSpectators = 0;
1076 if(dynSpectators.empty() && geomSpectators.empty()) {
1078 }
else if(dynSpectators.size()==1 && geomSpectators.empty()) {
1089 nUnmergedSpectators = (
G4int)rejected.size();
1097 return nUnmergedSpectators;
1100 void INCL::initMaxInteractionDistance(ParticleSpecies
const &projectileSpecies,
const G4double kineticEnergy) {
1101 if(projectileSpecies.theType !=
Composite) {
1102 maxInteractionDistance = 0.;
1110 maxInteractionDistance = r0 + theNNDistance;
1111 INCL_DEBUG(
"Initialised interaction distance: r0 = " << r0 <<
'\n'
1112 <<
" theNNDistance = " << theNNDistance <<
'\n'
1113 <<
" maxInteractionDistance = " << maxInteractionDistance <<
'\n');
1116 void INCL::initUniverseRadius(ParticleSpecies
const &p,
const G4double kineticEnergy,
const G4int A,
const G4int Z) {
1119 IsotopicDistribution
const &anIsotopicDistribution =
1121 IsotopeVector theIsotopes = anIsotopicDistribution.getIsotopes();
1122 for(
IsotopeIter i=theIsotopes.begin(), e=theIsotopes.end(); i!=e; ++i) {
1125 const G4double maximumRadius = std::max(pMaximumRadius, nMaximumRadius);
1126 rMax = std::max(maximumRadius, rMax);
1131 const G4double maximumRadius = std::max(pMaximumRadius, nMaximumRadius);
1132 rMax = std::max(maximumRadius, rMax);
1137 }
else if(p.theType==
PiPlus
1142 }
else if(p.theType==
KPlus
1143 || p.theType==
KZero) {
1150 }
else if(p.theType==
Lambda
1158 maxUniverseRadius = rMax;
1160 INCL_DEBUG(
"Initialised universe radius: " << maxUniverseRadius <<
'\n');
1170 for(
IsotopeIter i=theIsotopes.begin(), e=theIsotopes.end(); i!=e; ++i) {
1173 const G4double maximumRadius = std::max(pMaximumRadius, nMaximumRadius);
1174 rMax = std::max(maximumRadius, rMax);
1179 const G4double maximumRadius = std::max(pMaximumRadius, nMaximumRadius);
1180 rMax = std::max(maximumRadius, rMax);
1186 void INCL::updateGlobalInfo() {
1194 if(forceTransparent)
1214 G4double INCL::read_file(std::string filename, std::vector<G4double>& probabilities,
1215 std::vector<std::vector<G4String>>& particle_types) {
1216 std::ifstream file(filename);
1218 if (file.is_open()) {
1220 while (getline(file, line)) {
1221 std::istringstream iss(line);
1225 probabilities.push_back(prob);
1226 std::vector<G4String> types;
1228 while (iss >> type) {
1229 types.push_back(type);
1231 particle_types.push_back(types);
1234#ifdef INCLXX_IN_GEANT4_MODE
1235 G4cout <<
"ERROR no fread_file " << filename <<
G4endl;
1237 std::cout <<
"ERROR no fread_file " << filename << std::endl;
1244 G4int INCL::findStringNumber(
G4double rdm, std::vector<G4double> yields) {
1245 G4int stringNumber = -1;
1249 for (
G4int i = 0; i < static_cast<G4int>(yields.size()-1); i++) {
1250 if (rdm >= smallestsum && rdm <= biggestsum) {
1254 smallestsum += yields[i];
1255 biggestsum += yields[i+1];
1257 if(stringNumber==-1) stringNumber =
static_cast<G4int>(yields.size());
1258 if(stringNumber==-1){
1259 INCL_ERROR(
"ERROR in findStringNumber (stringNumber=-1)");
1260#ifdef INCLXX_IN_GEANT4_MODE
1263 std::cout <<
"ERROR in findStringNumber" << std::endl;
1266 return stringNumber;
1270 void INCL::preCascade_pbarH1(ParticleSpecies
const &projectileSpecies,
const G4double kineticEnergy) {
1272 theEventInfo.
reset();
1278 theEventInfo.
Ap = -1;
1279 theEventInfo.
Zp = -1;
1280 theEventInfo.
Sp = 0;
1281 theEventInfo.
Ep = kineticEnergy;
1282 theEventInfo.
St = 0;
1283 theEventInfo.
At = 1;
1284 theEventInfo.
Zt = 1;
1288 void INCL::postCascade_pbarH1(ParticleList
const &outgoingParticles) {
1295 for(
ParticleIter i=outgoingParticles.begin(), e=outgoingParticles.end(); i!=e; ++i ) {
1299 theEventInfo.
EKin[theEventInfo.
nParticles] = (*i)->getKineticEnergy();
1300 ThreeVector mom = (*i)->getMomentum();
1307#ifdef INCLXX_IN_GEANT4_MODE
1311 theEventInfo.
history.push_back(
"");
1312 ParticleSpecies pt((*i)->getType());
1320 void INCL::preCascade_pbarH2(ParticleSpecies
const &projectileSpecies,
const G4double kineticEnergy) {
1322 theEventInfo.
reset();
1328 theEventInfo.
Ap = -1;
1329 theEventInfo.
Zp = -1;
1330 theEventInfo.
Sp = 0;
1331 theEventInfo.
Ep = kineticEnergy;
1332 theEventInfo.
St = 0;
1333 theEventInfo.
At = 2;
1334 theEventInfo.
Zt = 1;
1338 void INCL::postCascade_pbarH2(ParticleList
const &outgoingParticles, ParticleList
const &H2Particles) {
1345 for(
ParticleIter i=outgoingParticles.begin(), e=outgoingParticles.end(); i!=e; ++i ) {
1349 theEventInfo.
EKin[theEventInfo.
nParticles] = (*i)->getKineticEnergy();
1350 ThreeVector mom = (*i)->getMomentum();
1357#ifdef INCLXX_IN_GEANT4_MODE
1361 theEventInfo.
history.push_back(
"");
1362 ParticleSpecies pt((*i)->getType());
1367 for(
ParticleIter i=H2Particles.begin(), e=H2Particles.end(); i!=e; ++i ) {
1371 theEventInfo.
EKin[theEventInfo.
nParticles] = (*i)->getKineticEnergy();
1372 ThreeVector mom = (*i)->getMomentum();
1379#ifdef INCLXX_IN_GEANT4_MODE
1383 theEventInfo.
history.push_back(
"");
1384 ParticleSpecies pt((*i)->getType());
G4double S(G4double temp)
const char * G4FindDataDir(const char *)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
Alternative CascadeAction for dumping avatars.
Class containing default actions to be performed at intermediate cascade steps.
Static class for cluster formation.
Static class for selecting Coulomb distortion.
Simple container for output of calculation-wide results.
Abstract interface to the nuclear potential.
Simple class for computing intersections between a straight line and a sphere.
Functions that encapsulate a mass table.
G4GLOB_DLL std::ostream G4cout
static void setBias(const G4double b)
Set the global bias factor.
static void setCutNN(const G4double c)
G4int getCascading() const
ParticleList const & getParticles() const
void setExcitationEnergy(const G4double e)
Set the excitation energy of the cluster.
void setS(const G4int S)
Set the strangess number of the cluster.
void setSpin(const ThreeVector &j)
Set the spin of the nucleus.
void setA(const G4int A)
Set the mass number of the cluster.
void setZ(const G4int Z)
Set the charge number of the cluster.
static std::string const getVersionString()
Get the INCL version string.
G4double getImpactParameter() const
CascadeActionType getCascadeActionType() const
Get the cascade-action type.
std::string const & getINCLXXDataFilePath() const
Set the ABLAXX datafile path.
G4int getTargetA() const
Get the target mass number.
G4double getDecayTimeThreshold() const
Get the decay time threshold time.
G4double getProjectileKineticEnergy() const
Get the projectile kinetic energy.
G4double getHadronizationTime() const
Get the hadronization time.
ParticleSpecies getProjectileSpecies() const
Get the projectile species.
LocalEnergyType getLocalEnergyPiType() const
Get the type of local energy for pi-N and decay avatars.
G4bool isNaturalTarget() const
Natural targets.
G4int getTargetS() const
Get the target strangess number.
G4double getCutNN() const
LocalEnergyType getLocalEnergyBBType() const
Get the type of local energy for N-N avatars.
G4double getBias() const
Get the bias.
G4int getTargetZ() const
Get the target charge number.
std::string getDeExcitationString() const
Get the de-excitation string.
void finalizeGlobalInfo(Random::SeedVector const &initialSeeds)
G4bool prepareReaction(const ParticleSpecies &projectileSpecies, const G4double kineticEnergy, const G4int A, const G4int Z, const G4int S)
INCL(Config const *const config)
const EventInfo & processEvent()
G4double initUniverseRadiusForAntiprotonAtRest(const G4int A, const G4int Z)
G4bool initializeTarget(const G4int A, const G4int Z, const G4int S, AnnihilationType theAType)
virtual G4double shoot(ParticleSpecies const &projectileSpecies, const G4double kineticEnergy, const G4double impactParameter, const G4double phi)=0
virtual G4INCL::IAvatar * propagate(FinalState const *const fs)=0
virtual G4double getCurrentTime()=0
virtual G4double getStoppingTime()=0
virtual void setNucleus(G4INCL::Nucleus *nucleus)=0
static void deleteBackupParticles()
Release the memory allocated for the backup particles.
Class that stores isotopic abundances for a given element.
IsotopeVector const & getIsotopes() const
Get the isotope vector.
G4bool decayOutgoingNeutralKaon()
Force the transformation of outgoing Neutral Kaon into propation eigenstate.
G4bool containsSigma()
Returns true if the nucleus contains any Sigma.
const ThreeVector & getIncomingAngularMomentum() const
Get the incoming angular-momentum vector.
ProjectileRemnant * getProjectileRemnant() const
Get the projectile remnant.
void fillEventInfo(EventInfo *eventInfo)
AnnihilationType getAnnihilationType() const
Getter for theAnnihilationType.
G4bool decayMe()
Force the phase-space decay of the Nucleus.
G4bool decayInsideDeltas()
Force the decay of deltas inside the nucleus.
void computeRecoilKinematics()
Compute the recoil momentum and spin of the nucleus.
void finalizeProjectileRemnant(const G4double emissionTime)
Finalise the projectile remnant.
G4bool containsDeltas()
Returns true if the nucleus contains any deltas.
G4bool getTryCompoundNucleus()
G4bool emitInsideKaon()
Force emission of all Kaon inside the nucleus.
G4bool isEventTransparent() const
Is the event transparent?
void applyFinalState(FinalState *)
G4bool isNucleusNucleusCollision() const
Is it a nucleus-nucleus collision?
G4bool containsKaon()
Returns true if the nucleus contains any Kaons.
void emitInsideStrangeParticles()
Force emission of all strange particles inside the nucleus.
G4bool decayOutgoingPionResonances(G4double timeThreshold)
Force the decay of outgoing PionResonances (eta/omega).
void useFusionKinematics()
Adjust the kinematics for complete-fusion events.
G4bool containsLambda()
Returns true if the nucleus contains any Lambda.
const ThreeVector & getIncomingMomentum() const
Get the incoming momentum vector.
G4bool decayOutgoingClusters()
Force the decay of unstable outgoing clusters.
G4double getExcitationEnergy() const
Get the excitation energy of the nucleus.
G4int emitInsideLambda()
Force emission of all Lambda (desexitation code with strangeness not implanted yet)
G4bool decayInsideStrangeParticles()
Force the transformation of strange particles into a Lambda;.
ConservationBalance getConservationBalance(EventInfo const &theEventInfo, const G4bool afterRecoil) const
Compute charge, mass, energy and momentum balance.
void initializeParticles()
G4bool hasRemnant() const
Does the nucleus give a cascade remnant?
G4double computeExcitationEnergy() const
Compute the current excitation energy.
G4bool containsAntiKaon()
Returns true if the nucleus contains any anti Kaons.
G4bool decayOutgoingDeltas()
Force the decay of outgoing deltas.
G4bool decayOutgoingSigmaZero(G4double timeThreshold)
Force the decay of outgoing Neutral Sigma.
G4int getS() const
Returns the strangeness number.
G4double getEnergy() const
static std::vector< G4double > INCLBiasVector
Time ordered vector of all bias applied.
void setMass(G4double mass)
G4int getZ() const
Returns the charge number.
static G4double getTotalBias()
General bias vector function.
virtual void setMomentum(const G4INCL::ThreeVector &momentum)
void setEnergy(G4double energy)
static G4ThreadLocal G4int nextBiasedCollisionID
G4int getA() const
Returns the baryon number.
ParticleList addAllDynamicalSpectators(ParticleList const &pL)
Add back all dynamical spectators to the projectile remnant.
void reset()
Reset the projectile remnant to the state at the beginning of the cascade.
ParticleList const & getIncomingParticles() const
void deleteIncoming()
Clear the incoming list and delete the particles.
ParticleList const & getOutgoingParticles() const
void addToOutgoing(Particle *p)
add the particle to the outgoing particle list.
void clearIncoming()
Clear the incoming list.
void addParticleEntryAvatar(IAvatar *a)
Add one ParticleEntry avatar.
ParticleList extractDynamicalSpectators()
Returns a list of dynamical spectators.
void initialize(Config const *const theConfig)
Initialize the clustering model based on the Config object.
void deleteClusteringModel()
Delete the clustering model.
void initialize(Config const *const theConfig)
Initialize the Coulomb-distortion algorithm.
void deleteCoulomb()
Delete the Coulomb-distortion object.
void distortOut(ParticleList const &pL, Nucleus const *const n)
Modify the momentum of an outgoing particle.
G4double maxImpactParameter(ParticleSpecies const &p, const G4double kinE, Nucleus const *const n)
Return the maximum impact parameter for Coulomb-distorted trajectories.
G4double interactionDistanceKbarN(const G4double projectileKineticEnergy)
Compute the "interaction distance".
G4double interactionDistancePiN(const G4double projectileKineticEnergy)
Compute the "interaction distance".
G4double interactionDistanceKN(const G4double projectileKineticEnergy)
Compute the "interaction distance".
G4double interactionDistanceYN(const G4double projectileKineticEnergy)
Compute the "interaction distance".
void deleteCrossSections()
void initialize(Config const *const theConfig)
G4double interactionDistanceNN(const ParticleSpecies &aSpecies, const G4double kineticEnergy)
Compute the "interaction distance".
Intersection getEarlierTrajectoryIntersection(const ThreeVector &x0, const ThreeVector &p, const G4double r)
Compute the first intersection of a straight particle trajectory with a sphere.
void initVerbosityLevelFromEnvvar()
G4double toDegrees(G4double radians)
void clearCache()
Clear the INuclearPotential cache.
G4ThreadLocal NuclearMassFn getTableMass
Static pointer to the mass function for nuclei.
void initialize(Config const *const theConfig=0)
Initialize the particle table.
G4int drawRandomNaturalIsotope(const G4int Z)
G4double getRealMass(const G4INCL::ParticleType t)
Get particle mass (in MeV/c^2)
G4double getMaximumNuclearRadius(const ParticleType t, const G4int A, const G4int Z)
IsotopicDistribution const & getNaturalIsotopicDistribution(const G4int Z)
G4double getNuclearRadius(const ParticleType t, const G4int A, const G4int Z)
void initialize(Config const *const aConfig)
Initialise blockers according to a Config object.
void deleteBlockers()
Delete blockers.
void initialize(Config const *const theConfig)
void deletePhaseSpaceGenerator()
void generate(const G4double sqrtS, ParticleList &particles)
Generate an event in the CM system.
const G4double eSquared
Coulomb conversion factor [MeV*fm].
ThreeVector normVector(G4double norm=1.)
Adapter const & getAdapter()
void initialize(Config const *const)
Initialize generator according to a Config object.
Solution solve(RootFunctor const *const f, const G4double x0)
Numerically solve a one-dimensional equation.
ParticleList::const_iterator ParticleIter
IsotopeVector::iterator IsotopeIter
std::vector< Isotope > IsotopeVector
Bool_t pionAbsorption
True if the event is a pion absorption.
void reset()
Reset the EventInfo members.
Short_t S[maxSizeParticles]
Particle strangeness number.
Bool_t lambdasInside
Event involved lambdas in the nucleus at the end of the cascade.
Short_t origin[maxSizeParticles]
Origin of the particle.
Bool_t forcedDeltasOutside
Event involved forced delta decays outside the nucleus.
Short_t At
Mass number of the target nucleus.
Short_t Zp
Charge number of the projectile nucleus.
Int_t parentResonancePDGCode[maxSizeParticles]
Particle's parent resonance PDG code.
Bool_t annihilationP
True if annihilation at rest on a proton.
Int_t projectileType
Projectile particle type.
Float_t pTransBalance
Transverse momentum-conservation balance [MeV/c].
Float_t Ep
Projectile kinetic energy given as input.
Short_t nCascadeParticles
Number of cascade particles.
Short_t nRemnants
Number of remnants.
Float_t eventBias
Event bias.
Bool_t transparent
True if the event is transparent.
Float_t theta[maxSizeParticles]
Particle momentum polar angle [radians].
Short_t A[maxSizeParticles]
Particle mass number.
Bool_t sigmasInside
Event involved sigmas in the nucleus at the end of the cascade.
Bool_t deltasInside
Event involved deltas in the nucleus at the end of the cascade.
Float_t EBalance
Energy-conservation balance [MeV].
Int_t parentResonanceID[maxSizeParticles]
Particle's parent resonance unique ID identifier.
Bool_t forcedPionResonancesOutside
Event involved forced eta/omega decays outside the nucleus.
Bool_t nucleonAbsorption
True if the event is a nucleon absorption.
Int_t emitLambda
Number of forced Lambda emit out of the nucleus.
Short_t St
Strangeness number of the target nucleus.
Float_t effectiveImpactParameter
Effective (Coulomb-distorted) impact parameter [fm].
Bool_t kaonsInside
Event involved kaons in the nucleus at the end of the cascade.
Float_t stoppingTime
Cascade stopping time [fm/c].
Int_t nEnergyViolationInteraction
Number of attempted collisions/decays for which the energy-conservation algorithm failed to find a so...
Float_t phi[maxSizeParticles]
Particle momentum azimuthal angle [radians].
Short_t Ap
Mass number of the projectile nucleus.
Short_t Z[maxSizeParticles]
Particle charge number.
std::vector< std::string > history
History of the particle.
Short_t Sp
Strangeness number of the projectile nucleus.
Float_t EKin[maxSizeParticles]
Particle kinetic energy [MeV].
Bool_t emitKaon
Event involved forced Kaon emission.
Short_t nParticles
Number of particles in the final state.
Bool_t antikaonsInside
Event involved antikaons in the nucleus at the end of the cascade.
Bool_t clusterDecay
Event involved cluster decay.
Float_t px[maxSizeParticles]
Particle momentum, x component [MeV/c].
Bool_t forcedDeltasInside
Event involved forced delta decays inside the nucleus.
Bool_t annihilationN
True if annihilation at rest on a neutron.
Short_t Zt
Charge number of the target nucleus.
static G4ThreadLocal Int_t eventNumber
Number of the event.
Float_t impactParameter
Impact parameter [fm].
Float_t pz[maxSizeParticles]
Particle momentum, z component [MeV/c].
Bool_t absorbedStrangeParticle
Event involved forced strange absorption inside the nucleus.
Int_t PDGCode[maxSizeParticles]
PDG numbering of the particles.
Int_t nUnmergedSpectators
Number of dynamical spectators that were merged back into the projectile remnant.
Float_t py[maxSizeParticles]
Particle momentum, y component [MeV/c].
Float_t pLongBalance
Longitudinal momentum-conservation balance [MeV/c].
Int_t nNucleonAbsorptions
Number of nucleon absorptions (no outcoming particles)
std::string deexcitationModel
Name of the de-excitation model.
Float_t forcedCNCrossSection
Calculated forced-compound-nucleus cross section.
Float_t pionAbsorptionCrossSection
Pion absorption cross section.
Float_t errorCompleteFusionCrossSection
Error on the calculated complete-fusion cross section (nParticles==0)
Short_t St
Target strangeness number given as input.
Float_t Ep
Projectile kinetic energy given as input.
Int_t nEnergyViolationInteraction
Number of attempted collisions/decays for which the energy-conservation algorithm failed to find a so...
Float_t biasFactor
Bias factor.
std::vector< Int_t > initialRandomSeeds
Initial seeds for the pseudo-random-number generator.
Short_t At
Target mass number given as input.
Int_t nShots
Number of shots.
Float_t completeFusionCrossSection
Calculated complete-fusion cross section (nParticles==0)
Float_t nucleonAbsorptionCrossSection
Nucleon absorption cross section.
Float_t errorReactionCrossSection
Error on the calculated reaction cross section.
Short_t Zt
Target charge number given as input.
std::vector< Int_t > finalRandomSeeds
Final seeds for the pseudo-random-number generator.
Int_t nPionAbsorptions
Number of nucleon absorptions (no outcoming pions)
Short_t Ap
Projectile mass number given as input.
Float_t energyViolationInteractionCrossSection
Cross section for attempted collisions/decays for which the energy-conservation algorithm failed to f...
Int_t nCompleteFusion
Number of complete-fusion events (nParticles==0)
Int_t nTransparents
Number of transparent shots.
Short_t Sp
Projectile strangeness number given as input.
Int_t nForcedCompoundNucleus
Number of forced compound-nucleus events.
Short_t Zp
Projectile charge number given as input.
Int_t nForcedTransparents
Number of forced transparents.
std::string cascadeModel
Name of the cascade model.
Float_t reactionCrossSection
Calculated reaction cross section.
Float_t errorForcedCNCrossSection
Error on the calculated forced-compound-nucleus cross section.
Float_t geometricCrossSection
Geometric cross section.