Import Geant4 8.3.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 15:07:44 +02:00
parent fe73f43734
commit 75c7fd177d
764 changed files with 45230 additions and 95238 deletions
+41 -8
View File
@@ -14,6 +14,38 @@ code and to keep track of all tags.
* Please list in reverse chronological order (last date on top)
---------------------------------------------------------------
23 Apr 2007 Dennis Wright (hadr-man-V08-02-03)
----------------------------------------------
- G4HadronicProcess.hh
remove AlwaysKillLeadingHadron method
- G4HadronicProcess.cc
use Alex Howard's fix of weighting error in leading particle killer
10 Apr 2007 Dennis Wright (hadr-man-V08-02-02)
----------------------------------------------
- G4HadronicInteractionWrapper.hh, .cc
add process and model name arguments to ApplyInteraction method
and enter them into whiteboard
- G4HadronicProcess.cc
add process and model name arguments to ApplyInteraction method
2 Mar 2007 Dennis Wright (hadr-man-V08-02-01)
---------------------------------------------
- G4HadronicProcess.cc: put in Vladimir Ivantchenko's fix to
stop killing primaries for elastic
26 Dec 2006 Dennis Wright (hadr-man-V08-02-00)
----------------------------------------------
- G4HadronicProcess.hh, .cc:
Add handling of user-defined isotopes: re-implement methods
GetMeanFreePath() and ChooseAandZ() to use new methods in
G4CrossSectionDataStore.
No longer use dispatch pointer to call data store methods.
Data members currentZ, currentN and methods GetCurrentZ(),
GetCurrentN() removed as no longer needed
20 Oct 2006 Dennis Wright (hadr-man-V08-01-00)
----------------------------------------------
- G4HadronicProcess.hh, .cc:
@@ -42,8 +74,8 @@ code and to keep track of all tags.
16 Dec 2005 Dennis Wright for Mikhail Kossov (hadr-man-V08-00-00)
-----------------------------------------------------------------
- G4HadronicProcess.hh: in method ChooseHadronicInteraction, check
G4HadronicInteractionCounter for error - if so
print out
G4HadronicInteractionCounter for error - if
so print out
- G4EnergyRangeManager.hh: make method GetHadronicInteractionCounter public
- G4EnergyRangeManager.cc: in method GetHadronicInteraction, case 0, print out
@@ -52,13 +84,14 @@ code and to keep track of all tags.
15 Dec 2005 Dennis Wright
-------------------------
- G4HadronicProcess.cc: fixed bug # 611 - problems caused when hadronic interactions
reset stopButAlive particle to Alive
solution: In method FillTotalResult add lines
- G4HadronicProcess.cc:
fixed bug # 611 - problems caused when hadronic interactions
reset stopButAlive particle to Alive
solution: In method FillTotalResult add lines
} else if (aT.GetKineticEnergy() == 0) {
theTotalResult->ProposeTrackStatus(fStopButAlive);
}
} else if (aT.GetKineticEnergy() == 0) {
theTotalResult->ProposeTrackStatus(fStopButAlive);
}
18 Nov 2005 Dennis Wright (hadr-man-V07-01-00)
@@ -33,9 +33,11 @@
class G4HadronicInteractionWrapper
{
public:
G4HadFinalState * ApplyInteraction(G4HadProjectile & thePro,
G4Nucleus & targetNucleus,
G4HadronicInteraction * theInteraction);
G4HadFinalState * ApplyInteraction(G4HadProjectile& thePro,
G4Nucleus& targetNucleus,
G4HadronicInteraction* theInteraction,
const G4String& theProcessName,
const G4String& theModelName);
};
#endif
@@ -52,7 +52,7 @@
#include "G4Delete.hh"
#include "G4CrossSectionDataStore.hh"
#include "G4HadronicException.hh"
#include "G4Fuzzy.hh"
class G4Track;
class G4Step;
@@ -77,11 +77,13 @@ class G4ParticleChange;
virtual G4VParticleChange *PostStepDoIt( const G4Track &aTrack,
const G4Step &aStep ) = 0;
virtual G4double GetMicroscopicCrossSection( const G4DynamicParticle *aParticle,
const G4Element *anElement,
G4double aTemp ) = 0;
virtual
G4double GetMicroscopicCrossSection(const G4DynamicParticle *aParticle,
const G4Element *anElement,
G4double aTemp ) = 0;
G4double GetMeanFreePath(const G4Track &aTrack, G4double, G4ForceCondition *);
G4double GetMeanFreePath(const G4Track &aTrack, G4double,
G4ForceCondition *);
// Set methods for isotope production
@@ -102,15 +104,6 @@ class G4ParticleChange;
return anIsoResult;
}
// use this with bool only
static G4bool AlwaysKillLeadingHadron(G4Fuzzy aB=G4Fuzzy())
{
static G4Fuzzy state = G4Fuzzy();
if(getenv("AlwaysKillLeadingHadron")) return true;
if (!aB.first) state = aB;
return state.second;
}
void BiasCrossSectionByFactor(G4double aScale)
{
xBiasOn = true;
@@ -135,9 +128,10 @@ class G4ParticleChange;
virtual void ResetNumberOfInteractionLengthLeft()
{
G4VProcess::theNumberOfInteractionLengthLeft = -std::log( G4UniformRand() );
theInitialNumberOfInteractionLength = G4VProcess::theNumberOfInteractionLengthLeft;
// hpw ReStarted = true;
G4VProcess::theNumberOfInteractionLengthLeft =
-std::log( G4UniformRand() );
theInitialNumberOfInteractionLength =
G4VProcess::theNumberOfInteractionLengthLeft;
}
G4VParticleChange *GeneralPostStepDoIt( const G4Track &aTrack,
@@ -146,8 +140,8 @@ class G4ParticleChange;
void SetDispatch( G4HadronicProcess *value )
{ dispatch=value; }
G4Element * ChooseAandZ( const G4DynamicParticle *aParticle,
const G4Material *aMaterial );
G4Element* ChooseAandZ(const G4DynamicParticle *aParticle,
const G4Material *aMaterial);
inline const G4EnergyRangeManager &GetEnergyRangeManager() const
{ return theEnergyRangeManager; }
@@ -160,9 +154,10 @@ class G4ParticleChange;
{
G4EnergyRangeManager* ERMan = GetManagerPointer();
if(!ERMan->GetHadronicInteractionCounter())
G4cout<<"*G4HadronicProcess::ChooseHadronicInteraction: process = "
<<GetProcessName()<<", nM="<<ERMan->GetHadronicInteractionCounter()<<G4endl;
return ERMan->GetHadronicInteraction(kineticEnergy, aMaterial, anElement);
G4cout<< "*G4HadronicProcess::ChooseHadronicInteraction: process = "
<< GetProcessName() << ", nM="
<< ERMan->GetHadronicInteractionCounter() << G4endl;
return ERMan->GetHadronicInteraction(kineticEnergy,aMaterial,anElement);
}
inline G4HadronicInteraction *GetHadronicInteraction()
@@ -173,12 +168,6 @@ class G4ParticleChange;
{ return &theEnergyRangeManager; }
protected:
G4double GetCurrentZ()
{ return currentZ; }
G4double GetCurrentN()
{ return currentN; }
G4CrossSectionDataStore* GetCrossSectionDataStore()
{
return theCrossSectionDataStore;
@@ -222,8 +211,6 @@ class G4ParticleChange;
G4Nucleus targetNucleus;
G4double currentZ;
G4double currentN;
G4HadronicProcess *dispatch;
// swiches for isotope production
@@ -236,10 +223,10 @@ class G4ParticleChange;
std::vector<G4VLeadingParticleBiasing *> theBias;
static G4IsoParticleChange * theIsoResult;
static G4IsoParticleChange * theOldIsoResult;
static G4IsoParticleChange* theIsoResult;
static G4IsoParticleChange* theOldIsoResult;
G4ParticleChange * theTotalResult;
G4ParticleChange* theTotalResult;
G4double theInitialNumberOfInteractionLength;
@@ -25,13 +25,17 @@
//
#include "G4HadronicInteractionWrapper.hh"
G4HadFinalState * G4HadronicInteractionWrapper::
ApplyInteraction(G4HadProjectile & thePro,
G4Nucleus & targetNucleus,
G4HadronicInteraction * theInteraction)
{
static G4HadronicWhiteBoard & theBoard = G4HadronicWhiteBoard::Instance();
theBoard.SetProjectile(thePro);
theBoard.SetTargetNucleus(targetNucleus);
return theInteraction->ApplyYourself( thePro, targetNucleus);
}
G4HadFinalState* G4HadronicInteractionWrapper::
ApplyInteraction(G4HadProjectile& thePro,
G4Nucleus& targetNucleus,
G4HadronicInteraction* theInteraction,
const G4String& theProcessName,
const G4String& theModelName)
{
static G4HadronicWhiteBoard & theBoard = G4HadronicWhiteBoard::Instance();
theBoard.SetProjectile(thePro);
theBoard.SetTargetNucleus(targetNucleus);
theBoard.SetProcessName(theProcessName);
theBoard.SetModelName(theModelName);
return theInteraction->ApplyYourself( thePro, targetNucleus);
}
@@ -24,8 +24,6 @@
// ********************************************************************
//
//
//
// HPW to implement the choosing of an element for scattering.
#include "G4Types.hh"
@@ -97,7 +95,6 @@ G4HadronicProcess::~G4HadronicProcess()
theBias.end(),
G4Delete());
if(theOldIsoResult) delete theOldIsoResult;
// if(theIsoResult) delete theIsoResult;
}
void G4HadronicProcess::RegisterMe( G4HadronicInteraction *a )
@@ -114,22 +111,6 @@ void G4HadronicProcess::RegisterMe( G4HadronicInteraction *a )
G4double G4HadronicProcess::
GetMeanFreePath(const G4Track &aTrack, G4double, G4ForceCondition *)
{
/*
if(ReStarted)
{
if(trackIdCache == aTrack.GetTrackId())
{
theInitialNumberOfInteractionLength += G4VProcess::theNumberOfInteractionLengthLeft;
}
else
{
theInitialNumberOfInteractionLength = G4VProcess::theNumberOfInteractionLengthLeft;
}
trackIdCache = aTrack.GetTrackId();
ReStarted = false;
}
*/
G4double sigma = 0.0;
try
{
@@ -153,22 +134,10 @@ GetMeanFreePath(const G4Track &aTrack, G4double, G4ForceCondition *)
aParticle->GetDefinition()->GetParticleName()).c_str() );
}
G4Material *aMaterial = aTrack.GetMaterial();
G4int nElements = aMaterial->GetNumberOfElements();
ModelingState = 1;
// returns the mean free path in GEANT4 internal units
const G4double *theAtomicNumDensityVector =
aMaterial->GetAtomicNumDensityVector();
G4double aTemp = aMaterial->GetTemperature();
for( G4int i=0; i<nElements; ++i )
{
G4double xSection =
GetMicroscopicCrossSection( aParticle, (*aMaterial->GetElementVector())[i], aTemp);
sigma += theAtomicNumDensityVector[i] * xSection;
}
sigma = theCrossSectionDataStore->GetCrossSection(aParticle, aMaterial);
sigma *= aScaleFactor;
theLastCrossSection = sigma;
}
@@ -185,124 +154,27 @@ GetMeanFreePath(const G4Track &aTrack, G4double, G4ForceCondition *)
}
G4Element * G4HadronicProcess::ChooseAandZ(
G4Element* G4HadronicProcess::ChooseAandZ(
const G4DynamicParticle *aParticle, const G4Material *aMaterial )
{
static G4bool noIsotopeWiseCrossSections=getenv("GHAD_DISABLE_ISOTOPE_WISE_CROSS_SECTIONS");
static G4StableIsotopes theIso;
currentZ = 0;
currentN = 0;
const G4int numberOfElements = aMaterial->GetNumberOfElements();
const G4ElementVector *theElementVector = aMaterial->GetElementVector();
G4int i;
if( numberOfElements == 1 )
{
currentZ = G4double( ((*theElementVector)[0])->GetZ());
G4int localZ = G4lrint(currentZ);
if(noIsotopeWiseCrossSections)
{
currentN = (*theElementVector)[0]->GetN();
}
else
{
G4double * running = new G4double[theIso.GetNumberOfIsotopes(localZ)];
for (i=0; i<theIso.GetNumberOfIsotopes(localZ); i++)
{
G4double fracInPercent=theIso.GetAbundance(theIso.GetFirstIsotope(localZ)+i);
G4double runningA=theIso.GetIsotopeNucleonCount(theIso.GetFirstIsotope(localZ)+i);
running[i]=fracInPercent*std::pow(runningA, 2./3.);
// rough approximation; to get it better, redesign getMSC to not use G4Element, see also below
if(i!=0) running[i] += running[i-1];
}
G4double trial = G4UniformRand();
G4double sum = running[theIso.GetNumberOfIsotopes(localZ)-1];
for(i=0; i<theIso.GetNumberOfIsotopes(localZ); i++)
{
currentN = theIso.GetIsotopeNucleonCount(theIso.GetFirstIsotope(localZ)+i);
if(running[i]/sum>trial) break;
}
delete [] running;
}
// Check for Z > 92)
if (currentZ > 92) G4Exception("G4HadronicProcess", "008", FatalException, "Z > 92 not allowed");
std::pair<G4double, G4double> ZA =
theCrossSectionDataStore->SelectRandomIsotope(aParticle, aMaterial);
G4double ZZ = ZA.first;
G4double AA = ZA.second;
targetNucleus.SetParameters(currentN, currentZ);
return (*theElementVector)[0];
targetNucleus.SetParameters(AA, ZZ);
const G4int numberOfElements = aMaterial->GetNumberOfElements();
const G4ElementVector* theElementVector = aMaterial->GetElementVector();
G4Element* chosen = 0;
for (G4int i = 0; i < numberOfElements; i++) {
chosen = (*theElementVector)[i];
if (chosen->GetZ() == ZZ) break;
}
const G4double *theAtomicNumberDensity = aMaterial->GetAtomicNumDensityVector();
G4double aTemp = aMaterial->GetTemperature();
G4double crossSectionTotal = 0;
std::vector<G4double> runningSum;
for( i=0; i < numberOfElements; ++i )
{
runningSum.push_back(theAtomicNumberDensity[i] *
dispatch->GetMicroscopicCrossSection( aParticle, (*theElementVector)[i], aTemp));
crossSectionTotal+=runningSum[i];
}
G4double random = G4UniformRand();
for( i=0; i < numberOfElements; ++i )
{
if(i!=0) runningSum[i]+=runningSum[i-1];
if( random<=runningSum[i]/crossSectionTotal )
{
currentZ = G4double( ((*theElementVector)[i])->GetZ());
G4int localZ = G4lrint(currentZ);
if(noIsotopeWiseCrossSections)
{
currentN = ((*theElementVector)[i])->GetN();
}
else
{
G4double * running = new G4double[theIso.GetNumberOfIsotopes(localZ)];
for (i=0; i<theIso.GetNumberOfIsotopes(localZ); i++)
{
G4double fracInPercent=theIso.GetAbundance(theIso.GetFirstIsotope(localZ)+i);
G4double runningA=theIso.GetIsotopeNucleonCount(theIso.GetFirstIsotope(localZ)+i);
running[i]=fracInPercent*std::pow(runningA, 2./3.);
if(i!=0) running[i] += running[i-1];
}
G4double trial = G4UniformRand();
for(i=0; i<theIso.GetNumberOfIsotopes(localZ); i++)
{
currentN = theIso.GetIsotopeNucleonCount(theIso.GetFirstIsotope(localZ)+i);
if(running[i]/running[theIso.GetNumberOfIsotopes(localZ)-1]>trial) break;
}
delete [] running;
}
targetNucleus.SetParameters(currentN, currentZ);
return (*theElementVector)[i];
}
}
currentZ = G4double((*theElementVector)[numberOfElements-1]->GetZ());
G4int localZ = G4lrint(currentZ);
if(noIsotopeWiseCrossSections)
{
currentN = (*theElementVector)[numberOfElements-1]->GetN();
}
else
{
G4double * running = new G4double[theIso.GetNumberOfIsotopes(localZ)];
for (i=0; i<theIso.GetNumberOfIsotopes(localZ); i++)
{
G4double fracInPercent=theIso.GetAbundance(theIso.GetFirstIsotope(localZ)+i);
G4double runningA=theIso.GetIsotopeNucleonCount(theIso.GetFirstIsotope(localZ)+i);
running[i]=fracInPercent*std::pow(runningA, 2./3.);
// rough approximation; to get it better, redesign getMSC to not use G4Element
if(i!=0) running[i] += running[i-1];
}
G4double trial = G4UniformRand();
for(i=0; i<theIso.GetNumberOfIsotopes(localZ); i++)
{
currentN = theIso.GetIsotopeNucleonCount(theIso.GetFirstIsotope(localZ)+i);
if(running[i]/running[theIso.GetNumberOfIsotopes(localZ)-1]>trial) break;
}
delete [] running;
}
targetNucleus.SetParameters(currentN, currentZ);
return (*theElementVector)[numberOfElements-1];
return chosen;
}
struct G4Nancheck{ bool operator()(G4double aV){return (!(aV<1))&&(!(aV>-1));}};
G4VParticleChange *G4HadronicProcess::GeneralPostStepDoIt(
@@ -312,7 +184,8 @@ const G4Track &aTrack, const G4Step &)
bool G4HadronicProcess_debug_flag = false;
if(getenv("G4HadronicProcess_debug")) G4HadronicProcess_debug_flag = true;
if(G4HadronicProcess_debug_flag) std::cout << "@@@@ hadronic process start "<< std::endl;
if(G4HadronicProcess_debug_flag)
std::cout << "@@@@ hadronic process start "<< std::endl;
// G4cout << theNumberOfInteractionLengthLeft<<G4endl;
#ifndef G4HadSignalHandler_off
G4HadSignalHandler aHandler(G4HadronicProcess_local::G4HadronicProcessHandler_1);
@@ -353,12 +226,10 @@ const G4Track &aTrack, const G4Step &)
// Get kinetic energy per nucleon for ions
if(aParticle->GetDefinition()->GetBaryonNumber()>1.5)
{
kineticEnergy/=aParticle->GetDefinition()->GetBaryonNumber();
}
if(aParticle->GetDefinition()->GetBaryonNumber() > 1.5)
kineticEnergy/=aParticle->GetDefinition()->GetBaryonNumber();
G4Element * anElement = 0;
G4Element* anElement = 0;
try
{
anElement = ChooseAandZ( aParticle, aMaterial );
@@ -374,6 +245,7 @@ const G4Track &aTrack, const G4Step &)
G4Exception("G4HadronicProcess", "007", FatalException,
"GeneralPostStepDoIt failed on element selection.");
}
try
{
theInteraction = ChooseHadronicInteraction( kineticEnergy,
@@ -385,7 +257,8 @@ const G4Track &aTrack, const G4Step &)
G4cout << "Unrecoverable error for:"<<G4endl;
G4cout << " - Particle energy[GeV] = "<< originalEnergy/GeV<<G4endl;
G4cout << " - Material = "<<aMaterial->GetName()<<G4endl;
G4cout << " - Particle type = "<<aParticle->GetDefinition()->GetParticleName()<<G4endl;
G4cout << " - Particle type = "
<< aParticle->GetDefinition()->GetParticleName()<<G4endl;
G4Exception("G4HadronicProcess", "007", FatalException,
"ChooseHadronicInteraction failed.");
}
@@ -394,8 +267,9 @@ const G4Track &aTrack, const G4Step &)
G4HadProjectile thePro(aTrack);
G4HadFinalState *result = 0;
G4HadFinalState* result = 0;
G4int reentryCount = 0;
do
{
try
@@ -403,15 +277,19 @@ const G4Track &aTrack, const G4Step &)
// Call the interaction
G4HadronicInteractionWrapper aW;
result = aW.ApplyInteraction(thePro, targetNucleus, theInteraction);
result = aW.ApplyInteraction(thePro, targetNucleus, theInteraction,
GetProcessName(),
theInteraction->GetModelName());
}
catch(G4HadReentrentException aR)
{
aR.Report(G4cout);
G4cout << " G4HadronicProcess re-entering the ApplyYourself call for"<<G4endl;
G4cout << " G4HadronicProcess re-entering the ApplyYourself call for "
<<G4endl;
G4cout << " - Particle energy[GeV] = "<< originalEnergy/GeV<<G4endl;
G4cout << " - Material = "<<aMaterial->GetName()<<G4endl;
G4cout << " - Particle type = "<<aParticle->GetDefinition()->GetParticleName()<<G4endl;
G4cout << " - Particle type = "
<< aParticle->GetDefinition()->GetParticleName() << G4endl;
result = 0; // here would still be leaking...
if(reentryCount>100)
{
@@ -424,10 +302,12 @@ const G4Track &aTrack, const G4Step &)
catch(G4HadronicException aR)
{
aR.Report(G4cout);
G4cout << " G4HadronicProcess failed in ApplyYourself call for"<<G4endl;
G4cout << " G4HadronicProcess failed in ApplyYourself call for"
<< G4endl;
G4cout << " - Particle energy[GeV] = "<< originalEnergy/GeV<<G4endl;
G4cout << " - Material = "<<aMaterial->GetName()<<G4endl;
G4cout << " - Particle type = "<<aParticle->GetDefinition()->GetParticleName()<<G4endl;
G4cout << " - Particle type = "
<< aParticle->GetDefinition()->GetParticleName() << G4endl;
G4Exception("G4HadronicProcess", "007", FatalException,
"GeneralPostStepDoIt failed.");
}
@@ -443,9 +323,11 @@ const G4Track &aTrack, const G4Step &)
// NOT USED ?? Projectile particle has changed character during interaction
if(result->GetStatusChange() == isAlive && thePro.GetDefinition() != aTrack.GetDefinition())
if(result->GetStatusChange() == isAlive &&
thePro.GetDefinition() != aTrack.GetDefinition())
{
G4DynamicParticle * aP = const_cast<G4DynamicParticle *>(aTrack.GetDynamicParticle());
G4DynamicParticle * aP =
const_cast<G4DynamicParticle *>(aTrack.GetDynamicParticle());
aP->SetDefinition(const_cast<G4ParticleDefinition *>(thePro.GetDefinition()));
}
@@ -459,9 +341,10 @@ const G4Track &aTrack, const G4Step &)
if(aSecTrack->GetDefinition()->GetPDGCharge()>1.5)
{
G4EffectiveCharge aCalculator;
G4double charge = aCalculator.GetCharge(aMaterial, aSecTrack->GetKineticEnergy(),
aSecTrack->GetDefinition()->GetPDGMass(),
aSecTrack->GetDefinition()->GetPDGCharge());
G4double charge =
aCalculator.GetCharge(aMaterial, aSecTrack->GetKineticEnergy(),
aSecTrack->GetDefinition()->GetPDGMass(),
aSecTrack->GetDefinition()->GetPDGCharge());
if(getenv("GHADChargeDebug"))
{
std::cout << "Recoil fractional charge is "
@@ -506,15 +389,16 @@ const G4Track &aTrack, const G4Step &)
// Put hadronic final state particles into G4ParticleChange
FillTotalResult(result, aTrack);
if(G4HadronicProcess_debug_flag) std::cout << "@@@@ hadronic process end "<< std::endl;
if(G4HadronicProcess_debug_flag)
std::cout << "@@@@ hadronic process end "<< std::endl;
return theTotalResult;
}
G4HadFinalState * G4HadronicProcess::
DoIsotopeCounting(G4HadFinalState * aResult,
const G4Track & aTrack,
const G4Nucleus & aNucleus)
G4HadFinalState*
G4HadronicProcess::DoIsotopeCounting(G4HadFinalState * aResult,
const G4Track & aTrack,
const G4Nucleus & aNucleus)
{
// get the PC from iso-production
if(theOldIsoResult) delete theOldIsoResult;
@@ -547,10 +431,10 @@ const G4Nucleus & aNucleus)
return aResult;
}
G4IsoResult * G4HadronicProcess::
ExtractResidualNucleus(const G4Track & ,
const G4Nucleus & aNucleus,
G4HadFinalState * aResult)
G4IsoResult*
G4HadronicProcess::ExtractResidualNucleus(const G4Track&,
const G4Nucleus& aNucleus,
G4HadFinalState* aResult)
{
G4double A = aNucleus.GetN();
G4double Z = aNucleus.GetZ();
@@ -597,8 +481,7 @@ G4HadFinalState * aResult)
return theResult;
}
G4double G4HadronicProcess::
XBiasSurvivalProbability()
G4double G4HadronicProcess::XBiasSurvivalProbability()
{
G4double result = 0;
G4double nLTraversed = GetTotalNumberOfInteractionLengthTraversed();
@@ -608,16 +491,17 @@ XBiasSurvivalProbability()
return result;
}
G4double G4HadronicProcess::
XBiasSecondaryWeight()
G4double G4HadronicProcess::XBiasSecondaryWeight()
{
G4double result = 0;
G4double nLTraversed = GetTotalNumberOfInteractionLengthTraversed();
result = 1./aScaleFactor*std::exp(-nLTraversed/aScaleFactor*(1-1./aScaleFactor));
result =
1./aScaleFactor*std::exp(-nLTraversed/aScaleFactor*(1-1./aScaleFactor));
return result;
}
void G4HadronicProcess::FillTotalResult(G4HadFinalState * aR, const G4Track & aT)
void
G4HadronicProcess::FillTotalResult(G4HadFinalState * aR, const G4Track & aT)
{
G4Nancheck go_wild;
theTotalResult->Clear();
@@ -712,8 +596,7 @@ void G4HadronicProcess::FillTotalResult(G4HadFinalState * aR, const G4Track & aT
G4Exception("G4HadronicProcess", "007", FatalException,
"use of unsupported track-status.");
}
if(GetProcessName() != "LElastic"
&& AlwaysKillLeadingHadron()
if(GetProcessName() != "hElastic" && GetProcessName() != "HadronElastic"
&& theTotalResult->GetTrackStatus()==fAlive
&& aR->GetStatusChange()==isAlive
)
@@ -729,7 +612,7 @@ void G4HadronicProcess::FillTotalResult(G4HadFinalState * aR, const G4Track & aT
//std::cout << "Debug 2 "<<aR->GetMomentumChange()<<" "<< aNew->GetMomentum() << std::endl;
//std::cout << "Debug 3 "<<newWeight<<std::endl;
//std::cout << std::endl;
G4HadSecondary * theSec = new G4HadSecondary(aNew, newWeight);
G4HadSecondary* theSec = new G4HadSecondary(aNew, 1.0);
aR->AddSecondary(theSec);
aR->SetStatusChange(stopAndKill);
theTotalResult->ProposeTrackStatus(fStopAndKill);