679 G4int initial_A = target_A + track_A;
680 G4int initial_Z = target_Z + track_Z;
686 G4int final_A(0), final_Z(0);
701 final4mom = temp.GetDynamicParticle()->Get4Momentum() + target4mom;
706 final4mom = temp.GetDynamicParticle()->Get4Momentum();
716 for (
G4int i = 0; i < nSec; i++) {
729 std::pair<G4double, G4double> checkLevels = epCheckLevels;
730 if (!levelsSetByProcess) {
732 checkLevels.first=
std::min(checkLevels.first, epCheckLevels.first);
733 checkLevels.second=
std::min(checkLevels.second, epCheckLevels.second);
749 if ( std::abs(relative) > checkLevels.first
750 || std::abs(relative_mom) > checkLevels.first) {
752 relResult = checkRelative ?
"fail" :
"N/A";
757 if ( std::abs(absolute) > checkLevels.second
758 || std::abs(absolute_mom) > checkLevels.second ) {
765 if ( (initial_A-final_A)!=0
766 || (initial_Z-final_Z)!=0 ) {
767 chargePass = checkLevels.second <
DBL_MAX ?
false :
true;
768 chargeResult =
"fail";
771 G4bool conservationPass = (relPass || absPass) && chargePass;
773 std::stringstream Myout;
774 G4bool Myout_notempty(
false);
785 Myout <<
" Process: " << processName <<
" , Model: " << modelName <<
G4endl;
789 <<
", target nucleus (" << aNucleus.
GetZ_asInt() <<
","
795 || ! conservationPass ){
797 Myout <<
" "<< relResult <<
" relative, limit " << checkLevels.
first <<
", values E/T(0) = "
798 << relative <<
" p/p(0)= " << relative_mom <<
G4endl;
799 Myout <<
" "<< absResult <<
" absolute, limit (MeV) " << checkLevels.second/
MeV <<
", values E / p (MeV) = "
800 << absolute/
MeV <<
" / " << absolute_mom/
MeV <<
" 3mom: " << (diff.
vect())*1./
MeV << G4endl;
801 Myout <<
" "<< chargeResult <<
" charge/baryon number balance " << (initial_Z-final_Z) <<
" / " << (initial_A-final_A) <<
" "<<
G4endl;
806 if ( Myout_notempty ) {
G4ParticleDefinition * GetDefinition() const
static G4double GetNuclearMass(const G4double A, const G4double Z)
G4int GetNumberOfSecondaries() const
G4Track * GetSecondary(G4int anIndex) const
const G4DynamicParticle * GetDynamicParticle() const
G4int GetPDGEncoding() const
const G4ThreeVector * GetMomentumDirection() const
const G4String & GetModelName() const
const G4String & GetParticleName() const
G4double GetKineticEnergy() const
G4GLOB_DLL std::ostream G4cout
G4ParticleChange * theTotalResult
virtual std::pair< G4double, G4double > GetEnergyMomentumCheckLevels() const
const G4ParticleDefinition * GetParticleDefinition() const
const G4String & GetProcessName() const
G4LorentzVector Get4Momentum() const
G4ThreeVector GetMomentum() const
G4HadronicInteraction * GetHadronicInteraction() const
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
G4double GetEnergy() const
static constexpr double MeV
G4TrackStatus GetTrackStatus() const
G4double GetPDGCharge() const
G4GLOB_DLL std::ostream G4cerr
G4int GetBaryonNumber() const