60 for (
int i = 0 ; i < nSecondaries ; i++ )
98 if( getenv(
"G4ParticleHPDebug"))
G4cout <<
"G4ParticleHPFinalState::adjust_final_stat BaseZ " << baseZNew <<
" BaseA " << baseANew <<
" sum_Z " << sum_Z <<
" sum_A " << sum_A <<
G4endl;
101 G4bool needOneMoreSec =
false;
103 if ( (
int)(baseZNew - sum_Z) == 0 && (
int)(baseANew - sum_A) == 0 )
110 if ( max_SecA >=
int(baseANew - sum_A) )
114 needOneMoreSec =
true;
122 if ( needOneMoreSec )
124 if (
int(baseZNew - sum_Z) == 0 && (
int)(baseANew - sum_A) > 0 )
127 if (
int(baseANew - sum_A) > 1 )
G4cout <<
"More than one neutron is required for the balance of baryon number!" <<
G4endl;
133 if( getenv(
"G4ParticleHPDebug"))
G4cout <<
this <<
"G4ParticleHPFinalState oneMoreSec_pd Z " << baseZNew <<
" - " << sum_Z <<
" A " << baseANew <<
" - " << sum_A <<
" projectile " <<
theProjectile->
GetParticleName() <<
G4endl;
136 if( !oneMoreSec_pd ) {
138 G4Exception(
"G4ParticleHPFinalState:adjust_final_state",
141 "No adjustment will be done!");
147 if ( resi_pd == NULL )
171 if ( (
int)(ndlZNew - sum_Z) == 0 && (
int)(ndlANew - sum_A) == 0 )
178 G4Exception(
"G4ParticleHPFinalState:adjust_final_state",
181 "No adjustment will be done!");
185 for (
int i = 0 ; i < nSecondaries ; i++ )
210 for (
G4int i = 0 ; i < n_sec ; i++ )
233 if ( slow > beta && beta != 0 )
277 if ( slow > p4.
beta() )
282 dif_4p = init_4p_lab - ( secs_4p_lab + p4 );
285 if ( needOneMoreSec && oneMoreSec_pd)
297 if ( slow > p4.
beta() )
300 islow = nSecondaries-1;
302 dif_4p = init_4p_lab - ( secs_4p_lab + p4 );
307 if ( dif_4p.
v().
mag() < std::abs( dif_4p.
e() ) )
312 if ( minimum_energy < dif_4p.
v().
mag() && dif_4p.
v().
mag() < 1*
MeV )
340 G4double dif_e = dif_4p.
e() - ( dif_4p.
v() ).mag();
351 if ( minimum_energy < e1 )
356 std::sin(std::acos(costh))*std::sin(phi),
377 if ( ke0 + dif_e > 0 )
static G4ParticleHPManager * GetInstance()
G4Cache< G4HadFinalState * > theResult
void SetMomentum(const G4ThreeVector &momentum)
G4HadSecondary * GetSecondary(size_t i)
G4double GetKineticEnergy() const
G4ParticleDefinition * GetIon(G4int Z, G4int A, G4int lvl=0)
G4ParticleDefinition * GetDefinition() const
const G4String & GetParticleName() const
G4int GetAtomicNumber() const
G4ParticleDefinition * theProjectile
static constexpr double twopi
void adjust_final_state(G4LorentzVector)
G4GLOB_DLL std::ostream G4cout
typedef int(XMLCALL *XML_NotStandaloneHandler)(void *userData)
static G4Triton * Triton()
static G4Proton * Proton()
static G4Neutron * Neutron()
static G4Deuteron * Deuteron()
G4int GetAtomicMass() const
void SetKineticEnergy(G4double aEnergy)
G4LorentzVector Get4Momentum() const
static G4IonTable * GetIonTable()
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
G4double GetPDGMass() const
T max(const T t1, const T t2)
brief Return the largest of the two arguments
G4DynamicParticle * GetParticle()
static constexpr double MeV
void AddSecondary(G4DynamicParticle *aP, G4int mod=-1)
void SetDefinition(const G4ParticleDefinition *aParticleDefinition)
static constexpr double keV
G4int GetNumberOfSecondaries() const
G4ThreeVector GetMomentum() const
G4GLOB_DLL std::ostream G4cerr