132 std::strtol(std::getenv(
"G4Hadronic_epReportLevel"),0,10) : 0;
134 epCheckLevels.first = std::getenv(
"G4Hadronic_epCheckRelativeLevel") ?
135 std::strtod(std::getenv(
"G4Hadronic_epCheckRelativeLevel"),0) :
DBL_MAX;
137 epCheckLevels.second = std::getenv(
"G4Hadronic_epCheckAbsoluteLevel") ?
138 std::strtod(std::getenv(
"G4Hadronic_epCheckAbsoluteLevel"),0) :
DBL_MAX;
169 <<
" because no material defined \n"
170 <<
" Please, specify material pointer or define simple material"
172 G4Exception(
"G4HadronicProcess::GetElementCrossSection",
"had066",
182 if(std::getenv(
"G4HadronicProcess_debug")) {
245 ed <<
"G4HadronicProcess: track in unusable state - "
247 ed <<
"G4HadronicProcess: returning unchanged track " <<
G4endl;
259 aMaterial, anElement);
262 ed <<
"Target element "<<anElement->
GetName()<<
" Z= "
265 DumpState(aTrack,
"ChooseHadronicInteraction",ed);
266 ed <<
" No HadronicInteraction found out" <<
G4endl;
272 G4int reentryCount = 0;
298 ed <<
"Target element "<<anElement->
GetName()<<
" Z= "
302 ed <<
" ApplyYourself failed" <<
G4endl;
310 if(reentryCount>100) {
313 ed <<
"Target element "<<anElement->
GetName()<<
" Z= "
317 ed <<
" ApplyYourself does not completed after 100 attempts" <<
G4endl;
331 for (
G4int i = 0; i < nSec; ++i ) {
365 outFile <<
"The description for this process has not been written yet.\n";
374 G4double result = (biasedProbability-realProbability)/biasedProbability;
400 }
else if(0.0 == efinal) {
429 for (
G4int i = 0; i < nSec; ++i) {
443 if(
std::abs(dmass - mass) > delta_mass_lim) {
453 <<
" EkinNew(MeV)= " << e
454 <<
" DeltaMass(MeV)= " << dmass - mass <<
G4endl;
477 DumpState(aT,
"Secondary has zero energy",ed);
480 G4Exception(
"G4HadronicProcess::FillResults",
"had011",
498 ed <<
" Wrong biasing factor " << aScale <<
" for " <<
GetProcessName();
499 G4Exception(
"G4HadronicProcess::BiasCrossSectionByFactor",
"had010",
536 for (
G4int i = 0; i < nSec; i++) {
541 if (
std::abs(mass_pdg - mass_dyn) > 0.1*mass_pdg + 1.*
MeV ) {
550 desc <<
"Warning: Secondary with off-shell dynamic mass detected: "
553 <<
", PDG mass: " << mass_pdg <<
", dynamic mass: "
556 :
"re-sample the interaction") <<
G4endl
562 <<
", target nucleus (" << aNucleus.
GetZ_asInt() <<
", "
564 G4Exception(
"G4HadronicProcess:CheckResult()",
"had012",
572 std::pair<G4double, G4double> checkLevels =
574 if (
std::abs(deltaE) > checkLevels.second &&
580 desc <<
"Warning: Bad energy non-conservation detected, will "
582 :
"re-sample the interaction") <<
G4endl
588 <<
", target nucleus (" << aNucleus.
GetZ_asInt() <<
", "
590 <<
" E(initial - final) = " << deltaE <<
" MeV." <<
G4endl;
591 G4Exception(
"G4HadronicProcess:CheckResult()",
"had012",
612 G4int initial_A = target_A + track_A;
619 G4int final_A(0), final_Z(0);
628 final4mom = initial4mom;
648 for (
G4int i = 0; i < nSec; i++) {
681 if (
std::abs(relative) > checkLevels.first
682 ||
std::abs(relative_mom) > checkLevels.first) {
684 relResult = checkRelative ?
"fail" :
"N/A";
689 if (
std::abs(absolute) > checkLevels.second
690 ||
std::abs(absolute_mom) > checkLevels.second ) {
697 if ( (initial_A-final_A)!=0
698 || (initial_Z-final_Z)!=0 ) {
699 chargePass = checkLevels.second <
DBL_MAX ?
false :
true;
700 chargeResult =
"fail";
703 G4bool conservationPass = (relPass || absPass) && chargePass;
705 std::stringstream Myout;
706 G4bool Myout_notempty(
false);
717 Myout <<
" Process: " << processName <<
" , Model: " << modelName <<
G4endl;
721 <<
", target nucleus (" << aNucleus.
GetZ_asInt() <<
","
727 || ! conservationPass ){
729 Myout <<
" "<< relResult <<
" relative, limit " << checkLevels.
first <<
", values E/T(0) = "
730 << relative <<
" p/p(0)= " << relative_mom <<
G4endl;
731 Myout <<
" "<< absResult <<
" absolute, limit (MeV) " << checkLevels.second/
MeV <<
", values E / p (MeV) = "
732 << absolute/
MeV <<
" / " << absolute_mom/
MeV <<
" 3mom: " << (diff.
vect())*1./
MeV << G4endl;
733 Myout <<
" "<< chargeResult <<
" charge/baryon number balance " << (initial_Z-final_Z) <<
" / " << (initial_A-final_A) <<
" "<<
G4endl;
738 if ( Myout_notempty ) {
748 ed <<
"Unrecoverable error in the method " << method <<
" of "
750 ed <<
"TrackID= "<< aTrack.
GetTrackID() <<
" ParentID= "
779 std::vector<G4HadronicInteraction*>&
788 std::vector<G4HadronicInteraction*>& list
790 for (
size_t li=0; li<list.size(); li++) {
791 if (list[li]->GetModelName() == modelName)
return list[li];