243 {
244
245
246 #ifdef INCLXX_IN_GEANT4_MODE
249 ed << " Data missing: set environment variable G4INCLDATA\n"
250 << " to point to the directory containing data files needed\n"
251 <<
" by the INCL++ model" <<
G4endl;
252 G4Exception(
"G4INCLDataFile::readData()",
"rawppbarFS.dat, ...",
254 }
256 G4String dataPathppbar(dataPath0 +
"/rawppbarFS.dat");
257 G4String dataPathnpbar(dataPath0 +
"/rawnpbarFS.dat");
258 G4String dataPathppbark(dataPath0 +
"/rawppbarFSkaonic.dat");
259 G4String dataPathnpbark(dataPath0 +
"/rawnpbarFSkaonic.dat");
260 #else
262 std::string path;
263 if(theConfig)
264 path = theConfig->getINCLXXDataFilePath();
265 std::string dataPathppbar(path + "/rawppbarFS.dat");
266 INCL_DEBUG(
"Reading https://doi.org/10.1016/0375-9474(92)90362-N ppbar final states" << dataPathppbar <<
'\n');
267 std::string dataPathnpbar(path + "/rawnpbarFS.dat");
268 INCL_DEBUG(
"Reading https://doi.org/10.1016/0375-9474(92)90362-N npbar final states" << dataPathnpbar <<
'\n');
269 std::string dataPathppbark(path + "/rawppbarFSkaonic.dat");
270 INCL_DEBUG(
"Reading https://doi.org/10.1016/j.physrep.2005.03.002 ppbar kaonic final states" << dataPathppbark <<
'\n');
271 std::string dataPathnpbark(path + "/rawnpbarFSkaonic.dat");
272 INCL_DEBUG(
"Reading https://doi.org/10.1007/BF02818764 and https://link.springer.com/article/10.1007/BF02754930 npbar kaonic final states" << dataPathnpbark <<
'\n');
273 #endif
274
275
276
277
278
279
280
281
282
283
284
285 std::vector<G4double> probabilities;
286 std::vector<std::vector<std::string>> particle_types;
289
293 a++;
294 if(isProton == true){z++;}
295 ThreeVector annihilationPosition;
296 ParticleList starlist;
297 ThreeVector mommy;
298
299
301 if(isProton == true){
303 if(rdm < (1.-kaonicFSprob)){
304 INCL_DEBUG(
"pionic pp final state chosen" <<
'\n');
305 sum =
read_file(dataPathppbar, probabilities, particle_types);
306 rdm = (rdm/(1.-kaonicFSprob))*sum;
307
309 if ( n < 0 ) return starlist;
310 for(
G4int j = 0; j < static_cast<G4int>(particle_types[n].size()); j++){
311 if(particle_types[n][j] == "pi0"){
312 Particle *p =
new Particle(
PiZero, mommy, annihilationPosition);
313 starlist.push_back(p);
314 }
315 else if(particle_types[n][j] == "pi-"){
316 Particle *p =
new Particle(
PiMinus, mommy, annihilationPosition);
317 starlist.push_back(p);
318 }
319 else if(particle_types[n][j] == "pi+"){
320 Particle *p =
new Particle(
PiPlus, mommy, annihilationPosition);
321 starlist.push_back(p);
322 }
323 else if(particle_types[n][j] == "omega"){
324 Particle *p =
new Particle(
Omega, mommy, annihilationPosition);
325 starlist.push_back(p);
326 }
327 else if(particle_types[n][j] == "eta"){
328 Particle *p =
new Particle(
Eta, mommy, annihilationPosition);
329 starlist.push_back(p);
330 }
331 else if(particle_types[n][j] == "rho-"){
332 Particle *p =
new Particle(
PiMinus, mommy, annihilationPosition);
333 starlist.push_back(p);
334 Particle *
pp =
new Particle(
PiZero, mommy, annihilationPosition);
335 starlist.push_back(pp);
336 }
337 else if(particle_types[n][j] == "rho+"){
338 Particle *p =
new Particle(
PiPlus, 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] == "rho0"){
344 Particle *p =
new Particle(
PiMinus, mommy, annihilationPosition);
345 starlist.push_back(p);
346 Particle *
pp =
new Particle(
PiPlus, mommy, annihilationPosition);
347 starlist.push_back(pp);
348 }
349 else{
350 INCL_ERROR(
"Some non-existing FS particle detected when reading pbar FS files");
351 for(
G4int jj = 0; jj < static_cast<G4int>(particle_types[n].size()); jj++){
352 std::cout <<
"gotcha! " << particle_types[
n][jj] << std::endl;
353 }
354 std::cout << "Some non-existing FS particle detected when reading pbar FS files" << std::endl;
355 }
356 }
357 }
358 else{
359 INCL_DEBUG(
"kaonic pp final state chosen" <<
'\n');
360 sum =
read_file(dataPathppbark, probabilities, particle_types);
361 rdm = ((1-rdm)/kaonicFSprob)*sum;
362
364 if ( n < 0 ) return starlist;
365 for(
G4int j = 0; j < static_cast<G4int>(particle_types[n].size()); j++){
366 if(particle_types[n][j] == "pi0"){
367 Particle *p =
new Particle(
PiZero, mommy, annihilationPosition);
368 starlist.push_back(p);
369 }
370 else if(particle_types[n][j] == "pi-"){
371 Particle *p =
new Particle(
PiMinus, mommy, annihilationPosition);
372 starlist.push_back(p);
373 }
374 else if(particle_types[n][j] == "pi+"){
375 Particle *p =
new Particle(
PiPlus, mommy, annihilationPosition);
376 starlist.push_back(p);
377 }
378 else if(particle_types[n][j] == "omega"){
379 Particle *p =
new Particle(
Omega, mommy, annihilationPosition);
380 starlist.push_back(p);
381 }
382 else if(particle_types[n][j] == "eta"){
383 Particle *p =
new Particle(
Eta, mommy, annihilationPosition);
384 starlist.push_back(p);
385 }
386 else if(particle_types[n][j] == "K-"){
387 Particle *p =
new Particle(
KMinus, mommy, annihilationPosition);
388 starlist.push_back(p);
389 }
390 else if(particle_types[n][j] == "K+"){
391 Particle *p =
new Particle(
KPlus, mommy, annihilationPosition);
392 starlist.push_back(p);
393 }
394 else if(particle_types[n][j] == "K0"){
395 Particle *p =
new Particle(
KZero, mommy, annihilationPosition);
396 starlist.push_back(p);
397 }
398 else if(particle_types[n][j] == "K0b"){
399 Particle *p =
new Particle(
KZeroBar, mommy, annihilationPosition);
400 starlist.push_back(p);
401 }
402 else{
403 INCL_ERROR(
"Some non-existing FS particle detected when reading pbar FS files");
404 for(
G4int jj = 0; jj < static_cast<G4int>(particle_types[n].size()); jj++){
405 std::cout <<
"gotcha! " << particle_types[
n][jj] << std::endl;
406 }
407 std::cout << "Some non-existing FS particle detected when reading pbar FS files" << std::endl;
408 }
409 }
410 }
411 }
412 else{
414 if(rdm < (1.-kaonicFSprob)){
415 INCL_DEBUG(
"pionic np final state chosen" <<
'\n');
416 sum =
read_file(dataPathnpbar, probabilities, particle_types);
417 rdm = (rdm/(1.-kaonicFSprob))*sum;
418
420 if ( n < 0 ) return starlist;
421 for(
G4int j = 0; j < static_cast<G4int>(particle_types[n].size()); j++){
422 if(particle_types[n][j] == "pi0"){
423 Particle *p =
new Particle(
PiZero, mommy, annihilationPosition);
424 starlist.push_back(p);
425 }
426 else if(particle_types[n][j] == "pi-"){
427 Particle *p =
new Particle(
PiMinus, mommy, annihilationPosition);
428 starlist.push_back(p);
429 }
430 else if(particle_types[n][j] == "pi+"){
431 Particle *p =
new Particle(
PiPlus, mommy, annihilationPosition);
432 starlist.push_back(p);
433 }
434 else if(particle_types[n][j] == "omega"){
435 Particle *p =
new Particle(
Omega, mommy, annihilationPosition);
436 starlist.push_back(p);
437 }
438 else if(particle_types[n][j] == "eta"){
439 Particle *p =
new Particle(
Eta, mommy, annihilationPosition);
440 starlist.push_back(p);
441 }
442 else if(particle_types[n][j] == "rho-"){
443 Particle *p =
new Particle(
PiMinus, mommy, annihilationPosition);
444 starlist.push_back(p);
445 Particle *
pp =
new Particle(
PiZero, mommy, annihilationPosition);
446 starlist.push_back(pp);
447 }
448 else if(particle_types[n][j] == "rho+"){
449 Particle *p =
new Particle(
PiPlus, 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] == "rho0"){
455 Particle *p =
new Particle(
PiMinus, mommy, annihilationPosition);
456 starlist.push_back(p);
457 Particle *
pp =
new Particle(
PiPlus, mommy, annihilationPosition);
458 starlist.push_back(pp);
459 }
460 else{
461 INCL_ERROR(
"Some non-existing FS particle detected when reading pbar FS files");
462 for(
G4int jj = 0; jj < static_cast<G4int>(particle_types[n].size()); jj++){
463 std::cout <<
"gotcha! " << particle_types[
n][jj] << std::endl;
464 }
465 std::cout << "Some non-existing FS particle detected when reading pbar FS files" << std::endl;
466 }
467 }
468 }
469 else{
470 INCL_DEBUG(
"kaonic np final state chosen" <<
'\n');
471 sum =
read_file(dataPathnpbark, probabilities, particle_types);
472 rdm = ((1-rdm)/kaonicFSprob)*sum;
473
475 if ( n < 0 ) return starlist;
476 for(
G4int j = 0; j < static_cast<G4int>(particle_types[n].size()); j++){
477 if(particle_types[n][j] == "pi0"){
478 Particle *p =
new Particle(
PiZero, mommy, annihilationPosition);
479 starlist.push_back(p);
480 }
481 else if(particle_types[n][j] == "pi-"){
482 Particle *p =
new Particle(
PiMinus, mommy, annihilationPosition);
483 starlist.push_back(p);
484 }
485 else if(particle_types[n][j] == "pi+"){
486 Particle *p =
new Particle(
PiPlus, mommy, annihilationPosition);
487 starlist.push_back(p);
488 }
489 else if(particle_types[n][j] == "omega"){
490 Particle *p =
new Particle(
Omega, mommy, annihilationPosition);
491 starlist.push_back(p);
492 }
493 else if(particle_types[n][j] == "eta"){
494 Particle *p =
new Particle(
Eta, mommy, annihilationPosition);
495 starlist.push_back(p);
496 }
497 else if(particle_types[n][j] == "K-"){
498 Particle *p =
new Particle(
KMinus, mommy, annihilationPosition);
499 starlist.push_back(p);
500 }
501 else if(particle_types[n][j] == "K+"){
502 Particle *p =
new Particle(
KPlus, mommy, annihilationPosition);
503 starlist.push_back(p);
504 }
505 else if(particle_types[n][j] == "K0"){
506 Particle *p =
new Particle(
KZero, mommy, annihilationPosition);
507 starlist.push_back(p);
508 }
509 else if(particle_types[n][j] == "K0b"){
510 Particle *p =
new Particle(
KZeroBar, mommy, annihilationPosition);
511 starlist.push_back(p);
512 }
513 else{
514 INCL_ERROR(
"Some non-existing FS particle detected when reading pbar FS files");
515 for(
G4int jj = 0; jj < static_cast<G4int>(particle_types[n].size()); jj++){
516 std::cout <<
"gotcha! " << particle_types[
n][jj] << std::endl;
517 }
518 std::cout << "Some non-existing FS particle detected when reading pbar FS files" << std::endl;
519 }
520 }
521 }
522 }
523
524
528 if(isProton == true){
531 }
532 else{
535 }
536
537
538 if(starlist.size() < 2){
539 INCL_ERROR(
"should never happen, at least 2 final state particles!" <<
'\n');
540 }
541 else if(starlist.size() == 2){
546 G4double s = energyOfMesonStar*energyOfMesonStar;
547 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));
549 (*first)->setMomentum(momentello);
550 (*first)->adjustEnergyFromMomentum();
551 (*last)->setMomentum(-momentello);
552 (*last)->adjustEnergyFromMomentum();
553
554 }
555 else{
557
558
559
560
561 }
562
563 return starlist;
564 }
const char * G4FindDataDir(const char *)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
G4double getEmissionPbarQvalueCorrection(const G4int AParent, const G4int ZParent, const G4bool Victim) const
virtual G4double getTableMass() const
Get the tabulated particle mass.
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)
Config const * getConfig()
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.)