320 {
321
322 ParticleList starlistH2;
323
324 if (projectileSpecies.theType==
antiProton && (targetA==1 || targetA==2) && targetZ==1 && targetS==0) {
325
326 if (targetA==1) {
327 preCascade_pbarH1(projectileSpecies, kineticEnergy);
328 } else {
329 preCascade_pbarH2(projectileSpecies, kineticEnergy);
332
334
335 ThreeVector dummy(0.,0.,0.);
337 if (rndm <= SpOverSn) {
339 Particle *p2 =
new Particle(
Neutron, dummy, dummy);
340 starlistH2.push_back(p2);
341
342 } else {
344 Particle *p2 =
new Particle(
Proton, dummy, dummy);
345 starlistH2.push_back(p2);
346
347 }
348 }
349
350
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;
358 }
360 G4String dataPathppbar(dataPath0 +
"/rawppbarFS.dat");
361 G4String dataPathnpbar(dataPath0 +
"/rawnpbarFS.dat");
362 G4String dataPathppbark(dataPath0 +
"/rawppbarFSkaonic.dat");
363 G4String dataPathnpbark(dataPath0 +
"/rawnpbarFSkaonic.dat");
364#else
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');
375 #endif
376
377
378 std::vector<G4double> probabilities;
379 std::vector<std::vector<G4String>> particle_types;
382
383 ParticleList starlist;
384 ThreeVector mommy;
385
387 ThreeVector annihilationPosition(0.,0.,0.);
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;
392
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") {
397 Particle *p =
new Particle(
PiZero, mommy, annihilationPosition);
398 starlist.push_back(p);
399 } else if (particle_types[n][j] == "pi-") {
400 Particle *p =
new Particle(
PiMinus, mommy, annihilationPosition);
401 starlist.push_back(p);
402 } else if (particle_types[n][j] == "pi+") {
403 Particle *p =
new Particle(
PiPlus, mommy, annihilationPosition);
404 starlist.push_back(p);
405 } else if (particle_types[n][j] == "omega") {
406 Particle *p =
new Particle(
Omega, mommy, annihilationPosition);
407 starlist.push_back(p);
408 } else if (particle_types[n][j] == "eta") {
409 Particle *p =
new Particle(
Eta, mommy, annihilationPosition);
410 starlist.push_back(p);
411 } else if (particle_types[n][j] == "rho-") {
412 Particle *p =
new Particle(
PiMinus, mommy, annihilationPosition);
413 starlist.push_back(p);
414 Particle *
pp =
new Particle(
PiZero, mommy, annihilationPosition);
415 starlist.push_back(pp);
416 } else if (particle_types[n][j] == "rho+") {
417 Particle *p =
new Particle(
PiPlus, mommy, annihilationPosition);
418 starlist.push_back(p);
419 Particle *
pp =
new Particle(
PiZero, mommy, annihilationPosition);
420 starlist.push_back(pp);
421 } else if (particle_types[n][j] == "rho0") {
422 Particle *p =
new Particle(
PiMinus, mommy, annihilationPosition);
423 starlist.push_back(p);
424 Particle *
pp =
new Particle(
PiPlus, mommy, annihilationPosition);
425 starlist.push_back(pp);
426 } else {
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
431#else
432 std::cout <<
"gotcha! " << particle_types[
n][jj] << std::endl;
433#endif
434 }
435#ifdef INCLXX_IN_GEANT4_MODE
436 G4cout <<
"Some non-existing FS particle detected when reading pbar FS files" <<
G4endl;
437#else
438 std::cout << "Some non-existing FS particle detected when reading pbar FS files" << std::endl;
439#endif
440 }
441 }
442 } else {
443 INCL_DEBUG(
"kaonic pp final state chosen" <<
'\n');
444 sum = read_file(dataPathppbark, probabilities, particle_types);
445 rdm = ((1.-rdm)/kaonicFSprob)*sum;
446
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") {
451 Particle *p =
new Particle(
PiZero, mommy, annihilationPosition);
452 starlist.push_back(p);
453 } else if (particle_types[n][j] == "pi-") {
454 Particle *p =
new Particle(
PiMinus, mommy, annihilationPosition);
455 starlist.push_back(p);
456 } else if (particle_types[n][j] == "pi+") {
457 Particle *p =
new Particle(
PiPlus, mommy, annihilationPosition);
458 starlist.push_back(p);
459 } else if (particle_types[n][j] == "omega") {
460 Particle *p =
new Particle(
Omega, mommy, annihilationPosition);
461 starlist.push_back(p);
462 } else if (particle_types[n][j] == "eta") {
463 Particle *p =
new Particle(
Eta, mommy, annihilationPosition);
464 starlist.push_back(p);
465 } else if (particle_types[n][j] == "K-") {
466 Particle *p =
new Particle(
KMinus, mommy, annihilationPosition);
467 starlist.push_back(p);
468 } else if (particle_types[n][j] == "K+") {
469 Particle *p =
new Particle(
KPlus, mommy, annihilationPosition);
470 starlist.push_back(p);
471 } else if (particle_types[n][j] == "K0") {
472 Particle *p =
new Particle(
KZero, mommy, annihilationPosition);
473 starlist.push_back(p);
474 } else if (particle_types[n][j] == "K0b") {
475 Particle *p =
new Particle(
KZeroBar, mommy, annihilationPosition);
476 starlist.push_back(p);
477 } else {
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
482#else
483 std::cout <<
"gotcha! " << particle_types[
n][jj] << std::endl;
484#endif
485 }
486#ifdef INCLXX_IN_GEANT4_MODE
487 G4cout <<
"Some non-existing FS particle detected when reading pbar FS files" <<
G4endl;
488#else
489 std::cout << "Some non-existing FS particle detected when reading pbar FS files" << std::endl;
490#endif
491 }
492 }
493 }
494
495
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();
511 } else {
513 }
514
515 if (targetA==1) postCascade_pbarH1(starlist);
516 else postCascade_pbarH2(starlist,starlistH2);
517
519 return theEventInfo;
520 }
521
522
524
526
527
528 targetInitSuccess =
prepareReaction(projectileSpecies, kineticEnergy, targetA, targetZ, targetS);
529
530 if(!targetInitSuccess) {
531 INCL_WARN(
"Target initialisation failed for A=" << targetA <<
", Z=" << targetZ <<
", S=" << targetS <<
'\n');
533 return theEventInfo;
534 }
535
536 cascadeAction->beforeCascadeAction(propagationModel);
537
538 const G4bool canRunCascade = preCascade(projectileSpecies, kineticEnergy);
539 if(canRunCascade) {
540 cascade();
541 postCascade(projectileSpecies, kineticEnergy);
542 cascadeAction->afterCascadeAction(nucleus);
543 }
544 updateGlobalInfo();
545 return theEventInfo;
546 }
const char * G4FindDataDir(const char *)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
G4GLOB_DLL std::ostream G4cout
std::string const & getINCLXXDataFilePath() const
Set the ABLAXX datafile path.
G4bool prepareReaction(const ParticleSpecies &projectileSpecies, const G4double kineticEnergy, const G4int A, const G4int Z, const G4int S)
static std::vector< G4double > INCLBiasVector
Time ordered vector of all bias applied.
static G4ThreadLocal G4int nextBiasedCollisionID
G4double getRealMass(const G4INCL::ParticleType t)
Get particle mass (in MeV/c^2)
void generate(const G4double sqrtS, ParticleList &particles)
Generate an event in the CM system.
ThreeVector normVector(G4double norm=1.)
ParticleList::const_iterator ParticleIter
Bool_t transparent
True if the event is transparent.