Import Geant4 10.5.1 source tree

This commit is contained in:
Gabriele Cosmo
2019-04-17 10:39:02 +02:00
parent a7fdc52004
commit 28a70706e0
661 changed files with 55791 additions and 106984 deletions
+3
View File
@@ -16,6 +16,9 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
March 11th, 2019 Gabriele Cosmo (procbiasing-V10-04-04)
- Fixed typos in printouts and comments.
May 17th, 2018 Jonathan Madsen (procbiasing-V10-04-03)
- updated "thread-local-static-var" model to
"function-returning-thread-local-static-reference" model
@@ -37,7 +37,7 @@
// occurs. In volumes with biasing (with a G4VBiasingOperator
// attached) the process gets what to do messaging the biasing
// operator :
// - at the PostStepGPIL level, for getting an occurence biasing
// - at the PostStepGPIL level, for getting an occurrence biasing
// operation. If such an operation is returned to the process
// this operation will be messaged at several places.
// - at the PostStepDoIt level, to get a possible final state
@@ -30,7 +30,7 @@
// G4ParticleChangeForOccurenceBiasing
//
// Class Description:
// A G4VParticleChange dedicated to occurence biasing : it
// A G4VParticleChange dedicated to occurrence biasing : it
// applies weights for non-interaction over a step, and for
// interaction at the end of the step (if interaction occurs) on
// top of a given particle change, that is the one produced by a
@@ -56,7 +56,7 @@ public:
G4double GetOccurenceWeightForInteraction() const {return fOccurenceWeightForInteraction;}
public:
// -- set a wrapped particle change AND USE IT TO UPDATE this occurence particle change state:
// -- set a wrapped particle change AND USE IT TO UPDATE this occurrence particle change state:
void SetWrappedParticleChange(G4VParticleChange* wpc);
G4VParticleChange* GetWrappedParticleChange() const {return fWrappedParticleChange;}
public:
@@ -97,7 +97,7 @@ G4VParticleChange* G4BOptnForceCommonTruncatedExp::ApplyFinalStateBiasing( const
if ( processGPIL <= step->GetStepLength() )
{
// -- if process won, wrapped process produces the final state.
// -- In this case, the weight for occurence biasing is applied
// -- In this case, the weight for occurrence biasing is applied
// -- by the callingProcess, at exit of present method. This is
// -- selected by "forceFinalState = false":
forceFinalState = false;
@@ -119,7 +119,7 @@ G4BiasingProcessInterface::G4BiasingProcessInterface(G4VProcess* wrappedProcess,
// -- create physical interaction law:
fPhysicalInteractionLaw = new G4InteractionLawPhysical("PhysicalInteractionLawFor("+GetProcessName()+")");
// -- instantiate particle change wrapper for occurence biaising:
// -- instantiate particle change wrapper for occurrence biaising:
fOccurenceBiasingParticleChange = new G4ParticleChangeForOccurenceBiasing("biasingPCfor"+GetProcessName());
// -- instantiate a "do nothing" particle change:
fDummyParticleChange = new G4ParticleChangeForNothing();
@@ -362,7 +362,7 @@ G4double G4BiasingProcessInterface::PostStepGetPhysicalInteractionLength( const
ResetForUnbiasedTracking();
if ( fIsPhysicsBasedBiasing )
{
// -- if the physics process has been under occurence biasing, reset it:
// -- if the physics process has been under occurrence biasing, reset it:
if ( fResetWrappedProcessInteractionLength )
{
fResetWrappedProcessInteractionLength = false;
@@ -414,7 +414,7 @@ G4double G4BiasingProcessInterface::PostStepGetPhysicalInteractionLength( const
fOccurenceBiasingOperation = (fSharedData->fCurrentBiasingOperator)->GetProposedOccurenceBiasingOperation( &track, this );
// -- no operation for occurence biasing, analog GPIL returns the wrapped process GPIL and condition values
// -- no operation for occurrence biasing, analog GPIL returns the wrapped process GPIL and condition values
if ( fOccurenceBiasingOperation == 0 )
{
*condition = fWrappedProcessForceCondition;
@@ -474,14 +474,14 @@ G4VParticleChange* G4BiasingProcessInterface::PostStepDoIt(const G4Track& track,
// -- stepping.
// -- In all other cases (analog final state or biased final but
// -- not forced) the final state weight may be modified by the
// -- occurence biasing, if such an occurence biasing is at play.
// -- occurrence biasing, if such an occurrence biasing is at play.
// -- Get final state, biased or analog:
G4VParticleChange* finalStateParticleChange;
G4BiasingAppliedCase BAC;
fFinalStateBiasingOperation = (fSharedData->fCurrentBiasingOperator)->GetProposedFinalStateBiasingOperation( &track, this );
// -- Flag below is to force the biased generated particle change to be retruned "as is" to the stepping, disregarding there
// -- was or not a occurence biasing that would apply. Weight relevance under full responsibility of the biasing operation.
// -- Flag below is to force the biased generated particle change to be returned "as is" to the stepping, disregarding there
// -- was or not a occurrence biasing that would apply. Weight relevance under full responsibility of the biasing operation.
G4bool forceBiasedFinalState = false;
if ( fFinalStateBiasingOperation != 0 )
{
@@ -494,7 +494,7 @@ G4VParticleChange* G4BiasingProcessInterface::PostStepDoIt(const G4Track& track,
BAC = BAC_None ;
}
// -- if no occurence biasing operation, we're done:
// -- if no occurrence biasing operation, we're done:
if ( fOccurenceBiasingOperation == 0 )
{
(fSharedData->fCurrentBiasingOperator)->ReportOperationApplied( this, BAC, fFinalStateBiasingOperation, finalStateParticleChange );
@@ -509,7 +509,7 @@ G4VParticleChange* G4BiasingProcessInterface::PostStepDoIt(const G4Track& track,
}
// -- If occurence biasing, applies the occurence biasing weight correction on top of final state (biased or not):
// -- If occurrence biasing, applies the occurrence biasing weight correction on top of final state (biased or not):
G4double weightForInteraction = 1.0;
if ( !fBiasingInteractionLaw->IsSingular() ) weightForInteraction =
fPhysicalInteractionLaw->ComputeEffectiveCrossSectionAt(step.GetStepLength()) /
@@ -615,9 +615,9 @@ G4double G4BiasingProcessInterface::AlongStepGetPhysicalInteractionLen
}
// ----------------------------------------------------------
// -- From here we have an valid occurence biasing operation:
// ----------------------------------------------------------
// -----------------------------------------------------------
// -- From here we have an valid occurrence biasing operation:
// -----------------------------------------------------------
// -- Give operation opportunity to shorten step proposed by physics process:
fBiasingAlongStepGPIL = fOccurenceBiasingOperation->ProposeAlongStepLimit( this );
G4double minimumStep = fBiasingAlongStepGPIL < currentMinimumStep ? fBiasingAlongStepGPIL : currentMinimumStep ;
@@ -1051,7 +1051,7 @@ void G4BiasingProcessInterface::InvokeWrappedProcessPostStepGPIL( const G4Track&
G4ForceCondition* condition )
{
G4double usedPreviousStepSize = previousStepSize;
// -- if the physics process has been under occurence biasing in the previous step
// -- if the physics process has been under occurrence biasing in the previous step
// -- we reset it, as we don't know if it will be biased again or not in this
// -- step. The pity is that PostStepGPIL and interaction length (cross-section)
// -- calculations are done both in the PostStepGPIL of the process, while here we
@@ -64,7 +64,7 @@ G4Step* G4ParticleChangeForOccurenceBiasing::UpdateStepForAlongStep(G4Step* step
// -- make particle change of wrapped process to apply its changes:
if ( fWrappedParticleChange ) fWrappedParticleChange->UpdateStepForAlongStep( step );
// -- multiply parent weight by weight due to occurence biasing:
// -- multiply parent weight by weight due to occurrence biasing:
G4StepPoint* postStepPoint = step->GetPostStepPoint();
postStepPoint->SetWeight( postStepPoint->GetWeight() * fOccurenceWeightForNonInteraction );
@@ -75,7 +75,7 @@ G4Step* G4ParticleChangeForOccurenceBiasing::UpdateStepForPostStep(G4Step* step)
{
// -- let make first wrapped process to apply its changes:
fWrappedParticleChange->UpdateStepForPostStep(step);
// -- then apply weight correction due to occurence biasing:
// -- then apply weight correction due to occurrence biasing:
G4StepPoint* postStepPoint = step->GetPostStepPoint();
postStepPoint->SetWeight( postStepPoint->GetWeight() * fOccurenceWeightForInteraction );
@@ -47,7 +47,7 @@ enum G4BiasingAppliedCase
BAC_None, // -- not under biasing
BAC_NonPhysics, // -- splitting, killing (not a physics process biasing)
BAC_FinalState, // -- physics process final state biasing only
BAC_Occurence // -- physics process occurence biasing; may come together with a final state biasing
BAC_Occurence // -- physics process occurrence biasing; may come together with a final state biasing
};
#endif
@@ -36,13 +36,13 @@
//
// o The change of behavior of a physics process can be:
// - a change of the PostStep interaction probabilty, so-called
// occurence biasing
// occurrence biasing
// - a change in final state production
// - both, provided above two are uncorrelated.
// o The change of occurence is driven by providing a biasing interaction
// o The change of occurrence is driven by providing a biasing interaction
// law (G4VBiasingInteractionLaw) that is used in place of the analog
// exponential law.
// This change of occurence is controlled through many handles.
// This change of occurrence is controlled through many handles.
// o The change in final state production is made through one single
// method the user is fully responsible of.
//
@@ -96,12 +96,12 @@ public:
// ** Methods for physics-based biasing:
// *************************************
// --
// ---- I. Biasing of the process occurence:
// ---- I. Biasing of the process occurrence:
// -----------------------------------------
// ---- The biasing of the process occurence regards the occurence of the PostStepDoIt
// ---- The biasing of the process occurrence regards the occurrence of the PostStepDoIt
// ---- behavior. But the weight is manipulated by both AlongStep methods (weight for
// ---- non-interaction) and PostStep methods (weight for interaction). For this
// ---- reason, occurence biasing is handled by both AlongStep and PostStep methods.
// ---- reason, occurrence biasing is handled by both AlongStep and PostStep methods.
// ----
// ---- If the operation is returned to the G4BiasingProcessInterface process by the
// ---- ProposeOccurenceBiasingOperation(...)/GetProposedOccurenceBiasingOperation(...) method
@@ -109,7 +109,7 @@ public:
// ----
// ---- I.1) Methods called in at the PostStepGetPhysicalInteractionLength(...) level :
// ----
// ------ o Main and mandatory method for biasing of the PostStep process biasing occurence :
// ------ o Main and mandatory method for biasing of the PostStep process biasing occurrence :
// ------ - propose an interaction law to be substituted to the process that is biased
// ------ - the operation is told which is the G4BiasingProcessInterface calling it with
// ------ callingProcess argument.
@@ -148,13 +148,13 @@ public:
// ------ User has full freedom for the particle change returned, and is reponsible for
// ------ the correctness of weights set to tracks.
// ------ The forcedBiasedFinalState should be left as is (ie false) in general. In this
// ------ way, if an occurence biasing is also applied in the step, the weight correction
// ------ way, if an occurrence biasing is also applied in the step, the weight correction
// ------ for it will be applied. If returned forceBiasedFinalState is returned true, then
// ------ the returned particle change will be returned as is to the stepping. Full
// ------ responsibility of the weight correctness is taken by the biasing operation.
// ------ The wrappedProcess can be accessed through the G4BiasingProcessInterface if needed.
// ------ This can be used in conjonction with an occurence biasing, provided this final
// ------ state biasing is uncorrelated with the occurence biasing (as single multiplication
// ------ This can be used in conjunction with an occurrence biasing, provided this final
// ------ state biasing is uncorrelated with the occurrence biasing (as single multiplication
// ------ of weights occur between these two biasings).
virtual G4VParticleChange* ApplyFinalStateBiasing( const G4BiasingProcessInterface* /* callingProcess */,
const G4Track* /* track */,
@@ -76,10 +76,10 @@
// 2) physics-based biasing:
// -------------------------
// Physics-based biasing operations are of two types:
// - biasing of the physics process occurence interaction law
// - biasing of the physics process occurrence interaction law
// - biasing of the physics process final state production
//
// a) The biasing of the occurence interaction law is proposed by:
// a) The biasing of the occurrence interaction law is proposed by:
//
// virtual G4VBiasingOperation* ProposeOccurenceBiasingOperation( const G4Track* track,
// const G4BiasingProcessInterface* callingProcess ) = 0;
@@ -131,7 +131,7 @@
// - physics-based biasing:
// - the operator requested no biasing operations, and did let the physics
// process go : biasingCase == BAC_None;
// - a single final state biasing was proposed, with no concomittant occurence:
// - a single final state biasing was proposed, with no concomittant occurrence:
// biasingCase == BAC_FinalState;
// The operation applied and final state passed to the tracking (particleChangeProduced) are
// passed as information to the operator.
@@ -142,14 +142,14 @@
// G4double weightForOccurenceInteraction,
// G4VBiasingOperation* finalStateOperationApplied,
// const G4VParticleChange* particleChangeProduced );
// This method is called in case an occurence biasing operation has been applied during the step.
// This method is called in case an occurrence biasing operation has been applied during the step.
// The biasingCase value is then the one of the final state biasing, if any : depending on if the
// occurence operation was applied alone and together with a final state operation, the
// occurrence operation was applied alone and together with a final state operation, the
// biasingCase will take values:
// - occurence biasing alone : biasingCase == BAC_None ;
// - occurrence biasing alone : biasingCase == BAC_None ;
// in which case finalStateOperationApplied == 0;
// - occurence biasing + final state biasing : biasingCase == BAC_FinalState;
// The particleChangeProduced is the one *before* application of the weight for occurence : hence
// - occurrence biasing + final state biasing : biasingCase == BAC_FinalState;
// The particleChangeProduced is the one *before* application of the weight for occurrence : hence
// either the particle change of the (analog) physics process, or the biased final state, resulting
// from the biasing by the finalStateOperationApplied operation.
//
@@ -213,11 +213,11 @@ protected:
virtual G4VBiasingOperation* ProposeNonPhysicsBiasingOperation( const G4Track* track, const G4BiasingProcessInterface* callingProcess ) = 0;
// -- physics-based biasing:
// -------------------------
// -- Method to propose an occurence biasing operation : ie a change of the interaction length distribution. The proposed
// -- Method to propose an occurrence biasing operation : ie a change of the interaction length distribution. The proposed
// -- biasing operation will then be asked for its interaction law.
// -- Note that *** all sanity checks regarding the operation and its interaction law will have to have been performed
// -- before returning the biasing operation pointer *** as no corrective/aborting actions will be possible beyond this point.
// -- The informations provided by the G4BiasingProcessInterface calling process (previous occurence operation, previous step length,
// -- The informations provided by the G4BiasingProcessInterface calling process (previous occurrence operation, previous step length,
// -- etc.) might be useful for doing this. They will be useful also to decide with continuing with a same operation proposed
// -- in the previous step, updating the interaction law taking into account the new G4Track state and the previous step size.
// -- [ Second operator method called, at the PostStepGetPhysicalInterationLenght(...) level. ]
@@ -231,9 +231,9 @@ protected:
// ---- report to operator about the operation applied, the biasingCase value provides the case of biasing applied:
virtual void OperationApplied( const G4BiasingProcessInterface* callingProcess, G4BiasingAppliedCase biasingCase,
G4VBiasingOperation* operationApplied, const G4VParticleChange* particleChangeProduced );
// ---- same as above, report about the operation applied, for the case an occurence biasing was applied, together or not with a final state biasing.
// ---- same as above, report about the operation applied, for the case an occurrence biasing was applied, together or not with a final state biasing.
// ---- The variable biasingCase tells if the final state is a biased one or not. **But in all cases**, this call happens only
// ---- for an occurence biaising : ie the occurence weight is applied on top of the particleChangeProduced, which is the particle
// ---- for an occurrence biasing : ie the occurrence weight is applied on top of the particleChangeProduced, which is the particle
// ---- *before* the weight application for occurence biasing.
virtual void OperationApplied( const G4BiasingProcessInterface* callingProcess, G4BiasingAppliedCase biasingCase,
G4VBiasingOperation* occurenceOperationApplied, G4double weightForOccurenceInteraction,