54 std::ostringstream ost;
74 if(!getenv(
"G4NEUTRONHPDATA"))
75 throw G4HadronicException(__FILE__, __LINE__,
"Please setenv G4NEUTRONHPDATA to point to the neutron cross-section files.");
76 G4String tBase = getenv(
"G4NEUTRONHPDATA");
90 if(getenv(
"NeutronHPNamesLogging"))
G4cout <<
"Skipped = "<< filename <<
" "<<A<<
" "<<Z<<
G4endl;
110 while (theData >> infoType)
113 if(dummy==
INT_MAX) theData >> dummy >> dummy;
138 else if(dataType==12)
144 else if(dataType==13)
150 else if(dataType==14)
155 else if(dataType==15)
162 throw G4HadronicException(__FILE__, __LINE__,
"Data-type unknown to G4NeutronHPInelasticBaseFS");
195 if ( targetMass == 0 )
208 boosted.
Lorentz(theNeutron, theTarget);
218 for(ii=0; ii<nDef; ii++)
222 thePhaseSpaceDistribution.
Init(aPhaseMass, nDef);
223 thePhaseSpaceDistribution.
SetNeutron(&theNeutron);
224 thePhaseSpaceDistribution.
SetTarget(&theTarget);
225 for(ii=0; ii<nDef; ii++)
227 G4double massCode = 1000.*std::abs(theDefs[ii]->GetPDGCharge());
231 aSec->
Lorentz(*aSec, -1.*theTarget);
274 for(i0=0; i0<nDef; i0++) Done[i0] =
false;
281 for(i=0; i<tmpHadrons->size(); i++)
283 for(ii=0; ii<nDef; ii++)
284 if(!Done[ii] && tmpHadrons->operator[](i)->GetDefinition() == theDefs[ii])
291 for(i0=0; i0<nDef; i0++)
313 throw G4HadronicException(__FILE__, __LINE__,
"No energy distribution to sample from in InelasticBaseFS::BaseApply");
326 G4double availableEnergy = eKinetic+massn+localMass-mass1-mass2-concreteMass;
328 G4double emin = availableEnergy+mass1+mass2 - std::sqrt((mass1+mass2)*(mass1+mass2)+orgMomentum*orgMomentum);
329 G4double p1=std::sqrt(2.*mass2*emin);
339 bufferedDirection = -bufferedDirection;
347 +bufferedDirection.
mag2()) );
349 aHadron->
Lorentz(*aHadron, -1.*(theTarget+theNeutron));
355 tmpHadrons->push_back(aHadron);
362 throw G4HadronicException(__FILE__, __LINE__,
"No data to create the neutrons in NInelasticFS");
370 boosted_tmp.
Lorentz(theNeutron, theTarget);
375 for(i=0; i<thePhotons->size(); i++)
378 thePhotons->operator[](i)->Lorentz(*(thePhotons->operator[](i)), -1.*theTarget);
387 theGammaEnergy = anEnergy-theGammaEnergy;
397 for(i=0; i<tmpHadrons->size(); i++)
401 eBindProducts+=eBindN;
405 eBindProducts+=eBindP;
409 eBindProducts+=eBindD;
413 eBindProducts+=eBindT;
415 else if(tmpHadrons->operator[](i)->GetDefinition() ==
G4He3::He3())
417 eBindProducts+=eBindHe3;
419 else if(tmpHadrons->operator[](i)->GetDefinition() ==
G4Alpha::Alpha())
421 eBindProducts+=eBindA;
426 theGammaEnergy += eBindProducts;
438 theGammaEnergy -= (2*eBindA);
459 if(random > (eHigh-eLow)/(theGammaEnergy-eLow)) iLevel++;
463 if(theOtherPhotons != 0)
465 for(
unsigned int iii=0; iii<theOtherPhotons->size(); iii++)
467 thePhotons->push_back(theOtherPhotons->operator[](iii));
469 delete theOtherPhotons;
472 if(iLevel == -1)
break;
477 unsigned int nSecondaries = tmpHadrons->size();
478 unsigned int nPhotons = 0;
479 if(thePhotons!=0) { nPhotons = thePhotons->size(); }
480 nSecondaries += nPhotons;
483 for(i=0; i<nSecondaries-nPhotons; i++)
486 theSec->
SetDefinition(tmpHadrons->operator[](i)->GetDefinition());
487 theSec->
SetMomentum(tmpHadrons->operator[](i)->GetMomentum());
489 delete tmpHadrons->operator[](i);
493 for(i=0; i<nPhotons; i++)
496 theSec->
SetDefinition(thePhotons->operator[](i)->GetDefinition());
497 theSec->
SetMomentum(thePhotons->operator[](i)->GetMomentum());
499 delete thePhotons->operator[](i);