59 std::ostringstream ost;
80 if(!std::getenv(
"G4NEUTRONHPDATA"))
81 throw G4HadronicException(__FILE__, __LINE__,
"Please setenv G4NEUTRONHPDATA to point to the neutron cross-section files where Inelastic/Gammas data is found.");
82 G4String tBase = std::getenv(
"G4NEUTRONHPDATA");
89 if( std::getenv(
"G4ParticleHPDebug") )
G4cout <<
" G4ParticleHPInelasticBaseFS::Init FILE " << filename <<
G4endl;
100 if(std::getenv(
"G4ParticleHPDebug_NamesLogging"))
G4cout <<
"Skipped = "<< filename <<
" "<<A<<
" "<<Z<<
G4endl;
125 while (theData >> infoType)
157 else if(dataType==12)
163 else if(dataType==13)
169 else if(dataType==14)
174 else if(dataType==15)
181 throw G4HadronicException(__FILE__, __LINE__,
"Data-type unknown to G4ParticleHPInelasticBaseFS");
217 if ( targetMass == 0 )
236 boosted.
Lorentz(incidReactionProduct, theTarget);
246 for(ii=0; ii<nDef; ii++)
252 if(Qvalue<1.*CLHEP::keV && Qvalue>-1.*
CLHEP::keV){
256 for (ii = 0; ii < nDef; ii++) {
261 if (ResidualA > 0 && ResidualZ > 0) {
273 thePhaseSpaceDistribution.
Init(aPhaseMass, nDef);
275 thePhaseSpaceDistribution.
SetTarget(&theTarget);
278 for(ii=0; ii<nDef; ii++)
284 aSec->
Lorentz(*aSec, -1.*theTarget);
330 if ( !std::getenv(
"G4PHP_DO_NOT_ADJUST_FINAL_STATE" ) ) {
333 if ( tmpHadrons != NULL ) {
338 for (
G4int j = 0 ; j != (
G4int)tmpHadrons->size() ; j++ ) {
340 if ( tmpHadrons->at(j)->GetDefinition()->GetBaryonNumber() >
maxA ) {
341 maxA = tmpHadrons->at(j)->GetDefinition()->GetBaryonNumber();
344 sumA += tmpHadrons->at(j)->GetDefinition()->GetBaryonNumber();
345 sumZ +=
G4int( tmpHadrons->at(j)->GetDefinition()->GetPDGCharge() +
eps );
349 if ( dA < 0 || dZ < 0 ) {
350 G4int newA = tmpHadrons->at(jAtMaxA)->GetDefinition()->GetBaryonNumber() + dA ;
351 G4int newZ =
G4int( tmpHadrons->at(jAtMaxA)->GetDefinition()->GetPDGCharge() +
eps ) + dZ;
352 if(newA>newZ && newZ>0){
354 tmpHadrons->at( jAtMaxA )->SetDefinition( pd );
365 for(i0=0; i0<nDef; i0++) Done[i0] =
false;
387 for(i0=0; i0<nDef; i0++)
409 throw G4HadronicException(__FILE__, __LINE__,
"No energy distribution to sample from in InelasticBaseFS::BaseApply");
422 G4double availableEnergy = eKinetic+massn+localMass-mass1-mass2-concreteMass;
424 G4double emin = availableEnergy+mass1+mass2 - std::sqrt((mass1+mass2)*(mass1+mass2)+orgMomentum*orgMomentum);
425 G4double p1=std::sqrt(2.*mass2*emin);
428 if(std::getenv(
"G4ParticleHPDebug"))
430 G4cout <<
"G4ParticleHPInelasticBaseFS "<<z1<<
" "<<
theBaseZ<<
" "<<a1<<
" "<<
theBaseA<<
" "<<availableEnergy<<
" "
437 bufferedDirection = -bufferedDirection;
441 if(std::getenv(
"G4ParticleHPDebug"))
443 G4cout <<
" G4ParticleHPInelasticBaseFS "<<bufferedDirection.
mag2()<<
G4endl;
447 +bufferedDirection.
mag2()) );
449 aHadron->
Lorentz(*aHadron, -1.*(theTarget+incidReactionProduct));
451 if(std::getenv(
"G4ParticleHPDebug"))
457 tmpHadrons->push_back(aHadron);
467 throw G4HadronicException(__FILE__, __LINE__,
"No data to create the neutrons in NInelasticFS");
475 boosted_tmp.
Lorentz(incidReactionProduct, theTarget);
480 for(i=0; i<thePhotons->size(); i++)
483 thePhotons->operator[](i)->Lorentz(*(thePhotons->operator[](i)), -1.*theTarget);
491 G4bool bAdjustPhotons =
true;
493 bAdjustPhotons =
true;
495 if ( std::getenv(
"G4PHP_DO_NOT_ADJUST_FINAL_STATE" ) ) bAdjustPhotons =
false;
498 if( bAdjustPhotons ) {
501 theGammaEnergy = anEnergy-theGammaEnergy;
511 for(i=0; i<tmpHadrons->size(); i++)
515 eBindProducts+=eBindN;
519 eBindProducts+=eBindP;
523 eBindProducts+=eBindD;
527 eBindProducts+=eBindT;
529 else if(tmpHadrons->operator[](i)->GetDefinition() ==
G4He3::He3())
531 eBindProducts+=eBindHe3;
533 else if(tmpHadrons->operator[](i)->GetDefinition() ==
G4Alpha::Alpha())
535 eBindProducts+=eBindA;
540 theGammaEnergy += eBindProducts;
543 if( std::getenv(
"G4ParticleHPDebug"))
G4cout <<
" G4ParticleHPInelasticBaseFS::BaseApply gamma Energy " << theGammaEnergy <<
" eBindProducts " << eBindProducts <<
G4endl;
556 theGammaEnergy -= (2*eBindA);
572 if( std::getenv(
"G4ParticleHPDebug"))
G4cout <<
" G4ParticleHPInelasticBaseFS::BaseApply adding gamma from level " << iLevel << theOtherPhotons->operator[](ii)->GetKineticEnergy() <<
G4endl;
580 if(random > (eHigh-eLow)/(theGammaEnergy-eLow)) iLevel++;
584 if(theOtherPhotons != 0)
586 for(
unsigned int iii=0; iii<theOtherPhotons->size(); iii++)
588 thePhotons->push_back(theOtherPhotons->operator[](iii));
590 if( std::getenv(
"G4ParticleHPDebug"))
591 G4cout << iii <<
" G4ParticleHPInelasticBaseFS::BaseApply adding gamma " << theOtherPhotons->operator[](iii)->GetKineticEnergy() <<
G4endl;
594 delete theOtherPhotons;
597 if(iLevel == -1)
break;
603 unsigned int nSecondaries = tmpHadrons->size();
604 unsigned int nPhotons = 0;
605 if(thePhotons!=0) { nPhotons = thePhotons->size(); }
606 nSecondaries += nPhotons;
609 if( std::getenv(
"G4ParticleHPDebug"))
G4cout <<
" G4ParticleHPInelasticBaseFS::BaseApply N hadrons " << nSecondaries-nPhotons <<
G4endl;
612 for(i=0; i<nSecondaries-nPhotons; i++)
615 theSec->
SetDefinition(tmpHadrons->operator[](i)->GetDefinition());
616 theSec->
SetMomentum(tmpHadrons->operator[](i)->GetMomentum());
622 delete tmpHadrons->operator[](i);
625 if( std::getenv(
"G4ParticleHPDebug"))
G4cout <<
" G4ParticleHPInelasticBaseFS::BaseApply N photons " << nPhotons << G4endl;
629 for(i=0; i<nPhotons; i++)
632 theSec->
SetDefinition(thePhotons->operator[](i)->GetDefinition());
633 theSec->
SetMomentum(thePhotons->operator[](i)->GetMomentum());
638 delete thePhotons->operator[](i);