252 #ifdef INCLXX_IN_GEANT4_MODE
255 ed <<
" Data missing: set environment variable G4INCLDATA\n"
256 <<
" to point to the directory containing data files needed\n"
257 <<
" by the INCL++ model" <<
G4endl;
258 G4Exception(
"G4INCLDataFile::readData()",
"rawppbarFS.dat, ...",
262 const G4String& dataPathppbar(dataPath0 +
"/rawppbarFS.dat");
263 const G4String& dataPathnpbar(dataPath0 +
"/rawnpbarFS.dat");
264 const G4String& dataPathppbark(dataPath0 +
"/rawppbarFSkaonic.dat");
265 const G4String& dataPathnpbark(dataPath0 +
"/rawnpbarFSkaonic.dat");
267 Config const *theConfig=theNucleus->getStore()->getConfig();
271 const std::string& dataPathppbar(path +
"/rawppbarFS.dat");
272 INCL_DEBUG(
"Reading https://doi.org/10.1016/0375-9474(92)90362-N ppbar final states" << dataPathppbar <<
'\n');
273 const std::string& dataPathnpbar(path +
"/rawnpbarFS.dat");
274 INCL_DEBUG(
"Reading https://doi.org/10.1016/0375-9474(92)90362-N npbar final states" << dataPathnpbar <<
'\n');
275 const std::string& dataPathppbark(path +
"/rawppbarFSkaonic.dat");
276 INCL_DEBUG(
"Reading https://doi.org/10.1016/j.physrep.2005.03.002 ppbar kaonic final states" << dataPathppbark <<
'\n');
277 const std::string& dataPathnpbark(path +
"/rawnpbarFSkaonic.dat");
278 INCL_DEBUG(
"Reading https://doi.org/10.1007/BF02818764 and https://link.springer.com/article/10.1007/BF02754930 npbar kaonic final states" << dataPathnpbark <<
'\n');
291 std::vector<G4double> probabilities;
292 std::vector<std::vector<std::string>> particle_types;
297 G4int z = theNucleus->getZ();
298 G4int a = theNucleus->getA();
300 if(isProton ==
true){z++;}
307 if(isProton ==
true){
309 if(rdm < (1.-kaonicFSprob)){
310 INCL_DEBUG(
"pionic pp final state chosen" <<
'\n');
311 sum =
read_file(dataPathppbar, probabilities, particle_types);
312 rdm = (rdm/(1.-kaonicFSprob))*sum;
315 if ( n < 0 )
return starlist;
316 for(
G4int j = 0; j < static_cast<G4int>(particle_types[n].size()); j++){
317 if(particle_types[n][j] ==
"pi0"){
319 starlist.push_back(p);
321 else if(particle_types[n][j] ==
"pi-"){
323 starlist.push_back(p);
325 else if(particle_types[n][j] ==
"pi+"){
327 starlist.push_back(p);
329 else if(particle_types[n][j] ==
"omega"){
331 starlist.push_back(p);
333 else if(particle_types[n][j] ==
"eta"){
335 starlist.push_back(p);
337 else if(particle_types[n][j] ==
"rho-"){
339 starlist.push_back(p);
341 starlist.push_back(pp);
343 else if(particle_types[n][j] ==
"rho+"){
345 starlist.push_back(p);
347 starlist.push_back(pp);
349 else if(particle_types[n][j] ==
"rho0"){
351 starlist.push_back(p);
353 starlist.push_back(pp);
356 INCL_ERROR(
"Some non-existing FS particle detected when reading pbar FS files");
357 for(
G4int jj = 0; jj < static_cast<G4int>(particle_types[n].size()); jj++){
358 std::cout <<
"gotcha! " << particle_types[n][jj] << std::endl;
360 std::cout <<
"Some non-existing FS particle detected when reading pbar FS files" << std::endl;
365 INCL_DEBUG(
"kaonic pp final state chosen" <<
'\n');
366 sum =
read_file(dataPathppbark, probabilities, particle_types);
367 rdm = ((1-rdm)/kaonicFSprob)*sum;
370 if ( n < 0 )
return starlist;
371 for(
G4int j = 0; j < static_cast<G4int>(particle_types[n].size()); j++){
372 if(particle_types[n][j] ==
"pi0"){
374 starlist.push_back(p);
376 else if(particle_types[n][j] ==
"pi-"){
378 starlist.push_back(p);
380 else if(particle_types[n][j] ==
"pi+"){
382 starlist.push_back(p);
384 else if(particle_types[n][j] ==
"omega"){
386 starlist.push_back(p);
388 else if(particle_types[n][j] ==
"eta"){
390 starlist.push_back(p);
392 else if(particle_types[n][j] ==
"K-"){
394 starlist.push_back(p);
396 else if(particle_types[n][j] ==
"K+"){
398 starlist.push_back(p);
400 else if(particle_types[n][j] ==
"K0"){
402 starlist.push_back(p);
404 else if(particle_types[n][j] ==
"K0b"){
406 starlist.push_back(p);
409 INCL_ERROR(
"Some non-existing FS particle detected when reading pbar FS files");
410 for(
G4int jj = 0; jj < static_cast<G4int>(particle_types[n].size()); jj++){
411 std::cout <<
"gotcha! " << particle_types[n][jj] << std::endl;
413 std::cout <<
"Some non-existing FS particle detected when reading pbar FS files" << std::endl;
420 if(rdm < (1.-kaonicFSprob)){
421 INCL_DEBUG(
"pionic np final state chosen" <<
'\n');
422 sum =
read_file(dataPathnpbar, probabilities, particle_types);
423 rdm = (rdm/(1.-kaonicFSprob))*sum;
426 if ( n < 0 )
return starlist;
427 for(
G4int j = 0; j < static_cast<G4int>(particle_types[n].size()); j++){
428 if(particle_types[n][j] ==
"pi0"){
430 starlist.push_back(p);
432 else if(particle_types[n][j] ==
"pi-"){
434 starlist.push_back(p);
436 else if(particle_types[n][j] ==
"pi+"){
438 starlist.push_back(p);
440 else if(particle_types[n][j] ==
"omega"){
442 starlist.push_back(p);
444 else if(particle_types[n][j] ==
"eta"){
446 starlist.push_back(p);
448 else if(particle_types[n][j] ==
"rho-"){
450 starlist.push_back(p);
452 starlist.push_back(pp);
454 else if(particle_types[n][j] ==
"rho+"){
456 starlist.push_back(p);
458 starlist.push_back(pp);
460 else if(particle_types[n][j] ==
"rho0"){
462 starlist.push_back(p);
464 starlist.push_back(pp);
467 INCL_ERROR(
"Some non-existing FS particle detected when reading pbar FS files");
468 for(
G4int jj = 0; jj < static_cast<G4int>(particle_types[n].size()); jj++){
469 std::cout <<
"gotcha! " << particle_types[n][jj] << std::endl;
471 std::cout <<
"Some non-existing FS particle detected when reading pbar FS files" << std::endl;
476 INCL_DEBUG(
"kaonic np final state chosen" <<
'\n');
477 sum =
read_file(dataPathnpbark, probabilities, particle_types);
478 rdm = ((1-rdm)/kaonicFSprob)*sum;
481 if ( n < 0 )
return starlist;
482 for(
G4int j = 0; j < static_cast<G4int>(particle_types[n].size()); j++){
483 if(particle_types[n][j] ==
"pi0"){
485 starlist.push_back(p);
487 else if(particle_types[n][j] ==
"pi-"){
489 starlist.push_back(p);
491 else if(particle_types[n][j] ==
"pi+"){
493 starlist.push_back(p);
495 else if(particle_types[n][j] ==
"omega"){
497 starlist.push_back(p);
499 else if(particle_types[n][j] ==
"eta"){
501 starlist.push_back(p);
503 else if(particle_types[n][j] ==
"K-"){
505 starlist.push_back(p);
507 else if(particle_types[n][j] ==
"K+"){
509 starlist.push_back(p);
511 else if(particle_types[n][j] ==
"K0"){
513 starlist.push_back(p);
515 else if(particle_types[n][j] ==
"K0b"){
517 starlist.push_back(p);
520 INCL_ERROR(
"Some non-existing FS particle detected when reading pbar FS files");
521 for(
G4int jj = 0; jj < static_cast<G4int>(particle_types[n].size()); jj++){
522 std::cout <<
"gotcha! " << particle_types[n][jj] << std::endl;
524 std::cout <<
"Some non-existing FS particle detected when reading pbar FS files" << std::endl;
531 G4int stra = theNucleus->getS();
533 if(theNucleus->isNucleusNucleusCollision()==
false){
534 if(isProton ==
true){
542 }
else if(theNucleus->isNucleusNucleusCollision()==
true){
547 if(starlist.size() < 2){
548 INCL_ERROR(
"should never happen, at least 2 final state particles!" <<
'\n');
550 else if(starlist.size() == 2){
555 G4double s = energyOfMesonStar*energyOfMesonStar;
556 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));
558 (*first)->setMomentum(momentello);
559 (*first)->adjustEnergyFromMomentum();
560 (*last)->setMomentum(-momentello);
561 (*last)->adjustEnergyFromMomentum();