350{
351#ifdef debugPrecoInt
357 G4cout<<
"Directly produced particles number "<<theSecondaries->size()<<
G4endl;
360#endif
361
362
365 G4int numberOfEx = 0;
366 G4int numberOfCh = 0;
367 G4int numberOfHoles = 0;
371
372
375 while(theCurrentNucleon)
376 {
378 ++numberOfHoles;
379 ++numberOfEx;
380 --anA;
382 eplus + 0.1);
385 }
387 }
388
389#ifdef debugPrecoInt
390 G4cout<<
"Residual Target A Z E* 4mom "<<anA<<
" "<<aZ<<
" "<<exEnergy<<
" "
391 <<Target4Momentum<<
G4endl;
392#endif
393
394
395
396 G4bool ProjectileIsAntiNucleus=
398
400
403 G4int numberOfExB = 0;
404 G4int numberOfChB = 0;
405 G4int numberOfHolesB = 0;
409
410
411 theCurrentNucleon =
413 while(theCurrentNucleon)
414 {
416 ++numberOfHolesB;
417 ++numberOfExB;
418 --anAb;
419 if(!ProjectileIsAntiNucleus) {
421 eplus + 0.1);
422 } else {
424 eplus - 0.1);
425 }
427 Projectile4Momentum -=theCurrentNucleon->
Get4Momentum();
428 }
430 }
431
433 0.3*
G4double (numberOfHoles + anA);
435 0.3*
G4double (numberOfHolesB + anAb);
436
437#ifdef debugPrecoInt
438 G4cout<<
"Projectile residual A Z E* 4mom "<<anAb<<
" "<<aZb<<
" "<<exEnergyB<<
" "
439 <<Projectile4Momentum<<
G4endl;
440 G4cout<<
" ExistTargetRemnant ExistProjectileRemnant "
441 <<ExistTargetRemnant<<
" "<< ExistProjectileRemnant<<
G4endl;
442#endif
443
444
447
449
450 #ifdef debugPrecoInt
451 G4cout<<
"Secondary stable particles number "<<theSecondaries->size()<<
G4endl;
452 #endif
453
454#ifdef debugPrecoInt
457#endif
458
459
460 G4KineticTrackVector::iterator iter;
461 for(iter=theSecondaries->begin(); iter !=theSecondaries->end(); ++iter)
462 {
465
466 if( part != proton && part != neutron &&
467 (part != ANTIproton && ProjectileIsAntiNucleus) &&
468 (part != ANTIneutron && ProjectileIsAntiNucleus) )
469 {
473 theTotalResult->push_back(theNew);
474#ifdef debugPrecoInt
475 SecondrNum++;
476 secondary4Momemtum += (*iter)->Get4Momentum();
477 G4cout<<
"Secondary "<<SecondrNum<<
" "
480
481#endif
482 delete (*iter);
483 continue;
484 }
485
486 G4bool CanBeCapturedByTarget =
false;
487 if( part == proton || part == neutron)
488 {
489 CanBeCapturedByTarget = ExistTargetRemnant &&
491 (aTrack4Momentum + Target4Momentum).mag() -
492 aTrack4Momentum.
mag() - Target4Momentum.mag()) &&
493 ((*iter)->GetPosition().mag() < R);
494 }
495
498
499 G4bool CanBeCapturedByProjectile =
false;
500
501 if( !ProjectileIsAntiNucleus &&
502 ( part == proton || part == neutron))
503 {
504 CanBeCapturedByProjectile = ExistProjectileRemnant &&
506 (aTrack4Momentum + Projectile4Momentum).mag() -
507 aTrack4Momentum.
mag() - Projectile4Momentum.mag()) &&
509 }
510
511 if( ProjectileIsAntiNucleus &&
512 ( part == ANTIproton || part == ANTIneutron))
513 {
514 CanBeCapturedByProjectile = ExistProjectileRemnant &&
516 (aTrack4Momentum + Projectile4Momentum).mag() -
517 aTrack4Momentum.
mag() - Projectile4Momentum.mag()) &&
519 }
520
521 if(CanBeCapturedByTarget && CanBeCapturedByProjectile)
522 {
524 { CanBeCapturedByTarget = true; CanBeCapturedByProjectile = false;}
525 else
526 { CanBeCapturedByTarget = false; CanBeCapturedByProjectile = true;}
527 }
528
529 if(CanBeCapturedByTarget)
530 {
531
532
533
534#ifdef debugPrecoInt
536 <<aTrack4Momentum<<
" "<<aTrack4Momentum.
mag()<<
G4endl;
537#endif
538 ++anA;
539 ++numberOfEx;
541 aZ += Z;
542 numberOfCh += Z;
543 Target4Momentum +=aTrack4Momentum;
544 delete (*iter);
545 } else if(CanBeCapturedByProjectile)
546 {
547
548
549
550#ifdef debugPrecoInt
552 <<aTrack4Momentum<<
" "<<aTrack4Momentum.
mag()<<
G4endl;
553#endif
554 ++anAb;
555 ++numberOfExB;
557 if( ProjectileIsAntiNucleus ) Z=-Z;
558 aZb += Z;
559 numberOfChB += Z;
560 Projectile4Momentum +=aTrack4Momentum;
561 delete (*iter);
562 } else
563 {
567 theTotalResult->push_back(theNew);
568
569#ifdef debugPrecoInt
570 SecondrNum++;
571 secondary4Momemtum += (*iter)->Get4Momentum();
572
573
574
575
576
577#endif
578 delete (*iter);
579 continue;
580 }
581 }
582 delete theSecondaries;
583
584
585 #ifdef debugPrecoInt
586 G4cout<<
"Final target residual A Z E* 4mom "<<anA<<
" "<<aZ<<
" "
587 <<exEnergy<<
" "<<Target4Momentum<<
G4endl;
588 #endif
589
590 if(0!=anA )
591 {
593
595 {Target4Momentum.setE(fMass);}
596
597 G4double RemnMass=Target4Momentum.mag();
598
599 if(RemnMass < fMass)
600 {
601 RemnMass=fMass + exEnergy;
602 Target4Momentum.setE(std::sqrt(Target4Momentum.vect().mag2() +
603 RemnMass*RemnMass));
604 } else
605 { exEnergy=RemnMass-fMass;}
606
607 if( exEnergy < 0.) exEnergy=0.;
608
609
610 G4Fragment anInitialState(anA, aZ, Target4Momentum);
611 anInitialState.SetNumberOfParticles(numberOfEx-numberOfHoles);
612 anInitialState.SetNumberOfCharged(numberOfCh);
613 anInitialState.SetNumberOfHoles(numberOfHoles);
614
617
618 #ifdef debugPrecoInt
619 G4cout<<
"Target fragment number "<<aPrecoResult->size()<<
G4endl;
620 #endif
621
622
623 for(unsigned int ll=0; ll<aPrecoResult->size(); ++ll)
624 {
625 theTotalResult->push_back(aPrecoResult->operator[](ll));
626 #ifdef debugPrecoInt
627 G4cout<<
"Target fragment "<<ll<<
" "
628 <<aPrecoResult->operator[](ll)->GetDefinition()->GetParticleName()<<" "
629 <<aPrecoResult->operator[](ll)->GetMomentum()<<" "
630 <<aPrecoResult->operator[](ll)->GetTotalEnergy()<<" "
631 <<aPrecoResult->operator[](ll)->GetMass()<<
G4endl;
632 #endif
633 }
634 delete aPrecoResult;
635 }
636
637
638 if((anAb == theProjectileNucleus->
GetMassNumber())&& (exEnergyB <= 0.))
640
641 #ifdef debugPrecoInt
642 G4cout<<
"Final projectile residual A Z E* Pmom Pmag2 "<<anAb<<
" "<<aZb<<
" "
643 <<exEnergyB<<" "<<Projectile4Momentum<<" "
644 <<Projectile4Momentum.mag2()<<
G4endl;
645 #endif
646
647 if(0!=anAb)
648 {
650 G4double RemnMass=Projectile4Momentum.mag();
651
652 if(RemnMass < fMass)
653 {
654 RemnMass=fMass + exEnergyB;
655 Projectile4Momentum.setE(std::sqrt(Projectile4Momentum.vect().mag2() +
656 RemnMass*RemnMass));
657 } else
658 { exEnergyB=RemnMass-fMass;}
659
660 if( exEnergyB < 0.) exEnergyB=0.;
661
663 Projectile4Momentum.boost(bstToCM);
664
665
666 G4Fragment anInitialState(anAb, aZb, Projectile4Momentum);
667 anInitialState.SetNumberOfParticles(numberOfExB-numberOfHolesB);
668 anInitialState.SetNumberOfCharged(numberOfChB);
669 anInitialState.SetNumberOfHoles(numberOfHolesB);
670
673
674 #ifdef debugPrecoInt
675 G4cout<<
"Projectile fragment number "<<aPrecoResult->size()<<
G4endl;
676 #endif
677
678
679 for(unsigned int ll=0; ll<aPrecoResult->size(); ++ll)
680 {
682 aPrecoResult->operator[](ll)->GetTotalEnergy());
684 aPrecoResult->operator[](ll)->SetMomentum(tmp.
vect());
685 aPrecoResult->operator[](ll)->SetTotalEnergy(tmp.
e());
686
687 if(ProjectileIsAntiNucleus)
688 {
697 else {}
698
699 aPrecoResult->operator[](ll)->SetDefinitionAndUpdateE(LastFragment);
700 }
701
702 #ifdef debugPrecoInt
703 G4cout<<
"Projectile fragment "<<ll<<
" "
704 <<aPrecoResult->operator[](ll)->GetDefinition()->GetParticleName()<<" "
705 <<aPrecoResult->operator[](ll)->GetMomentum()<<" "
706 <<aPrecoResult->operator[](ll)->GetTotalEnergy()<<" "
707 <<aPrecoResult->operator[](ll)->GetMass()<<
G4endl;
708 #endif
709
710 theTotalResult->push_back(aPrecoResult->operator[](ll));
711 }
712
713 delete aPrecoResult;
714 }
715
716 return theTotalResult;
717}
Hep3Vector boostVector() const
HepLorentzVector & boost(double, double, double)
static G4AntiAlpha * AntiAlphaDefinition()
static G4AntiDeuteron * AntiDeuteronDefinition()
static G4AntiHe3 * AntiHe3Definition()
static G4AntiNeutron * AntiNeutronDefinition()
static G4AntiProton * AntiProtonDefinition()
static G4AntiTriton * AntiTritonDefinition()
void MakeCoalescence(G4KineticTrackVector *theSecondaries)
const G4ParticleDefinition * GetDefinition() const
G4double GetBindingEnergy() const
G4int GetBaryonNumber() const
const G4ParticleDefinition * GetDefinition() const
G4double GetTotalEnergy() const
G4ThreeVector GetMomentum() const