249 {
250
251
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, ...",
260 }
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");
266 #else
267 Config const *theConfig=theNucleus->getStore()->getConfig();
268 std::string path;
269 if(theConfig)
270 path = theConfig->getINCLXXDataFilePath();
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');
279 #endif
280
281
282
283
284
285
286
287
288
289
290
291 std::vector<G4double> probabilities;
292 std::vector<std::vector<std::string>> particle_types;
295
297 G4int z = theNucleus->getZ();
298 G4int a = theNucleus->getA();
299 a++;
300 if(isProton == true){z++;}
301 ThreeVector annihilationPosition;
303 ThreeVector mommy;
304
305
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;
313
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"){
318 Particle *p =
new Particle(
PiZero, mommy, annihilationPosition);
319 starlist.push_back(p);
320 }
321 else if(particle_types[n][j] == "pi-"){
322 Particle *p =
new Particle(
PiMinus, mommy, annihilationPosition);
323 starlist.push_back(p);
324 }
325 else if(particle_types[n][j] == "pi+"){
326 Particle *p =
new Particle(
PiPlus, mommy, annihilationPosition);
327 starlist.push_back(p);
328 }
329 else if(particle_types[n][j] == "omega"){
330 Particle *p =
new Particle(
Omega, mommy, annihilationPosition);
331 starlist.push_back(p);
332 }
333 else if(particle_types[n][j] == "eta"){
334 Particle *p =
new Particle(
Eta, mommy, annihilationPosition);
335 starlist.push_back(p);
336 }
337 else if(particle_types[n][j] == "rho-"){
338 Particle *p =
new Particle(
PiMinus, mommy, annihilationPosition);
339 starlist.push_back(p);
340 Particle *
pp =
new Particle(
PiZero, mommy, annihilationPosition);
341 starlist.push_back(pp);
342 }
343 else if(particle_types[n][j] == "rho+"){
344 Particle *p =
new Particle(
PiPlus, mommy, annihilationPosition);
345 starlist.push_back(p);
346 Particle *
pp =
new Particle(
PiZero, mommy, annihilationPosition);
347 starlist.push_back(pp);
348 }
349 else if(particle_types[n][j] == "rho0"){
350 Particle *p =
new Particle(
PiMinus, mommy, annihilationPosition);
351 starlist.push_back(p);
352 Particle *
pp =
new Particle(
PiPlus, mommy, annihilationPosition);
353 starlist.push_back(pp);
354 }
355 else{
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;
359 }
360 std::cout << "Some non-existing FS particle detected when reading pbar FS files" << std::endl;
361 }
362 }
363 }
364 else{
365 INCL_DEBUG(
"kaonic pp final state chosen" <<
'\n');
366 sum =
read_file(dataPathppbark, probabilities, particle_types);
367 rdm = ((1-rdm)/kaonicFSprob)*sum;
368
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"){
373 Particle *p =
new Particle(
PiZero, mommy, annihilationPosition);
374 starlist.push_back(p);
375 }
376 else if(particle_types[n][j] == "pi-"){
377 Particle *p =
new Particle(
PiMinus, mommy, annihilationPosition);
378 starlist.push_back(p);
379 }
380 else if(particle_types[n][j] == "pi+"){
381 Particle *p =
new Particle(
PiPlus, mommy, annihilationPosition);
382 starlist.push_back(p);
383 }
384 else if(particle_types[n][j] == "omega"){
385 Particle *p =
new Particle(
Omega, mommy, annihilationPosition);
386 starlist.push_back(p);
387 }
388 else if(particle_types[n][j] == "eta"){
389 Particle *p =
new Particle(
Eta, mommy, annihilationPosition);
390 starlist.push_back(p);
391 }
392 else if(particle_types[n][j] == "K-"){
393 Particle *p =
new Particle(
KMinus, mommy, annihilationPosition);
394 starlist.push_back(p);
395 }
396 else if(particle_types[n][j] == "K+"){
397 Particle *p =
new Particle(
KPlus, mommy, annihilationPosition);
398 starlist.push_back(p);
399 }
400 else if(particle_types[n][j] == "K0"){
401 Particle *p =
new Particle(
KZero, mommy, annihilationPosition);
402 starlist.push_back(p);
403 }
404 else if(particle_types[n][j] == "K0b"){
405 Particle *p =
new Particle(
KZeroBar, mommy, annihilationPosition);
406 starlist.push_back(p);
407 }
408 else{
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;
412 }
413 std::cout << "Some non-existing FS particle detected when reading pbar FS files" << std::endl;
414 }
415 }
416 }
417 }
418 else{
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;
424
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"){
429 Particle *p =
new Particle(
PiZero, mommy, annihilationPosition);
430 starlist.push_back(p);
431 }
432 else if(particle_types[n][j] == "pi-"){
433 Particle *p =
new Particle(
PiMinus, mommy, annihilationPosition);
434 starlist.push_back(p);
435 }
436 else if(particle_types[n][j] == "pi+"){
437 Particle *p =
new Particle(
PiPlus, mommy, annihilationPosition);
438 starlist.push_back(p);
439 }
440 else if(particle_types[n][j] == "omega"){
441 Particle *p =
new Particle(
Omega, mommy, annihilationPosition);
442 starlist.push_back(p);
443 }
444 else if(particle_types[n][j] == "eta"){
445 Particle *p =
new Particle(
Eta, mommy, annihilationPosition);
446 starlist.push_back(p);
447 }
448 else if(particle_types[n][j] == "rho-"){
449 Particle *p =
new Particle(
PiMinus, mommy, annihilationPosition);
450 starlist.push_back(p);
451 Particle *
pp =
new Particle(
PiZero, mommy, annihilationPosition);
452 starlist.push_back(pp);
453 }
454 else if(particle_types[n][j] == "rho+"){
455 Particle *p =
new Particle(
PiPlus, mommy, annihilationPosition);
456 starlist.push_back(p);
457 Particle *
pp =
new Particle(
PiZero, mommy, annihilationPosition);
458 starlist.push_back(pp);
459 }
460 else if(particle_types[n][j] == "rho0"){
461 Particle *p =
new Particle(
PiMinus, mommy, annihilationPosition);
462 starlist.push_back(p);
463 Particle *
pp =
new Particle(
PiPlus, mommy, annihilationPosition);
464 starlist.push_back(pp);
465 }
466 else{
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;
470 }
471 std::cout << "Some non-existing FS particle detected when reading pbar FS files" << std::endl;
472 }
473 }
474 }
475 else{
476 INCL_DEBUG(
"kaonic np final state chosen" <<
'\n');
477 sum =
read_file(dataPathnpbark, probabilities, particle_types);
478 rdm = ((1-rdm)/kaonicFSprob)*sum;
479
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"){
484 Particle *p =
new Particle(
PiZero, mommy, annihilationPosition);
485 starlist.push_back(p);
486 }
487 else if(particle_types[n][j] == "pi-"){
488 Particle *p =
new Particle(
PiMinus, mommy, annihilationPosition);
489 starlist.push_back(p);
490 }
491 else if(particle_types[n][j] == "pi+"){
492 Particle *p =
new Particle(
PiPlus, mommy, annihilationPosition);
493 starlist.push_back(p);
494 }
495 else if(particle_types[n][j] == "omega"){
496 Particle *p =
new Particle(
Omega, mommy, annihilationPosition);
497 starlist.push_back(p);
498 }
499 else if(particle_types[n][j] == "eta"){
500 Particle *p =
new Particle(
Eta, mommy, annihilationPosition);
501 starlist.push_back(p);
502 }
503 else if(particle_types[n][j] == "K-"){
504 Particle *p =
new Particle(
KMinus, mommy, annihilationPosition);
505 starlist.push_back(p);
506 }
507 else if(particle_types[n][j] == "K+"){
508 Particle *p =
new Particle(
KPlus, mommy, annihilationPosition);
509 starlist.push_back(p);
510 }
511 else if(particle_types[n][j] == "K0"){
512 Particle *p =
new Particle(
KZero, mommy, annihilationPosition);
513 starlist.push_back(p);
514 }
515 else if(particle_types[n][j] == "K0b"){
516 Particle *p =
new Particle(
KZeroBar, mommy, annihilationPosition);
517 starlist.push_back(p);
518 }
519 else{
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;
523 }
524 std::cout << "Some non-existing FS particle detected when reading pbar FS files" << std::endl;
525 }
526 }
527 }
528 }
529
530
531 G4int stra = theNucleus->getS();
533 if(theNucleus->isNucleusNucleusCollision()==false){
534 if(isProton == true){
537 }
538 else{
541 }
542 } else if(theNucleus->isNucleusNucleusCollision()==true){
543 return starlist;
544 }
545
546
547 if(starlist.size() < 2){
548 INCL_ERROR(
"should never happen, at least 2 final state particles!" <<
'\n');
549 }
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();
562
563 }
564 else{
566
567
568
569
570 }
571
572 return starlist;
573 }
const char * G4FindDataDir(const char *)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
G4double read_file(std::string filename, std::vector< G4double > &probabilities, std::vector< std::vector< std::string > > &particle_types)
G4int findStringNumber(G4double rdm, std::vector< G4double > yields)
G4ThreadLocal NuclearMassFn getTableMass
Static pointer to the mass function for nuclei.
void generate(const G4double sqrtS, ParticleList &particles)
Generate an event in the CM system.
ThreeVector normVector(G4double norm=1.)
std::vector< Base * > ParticleList