257 {
258
259 #ifdef INCLXX_IN_GEANT4_MODE
262 ed << " Data missing: set environment variable G4INCLDATA\n"
263 << " to point to the directory containing data files needed\n"
264 <<
" by the INCL++ model" <<
G4endl;
265 G4Exception(
"G4INCLDataFile::readData()",
"rawppbarFS.dat, ...",
267 }
269 G4String dataPathnbarp(dataPath0 + "/rawnbarpFS.dat");
270 G4String dataPathnbarn(dataPath0 + "/rawnbarnFS.dat");
271 G4String dataPathnbarnk(dataPath0 + "/rawppbarFSkaonic.dat");
272 G4String dataPathnbarpk(dataPath0 + "/rawnbarpFSkaonic.dat");
273 #else
274 Config const *theConfig=theNucleus->getStore()->getConfig();
275 std::string path;
276 if(theConfig)
277 path = theConfig->getINCLXXDataFilePath();
278 std::string dataPathnbarn(path + "/rawnbarnFS.dat");
279 INCL_DEBUG(
"Reading nbarn final states" << dataPathnbarn <<
'\n');
280 std::string dataPathnbarp(path + "/rawnbarpFS.dat");
281 INCL_DEBUG(
"Reading nbarp final states" << dataPathnbarp <<
'\n');
282 std::string dataPathnbarnk(path + "/rawppbarFSkaonic.dat");
283 INCL_DEBUG(
"Reading nbarn kaonic final states" << dataPathnbarnk <<
'\n');
284 std::string dataPathnbarpk(path + "/rawnbarpFSkaonic.dat");
285 INCL_DEBUG(
"Reading nbarp kaonic final states" << dataPathnbarpk <<
'\n');
286 #endif
287
288 std::vector<G4double> probabilities;
289 std::vector<std::vector<std::string>> particle_types;
290
293
295 G4int z = theNucleus->getZ();
296 G4int a = theNucleus->getA();
297 a++;
298 if(isProton == true){z++;}
299 ThreeVector annihilationPosition;
301 ThreeVector mommy;
302
303
305 if(isProton == true){
307 if(rdm < (1.-kaonicFSprob)){
308 INCL_DEBUG(
"pionic pp final state chosen" <<
'\n');
309 sum =
read_file(dataPathnbarp, probabilities, particle_types);
310 rdm = (rdm/(1.-kaonicFSprob))*sum;
311
313 if ( n < 0 ) return starlist;
314 for(
G4int j = 0; j < static_cast<G4int>(particle_types[n].size()); j++){
315 if(particle_types[n][j] == "pi0"){
316 Particle *p =
new Particle(
PiZero, mommy, annihilationPosition);
317 starlist.push_back(p);
318 }
319 else if(particle_types[n][j] == "pi-"){
320 Particle *p =
new Particle(
PiMinus, mommy, annihilationPosition);
321 starlist.push_back(p);
322 }
323 else if(particle_types[n][j] == "pi+"){
324 Particle *p =
new Particle(
PiPlus, mommy, annihilationPosition);
325 starlist.push_back(p);
326 }
327 else if(particle_types[n][j] == "omega"){
328 Particle *p =
new Particle(
Omega, mommy, annihilationPosition);
329 starlist.push_back(p);
330 }
331 else if(particle_types[n][j] == "eta"){
332 Particle *p =
new Particle(
Eta, mommy, annihilationPosition);
333 starlist.push_back(p);
334 }
335 else if(particle_types[n][j] == "rho-"){
336 Particle *p =
new Particle(
PiMinus, mommy, annihilationPosition);
337 starlist.push_back(p);
338 Particle *
pp =
new Particle(
PiZero, mommy, annihilationPosition);
339 starlist.push_back(pp);
340 }
341 else if(particle_types[n][j] == "rho+"){
342 Particle *p =
new Particle(
PiPlus, mommy, annihilationPosition);
343 starlist.push_back(p);
344 Particle *
pp =
new Particle(
PiZero, mommy, annihilationPosition);
345 starlist.push_back(pp);
346 }
347 else if(particle_types[n][j] == "rho0"){
348 Particle *p =
new Particle(
PiMinus, mommy, annihilationPosition);
349 starlist.push_back(p);
350 Particle *
pp =
new Particle(
PiPlus, mommy, annihilationPosition);
351 starlist.push_back(pp);
352 }
353 else{
354 INCL_ERROR(
"Some non-existing FS particle detected when reading pbar FS files");
355 for(
G4int jj = 0; jj < static_cast<G4int>(particle_types[n].size()); jj++){
356 std::cout <<
"gotcha! " << particle_types[
n][jj] << std::endl;
357 }
358 std::cout << "Some non-existing FS particle detected when reading pbar FS files" << std::endl;
359 }
360 }
361 }
362 else{
363 INCL_DEBUG(
"kaonic pp final state chosen" <<
'\n');
364 sum =
read_file(dataPathnbarpk, probabilities, particle_types);
365 rdm = ((1-rdm)/kaonicFSprob)*sum;
366
368 if ( n < 0 ) return starlist;
369 for(
G4int j = 0; j < static_cast<G4int>(particle_types[n].size()); j++){
370 if(particle_types[n][j] == "pi0"){
371 Particle *p =
new Particle(
PiZero, mommy, annihilationPosition);
372 starlist.push_back(p);
373 }
374 else if(particle_types[n][j] == "pi-"){
375 Particle *p =
new Particle(
PiMinus, mommy, annihilationPosition);
376 starlist.push_back(p);
377 }
378 else if(particle_types[n][j] == "pi+"){
379 Particle *p =
new Particle(
PiPlus, mommy, annihilationPosition);
380 starlist.push_back(p);
381 }
382 else if(particle_types[n][j] == "omega"){
383 Particle *p =
new Particle(
Omega, mommy, annihilationPosition);
384 starlist.push_back(p);
385 }
386 else if(particle_types[n][j] == "eta"){
387 Particle *p =
new Particle(
Eta, mommy, annihilationPosition);
388 starlist.push_back(p);
389 }
390 else if(particle_types[n][j] == "K-"){
391 Particle *p =
new Particle(
KMinus, mommy, annihilationPosition);
392 starlist.push_back(p);
393 }
394 else if(particle_types[n][j] == "K+"){
395 Particle *p =
new Particle(
KPlus, mommy, annihilationPosition);
396 starlist.push_back(p);
397 }
398 else if(particle_types[n][j] == "K0"){
399 Particle *p =
new Particle(
KZero, mommy, annihilationPosition);
400 starlist.push_back(p);
401 }
402 else if(particle_types[n][j] == "K0b"){
403 Particle *p =
new Particle(
KZeroBar, mommy, annihilationPosition);
404 starlist.push_back(p);
405 }
406 else{
407 INCL_ERROR(
"Some non-existing FS particle detected when reading pbar FS files");
408 for(
G4int jj = 0; jj < static_cast<G4int>(particle_types[n].size()); jj++){
409 std::cout <<
"gotcha! " << particle_types[
n][jj] << std::endl;
410 }
411 std::cout << "Some non-existing FS particle detected when reading pbar FS files" << std::endl;
412 }
413 }
414 }
415 }
416 else{
418 if(rdm < (1.-kaonicFSprob)){
419 INCL_DEBUG(
"pionic np final state chosen" <<
'\n');
420 sum =
read_file(dataPathnbarn, probabilities, particle_types);
421 rdm = (rdm/(1.-kaonicFSprob))*sum;
422
424 if ( n < 0 ) return starlist;
425 for(
G4int j = 0; j < static_cast<G4int>(particle_types[n].size()); j++){
426 if(particle_types[n][j] == "pi0"){
427 Particle *p =
new Particle(
PiZero, mommy, annihilationPosition);
428 starlist.push_back(p);
429 }
430 else if(particle_types[n][j] == "pi-"){
431 Particle *p =
new Particle(
PiMinus, mommy, annihilationPosition);
432 starlist.push_back(p);
433 }
434 else if(particle_types[n][j] == "pi+"){
435 Particle *p =
new Particle(
PiPlus, mommy, annihilationPosition);
436 starlist.push_back(p);
437 }
438 else if(particle_types[n][j] == "omega"){
439 Particle *p =
new Particle(
Omega, mommy, annihilationPosition);
440 starlist.push_back(p);
441 }
442 else if(particle_types[n][j] == "eta"){
443 Particle *p =
new Particle(
Eta, mommy, annihilationPosition);
444 starlist.push_back(p);
445 }
446 else if(particle_types[n][j] == "rho-"){
447 Particle *p =
new Particle(
PiMinus, mommy, annihilationPosition);
448 starlist.push_back(p);
449 Particle *
pp =
new Particle(
PiZero, mommy, annihilationPosition);
450 starlist.push_back(pp);
451 }
452 else if(particle_types[n][j] == "rho+"){
453 Particle *p =
new Particle(
PiPlus, mommy, annihilationPosition);
454 starlist.push_back(p);
455 Particle *
pp =
new Particle(
PiZero, mommy, annihilationPosition);
456 starlist.push_back(pp);
457 }
458 else if(particle_types[n][j] == "rho0"){
459 Particle *p =
new Particle(
PiMinus, mommy, annihilationPosition);
460 starlist.push_back(p);
461 Particle *
pp =
new Particle(
PiPlus, mommy, annihilationPosition);
462 starlist.push_back(pp);
463 }
464 else{
465 INCL_ERROR(
"Some non-existing FS particle detected when reading pbar FS files");
466 for(
G4int jj = 0; jj < static_cast<G4int>(particle_types[n].size()); jj++){
467 std::cout <<
"gotcha! " << particle_types[
n][jj] << std::endl;
468 }
469 std::cout << "Some non-existing FS particle detected when reading pbar FS files" << std::endl;
470 }
471 }
472 }
473 else{
474 INCL_DEBUG(
"kaonic np final state chosen" <<
'\n');
475 sum =
read_file(dataPathnbarnk, probabilities, particle_types);
476 rdm = ((1-rdm)/kaonicFSprob)*sum;
477
479 if ( n < 0 ) return starlist;
480 for(
G4int j = 0; j < static_cast<G4int>(particle_types[n].size()); j++){
481 if(particle_types[n][j] == "pi0"){
482 Particle *p =
new Particle(
PiZero, mommy, annihilationPosition);
483 starlist.push_back(p);
484 }
485 else if(particle_types[n][j] == "pi-"){
486 Particle *p =
new Particle(
PiMinus, mommy, annihilationPosition);
487 starlist.push_back(p);
488 }
489 else if(particle_types[n][j] == "pi+"){
490 Particle *p =
new Particle(
PiPlus, mommy, annihilationPosition);
491 starlist.push_back(p);
492 }
493 else if(particle_types[n][j] == "omega"){
494 Particle *p =
new Particle(
Omega, mommy, annihilationPosition);
495 starlist.push_back(p);
496 }
497 else if(particle_types[n][j] == "eta"){
498 Particle *p =
new Particle(
Eta, mommy, annihilationPosition);
499 starlist.push_back(p);
500 }
501 else if(particle_types[n][j] == "K-"){
502 Particle *p =
new Particle(
KMinus, mommy, annihilationPosition);
503 starlist.push_back(p);
504 }
505 else if(particle_types[n][j] == "K+"){
506 Particle *p =
new Particle(
KPlus, mommy, annihilationPosition);
507 starlist.push_back(p);
508 }
509 else if(particle_types[n][j] == "K0"){
510 Particle *p =
new Particle(
KZero, mommy, annihilationPosition);
511 starlist.push_back(p);
512 }
513 else if(particle_types[n][j] == "K0b"){
514 Particle *p =
new Particle(
KZeroBar, mommy, annihilationPosition);
515 starlist.push_back(p);
516 }
517 else{
518 INCL_ERROR(
"Some non-existing FS particle detected when reading pbar FS files");
519 for(
G4int jj = 0; jj < static_cast<G4int>(particle_types[n].size()); jj++){
520 std::cout <<
"gotcha! " << particle_types[
n][jj] << std::endl;
521 }
522 std::cout << "Some non-existing FS particle detected when reading pbar FS files" << std::endl;
523 }
524 }
525 }
526 }
527
528
529 G4int stra = theNucleus->getS();
531 if(theNucleus->isNucleusNucleusCollision()==false){
532 if(isProton == true){
535 }
536 else{
539 }
540 } else if(theNucleus->isNucleusNucleusCollision()==true){
541 return starlist;
542 }
543
544
545 if(starlist.size() < 2){
546 INCL_ERROR(
"should never happen, at least 2 final state particles!" <<
'\n');
547 }
548 else if(starlist.size() == 2){
553 G4double s = energyOfMesonStar*energyOfMesonStar;
554 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));
556 (*first)->setMomentum(momentello);
557 (*first)->adjustEnergyFromMomentum();
558 (*last)->setMomentum(-momentello);
559 (*last)->adjustEnergyFromMomentum();
560
561 }
562 else{
564
565
566
567
568 }
569
570 return starlist;
571 }
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