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,
+4
View File
@@ -15,6 +15,10 @@ committal in the CVS repository !
----------------------------------------------------------
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
Mar. 11th, 2019 - G.Cosmo (procuts-V10-04-01)
- Fixed typos in printouts in G4PhysicsTableHelper and G4ProductionCutsTable.
Aug. 13th, 2018 - H.Kurashige (procuts-V10-04-00)
- clean up codes (use nullptr, and so on )
@@ -63,8 +63,8 @@ class G4MaterialCutsCouple
virtual ~G4MaterialCutsCouple();
// equal opperators
G4int operator==(const G4MaterialCutsCouple &right) const;
G4int operator!=(const G4MaterialCutsCouple &right) const;
G4bool operator==(const G4MaterialCutsCouple &right) const;
G4bool operator!=(const G4MaterialCutsCouple &right) const;
public: // with description
void SetMaterial(const G4Material*);
@@ -127,13 +127,13 @@ inline
{ return fCuts; }
inline
G4int G4MaterialCutsCouple::operator==(const G4MaterialCutsCouple &right) const
G4bool G4MaterialCutsCouple::operator==(const G4MaterialCutsCouple &right) const
{
return (this == &right);
}
inline
G4int G4MaterialCutsCouple::operator!=(const G4MaterialCutsCouple &right) const
G4bool G4MaterialCutsCouple::operator!=(const G4MaterialCutsCouple &right) const
{
return (this != &right);
}
@@ -73,8 +73,8 @@ class G4ProductionCuts
virtual ~G4ProductionCuts();
// equal opperators
G4int operator==(const G4ProductionCuts &right) const;
G4int operator!=(const G4ProductionCuts &right) const;
G4bool operator==(const G4ProductionCuts &right) const;
G4bool operator!=(const G4ProductionCuts &right) const;
public: // with description
// Set Cuts methods
@@ -70,8 +70,8 @@ class G4VRangeToEnergyConverter
virtual ~G4VRangeToEnergyConverter();
// equal opperators
G4int operator==(const G4VRangeToEnergyConverter &right) const;
G4int operator!=(const G4VRangeToEnergyConverter &right) const;
G4bool operator==(const G4VRangeToEnergyConverter &right) const;
G4bool operator!=(const G4VRangeToEnergyConverter &right) const;
public: // with description
// calculate energy cut from given range cut for the material
@@ -29,8 +29,9 @@
// GEANT 4 class header file
//
// Class Description
//
// G4PhysicsTableHelper is a static utility class
// for helping proceeses to build their physics table
// for helping processes to build their physics table
//
// ------------------------------------------------------------
// First Implementation 20 Aug. 2004 H.Kurashige
@@ -145,7 +146,7 @@ G4bool G4PhysicsTableHelper::RetrievePhysicsTable(G4PhysicsTable* physTable,
#ifdef G4VERBOSE
if (verboseLevel>1) {
G4cerr << "G4PhysicsTableHelper::RetrievePhysicsTable ";
G4cerr << "Fail to retreive from "<< fileName << G4endl;
G4cerr << "Fail to retrieve from "<< fileName << G4endl;
}
#endif
G4Exception( "G4ProductionCutsTable::RetrievePhysicsTable()",
@@ -75,13 +75,13 @@ G4ProductionCuts & G4ProductionCuts::operator=(const G4ProductionCuts &right)
G4int G4ProductionCuts::operator==(const G4ProductionCuts &right) const
G4bool G4ProductionCuts::operator==(const G4ProductionCuts &right) const
{
return (this == &right);
}
G4int G4ProductionCuts::operator!=(const G4ProductionCuts &right) const
G4bool G4ProductionCuts::operator!=(const G4ProductionCuts &right) const
{
return (this != &right);
}
@@ -437,7 +437,7 @@ G4bool G4ProductionCutsTable::StoreCutsTable(const G4String& dir,
#ifdef G4VERBOSE
if (verboseLevel >2) {
G4cout << "G4ProductionCutsTable::StoreCutsTable " ;
G4cout << " Material/Cuts information have been succesfully stored ";
G4cout << " Material/Cuts information have been successfully stored ";
if (ascii) {
G4cout << " in Ascii mode ";
}else{
@@ -458,7 +458,7 @@ G4bool G4ProductionCutsTable::RetrieveCutsTable(const G4String& dir,
#ifdef G4VERBOSE
if (verboseLevel >2) {
G4cout << "G4ProductionCutsTable::RetrieveCutsTable " ;
G4cout << " Material/Cuts information have been succesfully retreived ";
G4cout << " Material/Cuts information have been successfully retrieved ";
if (ascii) {
G4cout << " in Ascii mode ";
}else{
@@ -130,12 +130,12 @@ G4VRangeToEnergyConverter::~G4VRangeToEnergyConverter()
}
G4int G4VRangeToEnergyConverter::operator==(const G4VRangeToEnergyConverter &right) const
G4bool G4VRangeToEnergyConverter::operator==(const G4VRangeToEnergyConverter &right) const
{
return this == &right;
}
G4int G4VRangeToEnergyConverter::operator!=(const G4VRangeToEnergyConverter &right) const
G4bool G4VRangeToEnergyConverter::operator!=(const G4VRangeToEnergyConverter &right) const
{
return this != &right;
}
+3
View File
@@ -16,6 +16,9 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
- 14 December 2018 Makoto Asai (decay-V10-04-00)
- G4Decay.cc, G4UnknownDecay : Allowing absolute zero proper decay time.
- 12 September 2017 Krzysztof Genser (decay-V10-03-04)
- Moved Muonic Atom files to processes/hadronic/stopping
- Replaced DECAY_MuonicAtomDecay process type with DECAY_MuAtom
+1 -1
View File
@@ -454,7 +454,7 @@ G4double G4Decay::PostStepGetPhysicalInteractionLength(
//pre-assigned Decay time case
// reminder proper time
fRemainderLifeTime = pTime - track.GetProperTime();
if (fRemainderLifeTime <= 0.0) fRemainderLifeTime = DBL_MIN;
if (fRemainderLifeTime <= 0.0) fRemainderLifeTime = 0.0;
G4double rvalue=0.0;
// use pre-assigned Decay time to determine PIL
+2 -2
View File
@@ -71,7 +71,7 @@ G4bool G4UnknownDecay::IsApplicable(const G4ParticleDefinition& aParticleType)
G4double G4UnknownDecay::GetMeanFreePath(const G4Track& /*aTrack*/,G4double, G4ForceCondition*)
{
return DBL_MIN;
return 0.0;
}
void G4UnknownDecay::BuildPhysicsTable(const G4ParticleDefinition&)
@@ -131,7 +131,7 @@ G4VParticleChange* G4UnknownDecay::DecayIt(const G4Track& aTrack, const G4Step&
G4double finalGlobalTime = aTrack.GetGlobalTime();
//boost all decay products to laboratory frame
//if the particle has traveled
if(aParticle->GetPreAssignedDecayProperTime()>0.) {
if(aParticle->GetPreAssignedDecayProperTime()>=0.) {
products->Boost( ParentEnergy, ParentDirection);
}
@@ -16,13 +16,16 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
---------------------------------------------------------
11 Mar 2019: G. Cosmo (emadjoint-V10-04-00)
-Fixed typos in printouts and comments.
06 Nov 2017: V. Ivanchenko (emadjoint-V10-03-01)
-Extended correction of occurence of FPE in G4AdjointForcedInteractionForGamma.
-Extended correction of occurrence of FPE in G4AdjointForcedInteractionForGamma.
-G4eAdjointMultipleScattering - change index of the default accourding to recent
modifications in emutils
27 Jan 2017: L. Desorgher (emadjoint-V10-03-00)
-Correction of occurence of FPE in G4AdjointForcedInteractionForGamma.
-Correction of occurrence of FPE in G4AdjointForcedInteractionForGamma.
27 Octb 2016: L. Desorgher (emadjoint-V10-02-03)
-Correction in G4AdjointForcedInteractionForGamma to avoid high weight of forced gamma
@@ -43,7 +43,7 @@
//-------------------------------------------------------------
// Documentation:
// Is responsible for the management of all adjoint cross sections matrices, and for the computation of the total forward and adjoint cross sections.
// Total adjoint and forward cross sections are needed to correct the weight of a particle after a tracking step or after the occurence of a reverse reaction.
// Total adjoint and forward cross sections are needed to correct the weight of a particle after a tracking step or after the occurrence of a reverse reaction.
// It is also used to sample an adjoint secondary from a given adjoint cross section matrix.
//
#ifndef G4AdjointCSManager_h
@@ -39,7 +39,7 @@
//
// -January 2009. L. Desorgher
// Put a higher limit on the CS to avoid a high rate of Inverse Photo e- effect at low energy. The very high adjoint CS of the reverse
// photo electric reaction produce a high rate of reverse photo electric reaction in the inner side of a shielding for eaxmple, the correction of this occurence
// photo electric reaction produce a high rate of reverse photo electric reaction in the inner side of a shielding for eaxmple, the correction of this occurrence
// by weight correction in the StepDoIt method is not statistically sufficient at small energy. The problem is partially solved by setting an higher CS limit
// and compensating it by an extra weight correction factor. However when coupling it with other reverse processes the reverse photo-electric is still
// the source of very occasional high weight that decrease the efficiency of the computation. A way to solve this problemn is still needed but is difficult
@@ -16,6 +16,16 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
21 March 2018: V.Ivantchenko (emhighenergy-V10-04-03)
21 March 2019: V.Ivantchenko
- G4GammaConversionToMuons - fixed low-energy part of the model by adding
of intermediate limit 5*MuMass, below which an approximation of
x-section similar to the Bethe-Heitler model is used; fixed bug
in energy sampling for low-energy
01 March 2019: V.Ivantchenko
- G4mplIonisation, G4mplIonisationWithDeltaModel - added low limit
for delta-electron production threshold (fixing problem #2126)
17 Sept 2018: D.Sawkey (emhighenergy-V10-04-02)
- G4eeToHadrons, G4eeToHadronsMultiModel, G4hBremsstrahlung, G4hPairProduction,
G4hhIonisation, G4mplIonisation: automatic documentation format now rST
@@ -124,6 +124,7 @@ private:
G4double Mmuon;
G4double Rc;
G4double LimitEnergy; // energy limit for accurate x-section
G4double LowestEnergyLimit ; // low energy limit of the tables
G4double HighestEnergyLimit ; // high energy limit of the tables
@@ -72,6 +72,9 @@ public:
virtual G4bool IsApplicable(const G4ParticleDefinition& p) override;
virtual G4double MinPrimaryEnergy(const G4ParticleDefinition* p,
const G4Material*, G4double cut) final;
// Print out of the class parameters
virtual void PrintInfo() override;
@@ -81,7 +84,7 @@ public:
protected:
virtual void InitialiseEnergyLossProcess(const G4ParticleDefinition*,
const G4ParticleDefinition*) override;
const G4ParticleDefinition*) override;
private:
@@ -91,7 +94,6 @@ private:
G4double magneticCharge;
G4bool isInitialised;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -60,7 +60,7 @@ class G4mplIonisationWithDeltaModel : public G4VEmModel, public G4VEmFluctuation
public:
explicit G4mplIonisationWithDeltaModel(G4double mCharge,
const G4String& nam = "mplIonisationWithDelta");
const G4String& nam = "mplIonisationWithDelta");
virtual ~G4mplIonisationWithDeltaModel();
@@ -68,9 +68,9 @@ public:
const G4DataVector&) override;
virtual G4double ComputeDEDXPerVolume(const G4Material*,
const G4ParticleDefinition*,
G4double kineticEnergy,
G4double cutEnergy) override;
const G4ParticleDefinition*,
G4double kineticEnergy,
G4double cutEnergy) override;
virtual G4double ComputeCrossSectionPerElectron(
const G4ParticleDefinition*,
@@ -86,10 +86,10 @@ public:
G4double maxEnergy) override;
virtual void SampleSecondaries(std::vector<G4DynamicParticle*>*,
const G4MaterialCutsCouple*,
const G4DynamicParticle*,
G4double tmin,
G4double maxEnergy) override;
const G4MaterialCutsCouple*,
const G4DynamicParticle*,
G4double tmin,
G4double maxEnergy) override;
virtual G4double SampleFluctuations(const G4MaterialCutsCouple*,
@@ -103,6 +103,9 @@ public:
G4double tmax,
G4double length) override;
virtual G4double MinEnergyCut(const G4ParticleDefinition*,
const G4MaterialCutsCouple* couple) override;
void SetParticle(const G4ParticleDefinition* p);
protected:
@@ -112,7 +115,8 @@ protected:
private:
G4double ComputeDEDXAhlen(const G4Material* material, G4double bg2, G4double cut);
G4double ComputeDEDXAhlen(const G4Material* material, G4double bg2,
G4double cut);
// hide assignment operator
G4mplIonisationWithDeltaModel &
@@ -120,7 +124,7 @@ private:
G4mplIonisationWithDeltaModel(const G4mplIonisationWithDeltaModel&) = delete;
const G4ParticleDefinition* monopole;
G4ParticleDefinition* theElectron;
G4ParticleDefinition* theElectron;
G4ParticleChangeForLoss* fParticleChange;
G4double mass;
@@ -136,7 +140,6 @@ private:
G4double pi_hbarc2_over_mc2;
static std::vector<G4double>* dedx0;
};
#endif
@@ -56,8 +56,9 @@ G4GammaConversionToMuons::G4GammaConversionToMuons(const G4String& processName,
: G4VDiscreteProcess (processName, type),
Mmuon(G4MuonPlus::MuonPlus()->GetPDGMass()),
Rc(elm_coupling/Mmuon),
LowestEnergyLimit (4.*Mmuon), // 4*Mmuon
HighestEnergyLimit(1e21*eV), // ok to 1e21eV=1e12GeV, then LPM suppression
LimitEnergy (5.*Mmuon),
LowestEnergyLimit (2.*Mmuon),
HighestEnergyLimit(1e12*GeV), // ok to 1e12GeV, then LPM suppression
CrossSecFactor(1.)
{
SetProcessSubType(fGammaConversionToMuMu);
@@ -116,12 +117,19 @@ G4GammaConversionToMuons::ComputeMeanFreePath(G4double GammaEnergy,
const G4double* NbOfAtomsPerVolume = aMaterial->GetVecNbOfAtomsPerVolume();
G4double SIGMA = 0.0;
G4double fact = 1.0;
G4double e = GammaEnergy;
// low energy approximation as in Bethe-Heitler model
if(e < LimitEnergy) {
G4double y = (e - LowestEnergyLimit)/(LimitEnergy - LowestEnergyLimit);
fact = y*y;
e = LimitEnergy;
}
for ( size_t i=0 ; i < aMaterial->GetNumberOfElements(); ++i)
{
SIGMA += NbOfAtomsPerVolume[i] *
ComputeCrossSectionPerAtom(GammaEnergy,
(*theElementVector)[i]->GetZasInt());
SIGMA += NbOfAtomsPerVolume[i] * fact *
ComputeCrossSectionPerAtom(e, (*theElementVector)[i]->GetZasInt());
}
return (SIGMA > 0.0) ? 1./SIGMA : DBL_MAX;
}
@@ -147,7 +155,7 @@ G4double G4GammaConversionToMuons::ComputeCrossSectionPerAtom(
// Total cross section parametrisation from H.Burkhardt
// It gives a good description at any energy (from 0 to 10**21 eV)
{
if(Egam <= LowestEnergyLimit) return 0.0; // below threshold return 0
if(Egam < LimitEnergy) return 0.0; // below threshold return 0
G4double CrossSection = 0.0;
G4NistManager* nist = G4NistManager::Instance();
@@ -235,11 +243,11 @@ G4VParticleChange* G4GammaConversionToMuons::PostStepDoIt(
G4double C2Term2=electron_mass_c2/(183.*Zthird*Mmuon);
G4double GammaMuonInv=Mmuon/Egam;
G4double sqrtx=sqrt(.25-GammaMuonInv);
G4double xmax=.5+sqrtx;
G4double xmin=.5-sqrtx;
// generate xPlus according to the differential cross section by rejection
G4double xmin=(Egam < LimitEnergy) ? GammaMuonInv : .5-sqrt(.25-GammaMuonInv);
G4double xmax=1.-xmin;
G4double Ds2=(Dn*sqrte-2.);
G4double sBZ=sqrte*B*Zthird/electron_mass_c2;
G4double LogWmaxInv=1./G4Log(Winfty*(1.+2.*Ds2*GammaMuonInv)
@@ -247,15 +255,14 @@ G4VParticleChange* G4GammaConversionToMuons::PostStepDoIt(
G4double xPlus,xMinus,xPM,result,W;
G4int nn = 0;
const G4int nmax = 1000;
do
{ xPlus=xmin+G4UniformRand()*(xmax-xmin);
do {
xPlus=xmin+G4UniformRand()*(xmax-xmin);
xMinus=1.-xPlus;
xPM=xPlus*xMinus;
G4double del=Mmuon*Mmuon/(2.*Egam*xPM);
W=Winfty*(1.+Ds2*del/Mmuon)/(1.+sBZ*del);
if(W<=1. || nn > nmax) { break; } // to avoid negative cross section at xmin
G4double xxp=1.-4./3.*xPM; // the main xPlus dependence
result=xxp*G4Log(W)*LogWmaxInv;
result=(xxp > 0.) ? xxp*G4Log(W)*LogWmaxInv : 0.0;
if(result>1.) {
G4cout << "G4GammaConversionToMuons::PostStepDoIt WARNING:"
<< " in dSigxPlusGen, result=" << result << " > 1" << G4endl;
@@ -83,8 +83,21 @@ G4bool G4mplIonisation::IsApplicable(const G4ParticleDefinition&)
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4double G4mplIonisation::MinPrimaryEnergy(const G4ParticleDefinition* mpl,
const G4Material*,
G4double cut)
{
G4double x = 0.5*cut/electron_mass_c2;
G4double mass = mpl->GetPDGMass();
G4double ratio = electron_mass_c2/mass;
G4double gam = x*ratio + std::sqrt((1. + x)*(1. + x*ratio*ratio));
return mass*(gam - 1.0);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G4mplIonisation::InitialiseEnergyLossProcess(const G4ParticleDefinition* p,
const G4ParticleDefinition*)
const G4ParticleDefinition*)
{
if(isInitialised) { return; }
@@ -62,6 +62,7 @@
#include "G4ProductionCutsTable.hh"
#include "G4MaterialCutsCouple.hh"
#include "G4Log.hh"
#include "G4Pow.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -70,10 +71,10 @@ using namespace std;
std::vector<G4double>* G4mplIonisationWithDeltaModel::dedx0 = nullptr;
G4mplIonisationWithDeltaModel::G4mplIonisationWithDeltaModel(G4double mCharge,
const G4String& nam)
const G4String& nam)
: G4VEmModel(nam),G4VEmFluctuationModel(nam),
magCharge(mCharge),
twoln10(log(100.0)),
twoln10(std::log(100.0)),
betalow(0.01),
betalim(0.1),
beta2lim(betalim*betalim),
@@ -88,7 +89,7 @@ G4mplIonisationWithDeltaModel::G4mplIonisationWithDeltaModel(G4double mCharge,
fParticleChange = nullptr;
theElectron = G4Electron::Electron();
G4cout << "### Monopole ionisation model with d-electron production, Gmag= "
<< magCharge/eplus << G4endl;
<< magCharge/eplus << G4endl;
monopole = nullptr;
mass = 0.0;
}
@@ -118,7 +119,7 @@ void G4mplIonisationWithDeltaModel::SetParticle(const G4ParticleDefinition* p)
void
G4mplIonisationWithDeltaModel::Initialise(const G4ParticleDefinition* p,
const G4DataVector&)
const G4DataVector&)
{
if(!monopole) { SetParticle(p); }
if(!fParticleChange) { fParticleChange = GetParticleChangeForLoss(); }
@@ -129,27 +130,37 @@ G4mplIonisationWithDeltaModel::Initialise(const G4ParticleDefinition* p,
G4int numOfCouples = theCoupleTable->GetTableSize();
G4int n = dedx0->size();
if(n < numOfCouples) { dedx0->resize(numOfCouples); }
G4Pow* g4calc = G4Pow::GetInstance();
// initialise vector
for(G4int i=0; i<numOfCouples; ++i) {
const G4Material* material =
theCoupleTable->GetMaterialCutsCouple(i)->GetMaterial();
theCoupleTable->GetMaterialCutsCouple(i)->GetMaterial();
G4double eDensity = material->GetElectronDensity();
G4double vF = electron_Compton_length*pow(3.*pi*pi*eDensity,0.3333333333);
G4double vF = electron_Compton_length*g4calc->A13(3.*pi*pi*eDensity);
(*dedx0)[i] = pi_hbarc2_over_mc2*eDensity*nmpl*nmpl*
(G4Log(2*vF/fine_structure_const) - 0.5)/vF;
(G4Log(2*vF/fine_structure_const) - 0.5)/vF;
}
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4double
G4mplIonisationWithDeltaModel::MinEnergyCut(const G4ParticleDefinition*,
const G4MaterialCutsCouple* couple)
{
return couple->GetMaterial()->GetIonisation()->GetMeanExcitationEnergy();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4double
G4mplIonisationWithDeltaModel::ComputeDEDXPerVolume(const G4Material* material,
const G4ParticleDefinition* p,
G4double kineticEnergy,
G4double maxEnergy)
const G4ParticleDefinition* p,
G4double kineticEnergy,
G4double maxEnergy)
{
if(!monopole) { SetParticle(p); }
G4double tmax = MaxSecondaryEnergy(p,kineticEnergy);
@@ -162,7 +173,6 @@ G4mplIonisationWithDeltaModel::ComputeDEDXPerVolume(const G4Material* material,
G4double beta = sqrt(beta2);
// low-energy asymptotic formula
//G4double dedx = dedxlim*beta*material->GetDensity();
G4double dedx = (*dedx0)[CurrentCouple()->GetIndex()]*beta;
// above asymptotic
@@ -173,8 +183,6 @@ G4mplIonisationWithDeltaModel::ComputeDEDXPerVolume(const G4Material* material,
dedx = ComputeDEDXAhlen(material, bg2, cutEnergy);
} else {
//G4double dedx1 = dedxlim*betalow*material->GetDensity();
G4double dedx1 = (*dedx0)[CurrentCouple()->GetIndex()]*betalow;
G4double dedx2 = ComputeDEDXAhlen(material, bg2lim, cutEnergy);
@@ -191,15 +199,15 @@ G4mplIonisationWithDeltaModel::ComputeDEDXPerVolume(const G4Material* material,
G4double
G4mplIonisationWithDeltaModel::ComputeDEDXAhlen(const G4Material* material,
G4double bg2,
G4double cutEnergy)
G4double bg2,
G4double cutEnergy)
{
G4double eDensity = material->GetElectronDensity();
G4double eexc = material->GetIonisation()->GetMeanExcitationEnergy();
// Ahlen's formula for nonconductors, [1]p157, f(5.7)
G4double dedx =
0.5*(log(2.0 * electron_mass_c2 * bg2*cutEnergy / (eexc*eexc)) - 1.0);
0.5*(G4Log(2.0*electron_mass_c2*bg2*cutEnergy/(eexc*eexc)) -1.0);
// Kazama et al. cross-section correction
G4double k = 0.406;
@@ -217,7 +225,7 @@ G4mplIonisationWithDeltaModel::ComputeDEDXAhlen(const G4Material* material,
// now compute the total ionization loss
dedx *= pi_hbarc2_over_mc2 * eDensity * nmpl * nmpl;
if (dedx < 0.0) { dedx = 0.; }
dedx = std::max(dedx, 0.0);
return dedx;
}
@@ -226,18 +234,16 @@ G4mplIonisationWithDeltaModel::ComputeDEDXAhlen(const G4Material* material,
G4double
G4mplIonisationWithDeltaModel::ComputeCrossSectionPerElectron(
const G4ParticleDefinition* p,
G4double kineticEnergy,
G4double cut,
G4double maxKinEnergy)
G4double kineticEnergy,
G4double cut,
G4double maxKinEnergy)
{
if(!monopole) { SetParticle(p); }
G4double cross = 0.0;
G4double tmax = MaxSecondaryEnergy(p, kineticEnergy);
G4double maxEnergy = std::min(tmax,maxKinEnergy);
G4double maxEnergy = std::min(tmax, maxKinEnergy);
G4double cutEnergy = std::max(LowEnergyLimit(), cut);
if(cutEnergy < maxEnergy) {
cross = (0.5/cutEnergy - 0.5/maxEnergy)*pi_hbarc2_over_mc2 * nmpl * nmpl;
}
G4double cross = (cutEnergy < maxEnergy)
? (0.5/cutEnergy - 0.5/maxEnergy)*pi_hbarc2_over_mc2 * nmpl * nmpl : 0.0;
return cross;
}
@@ -245,11 +251,11 @@ G4mplIonisationWithDeltaModel::ComputeCrossSectionPerElectron(
G4double
G4mplIonisationWithDeltaModel::ComputeCrossSectionPerAtom(
const G4ParticleDefinition* p,
G4double kineticEnergy,
G4double Z, G4double,
G4double cutEnergy,
G4double maxEnergy)
const G4ParticleDefinition* p,
G4double kineticEnergy,
G4double Z, G4double,
G4double cutEnergy,
G4double maxEnergy)
{
G4double cross =
Z*ComputeCrossSectionPerElectron(p,kineticEnergy,cutEnergy,maxEnergy);
@@ -260,10 +266,10 @@ G4mplIonisationWithDeltaModel::ComputeCrossSectionPerAtom(
void
G4mplIonisationWithDeltaModel::SampleSecondaries(vector<G4DynamicParticle*>* vdp,
const G4MaterialCutsCouple*,
const G4DynamicParticle* dp,
G4double minKinEnergy,
G4double maxEnergy)
const G4MaterialCutsCouple*,
const G4DynamicParticle* dp,
G4double minKinEnergy,
G4double maxEnergy)
{
G4double kineticEnergy = dp->GetKineticEnergy();
G4double tmax = MaxSecondaryEnergy(dp->GetDefinition(),kineticEnergy);
@@ -272,8 +278,8 @@ G4mplIonisationWithDeltaModel::SampleSecondaries(vector<G4DynamicParticle*>* vdp
if(minKinEnergy >= maxKinEnergy) { return; }
//G4cout << "G4mplIonisationWithDeltaModel::SampleSecondaries: E(GeV)= "
// << kineticEnergy/GeV << " M(GeV)= " << mass/GeV
// << " tmin(MeV)= " << minKinEnergy/MeV << G4endl;
// << kineticEnergy/GeV << " M(GeV)= " << mass/GeV
// << " tmin(MeV)= " << minKinEnergy/MeV << G4endl;
G4double totEnergy = kineticEnergy + mass;
G4double etot2 = totEnergy*totEnergy;
@@ -290,7 +296,7 @@ G4mplIonisationWithDeltaModel::SampleSecondaries(vector<G4DynamicParticle*>* vdp
sqrt(deltaKinEnergy * (deltaKinEnergy + 2.0*electron_mass_c2));
G4double cost = deltaKinEnergy * (totEnergy + electron_mass_c2) /
(deltaMomentum * totMomentum);
if(cost > 1.0) { cost = 1.0; }
cost = std::min(cost, 1.0);
G4double sint = sqrt((1.0 - cost)*(1.0 + cost));
@@ -318,11 +324,11 @@ G4mplIonisationWithDeltaModel::SampleSecondaries(vector<G4DynamicParticle*>* vdp
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4double G4mplIonisationWithDeltaModel::SampleFluctuations(
const G4MaterialCutsCouple* couple,
const G4DynamicParticle* dp,
G4double tmax,
G4double length,
G4double meanLoss)
const G4MaterialCutsCouple* couple,
const G4DynamicParticle* dp,
G4double tmax,
G4double length,
G4double meanLoss)
{
G4double siga = Dispersion(couple->GetMaterial(),dp,tmax,length);
G4double loss = meanLoss;
@@ -349,9 +355,9 @@ G4double G4mplIonisationWithDeltaModel::SampleFluctuations(
G4double
G4mplIonisationWithDeltaModel::Dispersion(const G4Material* material,
const G4DynamicParticle* dp,
G4double tmax,
G4double length)
const G4DynamicParticle* dp,
G4double tmax,
G4double length)
{
G4double siga = 0.0;
G4double tau = dp->GetKineticEnergy()/mass;
@@ -369,7 +375,7 @@ G4mplIonisationWithDeltaModel::Dispersion(const G4Material* material,
G4double
G4mplIonisationWithDeltaModel::MaxSecondaryEnergy(const G4ParticleDefinition*,
G4double kinEnergy)
G4double kinEnergy)
{
G4double tau = kinEnergy/mass;
return 2.0*electron_mass_c2*tau*(tau + 2.);
@@ -16,6 +16,9 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
05.02.2019 S. Incerti, emlowen-V10-04-13
- Fix Bugzill 2089
22.10.2018 F. Longo, emlowen-V10-04-12
- Fix Bugzilla 2089
@@ -55,9 +55,9 @@ class G4PenelopeOscillator
//I need to overload the following operators: > < == =
G4PenelopeOscillator& operator=(const G4PenelopeOscillator&);
int operator==(const G4PenelopeOscillator&) const;
int operator>(const G4PenelopeOscillator&) const;
int operator<(const G4PenelopeOscillator&) const;
G4bool operator==(const G4PenelopeOscillator&) const;
G4bool operator>(const G4PenelopeOscillator&) const;
G4bool operator<(const G4PenelopeOscillator&) const;
//Setters and getters
G4double GetHartreeFactor() {return hartreeFactor;};
@@ -75,28 +75,28 @@ G4PenelopeOscillator& G4PenelopeOscillator::operator=(const G4PenelopeOscillator
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
int G4PenelopeOscillator::operator==(const G4PenelopeOscillator& right) const
G4bool G4PenelopeOscillator::operator==(const G4PenelopeOscillator& right) const
{
//Oscillator are ordered according to the ionisation energy. They are considered to be
//equal if the ionisation energy is the same
return (ionisationEnergy == right.ionisationEnergy) ? 1 : 0;
return (ionisationEnergy == right.ionisationEnergy) ? true : false;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
int G4PenelopeOscillator::operator>(const G4PenelopeOscillator& right) const
G4bool G4PenelopeOscillator::operator>(const G4PenelopeOscillator& right) const
{
//Oscillator are ordered according to the ionisation energy.
return (ionisationEnergy > right.ionisationEnergy) ? 1 : 0;
return (ionisationEnergy > right.ionisationEnergy) ? true : false;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
int G4PenelopeOscillator::operator<(const G4PenelopeOscillator& right) const
G4bool G4PenelopeOscillator::operator<(const G4PenelopeOscillator& right) const
{
//Oscillator are ordered according to the ionisation energy.
return (ionisationEnergy < right.ionisationEnergy) ? 1 : 0;
return (ionisationEnergy < right.ionisationEnergy) ? true : false;
}
@@ -257,7 +257,7 @@ G4PhotoElectricAngularGeneratorPolarized::DSigmaKshellGavrila1959(
+ (1-sqrtOneBeta2)/(4*beta2*oneBetaCosTheta*oneBetaCosTheta) * (beta/oneBeta2 - 2/oneBeta2 * cosTheta * cosPhi2 +
(1-sqrtOneBeta2)/oneBeta2_to_3_2 * cosTheta - beta * (1-sqrtOneBeta2)/oneBeta2_to_3_2);
dsigma = ( firstTerm*(1-pi*fine_structure_const/beta) + secondTerm*(pi*fine_structure_const) );
dsigma = ( firstTerm*(1-pi*fine_structure_const/beta) + secondTerm*(pi*fine_structure_const) )*std::sin(theta);
return dsigma;
}
@@ -16,9 +16,12 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
07 February 19: V.Ivanchenko (emmuons-V10-04-06)
- G4MuMultipleSacttering - reduced length of printout (fix problem #2105)
17 September 18: D.Sawkey (emmuons-V10-04-05)
- G4MuMultipleScattering, G4MuPairProduction, G4eePairProduction, G4MuBremsstrahlung,
G4MuIonisation: automatic documenation format now rST
- G4MuMultipleScattering, G4MuPairProduction, G4eePairProduction,
G4MuBremsstrahlung, G4MuIonisation: automatic documenation format now rST
22 August 18: V.Ivant (emmuons-V10-04-04)
- G4EnergyLossForExtrapolator - fixed MT initialisation and destruction
@@ -82,9 +82,9 @@ void G4MuMultipleScattering::InitialiseProcess(const G4ParticleDefinition*)
void G4MuMultipleScattering::StreamProcessInfo(std::ostream& out) const
{
out << " RangeFactor= " << RangeFactor()
<< ", step limit type: " << StepLimitType()
<< ", lateralDisplacement: " << LateralDisplasmentFlag()
<< ", polarAngleLimit(deg)= " << PolarAngleLimit()/degree
<< ", stepLimType: " << StepLimitType()
<< ", latDisp: " << LateralDisplasmentFlag()
<< ", polarAngLim(deg)= " << PolarAngleLimit()/degree
<< G4endl;
}
@@ -17,6 +17,26 @@ committal in the CVS repository !
----------------------------------------------------------
09 April 19: V.Ivanchenko (emstand-V10-04-55)
- G4IonCoulombScatteringModel, G4eSingleCoulombScatteringModel,
G4hCoulombScatteringModel - fixed kinematics for low kinetic energy
of primary (problem #2152)
01 March 19: V.Ivanchenko
- G4BetheBlochModel - code clean-up, removed tabs, some empty lines
07 February 19: V.Ivanchenko
- G4eMultipleSacttering, G4hMultipleScattering - reduced
length of printouts (fix problem #2105)
31 January 19: V.Ivanchenko
- G4ModifiedTsai, G4SauterGavrilaAngularDistribution - reduced
length of names for these generators (fix problem #2105)
15 January 19: V.Ivanchenko
- G4eplusTo2GammaOKVIModel - fixed crash at initialisation
26 November 18: V.Ivanchenko (emstand-V10-04-54)
- G4WentzelOKandVIxSection - fixed destructor
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// -------------------------------------------------------------------
//
// GEANT4 Class header file
@@ -169,7 +168,7 @@ void G4BetheBlochModel::SetupParameters()
if(particle->GetLeptonNumber() == 0) {
G4int iz = G4lrint(q);
if(iz <= 1) {
formfact = (spin == 0.0 && mass < GeV) ? 1.181e-6 : 1.548e-6;
formfact = (spin == 0.0 && mass < GeV) ? 1.181e-6 : 1.548e-6;
} else {
G4double x = nist->GetA27(iz);
formfact = 3.969e-6*x*x;
@@ -271,23 +270,23 @@ G4double G4BetheBlochModel::ComputeDEDXPerVolume(const G4Material* material,
if(material != currentMaterial) {
currentMaterial = material;
baseMaterial = material->GetBaseMaterial()
? material->GetBaseMaterial() : material;
? material->GetBaseMaterial() : material;
iICRU90 = fICRU90->GetIndex(baseMaterial);
}
if(iICRU90 >= 0) {
G4double e = kineticEnergy*proton_mass_c2/mass;
G4double dedx = 0.0;
if(chargeSquare > 1.1 && e < fAlphaTlimit) {
dedx = fICRU90->GetElectronicDEDXforAlpha(iICRU90, e)
*material->GetDensity()*0.25;
dedx = fICRU90->GetElectronicDEDXforAlpha(iICRU90, e)
*material->GetDensity()*0.25;
} else if(chargeSquare < 1.1 && e < fProtonTlimit) {
dedx = fICRU90->GetElectronicDEDXforProton(iICRU90, e)
*material->GetDensity();
dedx = fICRU90->GetElectronicDEDXforProton(iICRU90, e)
*material->GetDensity();
}
if(dedx > 0.0) {
dedx += (G4Log(xc) + (1.0 - xc)*beta2)*twopi_mc2_rcl2
*eDensity/beta2;
return std::max(chargeSquare*dedx, 0.0);
if(cutEnergy < tmax) {
dedx += (G4Log(xc) + (1.0 - xc)*beta2)*twopi_mc2_rcl2
*eDensity/beta2;
return std::max(chargeSquare*dedx, 0.0);
}
}
}
@@ -144,8 +144,6 @@ G4double G4IonCoulombScatteringModel::ComputeCrossSectionPerAtom(
ioncross->SetupKinematic(kinEnergy, tmass);
ioncross->SetupTarget(Z, kinEnergy, heavycorr);
cross = ioncross->NuclearCrossSection();
//cout<< "..........cross "<<G4BestUnit(cross,"Surface") <<endl;
return cross;
}
@@ -158,9 +156,7 @@ void G4IonCoulombScatteringModel::SampleSecondaries(
G4double, G4double)
{
G4double kinEnergy = dp->GetKineticEnergy();
DefineMaterial(couple);
SetupParticle(dp->GetDefinition());
// Choose nucleus
@@ -171,38 +167,42 @@ void G4IonCoulombScatteringModel::SampleSecondaries(
G4double mass2 = G4NucleiProperties::GetNuclearMass(ia, iz);
ioncross->SetupKinematic(kinEnergy, mass2);
ioncross->SetupTarget(currentElement->GetZ(), kinEnergy, heavycorr);
//scattering angle, z1 == (1-cost)
G4double z1 = ioncross->SampleCosineTheta();
if(z1 > 2.0) { z1 = 2.0; }
else if(z1 < 0.0) { z1 = 0.0; }
/*
G4cout << "Sample: " << particle->GetParticleName()
<< " mass(GeV)= " << mass/GeV
<< " Ekin(MeV)= " << kinEnergy << " cost= " << 1. - z1 << G4endl;
G4cout << " Z= " << iz << " A= " << ia
<< " mass(GeV)= " << mass2/GeV << G4endl;
*/
G4double cost = 1.0 - z1;
G4double sint = sqrt(z1*(1.0 + cost));
G4double phi = twopi * G4UniformRand();
// kinematics in the Lab system
G4double ptot = dp->GetTotalMomentum();
G4double e1 = dp->GetTotalEnergy();
G4double ptot = sqrt(kinEnergy*(kinEnergy + 2.0*mass));
G4double e1 = mass + kinEnergy;
// Lab. system kinematics along projectile direction
G4LorentzVector v0 = G4LorentzVector(0, 0, ptot, e1);
G4double bet = ptot/(e1 + mass2);
G4double gam = 1.0/sqrt((1.0 - bet)*(1.0 + bet));
G4LorentzVector v0 = G4LorentzVector(0, 0, ptot, e1+mass2);
G4LorentzVector v1 = G4LorentzVector(0, 0, ptot, e1);
G4ThreeVector bst = v0.boostVector();
v1.boost(-bst);
// CM projectile
G4double momCM = gam*(ptot - bet*e1);
G4double eCM = gam*(e1 - bet*ptot);
G4double momCM = v1.pz();
// Momentum after scattering of incident particle
G4double pxCM = momCM*sint*cos(phi);
G4double pyCM = momCM*sint*sin(phi);
G4double pzCM = momCM*cost;
v1.setX(momCM*sint*cos(phi));
v1.setY(momCM*sint*sin(phi));
v1.setZ(momCM*cost);
// CM--->Lab
G4LorentzVector v1(pxCM , pyCM, gam*(pzCM + bet*eCM), gam*(eCM + bet*pzCM));
v1.boost(bst);
// Rotate to global system
G4ThreeVector dir = dp->GetMomentumDirection();
@@ -213,7 +213,7 @@ void G4IonCoulombScatteringModel::SampleSecondaries(
// recoil v0 energy is kinetic
v0 -= v1;
G4double trec = v0.e();
G4double trec = std::max(v0.e() - mass2, 0.0);
G4double edep = 0.0;
G4double tcut = recoilThreshold;
@@ -241,6 +241,8 @@ void G4IonCoulombScatteringModel::SampleSecondaries(
finalT = 0.0;
}
edep = std::max(edep, 0.0);
//G4cout << "Efinal(MeV)= " << finalT << " Edep(MeV)= " << edep
// << " Trec(MeV)= " << trec << G4endl;
fParticleChange->SetProposedKineticEnergy(finalT);
fParticleChange->ProposeLocalEnergyDeposit(edep);
}
@@ -63,7 +63,7 @@
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4ModifiedTsai::G4ModifiedTsai(const G4String&)
: G4VEmAngularDistribution("AngularGenUrban")
: G4VEmAngularDistribution("ModifiedTsai")
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -46,7 +46,7 @@
#include "Randomize.hh"
G4SauterGavrilaAngularDistribution::G4SauterGavrilaAngularDistribution()
: G4VEmAngularDistribution("AngularGenSauterGavrila")
: G4VEmAngularDistribution("SauterGavrila")
{}
G4SauterGavrilaAngularDistribution::~G4SauterGavrilaAngularDistribution()
@@ -85,8 +85,8 @@ void G4eMultipleScattering::InitialiseProcess(const G4ParticleDefinition*)
void G4eMultipleScattering::StreamProcessInfo(std::ostream& out) const
{
out << " RangeFactor= " << RangeFactor()
<< ", stepLimitType: " << StepLimitType()
<< ", latDisplacement: " << LateralDisplasmentFlag();
<< ", stepLimType: " << StepLimitType()
<< ", latDisp: " << LateralDisplasmentFlag();
if(StepLimitType() == fUseDistanceToBoundary) {
out << ", skin= " << Skin() << ", geomFactor= " << GeomFactor();
}
@@ -206,9 +206,8 @@ void G4eSingleCoulombScatteringModel::SampleSecondaries(
// Choose nucleus
//last two :cutEnergy= min e kinEnergy=max
currentElement = SelectRandomAtom(couple,particle,
kinEnergy,cutEnergy,kinEnergy);
currentElement = SelectRandomAtom(couple, particle, kinEnergy,
cutEnergy, kinEnergy);
G4double Z = currentElement->GetZ();
G4int iz = G4int(Z);
G4int ia = SelectIsotopeNumber(currentElement);
@@ -227,23 +226,24 @@ void G4eSingleCoulombScatteringModel::SampleSecondaries(
G4double phi = twopi* G4UniformRand();
// kinematics in the Lab system
G4double ptot = dp->GetTotalMomentum();
G4double e1 = dp->GetTotalEnergy();
G4double ptot = sqrt(kinEnergy*(kinEnergy + 2.0*mass));
G4double e1 = mass + kinEnergy;
// Lab. system kinematics along projectile direction
G4LorentzVector v0 = G4LorentzVector(0, 0, ptot, e1);
G4double bet = ptot/(v0.e() + mass2);
G4double gam = 1.0/sqrt((1.0 - bet)*(1.0 + bet));
G4LorentzVector v0 = G4LorentzVector(0, 0, ptot, e1+mass2);
G4LorentzVector v1 = G4LorentzVector(0, 0, ptot, e1);
G4ThreeVector bst = v0.boostVector();
v1.boost(-bst);
// CM projectile
G4double momCM = v1.pz();
// Momentum after scattering of incident particle
v1.setX(momCM*sint*cos(phi));
v1.setY(momCM*sint*sin(phi));
v1.setZ(momCM*cost);
//CM Projectile
G4double momCM = gam*(ptot - bet*e1);
G4double eCM = gam*(e1 - bet*ptot);
//energy & momentum after scattering of incident particle
G4double pxCM = momCM*sint*cos(phi);
G4double pyCM = momCM*sint*sin(phi);
G4double pzCM = momCM*cost;
//CM--->Lab
G4LorentzVector v1(pxCM , pyCM, gam*(pzCM + bet*eCM), gam*(eCM + bet*pzCM));
// CM--->Lab
v1.boost(bst);
// Rotate to global system
G4ThreeVector dir = dp->GetMomentumDirection();
@@ -254,7 +254,7 @@ void G4eSingleCoulombScatteringModel::SampleSecondaries(
// recoil
v0 -= v1;
G4double trec = v0.e();
G4double trec = std::max(v0.e() - mass2, 0.0);
G4double edep = 0.0;
G4double tcut = recoilThreshold;
@@ -92,15 +92,16 @@ void G4eplusTo2GammaOKVIModel::Initialise(const G4ParticleDefinition* p,
f3GModel->Initialise(p, cuts);
fCuts = &cuts;
fGammaTh = G4EmParameters::Instance()->LowestTripletEnergy();
f3GModel->SetDelta(fDelta);
if(IsMaster()) {
if(!fCrossSection) {
f3GModel->SetDelta(fDelta);
G4double emin = 10*eV;
G4double emax = 100*TeV;
G4int nbins = 20*G4lrint(std::log10(emax/emin));
fCrossSection = new G4PhysicsLogVector(emin, emax, nbins);
f3GProbability= new G4PhysicsLogVector(emin, emax, nbins);
fCrossSection = new G4PhysicsLogVector(emin, emax, nbins);
fCrossSection3G = new G4PhysicsLogVector(emin, emax, nbins);
f3GProbability = new G4PhysicsLogVector(emin, emax, nbins);
fCrossSection->SetSpline(true);
fCrossSection3G->SetSpline(true);
f3GProbability->SetSpline(true);
@@ -266,24 +266,24 @@ void G4hCoulombScatteringModel::SampleSecondaries(
wokvi->SampleSingleScattering(costmin, costmax, ratio);
// kinematics in the Lab system
G4double ptot = dp->GetTotalMomentum();
G4double e1 = dp->GetTotalEnergy();
G4double ptot = sqrt(kinEnergy*(kinEnergy + 2.0*mass));
G4double e1 = mass + kinEnergy;
// Lab. system kinematics along projectile direction
G4LorentzVector v0 = G4LorentzVector(0, 0, ptot, e1 + mass2);
G4double bet = ptot/v0.e();
G4double gam = 1.0/sqrt((1.0 - bet)*(1.0 + bet));
G4LorentzVector v0 = G4LorentzVector(0, 0, ptot, e1+mass2);
G4LorentzVector v1 = G4LorentzVector(0, 0, ptot, e1);
G4ThreeVector bst = v0.boostVector();
v1.boost(-bst);
// CM projectile
G4double momCM = gam*(ptot - bet*e1);
G4double eCM = gam*(e1 - bet*ptot);
// energy & momentum after scattering of incident particle
G4double pxCM = momCM*newDirection.x();
G4double pyCM = momCM*newDirection.y();
G4double pzCM = momCM*newDirection.z();
G4double momCM = v1.pz();
// Momentum after scattering of incident particle
v1.setX(momCM*newDirection.x());
v1.setY(momCM*newDirection.y());
v1.setZ(momCM*newDirection.z());
// CM--->Lab
G4LorentzVector v1(pxCM , pyCM, gam*(pzCM + bet*eCM), gam*(eCM + bet*pzCM));
v1.boost(bst);
G4ThreeVector dir = dp->GetMomentumDirection();
newDirection = v1.vect().unit();
@@ -293,7 +293,7 @@ void G4hCoulombScatteringModel::SampleSecondaries(
// recoil
v0 -= v1;
G4double trec = v0.e() - mass2;
G4double trec = std::max(v0.e() - mass2, 0.0);
G4double edep = 0.0;
G4double tcut = recoilThreshold;
@@ -84,8 +84,8 @@ void G4hMultipleScattering::InitialiseProcess(const G4ParticleDefinition*)
void G4hMultipleScattering::StreamProcessInfo(std::ostream& out) const
{
out << " RangeFactor= " << RangeFactor()
<< ", stepLimitType: " << StepLimitType()
<< ", latDisplacement: " << LateralDisplasmentFlag();
<< ", stepLimType: " << StepLimitType()
<< ", latDisp: " << LateralDisplasmentFlag();
if(StepLimitType() == fUseDistanceToBoundary) {
out << ", skin= " << Skin() << ", geomFactor= " << GeomFactor();
}
@@ -16,6 +16,31 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
13 March 19: M.Asai (emutils-V10-04-27)
- G4EmParametersMessenger: Defining unit categories for UI commands
that take units.
11 March 19: G.Cosmo (emutils-V10-04-26)
- Fixed typos in printouts in G4EmParametersMessenger.
04 March 19: D.Sawkey
- G4EmBiasingManager, G4VEmProcess, G4VEnergyLossProcess - fix
weights for biasing. Should be like version 10.4 now for range cut,
splitting, roulette
18 February 19: D.Sawkey
- G4VEmProcess, G4VEnergyLossProcess - make printout information
more compact
13 February 19: D.Sawkey
- G4EmBiasingManager: fix incorrect weights with brem splitting
introduced in 10.5 (problem #2125)
31 January 19: V.Ivanchenko
- G4VEnergyLossProcess, G4VEmProcess, G4VMultipleScattering,
G4EmModelManager - make info printout at intialisation more
compact (fix problem #2105)
29 October 18: D.Sawkey (emutils-V10-04-25)
- G4EmBiasingManager - fix Valgrind warning
@@ -144,14 +144,14 @@ private:
G4int index,
G4double tcut);
void ApplyDirectionalSplitting(std::vector<G4DynamicParticle*>& vd,
G4double ApplyDirectionalSplitting(std::vector<G4DynamicParticle*>& vd,
const G4Track& track,
G4VEmModel* currentModel,
G4int index,
G4double tcut,
G4ParticleChangeForGamma* partChange);
void ApplyDirectionalSplitting(std::vector<G4DynamicParticle*>& vd,
G4double ApplyDirectionalSplitting(std::vector<G4DynamicParticle*>& vd,
const G4Track& track,
G4VEmModel* currentModel,
G4int index,
@@ -187,8 +187,6 @@ private:
G4double currentStepLimit;
G4bool startTracking;
G4double fWeight;
G4bool fDirectionalSplitting;
G4ThreeVector fDirectionalSplittingTarget;
G4double fDirectionalSplittingRadius;
@@ -76,8 +76,7 @@ class G4VEmProcess : public G4VDiscreteProcess
{
public:
G4VEmProcess(const G4String& name,
G4ProcessType type = fElectromagnetic);
G4VEmProcess(const G4String& name, G4ProcessType type = fElectromagnetic);
virtual ~G4VEmProcess();
@@ -76,7 +76,6 @@ G4EmBiasingManager::G4EmBiasingManager()
fDirectionalSplittingRadius = 0.;
fDirectionalSplittingTarget = G4ThreeVector(0.,0.,0.);
fDirectionalSplittingWeights.clear();
fWeight = 1.;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -304,7 +303,7 @@ G4EmBiasingManager::ApplySecondaryBiasing(
G4double safety)
{
G4int index = idxSecBiasedCouple[coupleIdx];
fWeight = 1.0;
G4double weight = 1.;
if(0 <= index) {
size_t n = vd.size();
@@ -322,18 +321,17 @@ G4EmBiasingManager::ApplySecondaryBiasing(
// Russian Roulette
} else if(1 == nsplit) {
fWeight = ApplyRussianRoulette(vd, index);
weight = ApplyRussianRoulette(vd, index);
// Splitting
} else {
if (fDirectionalSplitting) {
ApplyDirectionalSplitting(vd, track, currentModel, index, tcut);
fWeight = 1.;
weight = ApplyDirectionalSplitting(vd, track, currentModel, index, tcut);
} else {
G4double tmpEnergy = pPartChange->GetProposedKineticEnergy();
G4ThreeVector tmpMomDir = pPartChange->GetProposedMomentumDirection();
fWeight = ApplySplitting(vd, track, currentModel, index, tcut);
weight = ApplySplitting(vd, track, currentModel, index, tcut);
pPartChange->SetProposedKineticEnergy(tmpEnergy);
pPartChange->ProposeMomentumDirection(tmpMomDir);
@@ -341,7 +339,7 @@ G4EmBiasingManager::ApplySecondaryBiasing(
}
}
}
return fWeight;
return weight;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -358,7 +356,7 @@ G4EmBiasingManager::ApplySecondaryBiasing(
G4double safety)
{
G4int index = idxSecBiasedCouple[coupleIdx];
fWeight = 1.0;
G4double weight = 1.;
if(0 <= index) {
size_t n = vd.size();
@@ -376,19 +374,18 @@ G4EmBiasingManager::ApplySecondaryBiasing(
// Russian Roulette
} else if(1 == nsplit) {
fWeight = ApplyRussianRoulette(vd, index);
weight = ApplyRussianRoulette(vd, index);
// Splitting
} else {
if (fDirectionalSplitting) {
ApplyDirectionalSplitting(vd, track, currentModel,
weight = ApplyDirectionalSplitting(vd, track, currentModel,
index, tcut, pPartChange);
fWeight = 1.;
} else {
G4double tmpEnergy = pPartChange->GetProposedKineticEnergy();
G4ThreeVector tmpMomDir = pPartChange->GetProposedMomentumDirection();
fWeight = ApplySplitting(vd, track, currentModel, index, tcut);
weight = ApplySplitting(vd, track, currentModel, index, tcut);
pPartChange->SetProposedKineticEnergy(tmpEnergy);
pPartChange->ProposeMomentumDirection(tmpMomDir);
@@ -396,7 +393,7 @@ G4EmBiasingManager::ApplySecondaryBiasing(
}
}
}
return fWeight;
return weight;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -406,7 +403,7 @@ G4EmBiasingManager::ApplySecondaryBiasing(std::vector<G4Track*>& track,
G4int coupleIdx)
{
G4int index = idxSecBiasedCouple[coupleIdx];
fWeight = 1.0;
G4double weight = 1.;
if(0 <= index) {
size_t n = track.size();
@@ -419,9 +416,9 @@ G4EmBiasingManager::ApplySecondaryBiasing(std::vector<G4Track*>& track,
// Russian Roulette only
if(1 == nsplit) {
fWeight = secBiasedWeight[index];
weight = secBiasedWeight[index];
for(size_t k=0; k<n; ++k) {
if(G4UniformRand()*fWeight > 1.0) {
if(G4UniformRand()*weight > 1.0) {
const G4Track* t = track[k];
delete t;
track[k] = 0;
@@ -430,7 +427,7 @@ G4EmBiasingManager::ApplySecondaryBiasing(std::vector<G4Track*>& track,
}
}
}
return fWeight;
return weight;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -486,11 +483,11 @@ G4EmBiasingManager::ApplySplitting(std::vector<G4DynamicParticle*>& vd,
{
// method is applied only if 1 secondary created PostStep
// in the case of many secondaries there is a contradiction
fWeight = 1.0;
G4double weight = 1.;
size_t n = vd.size();
G4double w = secBiasedWeight[index];
if(1 != n || 1.0 <= w) { return fWeight; }
if(1 != n || 1.0 <= w) { return weight; }
G4double trackWeight = track.GetWeight();
const G4DynamicParticle* dynParticle = track.GetDynamicParticle();
@@ -500,7 +497,7 @@ G4EmBiasingManager::ApplySplitting(std::vector<G4DynamicParticle*>& vd,
// double splitting is suppressed
if(1 < nsplit && trackWeight>w) {
fWeight = w;
weight = w;
if(nsplit > (G4int)tmpSecondaries.size()) {
tmpSecondaries.reserve(nsplit);
}
@@ -515,12 +512,12 @@ G4EmBiasingManager::ApplySplitting(std::vector<G4DynamicParticle*>& vd,
}
}
}
return fWeight;
return weight;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void
G4double
G4EmBiasingManager::ApplyDirectionalSplitting(
std::vector<G4DynamicParticle*>& vd,
const G4Track& track,
@@ -537,8 +534,8 @@ G4EmBiasingManager::ApplyDirectionalSplitting(
fDirectionalSplittingWeights.clear();
if(1.0 <= w) {
fDirectionalSplittingWeights.push_back(fWeight);
return;
fDirectionalSplittingWeights.push_back(weight);
return weight;
}
G4double trackWeight = track.GetWeight();
@@ -570,14 +567,14 @@ G4EmBiasingManager::ApplyDirectionalSplitting(
if (sec->GetParticleDefinition() == theGamma) {
if (CheckDirection(pos, sec->GetMomentumDirection())) {
vd.push_back(sec);
fDirectionalSplittingWeights.push_back(weight);
fDirectionalSplittingWeights.push_back(1.);
} else if (G4UniformRand() < w) {
vd.push_back(sec);
fDirectionalSplittingWeights.push_back(1.0);
fDirectionalSplittingWeights.push_back(1./weight);
}
} else if (k==0) { // not gamma
vd.push_back(sec);
fDirectionalSplittingWeights.push_back(1.);
fDirectionalSplittingWeights.push_back(1./weight);
}
}
@@ -597,7 +594,7 @@ G4EmBiasingManager::ApplyDirectionalSplitting(
partChange->GetProposedMomentumDirection(),
partChange->GetProposedKineticEnergy());
vd.push_back(dp);
fDirectionalSplittingWeights.push_back(weight);
fDirectionalSplittingWeights.push_back(1.);
}
} else if (G4UniformRand()<w) { // not going to target. play RR.
if (!foundPrimaryParticle) {
@@ -610,7 +607,7 @@ G4EmBiasingManager::ApplyDirectionalSplitting(
partChange->GetProposedMomentumDirection(),
partChange->GetProposedKineticEnergy());
vd.push_back(dp);
fDirectionalSplittingWeights.push_back(1.0);
fDirectionalSplittingWeights.push_back(1./weight);
}
}
}
@@ -621,26 +618,29 @@ G4EmBiasingManager::ApplyDirectionalSplitting(
partChange->ProposeMomentumDirection(primaryMomdir);
} else {
for (size_t i = 0; i < vd.size(); ++i) {
fDirectionalSplittingWeights.push_back(trackWeight);
fDirectionalSplittingWeights.push_back(1.);
}
}
return;
return weight;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4double G4EmBiasingManager::GetWeight(G4int i)
{
// normally return 1. If a directionally split particle survives RR,
// return 1./(splitting factor)
if (fDirectionalSplittingWeights.size() >= (unsigned int)(i+1) ) {
return fDirectionalSplittingWeights[i];
}
else {
return fWeight;
G4double w = fDirectionalSplittingWeights[i];
fDirectionalSplittingWeights[i] = 1.; // ensure it's not used again
return w;
} else {
return 1.;
}
}
void
G4double
G4EmBiasingManager::ApplyDirectionalSplitting(
std::vector<G4DynamicParticle*>& vd,
const G4Track& track,
@@ -648,7 +648,7 @@ G4EmBiasingManager::ApplyDirectionalSplitting(
G4int index,
G4double tcut)
{
// Do nothing with primary
// primary is not a gamma. Do nothing with primary
G4double weight = 1.0;
G4double w = secBiasedWeight[index];
@@ -656,7 +656,7 @@ G4EmBiasingManager::ApplyDirectionalSplitting(
fDirectionalSplittingWeights.clear();
if(1.0 <= w) {
fDirectionalSplittingWeights.push_back(weight);
return;
return weight;
}
G4double trackWeight = track.GetWeight();
@@ -681,17 +681,17 @@ G4EmBiasingManager::ApplyDirectionalSplitting(
for (auto sec : tmpSecondaries) {
if (CheckDirection(pos, sec->GetMomentumDirection())) {
vd.push_back(sec);
fDirectionalSplittingWeights.push_back(weight);
fDirectionalSplittingWeights.push_back(1.);
} else if (G4UniformRand()<w) {
vd.push_back(sec);
fDirectionalSplittingWeights.push_back(1.0);
fDirectionalSplittingWeights.push_back(1./weight);
}
}
} // end of loop over nsplit
} else { // no splitting was done; still need weights
for (size_t i = 0; i < vd.size(); ++i) {
fDirectionalSplittingWeights.push_back(trackWeight);
fDirectionalSplittingWeights.push_back(1.0);
}
}
return;
return weight;
}
@@ -35,32 +35,7 @@
//
// Creation date: 07.05.2002
//
// Modifications:
//
// 23-12-02 V.Ivanchenko change interface in order to move
// to cut per region
// 20-01-03 Migrade to cut per region (V.Ivanchenko)
// 24-01-03 Make models region aware (V.Ivanchenko)
// 13-02-03 The set of models is defined for region (V.Ivanchenko)
// 06-03-03 Fix in energy intervals for models (V.Ivanchenko)
// 13-04-03 Add startFromNull (V.Ivanchenko)
// 13-05-03 Add calculation of precise range (V.Ivanchenko)
// 16-07-03 Replace G4Material by G4MaterialCutCouple in dE/dx and CrossSection
// calculation (V.Ivanchenko)
// 21-07-03 Add UpdateEmModel method (V.Ivanchenko)
// 03-11-03 Substitute STL vector for G4RegionModels (V.Ivanchenko)
// 26-01-04 Fix in energy range conditions (V.Ivanchenko)
// 24-03-05 Remove check or IsInCharge (V.Ivanchenko)
// 08-04-05 Major optimisation of internal interfaces (V.Ivantchenko)
// 18-08-05 Fix cut for e+e- pair production (V.Ivanchenko)
// 29-11-05 Add protection for arithmetic operations with cut=DBL_MAX (V.Ivanchenko)
// 20-01-06 Introduce G4EmTableType and reducing number of methods (VI)
// 13-05-06 Add GetModel by index method (VI)
// 15-03-07 Add maxCutInRange (V.Ivanchenko)
// 12-04-07 Add verbosity at destruction (V.Ivanchenko)
// 08-04-08 Fixed and simplified initialisation of G4RegionModel (VI)
// 03-08-09 Create internal vectors only it is needed (VI)
// 14-07-11 Use pointer to the vector of cuts and not local copy (VI)
// Modifications: V.Ivanchenko
//
// Class Description:
//
@@ -392,10 +367,6 @@ G4EmModelManager::Initialise(const G4ParticleDefinition* p,
// this model has lower order parameter than possible
// other models, with which there may be intersections
// so, appliction area of such models may be reduced
//G4cout << "tmin= " << tmin << " tmax= "
// << tmax << " push= " << push << " idx= " << idx <<G4endl;
//G4cout << "n= " << n << " eLow[0]= " << eLow[0] << " eLow[n-1]= " << eLow[n-1]
// << " eHigh[0]= " << eHigh[0] << " eHigh[n-1]= " << eHigh[n-1] << G4endl;
// insert below the first model
if (tmax <= eLow[0]) {
@@ -507,7 +478,8 @@ G4EmModelManager::Initialise(const G4ParticleDefinition* p,
eLow[n] = eHigh[n-1];
if(1 < verboseLevel) {
G4cout << "### New G4RegionModels set with " << n << " models for region <";
G4cout << "### New G4RegionModels set with " << n
<< " models for region <";
if (region) { G4cout << region->GetName(); }
G4cout << "> Elow(MeV)= ";
for(G4int iii=0; iii<=n; ++iii) {G4cout << eLow[iii]/MeV << " ";}
@@ -815,10 +787,10 @@ void G4EmModelManager::DumpModelList(std::ostream& out, G4int verb)
std::min(r->LowEdgeEnergy(j+1),model->HighEnergyActivationLimit());
if(emax > emin) {
out << std::setw(20);
out << model->GetName() << " : Emin= "
<< std::setw(8) << G4BestUnit(emin,"Energy")
<< " Emax= "
<< std::setw(8) << G4BestUnit(emax,"Energy");
out << model->GetName() << " : Emin="
<< std::setw(5) << G4BestUnit(emin,"Energy")
<< " Emax="
<< std::setw(5) << G4BestUnit(emax,"Energy");
G4PhysicsTable* table = model->GetCrossSectionTable();
if(table) {
size_t kk = table->size();
@@ -826,18 +798,18 @@ void G4EmModelManager::DumpModelList(std::ostream& out, G4int verb)
G4PhysicsVector* v = (*table)[k];
if(v) {
G4int nn = v->GetVectorLength() - 1;
out << " Table with " << nn << " bins Emin= "
<< std::setw(6) << G4BestUnit(v->Energy(0),"Energy")
<< " Emax= "
<< std::setw(6) << G4BestUnit(v->Energy(nn),"Energy");
out << " Nbins=" << nn << " "
<< std::setw(3) << G4BestUnit(v->Energy(0),"Energy")
<< " - "
<< std::setw(3) << G4BestUnit(v->Energy(nn),"Energy");
break;
}
}
}
G4VEmAngularDistribution* an = model->GetAngularDistribution();
if(an) { out << " " << an->GetName(); }
if(an) { out << " " << an->GetName(); }
if(fluoFlag && model->DeexcitationFlag()) {
out << " FluoActive";
out << " Fluo";
}
out << G4endl;
}
@@ -289,7 +289,7 @@ G4EmParametersMessenger::G4EmParametersMessenger(G4EmParameters* ptr)
labCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
mscfCmd = new G4UIcmdWithADouble("/process/msc/FactorForAngleLimit",this);
mscfCmd->SetGuidance("Set factor for computation of a limit for -t (invariant trasfer)");
mscfCmd->SetGuidance("Set factor for computation of a limit for -t (invariant transfer)");
mscfCmd->SetParameterName("Fact",true);
mscfCmd->SetRange("Fact>0");
mscfCmd->SetDefaultValue(1.);
@@ -471,6 +471,7 @@ G4EmParametersMessenger::G4EmParametersMessenger(G4EmParameters* ptr)
StepFuncCmd->SetGuidance("Set the energy loss step limitation parameters for e+-.");
StepFuncCmd->SetGuidance(" dRoverR : max Range variation per step");
StepFuncCmd->SetGuidance(" finalRange: range for final step");
StepFuncCmd->SetGuidance(" unit : unit of finalRange");
StepFuncCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
G4UIparameter* dRoverRPrm = new G4UIparameter("dRoverR",'d',false);
@@ -482,7 +483,7 @@ G4EmParametersMessenger::G4EmParametersMessenger(G4EmParameters* ptr)
StepFuncCmd->SetParameter(finalRangePrm);
G4UIparameter* unitPrm = new G4UIparameter("unit",'s',true);
unitPrm->SetDefaultValue("mm");
unitPrm->SetDefaultUnit("mm");
StepFuncCmd->SetParameter(unitPrm);
StepFuncCmd1 = new G4UIcommand("/process/eLoss/StepFunctionMuHad",this);
@@ -555,19 +556,22 @@ G4EmParametersMessenger::G4EmParametersMessenger(G4EmParameters* ptr)
fiCmd->SetParameter(regNam);
G4UIparameter* tlength = new G4UIparameter("tlength",'d',false);
tlength->SetParameterRange("tlength>0");
fiCmd->SetParameter(tlength);
G4UIparameter* unitT = new G4UIparameter("unitT",'s',true);
unitT->SetDefaultUnit("mm");
fiCmd->SetParameter(unitT);
G4UIparameter* flagT = new G4UIparameter("tflag",'s',true);
G4UIparameter* flagT = new G4UIparameter("tflag",'b',true);
flagT->SetDefaultValue(true);
fiCmd->SetParameter(flagT);
bsCmd = new G4UIcommand("/process/em/setSecBiasing",this);
bsCmd->SetGuidance("Set bremsstrahlung or delta-e- splitting/Russian roullette per region.");
bsCmd->SetGuidance("Set bremsstrahlung or delta-e- splitting/Russian roulette per region.");
bsCmd->SetGuidance(" bProcNam : process name");
bsCmd->SetGuidance(" bRegNam : region name");
bsCmd->SetGuidance(" bFactor : number of splitted gamma or probability of Russian roulette");
bsCmd->SetGuidance(" bFactor : number of split gamma or probability of Russian roulette");
bsCmd->SetGuidance(" bEnergy : max energy of a secondary for this biasing method");
bsCmd->SetGuidance(" bUnit : energy unit");
bsCmd->AvailableForStates(G4State_Idle,G4State_Idle);
@@ -585,6 +589,7 @@ G4EmParametersMessenger::G4EmParametersMessenger(G4EmParameters* ptr)
bsCmd->SetParameter(bEnergy);
G4UIparameter* bUnit = new G4UIparameter("bUnit",'s',true);
bUnit->SetDefaultUnit("MeV");
bsCmd->SetParameter(bUnit);
dirSplitCmd = new G4UIcmdWithABool("/process/em/setDirectionalSplitting",this);
@@ -606,7 +611,7 @@ G4EmParametersMessenger::G4EmParametersMessenger(G4EmParameters* ptr)
nffCmd->AvailableForStates(G4State_PreInit);
tripletCmd = new G4UIcmdWithAnInteger("/process/gconv/conversionType",this);
tripletCmd->SetGuidance("gamma conversion triplet/nuclear genaration type:");
tripletCmd->SetGuidance("gamma conversion triplet/nuclear generation type:");
tripletCmd->SetGuidance("0 - (default) both triplet and nuclear");
tripletCmd->SetGuidance("1 - force nuclear");
tripletCmd->SetGuidance("2 - force triplet");
@@ -401,8 +401,8 @@ void G4VEmProcess::BuildPhysicsTable(const G4ParticleDefinition& part)
for(G4int i=0; i<numberOfModels; ++i) {
G4VEmModel* mod = GetModelByIndex(i, printing);
G4VEmModel* mod0= masterProc->GetModelByIndex(i, printing);
//G4cout << i << ". " << mod << " " << mod0 << " "
// << particle->GetParticleName() << G4endl;
//G4cout << i << ". " << mod << " " << mod0 << " "
// << particle->GetParticleName() << G4endl;
mod->InitialiseLocal(particle, mod0);
}
// master thread
@@ -424,8 +424,8 @@ void G4VEmProcess::BuildPhysicsTable(const G4ParticleDefinition& part)
num == "kaon+" || num == "kaon-" ||
num == "alpha" || num == "anti_proton" ||
num == "GenericIon"|| num == "alpha++" ||
num == "alpha+" || num == "helium" ||
num == "hydrogen")))
num == "alpha+" || num == "helium" ||
num == "hydrogen")))
{
StreamInfo(G4cout, part);
}
@@ -542,33 +542,33 @@ void G4VEmProcess::StreamInfo(std::ostream& out,
out << std::setprecision(6);
out << G4endl << indent << GetProcessName() << ": ";
if (!rst) {
out << " for " << part.GetParticleName();
out << " for " << part.GetParticleName();
if (integral) { out << ","; }
}
if(integral) { out << " integral: 1 "; }
if(applyCuts) { out << ", applyCuts: 1 "; }
out << " SubType= " << GetProcessSubType();;
if(biasFactor != 1.0) { out << " BiasingFactor= " << biasFactor; }
out << " BuildTable= " << buildLambdaTable << G4endl;
if(integral) { out << " integral:1 "; }
if(applyCuts) { out << " applyCuts:1 "; }
out << " SubType=" << GetProcessSubType();
if(biasFactor != 1.0) { out << " BiasingFactor= " << biasFactor; }
out << " BuildTable=" << buildLambdaTable << G4endl;
if(buildLambdaTable) {
if(particle == &part) {
size_t length = theLambdaTable->length();
for(size_t i=0; i<length; ++i) {
G4PhysicsVector* v = (*theLambdaTable)[i];
if(v) {
out << " Lambda table from ";
G4double emin = v->Energy(0);
G4double emax = v->GetMaxEnergy();
G4int nbin = v->GetVectorLength() - 1;
if(emin > minKinEnergy) { out << "threshold "; }
else { out << G4BestUnit(emin,"Energy"); }
out << " to "
<< G4BestUnit(emax,"Energy")
<< ", " << G4lrint(nbin/std::log10(emax/emin))
<< " bins per decade, spline: "
<< splineFlag << G4endl;
break;
}
G4PhysicsVector* v = (*theLambdaTable)[i];
if(v) {
out << " Lambda table from ";
G4double emin = v->Energy(0);
G4double emax = v->GetMaxEnergy();
G4int nbin = v->GetVectorLength() - 1;
if(emin > minKinEnergy) { out << "threshold "; }
else { out << G4BestUnit(emin,"Energy"); }
out << " to "
<< G4BestUnit(emax,"Energy")
<< ", " << G4lrint(nbin/std::log10(emax/emin))
<< " bins/decade, spline: "
<< splineFlag << G4endl;
break;
}
}
} else {
out << " Used Lambda table of "
@@ -579,16 +579,16 @@ void G4VEmProcess::StreamInfo(std::ostream& out,
if(particle == &part) {
size_t length = theLambdaTablePrim->length();
for(size_t i=0; i<length; ++i) {
G4PhysicsVector* v = (*theLambdaTablePrim)[i];
if(v) {
out << " LambdaPrime table from "
<< G4BestUnit(v->Energy(0),"Energy")
<< " to "
<< G4BestUnit(v->GetMaxEnergy(),"Energy")
<< " in " << v->GetVectorLength()-1
<< " bins " << G4endl;
break;
}
G4PhysicsVector* v = (*theLambdaTablePrim)[i];
if(v) {
out << " LambdaPrime table from "
<< G4BestUnit(v->Energy(0),"Energy")
<< " to "
<< G4BestUnit(v->GetMaxEnergy(),"Energy")
<< " in " << v->GetVectorLength()-1
<< " bins " << G4endl;
break;
}
}
} else {
out << " Used LambdaPrime table of "
@@ -844,7 +844,7 @@ G4VParticleChange* G4VEmProcess::PostStepDoIt(const G4Track& track,
G4Track* t = new G4Track(dp, time, track.GetPosition());
t->SetTouchableHandle(track.GetTouchableHandle());
if (biasManager) {
t->SetWeight(biasManager->GetWeight(i));
t->SetWeight(weight * biasManager->GetWeight(i));
} else {
t->SetWeight(weight);
}
@@ -861,12 +861,12 @@ G4VParticleChange* G4VEmProcess::PostStepDoIt(const G4Track& track,
} else {
t->SetCreatorModelIndex(biasID);
}
/*
/*
G4cout << "Secondary(post step) has weight " << t->GetWeight()
<< ", Ekin= " << t->GetKineticEnergy()/MeV << " MeV "
<< GetProcessName() << " fluoID= " << fluoID
<< " augerID= " << augerID <<G4endl;
*/
<< ", Ekin= " << t->GetKineticEnergy()/MeV << " MeV "
<< GetProcessName() << " fluoID= " << fluoID
<< " augerID= " << augerID <<G4endl;
*/
} else {
delete dp;
edep += e;
@@ -889,8 +889,8 @@ G4VParticleChange* G4VEmProcess::PostStepDoIt(const G4Track& track,
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4bool G4VEmProcess::StorePhysicsTable(const G4ParticleDefinition* part,
const G4String& directory,
G4bool ascii)
const G4String& directory,
G4bool ascii)
{
G4bool yes = true;
if(!isTheMaster) { return yes; }
@@ -938,7 +938,7 @@ G4bool G4VEmProcess::StorePhysicsTable(const G4ParticleDefinition* part,
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
G4bool G4VEmProcess::RetrievePhysicsTable(const G4ParticleDefinition* part,
const G4String& directory,
const G4String& directory,
G4bool ascii)
{
if(1 < verboseLevel) {
@@ -1027,8 +1027,8 @@ G4VEmProcess::CrossSectionPerVolume(G4double kineticEnergy,
SelectModel(kineticEnergy, currentCoupleIndex);
if(currentModel) {
cross = fFactor*currentModel->CrossSectionPerVolume(currentMaterial,
currentParticle,
kineticEnergy);
currentParticle,
kineticEnergy);
}
}
return std::max(cross, 0.0);
@@ -677,7 +677,7 @@ void G4VEnergyLossProcess::BuildPhysicsTable(const G4ParticleDefinition& part)
num == "kaon+" || num == "kaon-" ||
num == "alpha" || num == "anti_proton" ||
num == "GenericIon"|| num == "alpha++" ||
num == "alpha+" )))
num == "alpha+" )))
{
StreamInfo(G4cout, part);
}
@@ -887,8 +887,8 @@ void G4VEnergyLossProcess::StreamInfo(std::ostream& out,
G4String indent = (rst ? " " : "");
out << std::setprecision(6);
out << G4endl << indent << GetProcessName() << ": ";
if (!rst) out << " for " << part.GetParticleName();
out << " SubType= " << GetProcessSubType() << G4endl
if (!rst) out << " for " << part.GetParticleName();
out << " SubType=" << GetProcessSubType() << G4endl
<< " dE/dx and range tables from "
<< G4BestUnit(minKinEnergy,"Energy")
<< " to " << G4BestUnit(maxKinEnergy,"Energy")
@@ -896,33 +896,33 @@ void G4VEnergyLossProcess::StreamInfo(std::ostream& out,
<< " Lambda tables from threshold to "
<< G4BestUnit(maxKinEnergy,"Energy")
<< ", " << theParameters->NumberOfBinsPerDecade()
<< " bins per decade, spline: "
<< " bins/decade, spline: "
<< theParameters->Spline()
<< G4endl;
if(theRangeTableForLoss && isIonisation) {
out << " finalRange(mm)= " << finalRange/mm
<< ", dRoverRange= " << dRoverRange
<< ", integral: " << integral
<< ", fluct: " << lossFluctuationFlag
<< ", linLossLimit= " << linLossLimit
<< G4endl;
out << " StepFunction=(" << dRoverRange << ", "
<< finalRange/mm << " mm)"
<< ", integ: " << integral
<< ", fluct: " << lossFluctuationFlag
<< ", linLossLim= " << linLossLimit
<< G4endl;
}
StreamProcessInfo(out);
modelManager->DumpModelList(out, verboseLevel);
if(theCSDARangeTable && isIonisation) {
out << " CSDA range table up"
<< " to " << G4BestUnit(maxKinEnergyCSDA,"Energy")
<< " in " << nBinsCSDA << " bins" << G4endl;
<< " to " << G4BestUnit(maxKinEnergyCSDA,"Energy")
<< " in " << nBinsCSDA << " bins" << G4endl;
}
if(nSCoffRegions>0 && isIonisation) {
out << " Subcutoff sampling in " << nSCoffRegions
<< " regions" << G4endl;
<< " regions" << G4endl;
}
if(2 < verboseLevel) {
out << " DEDXTable address= " << theDEDXTable << G4endl;
if(theDEDXTable && isIonisation) out << (*theDEDXTable) << G4endl;
out << "non restricted DEDXTable address= "
<< theDEDXunRestrictedTable << G4endl;
<< theDEDXunRestrictedTable << G4endl;
if(theDEDXunRestrictedTable && isIonisation) {
out << (*theDEDXunRestrictedTable) << G4endl;
}
@@ -933,11 +933,13 @@ void G4VEnergyLossProcess::StreamInfo(std::ostream& out,
if(theCSDARangeTable && isIonisation) {
out << (*theCSDARangeTable) << G4endl;
}
out << " RangeTableForLoss address= " << theRangeTableForLoss << G4endl;
out << " RangeTableForLoss address= " << theRangeTableForLoss
<< G4endl;
if(theRangeTableForLoss && isIonisation) {
out << (*theRangeTableForLoss) << G4endl;
}
out << " InverseRangeTable address= " << theInverseRangeTable << G4endl;
out << " InverseRangeTable address= " << theInverseRangeTable
<< G4endl;
if(theInverseRangeTable && isIonisation) {
out << (*theInverseRangeTable) << G4endl;
}
@@ -1029,7 +1031,7 @@ G4double G4VEnergyLossProcess::AlongStepGetPhysicalInteractionLength(
G4double finR = (rndmStepFlag) ? std::min(finalRange,
currentCouple->GetProductionCuts()->GetProductionCut(1)) : finalRange;
x = (fRange > finR) ?
fRange*dRoverRange + finR*(1.0 - dRoverRange)*(2.0 - finR/fRange) : fRange;
fRange*dRoverRange + finR*(1.0-dRoverRange)*(2.0-finR/fRange) : fRange;
// if(particle->GetPDGMass() > 0.9*GeV)
/*
G4cout<<GetProcessName()<<": e= "<<preStepKinEnergy
@@ -1643,7 +1645,7 @@ G4VParticleChange* G4VEnergyLossProcess::PostStepDoIt(const G4Track& track,
G4Track* t = new G4Track(secParticles[i], time, track.GetPosition());
t->SetTouchableHandle(track.GetTouchableHandle());
if (biasManager) {
t->SetWeight(biasManager->GetWeight(i));
t->SetWeight(weight * biasManager->GetWeight(i));
} else {
t->SetWeight(weight);
}
@@ -317,7 +317,7 @@ void G4VMultipleScattering::BuildPhysicsTable(const G4ParticleDefinition& part)
G4VMscModel* msc = static_cast<G4VMscModel*>(GetModelByIndex(i));
if(!msc) { continue; }
G4VMscModel* msc0=
static_cast<G4VMscModel*>(masterProcess->GetModelByIndex(i));
static_cast<G4VMscModel*>(masterProcess->GetModelByIndex(i));
msc->SetCrossSectionTable(msc0->GetCrossSectionTable(), false);
msc->InitialiseLocal(firstParticle, msc0);
}
@@ -333,7 +333,7 @@ void G4VMultipleScattering::BuildPhysicsTable(const G4ParticleDefinition& part)
num == "kaon+" || num == "kaon-" ||
num == "alpha" || num == "anti_proton" ||
num == "GenericIon" || num == "alpha+" ||
num == "alpha++" )))
num == "alpha++" )))
{
StreamInfo(G4cout, part);
}
@@ -353,8 +353,8 @@ void G4VMultipleScattering::StreamInfo(std::ostream& outFile,
{
G4String indent = (rst ? " " : "");
outFile << G4endl << indent << GetProcessName() << ": ";
if (!rst) outFile << " for " << part.GetParticleName();
outFile << " SubType= " << GetProcessSubType() << G4endl;
if (!rst) outFile << " for " << part.GetParticleName();
outFile << " SubType= " << GetProcessSubType() << G4endl;
StreamProcessInfo(outFile);
modelManager->DumpModelList(outFile, verboseLevel);
}
@@ -380,9 +380,9 @@ void G4VMultipleScattering::StartTracking(G4Track* track)
for(G4int i=0; i<numberOfModels; ++i) {
/*
G4cout << "Next model " << i << " " << msc
<< " Emin= " << msc->LowEnergyLimit()
<< " Emax= " << msc->HighEnergyLimit()
<< " Eact= " << msc->LowEnergyActivationLimit() << G4endl;
<< " Emin= " << msc->LowEnergyLimit()
<< " Emax= " << msc->HighEnergyLimit()
<< " Eact= " << msc->LowEnergyActivationLimit() << G4endl;
*/
G4VEmModel* msc = GetModelByIndex(i);
msc->StartTracking(track);
@@ -510,16 +510,16 @@ G4VMultipleScattering::AlongStepDoIt(const G4Track& track, const G4Step& step)
if(r2 > minDisplacement2) {
fPositionChanged = true;
G4double dispR = std::sqrt(r2);
G4double dispR = std::sqrt(r2);
G4double postSafety =
sFact*safetyHelper->ComputeSafety(fNewPosition, dispR);
sFact*safetyHelper->ComputeSafety(fNewPosition, dispR);
//G4cout<<" R= "<< dispR<<" postSafety= "<<postSafety<<G4endl;
// far away from geometry boundary
if(postSafety > 0.0 && dispR <= postSafety) {
fNewPosition += displacement;
//near the boundary
//near the boundary
} else {
// displaced point is definitely within the volume
//G4cout<<" R= "<<dispR<<" postSafety= "<<postSafety<<G4endl;
@@ -543,72 +543,73 @@ G4VMultipleScattering::AlongStepDoIt(const G4Track& track, const G4Step& step)
<< G4endl;
*/
// check if it is possible to shift to the boundary
// and the shift is not large
// and the shift is not large
if(safetyHelper->RecheckDistanceToCurrentBoundary(fNewPosition,
fNewDirection, maxshift, &dist, &safety)
&& std::abs(dist) < maxshift) {
/*
G4cout << "##MSC after Recheck dist= " << dist
<< " postsafety= " << postSafety
<< " t= " << tPathLength
<< " g= " << geomLength
<< " p= " << physStepLimit
<< G4endl;
*/
// shift is positive
if(dist >= 0.0) {
tPathLength *= (1.0 + dist/geomLength);
fNewPosition += dist*fNewDirection;
&& std::abs(dist) < maxshift) {
/*
G4cout << "##MSC after Recheck dist= " << dist
<< " postsafety= " << postSafety
<< " t= " << tPathLength
<< " g= " << geomLength
<< " p= " << physStepLimit
<< G4endl;
*/
// shift is positive
if(dist >= 0.0) {
tPathLength *= (1.0 + dist/geomLength);
fNewPosition += dist*fNewDirection;
// shift is negative cannot be larger than geomLength
} else {
maxshift = std::min(maxshift, geomLength);
if(0.0 < maxshift + dist) {
const G4ThreeVector& postpoint = step.GetPostStepPoint()->GetPosition();
G4ThreeVector point = fNewPosition + dist*fNewDirection;
G4double R2 = (postpoint - point).mag2();
G4double newdist = dist;
// check not more than 10 extra boundaries
for(G4int i=0; i<10; ++i) {
dist = 0.0;
if(safetyHelper->RecheckDistanceToCurrentBoundary(
point, fNewDirection, maxshift, &dist, &safety)
&& std::abs(newdist + dist) < maxshift) {
point += dist*fNewDirection;
G4double R2new = (postpoint - point).mag2();
//G4cout << "Backward i= " << i << " dist= " << dist
// << " R2= " << R2new << G4endl;
if(dist >= 0.0 || R2new > R2) { break; }
R2 = R2new;
fNewPosition = point;
newdist += dist;
} else {
break;
}
}
tPathLength *= (1.0 + newdist/geomLength);
// shift on boundary is not possible for negative disp
} else {
fNewPosition += displacement*(postSafety/dispR - 1.0);
}
}
// shift on boundary is not possible for any disp
} else {
fNewPosition += displacement*(postSafety/dispR - 1.0);
}
// reduced displacement
} else if(postSafety > geomMin) {
fNewPosition += displacement*(postSafety/dispR);
// shift is negative cannot be larger than geomLength
} else {
maxshift = std::min(maxshift, geomLength);
if(0.0 < maxshift + dist) {
const G4ThreeVector& postpoint =
step.GetPostStepPoint()->GetPosition();
G4ThreeVector point = fNewPosition + dist*fNewDirection;
G4double R2 = (postpoint - point).mag2();
G4double newdist = dist;
// check not more than 10 extra boundaries
for(G4int i=0; i<10; ++i) {
dist = 0.0;
if(safetyHelper->RecheckDistanceToCurrentBoundary(
point, fNewDirection, maxshift, &dist, &safety)
&& std::abs(newdist + dist) < maxshift) {
point += dist*fNewDirection;
G4double R2new = (postpoint - point).mag2();
//G4cout << "Backward i= " << i << " dist= " << dist
// << " R2= " << R2new << G4endl;
if(dist >= 0.0 || R2new > R2) { break; }
R2 = R2new;
fNewPosition = point;
newdist += dist;
} else {
break;
}
}
tPathLength *= (1.0 + newdist/geomLength);
// shift on boundary is not possible for negative disp
} else {
fNewPosition += displacement*(postSafety/dispR - 1.0);
}
}
// shift on boundary is not possible for any disp
} else {
fNewPosition += displacement*(postSafety/dispR - 1.0);
}
// reduced displacement
} else if(postSafety > geomMin) {
fNewPosition += displacement*(postSafety/dispR);
// very small postSafety
} else {
fPositionChanged = false;
}
}
if(fPositionChanged) {
safetyHelper->ReLocateWithinVolume(fNewPosition);
fParticleChange.ProposePosition(fNewPosition);
}
if(fPositionChanged) {
safetyHelper->ReLocateWithinVolume(fNewPosition);
fParticleChange.ProposePosition(fNewPosition);
}
}
}
}
@@ -16,6 +16,10 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
15 March 19: D. Sawkey (xrays-V10-04-06)
- G4Cerenkov: increase protection against infinite loops
(backport of xrays-V10-05-00)
20 September 18: D. Sawkey (xrays-V10-04-05)
- G4Cerenkov, G4Scintillation. Reset fNumPhotons to 0 correctly each step.
Fixes bug 2056.
@@ -552,8 +552,9 @@ G4double G4Cerenkov::PostStepGetPhysicalInteractionLength(
G4double Step = Range - RangeMin;
// If the step is smaller than 1e-16 mm, it may happen that the particle
// does not move. See bug 1992.
if (Step < 1.e-16*mm) return StepLimit;
// does not move. See bug 1992.
// 2019-03-11: change to 1e-15
if (Step < 1.e-15*mm) return StepLimit;
if (Step < StepLimit) StepLimit = Step;
// If user has defined an average maximum number of photons to
@@ -14,6 +14,9 @@ code and to keep track of all tags.
* Please list in reverse chronological order (last date on top)
---------------------------------------------------------------
20 December 2018 - Alberto Ribon (hadr-cross-V10-04-55)
- G4ChipsNeutronElasticXS : fixed compilation warnings on clang-7 .
22 October 2018 - Vladimir Ivanchenko (hadr-cross-V10-04-54)
- G4BGGPionElasticXS - limit cross section below 20 MeV
- G4HadronNucleonXsc - added extra method for kaons fully based on NS
@@ -768,10 +768,10 @@ G4double G4ChipsNeutronElasticXS::GetPTables(G4double LP, G4double ILP, G4int PD
static const G4int N41=3;
static const G4double pZ41N52[7]={2.6E-7, 8.3, 2.E-4, 1.2E-9, .4, 4.E-6, .0051};
static const std::pair<G4int, const G4double*> Z41N52(52,pZ41N52);
static const G4double pZ41N53[7]={2.E-7, 8.3, 1.6E-4, 1.4E-9, .35, 2.5E-6, .0051};
static const std::pair<G4int, const G4double*> Z41N53(53,pZ41N53);
static const G4double pZ41N54[7]={1.5E-7, 8.6, 1.E-4, 1.5E-9, .35, 2.5E-6, .0045};
static const std::pair<G4int, const G4double*> Z41N54(54,pZ41N54);
//static const G4double pZ41N53[7]={2.E-7, 8.3, 1.6E-4, 1.4E-9, .35, 2.5E-6, .0051};
//static const std::pair<G4int, const G4double*> Z41N53(53,pZ41N53);
//static const G4double pZ41N54[7]={1.5E-7, 8.6, 1.E-4, 1.5E-9, .35, 2.5E-6, .0045};
//static const std::pair<G4int, const G4double*> Z41N54(54,pZ41N54);
static const std::pair<G4int, const G4double*> Z41[N41]={Z41N52, Z41N52, Z41N52};
//==> Mo(Z=42)
static const G4int N42=8;
@@ -1174,8 +1174,8 @@ G4double G4ChipsNeutronElasticXS::GetPTables(G4double LP, G4double ILP, G4int PD
static const G4int N65=2;
static const G4double pZ65N94[7]={9.E-7, 16., 3.9E-4, 1.7E-9, 2., 2.2E-5, .0042};
static const std::pair<G4int, const G4double*> Z65N94(94,pZ65N94);
static const G4double pZ65N95[7]={4.5E-7, 16., 1.1E-4, 3.E-9, 1.7, 2.2E-5, .0024};
static const std::pair<G4int, const G4double*> Z65N95(95,pZ65N95);
//static const G4double pZ65N95[7]={4.5E-7, 16., 1.1E-4, 3.E-9, 1.7, 2.2E-5, .0024};
//static const std::pair<G4int, const G4double*> Z65N95(95,pZ65N95);
static const std::pair<G4int, const G4double*> Z65[N65]={Z65N94, Z65N94};
//==> Dy(Z=66)
static const G4int N66=7;
@@ -1270,8 +1270,8 @@ G4double G4ChipsNeutronElasticXS::GetPTables(G4double LP, G4double ILP, G4int PD
static const G4int N73=2;
static const G4double pZ73N108[7]={5.E-7, 18., 1.7E-4, 2.E-9, 1.2, 1.4E-5, .0035};
static const std::pair<G4int, const G4double*> Z73N108(108,pZ73N108);
static const G4double pZ73N109[7]={1.E-6, 14., .002, .3E-9, 1.3, 1.5E-5, .016};
static const std::pair<G4int, const G4double*> Z73N109(109,pZ73N109);
//static const G4double pZ73N109[7]={1.E-6, 14., .002, .3E-9, 1.3, 1.5E-5, .016};
//static const std::pair<G4int, const G4double*> Z73N109(109,pZ73N109);
static const std::pair<G4int, const G4double*> Z73[N73]={Z73N108, Z73N108};
//==> W (Z=74) *** W180 only bad TENDL-2008 *** (W180=Hf178)
static const G4int N74=5;
@@ -1475,8 +1475,8 @@ G4double G4ChipsNeutronElasticXS::GetPTables(G4double LP, G4double ILP, G4int PD
static const std::pair<G4int, const G4double*> Z92N147(147,pZ92N147);
static const G4double pZ92N148[7]={3.4E-7, 20., 1.3E-4, 1.3E-9, 2.2, 2.8E-5, .0036};
static const std::pair<G4int, const G4double*> Z92N148(148,pZ92N148);
static const G4double pZ92N149[7]={3.3E-7, 20., 1.5E-4, 1.2E-9, 3., 3.4E-5, .0044};
static const std::pair<G4int, const G4double*> Z92N149(149,pZ92N149);
//static const G4double pZ92N149[7]={3.3E-7, 20., 1.5E-4, 1.2E-9, 3., 3.4E-5, .0044};
//static const std::pair<G4int, const G4double*> Z92N149(149,pZ92N149);
static const std::pair<G4int, const G4double*> Z92[N92]={Z92N140, Z92N141, Z92N142,
Z92N143, Z92N144, Z92N145,
Z92N146, Z92N147, Z92N148,
@@ -14,6 +14,19 @@ code and to keep track of all tags.
* Please list in reverse chronological order (last date on top)
---------------------------------------------------------------
18 March 2019 Vladimir Ivanchenko (hadr-deex-V10-04-20)
- G4PhotonEvaporation - for nuclear levels without decay modes defined
perform decay not to the ground state but to the nearest level
(problem #2123)
- G4LevelManager, G4NucLevel - fixed debug and warning printouts
12 March 2019 Vladimir Ivanchenko
- G4PhotonEvaporation - fixed decay from nuclear level, which has no
decay channels defined (problem #2123)
28 January 2019 Vladimir Ivanchenko
- G4LevelReader - fixed typo (problem #2124)
05 December 2018 Gabriele Cosmo (hadr-deex-V10-04-19)
- G4ExcitationHandler: added protection to verbosity printouts in
SetDeexChannelsType() and Initialise() methods.
@@ -59,7 +59,7 @@ public:
// energies - list of excitation energies of nuclear levels starting
// from the ground state with energy zero
// spin - 2J, where J is the full angular momentum of the state
explicit G4LevelManager(G4int Z, G4int A, size_t ntrans,
explicit G4LevelManager(G4int Z, G4int A, size_t nlev,
const std::vector<G4double>& energies,
const std::vector<G4int>& spin,
const std::vector<const G4NucLevel*>& levels);
@@ -119,7 +119,7 @@ private:
G4bool operator!=(const G4LevelManager &right) const = delete;
std::vector<G4double> fLevelEnergy;
std::vector<G4int> fSpin;
std::vector<G4int> fSpin;
std::vector<const G4NucLevel*> fLevels;
G4double fPairingCorrection;
@@ -141,7 +141,7 @@ inline size_t G4LevelManager::NumberOfTransitions() const
inline const G4NucLevel* G4LevelManager::GetLevel(size_t i) const
{
#ifdef G4VERBOSE
if(i > nTransitions) { PrintError(i, "GetLevel"); }
if(i > nTransitions) { PrintError(i, "GetLevel(idx)"); }
#endif
return fLevels[i];
}
@@ -149,7 +149,7 @@ inline const G4NucLevel* G4LevelManager::GetLevel(size_t i) const
inline G4double G4LevelManager::LevelEnergy(size_t i) const
{
#ifdef G4VERBOSE
if(i > nTransitions) { PrintError(i, "LevelEnergy"); }
if(i > nTransitions) { PrintError(i, "LevelEnergy(idx)"); }
#endif
return fLevelEnergy[i];
}
@@ -113,7 +113,7 @@ inline size_t G4NucLevel::NumberOfTransitions() const
inline size_t G4NucLevel::FinalExcitationIndex(size_t idx) const
{
#ifdef G4VERBOSE
if(idx >= length) { PrintError(idx, "FinalExcitationEnergy"); }
if(idx >= length) { PrintError(idx, "FinalExcitationIndex(idx)"); }
#endif
return (size_t)(fTrans[idx]/10000);
}
@@ -121,7 +121,7 @@ inline size_t G4NucLevel::FinalExcitationIndex(size_t idx) const
inline G4int G4NucLevel::TransitionType(size_t idx) const
{
#ifdef G4VERBOSE
if(idx >= length) { PrintError(idx, "TransitionType"); }
if(idx >= length) { PrintError(idx, "TransitionType(idx)"); }
#endif
return fTrans[idx]%10000;
}
@@ -134,7 +134,7 @@ inline G4double G4NucLevel::GetTimeGamma() const
inline G4float G4NucLevel::GammaProbability(size_t idx) const
{
#ifdef G4VERBOSE
if(idx >= length) { PrintError(idx, "GammaProbability"); }
if(idx >= length) { PrintError(idx, "GammaProbability(idx)"); }
#endif
return fGammaProbability[idx];
}
@@ -142,7 +142,7 @@ inline G4float G4NucLevel::GammaProbability(size_t idx) const
inline G4float G4NucLevel::GammaCumProbability(size_t idx) const
{
#ifdef G4VERBOSE
if(idx >= length) { PrintError(idx, "GammaCumProbability"); }
if(idx >= length) { PrintError(idx, "GammaCumProbability(idx)"); }
#endif
return fGammaCumProbability[idx];
}
@@ -150,7 +150,7 @@ inline G4float G4NucLevel::GammaCumProbability(size_t idx) const
inline G4float G4NucLevel::MultipolarityRatio(size_t idx) const
{
#ifdef G4VERBOSE
if(idx >= length) { PrintError(idx, "GammaProbability"); }
if(idx >= length) { PrintError(idx, "MultipolarityRatio(idx)"); }
#endif
return fMpRatio[idx];
}
@@ -168,7 +168,7 @@ inline size_t G4NucLevel::SampleGammaTransition(G4double rndm) const
inline G4int G4NucLevel::SampleShell(size_t idx, G4double rndm) const
{
#ifdef G4VERBOSE
if(idx >= length) { PrintError(idx, "SampleShell"); }
if(idx >= length) { PrintError(idx, "SampleShell(idx,rndm)"); }
#endif
const std::vector<G4float>* prob = fShellProbability[idx];
G4int i(-1);
@@ -184,7 +184,7 @@ inline const std::vector<G4float>*
G4NucLevel::ShellProbabilty(size_t idx) const
{
#ifdef G4VERBOSE
if(idx >= length) { PrintError(idx, "ShellProbability"); }
if(idx >= length) { PrintError(idx, "ShellProbability(idx)"); }
#endif
return fShellProbability[idx];
}
@@ -127,7 +127,7 @@ G4LevelManager::NearestLevelIndex(G4double energy, size_t index) const
const G4String& G4LevelManager::FloatingType(size_t i) const
{
#ifdef G4VERBOSE
if(i > nTransitions) { PrintError(i, "Meta"); }
if(i > nTransitions) { PrintError(i, "FloatingType(idx)"); }
#endif
return fFloatingLevels[fSpin[i]/100000];
}
@@ -137,10 +137,9 @@ void G4LevelManager::PrintError(size_t idx, const G4String& ss) const
{
G4String sss = "G4LevelManager::"+ss+"()";
G4ExceptionDescription ed;
ed << "Index of a level " << idx << " > "
<< nTransitions << " (number of levels)";
G4Exception(sss,"had061",JustWarning,ed,"stop run");
throw G4HadronicException(__FILE__, __LINE__,"FATAL Hadronic Exception");
ed << "Index of a level " << idx << " >= "
<< nTransitions+1 << " (Nlevels) ";
G4Exception(sss,"had061",JustWarning,ed,"");
}
#endif
@@ -55,7 +55,7 @@ G4String G4LevelReader::fFloatingLevels[] = {
G4LevelReader::G4LevelReader(G4NuclearLevelData* ptr)
: fData(ptr),fVerbose(0),fLevelMax(632),fTransMax(145)
{
fAlphaMax = (G4float)1.e-15;
fAlphaMax = (G4float)1.e15;
fParam = fData->GetParameters();
fTimeFactor = CLHEP::second/G4Pow::GetInstance()->logZ(2);
char* directory = getenv("G4LEVELGAMMADATA");
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// -------------------------------------------------------------------
//
// GEANT4 class file
@@ -138,16 +137,16 @@ G4PhotonEvaporation::EmittedFragment(G4Fragment* nucleus)
delete nucleus->GetNuclearPolarization();
}
fPolarization = fNucPStore->FindOrBuild(nucleus->GetZ_asInt(),
nucleus->GetA_asInt(),
nucleus->GetExcitationEnergy());
nucleus->GetA_asInt(),
nucleus->GetExcitationEnergy());
nucleus->SetNuclearPolarization(fPolarization);
}
if(fVerbose > 1) {
G4cout << "G4PhotonEvaporation::EmittedFragment: "
<< *nucleus << G4endl;
<< *nucleus << G4endl;
if(fPolarization) { G4cout << "NucPolar: " << fPolarization << G4endl; }
G4cout << " CorrGamma: " << fCorrelatedGamma << " RDM: " << fRDM
<< " fPolarization: " << fPolarization << G4endl;
<< " fPolarization: " << fPolarization << G4endl;
}
G4Fragment* gamma = GenerateGamma(nucleus);
@@ -155,7 +154,7 @@ G4PhotonEvaporation::EmittedFragment(G4Fragment* nucleus)
if(fPolarization && 0 == fIndex) {
if(fVerbose > 1) {
G4cout << "G4PhotonEvaporation::EmittedFragment: remove "
<< fPolarization << G4endl;
<< fPolarization << G4endl;
}
fNucPStore->RemoveMe(fPolarization);
fPolarization = nullptr;
@@ -164,7 +163,7 @@ G4PhotonEvaporation::EmittedFragment(G4Fragment* nucleus)
if(fVerbose > 1) {
G4cout << "G4PhotonEvaporation::EmittedFragment: RDM= "
<< fRDM << " done:" << G4endl;
<< fRDM << " done:" << G4endl;
if(gamma) { G4cout << *gamma << G4endl; }
G4cout << " Residual: " << *nucleus << G4endl;
}
@@ -185,12 +184,12 @@ G4PhotonEvaporation::BreakItUp(const G4Fragment& nucleus)
}
G4bool G4PhotonEvaporation::BreakUpChain(G4FragmentVector* products,
G4Fragment* nucleus)
G4Fragment* nucleus)
{
if(!isInitialised) { Initialise(); }
if(fVerbose > 0) {
G4cout << "G4PhotonEvaporation::BreakUpChain RDM= " << fRDM << " "
<< *nucleus << G4endl;
<< *nucleus << G4endl;
}
G4Fragment* gamma = nullptr;
fSampleTime = (fRDM) ? false : true;
@@ -198,8 +197,8 @@ G4bool G4PhotonEvaporation::BreakUpChain(G4FragmentVector* products,
// start decay chain from unpolarized state
if(fCorrelatedGamma) {
fPolarization = new G4NuclearPolarization(nucleus->GetZ_asInt(),
nucleus->GetA_asInt(),
nucleus->GetExcitationEnergy());
nucleus->GetA_asInt(),
nucleus->GetExcitationEnergy());
nucleus->SetNuclearPolarization(fPolarization);
}
@@ -208,9 +207,9 @@ G4bool G4PhotonEvaporation::BreakUpChain(G4FragmentVector* products,
if(gamma) {
products->push_back(gamma);
if(fVerbose > 0) {
G4cout << "G4PhotonEvaporation::BreakUpChain: "
<< *gamma << G4endl;
G4cout << " Residual: " << *nucleus << G4endl;
G4cout << "G4PhotonEvaporation::BreakUpChain: "
<< *gamma << G4endl;
G4cout << " Residual: " << *nucleus << G4endl;
}
// for next decays in the chain always sample time
fSampleTime = true;
@@ -238,7 +237,7 @@ G4PhotonEvaporation::GetEmissionProbability(G4Fragment* nucleus)
fCode = 1000*Z + A;
if(fVerbose > 1) {
G4cout << "G4PhotonEvaporation::GetEmissionProbability: Z="
<< Z << " A=" << A << " Eexc(MeV)= " << fExcEnergy << G4endl;
<< Z << " A=" << A << " Eexc(MeV)= " << fExcEnergy << G4endl;
}
// ignore gamma de-excitation for exotic fragments
// and for very low excitations
@@ -270,7 +269,7 @@ G4PhotonEvaporation::GetEmissionProbability(G4Fragment* nucleus)
fStep /= ((G4double)(fPoints - 1));
if(fVerbose > 1) {
G4cout << "Emax= " << emax << " Npoints= " << fPoints
<< " Eex= " << fExcEnergy << G4endl;
<< " Eex= " << fExcEnergy << G4endl;
}
// integrate probabilities
G4double eres = (G4double)GREnergy[A];
@@ -297,8 +296,11 @@ G4PhotonEvaporation::GetEmissionProbability(G4Fragment* nucleus)
*gammaR2*gammaE2/(egdp2*egdp2 + gammaR2);
fProbability += (p1 + p0);
fCummProbability[i] = fProbability;
//G4cout << "Egamma= " << egam << " Eex= " << fExcEnergy
//<< " p0= " << p0 << " p1= " << p1 << " sum= " << fCummProbability[i] <<G4endl;
if(fVerbose > 2) {
G4cout << "Egamma= " << egam << " Eex= " << fExcEnergy
<< " p0= " << p0 << " p1= " << p1 << " sum= "
<< fCummProbability[i] <<G4endl;
}
p0 = p1;
}
@@ -351,98 +353,131 @@ G4PhotonEvaporation::GenerateGamma(G4Fragment* nucleus)
const G4NucLevel* level = nullptr;
size_t ntrans = 0;
if(fVerbose > 1) {
G4cout << "GenerateGamma: " << " Eex= " << eexc
<< " Eexmax= " << fLevelEnergyMax << G4endl;
}
// initial discrete state
if(fLevelManager && eexc <= fLevelEnergyMax + Tolerance) {
fIndex = fLevelManager->NearestLevelIndex(eexc, fIndex);
isDiscrete = true;
if(fVerbose > 1) {
G4cout << " index= " << fIndex
<< " lTime= " << fLevelManager->LifeTime(fIndex) << G4endl;
}
if(0 < fIndex) {
// for discrete transition
level = fLevelManager->GetLevel(fIndex);
if(level) {
ntrans = level->NumberOfTransitions();
ntrans = level->NumberOfTransitions();
JP1 = fLevelManager->SpinTwo(fIndex);
if(ntrans > 0) {
isDiscrete = true;
} else {
// if no transition available nothing is done for RDM
if(fRDM) {return result; }
if(fLevelManager->FloatingLevel(fIndex) > 0) {
--fIndex;
level = fLevelManager->GetLevel(fIndex);
ntrans = level->NumberOfTransitions();
JP1 = fLevelManager->SpinTwo(fIndex);
if(ntrans > 0) { isDiscrete = true; }
}
}
if(fVerbose > 2) {
G4cout << " ntrans= " << ntrans << " JP= " << JP1
<< " RDM: " << fRDM << G4endl;
}
if(0 == ntrans && fLevelManager->FloatingLevel(fIndex) > 0) {
--fIndex;
level = fLevelManager->GetLevel(fIndex);
ntrans = level->NumberOfTransitions();
JP1 = fLevelManager->SpinTwo(fIndex);
}
}
}
}
if(fVerbose > 1) {
G4int prec = G4cout.precision(4);
G4cout << "GenerateGamma: Z= " << nucleus->GetZ_asInt()
<< " A= " << nucleus->GetA_asInt()
<< " Exc= " << eexc << " Emax= "
<< fLevelEnergyMax << " idx= " << fIndex
<< " fCode= " << fCode << " fPoints= " << fPoints
<< " Ntr= " << ntrans << " discrete: " << isDiscrete
<< " fProb= " << fProbability << G4endl;
<< " A= " << nucleus->GetA_asInt()
<< " Exc= " << eexc << " Emax= "
<< fLevelEnergyMax << " idx= " << fIndex
<< " fCode= " << fCode << " fPoints= " << fPoints
<< " Ntr= " << ntrans << " discrete: " << isDiscrete
<< " fProb= " << fProbability << G4endl;
G4cout.precision(prec);
}
// continues part
if(!isDiscrete) {
// G4cout << "Continues fIndex= " << fIndex << G4endl;
// we compare current excitation versus value used for probability
// computation and also Z and A used for probability computation
if(fCode != 1000*theZ + theA || eexc != fExcEnergy) {
GetEmissionProbability(nucleus);
}
if(fProbability == 0.0) { return result; }
G4double y = fCummProbability[fPoints-1]*G4UniformRand();
for(G4int i=1; i<fPoints; ++i) {
//G4cout << "y= " << y << " cummProb= " << fCummProbability[i] << G4endl;
if(y <= fCummProbability[i]) {
efinal = fStep*((i - 1) + (y - fCummProbability[i-1])
/(fCummProbability[i] - fCummProbability[i-1]));
break;
//if(fProbability == 0.0) { return result; }
if(fProbability == 0.0) {
fPoints = 1;
efinal = 0.0;
} else {
G4double y = fCummProbability[fPoints-1]*G4UniformRand();
for(G4int i=1; i<fPoints; ++i) {
if(fVerbose > 2) {
G4cout << "y= " << y << " cummProb= " << fCummProbability[i]
<< " fPoints= " << fPoints << " fStep= " << fStep << G4endl;
}
if(y <= fCummProbability[i]) {
efinal = fStep*((i - 1) + (y - fCummProbability[i-1])
/(fCummProbability[i] - fCummProbability[i-1]));
break;
}
}
}
// final discrete level
if(fVerbose > 2) {
G4cout << "Continues Efinal= " << efinal << G4endl;
}
if(fLevelManager) {
if(efinal < fLevelEnergyMax) {
//G4cout << "Efinal= " << efinal << " idx= " << fIndex << G4endl;
fIndex = fLevelManager->NearestLevelIndex(efinal, fIndex);
efinal = fLevelManager->LevelEnergy(fIndex);
// protection - take level below
if(efinal >= eexc && 0 < fIndex) {
--fIndex;
efinal = fLevelManager->LevelEnergy(fIndex);
}
nucleus->SetFloatingLevelNumber(fLevelManager->FloatingLevel(fIndex));
fIndex = fLevelManager->NearestLevelIndex(efinal, fIndex);
efinal = fLevelManager->LevelEnergy(fIndex);
// protection - take level below
if(efinal >= eexc && 0 < fIndex) {
--fIndex;
efinal = fLevelManager->LevelEnergy(fIndex);
}
nucleus->SetFloatingLevelNumber(fLevelManager->FloatingLevel(fIndex));
// not allowed to have final energy above max energy
// if G4LevelManager exist
// not allowed to have final energy above max energy
// if G4LevelManager exist
} else {
efinal = fLevelEnergyMax;
fIndex = fLevelManager->NearestLevelIndex(efinal, fIndex);
efinal = fLevelEnergyMax;
fIndex = fLevelManager->NearestLevelIndex(efinal, fIndex);
}
}
if(fVerbose > 1) {
G4cout << "Continues emission efinal(MeV)= " << efinal << G4endl;
}
//discrete part
} else {
//discrete part ground state
} else if(0 == fIndex) {
return result;
//discrete part no transitions defined
} else if(0 == ntrans) {
for(size_t ii=fIndex-1; ii>0; --ii) {
level = fLevelManager->GetLevel(ii);
if(level) {
ntrans = level->NumberOfTransitions();
// transition identified
if(0 < ntrans) {
efinal = fLevelManager->LevelEnergy(ii);
fIndex = ii;
break;
}
}
}
//discrete part for levels with transitions
} else {
if(fVerbose > 1) {
G4cout << "Discrete emission from level Index= " << fIndex
<< " Elevel= " << fLevelManager->LevelEnergy(fIndex)
<< " Elevel= " << fLevelManager->LevelEnergy(fIndex)
<< " Ltime= " << fLevelManager->LifeTime(fIndex)
<< " LtimeMax= " << fMaxLifeTime
<< " RDM= " << fRDM << " ICM= " << fICM << G4endl;
<< " RDM= " << fRDM << " ICM= " << fICM << G4endl;
}
if(0 == fIndex || !level) { return result; }
// stable fragment has life time -1
// if called from radioactive decay the life time is not checked
// stable fragment has life time -1 or above the limit
// if is called from the radioactive decay the life time is not checked
G4double ltime = fLevelManager->LifeTime(fIndex);
if(ltime < 0.0 || (!fRDM && ltime > fMaxLifeTime)) { return result; }
@@ -452,20 +487,19 @@ G4PhotonEvaporation::GenerateGamma(G4Fragment* nucleus)
}
if(fVerbose > 1) {
G4cout << "Ntrans= " << ntrans << " idx= " << idx
<< " ICM= " << fICM << " JP1= " << JP1 << G4endl;
<< " ICM= " << fICM << " JP1= " << JP1 << G4endl;
}
G4double prob = (G4double)level->GammaProbability(idx);
// prob = 0 means that there is only internal conversion
if(fICM && prob < 1.0) {
G4double rndm = G4UniformRand();
if(rndm > prob) {
isGamma = false;
rndm = (rndm - prob)/(1.0 - prob);
vShellNumber = level->SampleShell(idx, rndm);
isGamma = false;
rndm = (rndm - prob)/(1.0 - prob);
vShellNumber = level->SampleShell(idx, rndm);
}
}
// it is discrete transition with possible gamma correlation
isDiscrete = true;
ratio = level->MultipolarityRatio(idx);
multiP = level->TransitionType(idx);
fIndex = level->FinalExcitationIndex(idx);
@@ -482,8 +516,8 @@ G4PhotonEvaporation::GenerateGamma(G4Fragment* nucleus)
if(std::abs(efinal - eexc) <= Tolerance) { return result; }
result = fTransition->SampleTransition(nucleus, efinal, ratio, JP1,
JP2, multiP, vShellNumber,
isDiscrete, isGamma);
JP2, multiP, vShellNumber,
isDiscrete, isGamma);
if(result) { result->SetCreationTime(time); }
// updated residual nucleus
@@ -499,10 +533,10 @@ G4PhotonEvaporation::GenerateGamma(G4Fragment* nucleus)
if(fVerbose > 1) {
G4cout << "Final level E= " << efinal << " time= " << time
<< " idxFinal= " << fIndex << " isDiscrete: " << isDiscrete
<< " isGamma: " << isGamma << " multiP= " << multiP
<< " shell= " << vShellNumber
<< " JP1= " << JP1 << " JP2= " << JP2 << G4endl;
<< " idxFinal= " << fIndex << " isDiscrete: " << isDiscrete
<< " isGamma: " << isGamma << " multiP= " << multiP
<< " shell= " << vShellNumber
<< " JP1= " << JP1 << " JP2= " << JP2 << G4endl;
}
return result;
}
@@ -14,6 +14,11 @@ code and to keep track of all tags.
* Please list in reverse chronological order (last date on top)
---------------------------------------------------------------
3 April 2019 Dennis Wright (hadr-fission-V10-04-01)
----------------------------------------------------
- G4SmpIsoDir.cc: remove use of G4Pow for squaring cospolang - sometimes
causes crash
19 December 2017 Gabriele Cosmo (hadr-fission-V10-04-00)
-------------------------------------------------------
- Fixed self-consistency in G4LLNLFission header (missing #include).
@@ -57,7 +57,6 @@
#include <cmath>
#include "G4fissionEvent.hh"
#include "G4Pow.hh"
#include "G4PhysicalConstants.hh"
void G4fissionEvent::G4SmpIsoDir(G4double* cosdiru, G4double* cosdirv, G4double* cosdirw) {
@@ -76,16 +75,11 @@ void G4fissionEvent::G4SmpIsoDir(G4double* cosdiru, G4double* cosdirv, G4double*
G4double cospolang, sinpolang, phi;
/*
Choose emission angle isotropically.
Select a polar angle direction cosine.
*/
G4Pow* Pow=G4Pow::GetInstance();
// Choose emission angle isotropically, then select polar angle direction cosine
cospolang = 1.-2.*fisslibrng();
sinpolang = std::sqrt(1.-Pow->powA(cospolang, 2.));
/*
Select an azimuthal angle uniformly on (0,2*pi)
*/
sinpolang = std::sqrt(1. - cospolang*cospolang);
// Select an azimuthal angle uniformly on (0,2*pi)
phi = twopi*fisslibrng();
*cosdiru = sinpolang * std::cos(phi);
*cosdirv = sinpolang * std::sin(phi);
@@ -15,6 +15,11 @@ code and to keep track of all tags.
* Please list in reverse chronological order (last date on top)
---------------------------------------------------------------
19 December 2018 - Alberto Ribon (hadr-inclxx-V10-04-07)
---------------------------------------------------------------
- G4INCLHFB.cc : Fixed (weak and strong) non-reproducibility by making
the arrays radiusP, radiusN, diffusenessP, diffusenessN thread-local.
21 November 2018 - Gabriele Cosmo (hadr-inclxx-V10-04-06)
---------------------------------------------------------------
- G4INCLRandom.hh: changed Adapter::operator()() to make direct use of
@@ -105,11 +105,11 @@ public:
G4INCLXXInterface(G4VPreCompoundModel * const aPreCompound = 0);
~G4INCLXXInterface(); // Destructor
G4int operator==(G4INCLXXInterface& right) {
G4bool operator==(G4INCLXXInterface& right) {
return (this == &right);
}
G4int operator!=(G4INCLXXInterface& right) {
G4bool operator!=(G4INCLXXInterface& right) {
return (this != &right);
}
@@ -45,16 +45,17 @@
#include "G4INCLHFB.hh"
#include "G4INCLParticleTable.hh"
#include "G4INCLGlobals.hh"
#include "G4Threading.hh"
#include <algorithm>
#include <istream>
namespace G4INCL {
namespace {
G4double radiusP[TableZSize][TableASize];
G4double radiusN[TableZSize][TableASize];
G4double diffusenessP[TableZSize][TableASize];
G4double diffusenessN[TableZSize][TableASize];
G4ThreadLocal G4double radiusP[TableZSize][TableASize];
G4ThreadLocal G4double radiusN[TableZSize][TableASize];
G4ThreadLocal G4double diffusenessP[TableZSize][TableASize];
G4ThreadLocal G4double diffusenessN[TableZSize][TableASize];
void cleanTable(){
for(G4int i=0;i<TableZSize;++i)
@@ -14,6 +14,25 @@ code and to keep track of all tags.
* Please list in reverse chronological order (last date on top)
---------------------------------------------------------------
11 April 2019 Dennis Wright (hadr-hpp-V10-04-13)
-------------------------------------------------
- fix of bug report #1824
Adopoted fix of Artem Zontikov to make sure production cross section is
not ignored when sampling discrete gamma emission.
G4ParticleHPPhotonDist.hh : added reaction cross section data member
G4ParticleHPPhotonDist::GetPhotons() modified to statistically suppress
gammas when reaction cross section is non-zero.
G4ParticleHPPhotonDist::InitPartials() modified to take cross section
argument
G4ParticleHPInelasticBaseFS.cc and G4ParticleHPInelasticCompFS.cc
modified to change calls to InitPartials to take cross section argument
6 February 2019 Alberto Ribon (hadr-hpp-V10-04-12)
-----------------------------------------------------
- G4ParticleHPKallbachMannSyst::Kallbach : replaced G4Exp with std::exp in order
to avoid underflow/overflow crashes observed with the physics list
QGSP_BIC_AllHP in the version G4 10.5 .
26 November 2018 Gabriele Cosmo (hadr-hpp-V10-04-11)
-----------------------------------------------------
- Fixed potential leaks in G4ParticleHPPhotonDist, G4ParticleHPContAngularPar
@@ -76,6 +76,7 @@ public:
energy = 0;
theYield = 0;
thePartialXsec = 0;
theReactionXsec = 0;
isPrimary = 0;
theShells = 0;
theGammas = 0;
@@ -99,6 +100,7 @@ public:
delete [] energy;
delete [] theYield;
delete [] thePartialXsec;
delete [] theReactionXsec;
delete [] isPrimary;
delete [] theShells;
delete [] theGammas;
@@ -135,7 +137,7 @@ public:
void InitEnergies(std::istream & aDataFile);
void InitPartials(std::istream & aDataFile);
void InitPartials(std::istream& aDataFile, G4ParticleHPVector* theXsec = 0);
G4ReactionProductVector * GetPhotons(G4double anEnergy);
@@ -151,12 +153,13 @@ private:
G4double targetMass;
G4int nDiscrete; //number of discrete photons
G4int * disType; // discrete, or continuum photons
G4double * energy; // photon energies
G4ParticleHPVector * theYield; // multiplicity as a function of neutron energy.
G4int* disType; // discrete, or continuum photons
G4double* energy; // photon energies
G4ParticleHPVector* theYield; // multiplicity as a function of neutron energy.
G4ParticleHPVector theTotalXsec;
G4ParticleHPVector * thePartialXsec;
G4int * isPrimary;
G4ParticleHPVector* thePartialXsec;
G4ParticleHPVector* theReactionXsec;
G4int* isPrimary;
G4int isoFlag; // isotropic or not?
G4int tabulationType;
@@ -1025,7 +1025,7 @@ G4FFG_DATA_FUNCTIONENTER__
// // issue /run/particle/addProcManage
// G4UImanager::GetUIpointer()->ApplyCommand(cmdAdd);
//
// // retreive /control/verbose
// // retrieve /control/verbose
// G4UImanager::GetUIpointer()->SetVerboseLevel(tempVerboseLevel);
// }
@@ -158,7 +158,7 @@ void G4ParticleHPInelasticBaseFS::Init (G4double A, G4double Z, G4int M, G4Strin
else if(dataType==13)
{
theFinalStatePhotons = new G4ParticleHPPhotonDist;
theFinalStatePhotons->InitPartials(theData);
theFinalStatePhotons->InitPartials(theData, theXsection);
hasFSData = true;
}
else if(dataType==14)
@@ -176,7 +176,7 @@ void G4ParticleHPInelasticCompFS::Init (G4double A, G4double Z, G4int M, G4Strin
else if(dataType==13)
{
theFinalStatePhotons[it] = new G4ParticleHPPhotonDist;
theFinalStatePhotons[it]->InitPartials(theData);
theFinalStatePhotons[it]->InitPartials(theData, theXsection[50]);
}
else if(dataType==14)
{
@@ -76,8 +76,10 @@ G4double G4ParticleHPKallbachMannSyst::Kallbach(G4double cosTh, G4double anEnerg
// Kallbach-Mann systematics without normalization.
G4double result;
G4double theX = A(anEnergy)*cosTh;
result = 0.5*(G4Exp( theX)*(1+theCompoundFraction)
+G4Exp(-theX)*(1-theCompoundFraction));
// We need to use here std::exp (and not G4Exp) to avoid underflow/overflow problems
// (observed with the physics list QGSP_BIC_AllHP in the version G4 10.5).
result = 0.5*(std::exp( theX)*(1+theCompoundFraction)
+std::exp(-theX)*(1-theCompoundFraction));
return result;
}
@@ -121,18 +121,20 @@ G4bool G4ParticleHPPhotonDist::InitMean(std::istream & aDataFile)
void G4ParticleHPPhotonDist::InitAngular(std::istream & aDataFile)
{
G4int i, ii;
//angular distributions
aDataFile >> isoFlag;
if (isoFlag != 1)
{
if ( repFlag == 2 ) G4cout << "G4ParticleHPPhotonDist: repFlag == 2 && isoFlag != 1 is unexpected! If you use G4ND3.x, then please report to Geant4 Hyper News. Thanks." << G4endl;
if (repFlag == 2) G4cout << "G4ParticleHPPhotonDist: repFlag == 2 && isoFlag != 1 is unexpected! If you use G4ND3.x, then please report to Geant4 HyperNews. " << G4endl;
aDataFile >> tabulationType >> nDiscrete2 >> nIso;
//080731
if ( theGammas != NULL && nDiscrete2 != nDiscrete ) G4cout << "080731c G4ParticleHPPhotonDist nDiscrete2 != nDiscrete, It looks like something wrong in your NDL files. Please update the latest. If you still have this messages after the update, then please report to Geant4 Hyper News." << G4endl;
if (theGammas != NULL && nDiscrete2 != nDiscrete)
G4cout << "080731c G4ParticleHPPhotonDist nDiscrete2 != nDiscrete, It looks like something wrong in your NDL files. Please update the latest. If you still have this messages after the update, then please report to Geant4 Hyper News." << G4endl;
// The order of cross section (InitPartials) and distribution (InitAngular here) data are different, we have to re-coordinate consistent data order.
// The order of cross section (InitPartials) and distribution
// (InitAngular here) data are different, we have to re-coordinate
// consistent data order.
std::vector < G4double > vct_gammas_par;
std::vector < G4double > vct_shells_par;
std::vector < G4int > vct_primary_par;
@@ -250,10 +252,11 @@ void G4ParticleHPPhotonDist::InitEnergies(std::istream & aDataFile)
}
}
void G4ParticleHPPhotonDist::InitPartials(std::istream & aDataFile)
void G4ParticleHPPhotonDist::InitPartials(std::istream& aDataFile,
G4ParticleHPVector* theXsec)
{
if (theXsec) theReactionXsec = theXsec;
//G4cout << "G4ParticleHPPhotonDist::InitPartials " << G4endl;
aDataFile >> nDiscrete >> targetMass;
if(nDiscrete != 1)
{
@@ -724,6 +727,16 @@ G4int maxEnergyIndex = 0;
//G4cout << "iphoton " << iphoton << G4endl;
//G4cout << "photon energy " << theGammas[ iphoton ] /eV << G4endl;
// Statistically suppress the photon according to reaction cross section
// Fix proposed by Artem Zontikov, Bug report #1824
if (theReactionXsec) {
if (thePartialXsec[iphoton].GetXsec(anEnergy)/theReactionXsec->GetXsec(anEnergy) < G4UniformRand() ) {
delete thePhotons;
thePhotons = 0;
return thePhotons;
}
}
// Angle
G4double cosTheta = 0.0; // mu
@@ -14,6 +14,15 @@ code and to keep track of all tags.
* Please list in reverse chronological order (last date on top)
---------------------------------------------------------------
06-Mar-2019 A. Ribon (hadr-string-diff-V10-04-16)
- G4FTFModel: fixed a memory leak in G4FTFModel::GetStrings() reported as
bug #2138.
26-Feb-2019 J. Yarba
- Correct FTF_NUCDESTR_P1_ADEP_TGT parameter (fNuclearTgtDestructP1_ADEP)
that has accidentally been made "fixed". No changes in the random sequence.
- Minor cleanups
20-Nov-2018 A. Ribon (hadr-string-diff-V10-04-15)
- G4FTFParameter: minor Coverity fix, no changes in the random sequence.
@@ -66,8 +66,8 @@ class G4DiffractiveExcitation {
private:
G4DiffractiveExcitation( const G4DiffractiveExcitation& right );
const G4DiffractiveExcitation& operator=( const G4DiffractiveExcitation& right );
int operator==( const G4DiffractiveExcitation& right ) const;
int operator!=( const G4DiffractiveExcitation& right ) const;
G4bool operator==( const G4DiffractiveExcitation& right ) const;
G4bool operator!=( const G4DiffractiveExcitation& right ) const;
G4double LambdaF(G4double sqrM, G4double sqrM1, G4double sqrM2) const;
@@ -60,8 +60,8 @@ class G4DiffractiveSplitableHadron : public G4VSplitableHadron {
private:
G4DiffractiveSplitableHadron( const G4DiffractiveSplitableHadron& );
G4DiffractiveSplitableHadron& operator=( const G4DiffractiveSplitableHadron& );
int operator==( const G4DiffractiveSplitableHadron& right ) const;
int operator!=( const G4DiffractiveSplitableHadron& right ) const;
G4bool operator==( const G4DiffractiveSplitableHadron& right ) const;
G4bool operator!=( const G4DiffractiveSplitableHadron& right ) const;
G4int Diquark( G4int aquark, G4int bquark, G4int Spin ) const;
void ChooseStringEnds( G4int PDGcode, G4int* aEnd, G4int* bEnd ) const;
@@ -58,8 +58,8 @@ class G4ElasticHNScattering {
G4ElasticHNScattering( const G4ElasticHNScattering& right );
G4ThreeVector GaussianPt( G4double AveragePt2, G4double maxPtSquare ) const;
const G4ElasticHNScattering& operator=( const G4ElasticHNScattering& right );
int operator==( const G4ElasticHNScattering& right ) const;
int operator!=( const G4ElasticHNScattering& right ) const;
G4bool operator==( const G4ElasticHNScattering& right ) const;
G4bool operator!=( const G4ElasticHNScattering& right ) const;
};
#endif
@@ -59,8 +59,8 @@ class G4FTFAnnihilation {
private:
G4FTFAnnihilation( const G4FTFAnnihilation& right );
const G4FTFAnnihilation& operator=( const G4FTFAnnihilation& right );
int operator==( const G4FTFAnnihilation& right ) const;
int operator!=( const G4FTFAnnihilation& right ) const;
G4bool operator==( const G4FTFAnnihilation& right ) const;
G4bool operator!=( const G4FTFAnnihilation& right ) const;
// The "Annihilate" method uses the following struct and 4 new utility methods:
struct CommonVariables {
@@ -74,14 +74,14 @@ class G4FTFModel : public G4VPartonStringModel {
private:
G4FTFModel( const G4FTFModel& right );
const G4FTFModel& operator=( const G4FTFModel& right );
int operator==( const G4FTFModel& right ) const;
int operator!=( const G4FTFModel& right ) const;
G4bool operator==( const G4FTFModel& right ) const;
G4bool operator!=( const G4FTFModel& right ) const;
void StoreInvolvedNucleon();
void ReggeonCascade();
G4bool PutOnMassShell();
G4bool ExciteParticipants();
G4ExcitedStringVector* BuildStrings();
void BuildStrings( G4ExcitedStringVector* strings );
void GetResiduals();
G4bool AdjustNucleons( G4VSplitableHadron* SelectedAntiBaryon,
@@ -52,8 +52,8 @@ class G4FTFParticipants : public G4VParticipants {
G4FTFParticipants();
const G4FTFParticipants& operator=( const G4FTFParticipants& right );
~G4FTFParticipants();
int operator==( const G4FTFParticipants& right ) const;
int operator!=( const G4FTFParticipants& right ) const;
G4bool operator==( const G4FTFParticipants& right ) const;
G4bool operator!=( const G4FTFParticipants& right ) const;
void GetList( const G4ReactionProduct& thePrimary, G4FTFParameters* theParameters );
void StartLoop();
@@ -1440,7 +1440,7 @@ const G4DiffractiveExcitation & G4DiffractiveExcitation::operator=( const G4Diff
//============================================================================
int G4DiffractiveExcitation::operator==( const G4DiffractiveExcitation& ) const {
G4bool G4DiffractiveExcitation::operator==( const G4DiffractiveExcitation& ) const {
throw G4HadronicException( __FILE__, __LINE__,
"G4DiffractiveExcitation == operator not meant to be called" );
}
@@ -1448,7 +1448,7 @@ int G4DiffractiveExcitation::operator==( const G4DiffractiveExcitation& ) const
//============================================================================
int G4DiffractiveExcitation::operator!= ( const G4DiffractiveExcitation& ) const {
G4bool G4DiffractiveExcitation::operator!= ( const G4DiffractiveExcitation& ) const {
throw G4HadronicException( __FILE__, __LINE__,
"G4DiffractiveExcitation != operator not meant to be called" );
}
@@ -246,7 +246,7 @@ const G4ElasticHNScattering & G4ElasticHNScattering::operator=( const G4ElasticH
//============================================================================
int G4ElasticHNScattering::operator==( const G4ElasticHNScattering& ) const {
G4bool G4ElasticHNScattering::operator==( const G4ElasticHNScattering& ) const {
throw G4HadronicException( __FILE__, __LINE__,
"G4ElasticHNScattering == operator not meant to be called" );
}
@@ -254,7 +254,7 @@ int G4ElasticHNScattering::operator==( const G4ElasticHNScattering& ) const {
//============================================================================
int G4ElasticHNScattering::operator!=( const G4ElasticHNScattering& ) const {
G4bool G4ElasticHNScattering::operator!=( const G4ElasticHNScattering& ) const {
throw G4HadronicException( __FILE__, __LINE__,
"G4ElasticHNScattering != operator not meant to be called" );
}
@@ -1080,7 +1080,7 @@ const G4FTFAnnihilation & G4FTFAnnihilation::operator=( const G4FTFAnnihilation&
//============================================================================
int G4FTFAnnihilation::operator==( const G4FTFAnnihilation& ) const {
G4bool G4FTFAnnihilation::operator==( const G4FTFAnnihilation& ) const {
throw G4HadronicException( __FILE__, __LINE__,
"G4FTFAnnihilation == operator not meant to be called" );
}
@@ -1088,7 +1088,7 @@ int G4FTFAnnihilation::operator==( const G4FTFAnnihilation& ) const {
//============================================================================
int G4FTFAnnihilation::operator!=( const G4FTFAnnihilation& ) const {
G4bool G4FTFAnnihilation::operator!=( const G4FTFAnnihilation& ) const {
throw G4HadronicException( __FILE__, __LINE__,
"G4DiffractiveExcitation != operator not meant to be called" );
}
@@ -324,7 +324,7 @@ G4ExcitedStringVector* G4FTFModel::GetStrings() {
G4cout << "FTF BuildStrings ";
#endif
theStrings = BuildStrings();
BuildStrings( theStrings );
#ifdef debugFTFmodel
G4cout << "FTF BuildStrings " << theStrings << " OK" << G4endl
@@ -1945,11 +1945,10 @@ void G4FTFModel::AdjustNucleonsAlgorithm_afterSampling( G4int interactionCase,
//============================================================================
G4ExcitedStringVector* G4FTFModel::BuildStrings() {
void G4FTFModel::BuildStrings( G4ExcitedStringVector* strings ) {
// Loop over all collisions; find all primaries, and all targets
// (targets may be duplicate in the List (to unique G4VSplitableHadrons) ).
G4ExcitedStringVector* strings = new G4ExcitedStringVector();
G4ExcitedString* FirstString( 0 ); // If there will be a kink,
G4ExcitedString* SecondString( 0 ); // two strings will be produced.
@@ -2244,7 +2243,7 @@ G4ExcitedStringVector* G4FTFModel::BuildStrings() {
//}
//G4cout << "------------------------" << G4endl;
return strings;
return;
}
@@ -117,11 +117,13 @@ class G4FTFSettingDefaultHDP
//
HDP.SetDefault( "FTF_BARYON_DELTA_PROB_QEXCHG", 0. );
HDP.SetDefault( "FTF_BARYON_PROB_SAME_QEXCHG", 0. );
HDP.SetDefault( "FTF_BARYON_DIFF_M_PROJ", 1.16, 1.16, 3. );
HDP.SetDefault( "FTF_BARYON_NONDIFF_M_PROJ", 1.16, 1.16, 3. );
HDP.SetDefault( "FTF_BARYON_DIFF_M_TGT", 1.16, 1.16, 3. );
HDP.SetDefault( "FTF_BARYON_NONDIFF_M_TGT", 1.16, 1.16, 3. );
HDP.SetDefault( "FTF_BARYON_AVRG_PT2", 0.3, 0.08, 1. );
HDP.SetDefault( "FTF_BARYON_DIFF_M_PROJ", 1.16, 1.16, 3. ); // it's supposed to be in GeV but do NOT do (*CLHEP::GeV)
// because it'll be done in the G4FTFParameters::SetProjMinDiffMass
HDP.SetDefault( "FTF_BARYON_NONDIFF_M_PROJ", 1.16, 1.16, 3. ); // do NOT (*CLHEP::GeV) - same as above
HDP.SetDefault( "FTF_BARYON_DIFF_M_TGT", 1.16, 1.16, 3. ); // do NOT (*CLHEP::GeV) - same as above
HDP.SetDefault( "FTF_BARYON_NONDIFF_M_TGT", 1.16, 1.16, 3. ); // do NOT (*CLHEP::GeV) - same as above
HDP.SetDefault( "FTF_BARYON_AVRG_PT2", 0.3, 0.08, 1. ); // do NOT (*CLHEP::GeV) - same as above
//
// JVY, Oct. 6, 2017: Per Alberto R., keep these two settings fixed (for now)
//
@@ -180,19 +182,17 @@ G4FTFParamCollection::G4FTFParamCollection()
HDP.DeveloperGet( "FTF_PT2_NUCDESTR_P3", fPt2NuclearDestructP3 );
HDP.DeveloperGet( "FTF_PT2_NUCDESTR_P4", fPt2NuclearDestructP4 );
//
// fNuclearProjDestructP1 = 1.; // in 10.2.p03 & 10.3.ref04-ref07/08/09 it's 0.00481; in 10.3.p01/p02/p03, etc. it's be 1. (fixed)
// fNuclearProjDestructP1_NBRNDEP = false;
// fNuclearTgtDestructP1 = 1.; // in 10.2.p03 & 10.3.ref04-ref07/08/09 it's 0.00481; in 10.3.p01/p02/p03, etc. it's be 1. (fixed)
fNuclearTgtDestructP1_ADEP = false;
// we keep these parameters fixed, that's why they're defined here explicitly
// rather than being picked up from HDP
//
fNuclearProjDestructP2 = 4.0;
fNuclearProjDestructP3 = 2.1;
// fNuclearTgtDestructP2 = 4.0;
// fNuclearTgtDestructP3 = 2.1;
// fPt2NuclearDestructP1 = 0.035;
// fPt2NuclearDestructP2 = 0.04;
// fPt2NuclearDestructP3 = 4.0;
// fPt2NuclearDestructP4 = 2.5;
//
// there are the default settings
// they may be overriden by values from HDP later on
// (e.g. in G4FTFParamCollBaryonProj(), etc.)
//
fProjDiffDissociation = false;
fTgtDiffDissociation = false;
}
@@ -278,7 +278,9 @@ G4FTFParamCollBaryonProj::G4FTFParamCollBaryonProj()
//
// Proc=0 --> Qexchg w/o excitation
//
/* As of Oct. 31, 2017 keep these fixed
/* // As of Oct. 31, 2017 keep these fixed;
// this is why we keep this code block commented, and
// set the parameters explicitly below rather than picking up from HDP
HDP.DeveloperGet( "FTF_BARYON_PROC0_A1", fProc0A1 );
HDP.DeveloperGet( "FTF_BARYON_PROC0_B1", fProc0B1 );
HDP.DeveloperGet( "FTF_BARYON_PROC0_A2", fProc0A2 );
@@ -298,7 +300,9 @@ G4FTFParamCollBaryonProj::G4FTFParamCollBaryonProj()
//
// Proc=1 --> Qexchg w/excitation
//
/* As of Oct. 31, 2017 keep these fixed
/* // As of Oct. 31, 2017 keep these fixed
// this is why we keep this code block commented,
// and set the parameters explicitly below rather than picking up from HDP
HDP.DeveloperGet( "FTF_BARYON_PROC1_A1", fProc1A1 );
HDP.DeveloperGet( "FTF_BARYON_PROC1_B1", fProc1B1 );
HDP.DeveloperGet( "FTF_BARYON_PROC1_A2", fProc1A2 );
@@ -328,7 +332,9 @@ G4FTFParamCollBaryonProj::G4FTFParamCollBaryonProj()
//
// Proc=4 --> Qexchg "w/additional multiplier" in excitation
//
/* As of Oct. 31, 2017 keep these fixed
/* // As of Oct. 31, 2017 keep these fixed
// this is why we keep this code block commented out,
// and set the parameters explicitly below rather than picking up from HDP
HDP.DeveloperGet( "FTF_BARYON_PROC4_A1", fProc4A1 );
HDP.DeveloperGet( "FTF_BARYON_PROC4_B1", fProc4B1 );
HDP.DeveloperGet( "FTF_BARYON_PROC4_A2", fProc4A2 );
@@ -355,15 +361,6 @@ G4FTFParamCollBaryonProj::G4FTFParamCollBaryonProj()
HDP.DeveloperGet( "FTF_BARYON_NONDIFF_M_TGT", fTgtMinNonDiffMass );
HDP.DeveloperGet( "FTF_BARYON_AVRG_PT2", fAveragePt2 );
//
// fDeltaProbAtQuarkExchange = 0.;
// fProbOfSameQuarkExchange = 0.;
// fProjMinDiffMass = 1.16; // it's supposed to be in GeV but do NOT do (*CLHEP::GeV)
// because it'll be done in the G4FTFParameters::SetProjMinDiffMass
// fProjMinNonDiffMass = 1.16; // do NOT (*CLHEP::GeV) - same as above
// fTgtMinDiffMass = 1.16; // do NOT (*CLHEP::GeV) - same as above
// fTgtMinNonDiffMass = 1.16; // do NOT (*CLHEP::GeV) - same as above
// fAveragePt2 = 0.15; // do NOT (*CLHEP::GeV*CLHEP::GeV)
//
// JVY - Per Alberto R., we're curretly keeping these two settings fixed,
// thus they're defined here explicitly, rather than via HDP
//
@@ -383,11 +380,7 @@ G4FTFParamCollBaryonProj::G4FTFParamCollBaryonProj()
HDP.DeveloperGet( "FTF_BARYON_EXCI_E_PER_WNDNUCLN", fExciEnergyPerWoundedNucleon );
HDP.DeveloperGet( "FTF_BARYON_NUCDESTR_DOF", fDofNuclearDestruct );
//
// fR2ofNuclearDestruct = 1.5 * CLHEP::fermi*CLHEP::fermi;
// fExciEnergyPerWoundedNucleon = 40. * CLHEP::MeV;
// fDofNuclearDestruct = 0.3;
//
// NOTE-1: this parameter has changed from 1. to 9. between 10.2 and 10.3.ref07 !!!
// NOTE-1: this parameter (below) has changed from 1. to 9. between 10.2 and 10.3.ref07 !!!
// ... then it went back to 1. for the 10.4-candidate...
// NOTE-2: this is a "technical" parameter, it should not be changed; this is why
// it is defined explicitly rather than via HDP
@@ -530,20 +523,6 @@ void G4FTFParameters::InitForInteraction( const G4ParticleDefinition* particle,
TargetMass /= GeV; TargetMass2 /= (GeV*GeV);
ProjectileMass /= GeV; ProjectileMass2 /= (GeV*GeV);
/* JYV, Oct. 31, 2017: Keep it in the ctor
// Andrea Dotti (13Jan2013):
// The following lines are changed for G4MT. Originally the code was:
// static G4ChipsComponentXS* _instance = new G4ChipsComponentXS(); // Witek Pokorski
// Note the code could go back at original if _instance could be shared among threads
if ( ! chipsComponentXSisInitialized ) {
chipsComponentXSisInitialized = true;
chipsComponentXSinstance = new G4ChipsComponentXS();
}
G4ChipsComponentXS* _instance = chipsComponentXSinstance;
FTFxsManager = _instance;
*/
Plab /= GeV;
G4double Xftf = 0.0;
@@ -14,6 +14,11 @@ code and to keep track of all tags.
* Please list in reverse chronological order (last date on top)
---------------------------------------------------------------
02-Apr-2019 A. Ribon (hadr-qgsm-V10-04-09)
- G4QGSParticipants : bug-fix (made by Vladimir Uzhinsky) in the
computation of the transverse mass in the method
G4QGSParticipants::DeterminePartonMomenta() .
20-Nov-2018 A. Ribon (hadr-qgsm-V10-04-08)
- Minor clean-up and indentation: no changes in the random sequence.
@@ -41,8 +41,8 @@ class G4DiffractiveStringBuilder
private:
G4DiffractiveStringBuilder(const G4DiffractiveStringBuilder &right);
G4int operator==(const G4DiffractiveStringBuilder &right) const;
G4int operator!=(const G4DiffractiveStringBuilder &right) const;
G4bool operator==(const G4DiffractiveStringBuilder &right) const;
G4bool operator!=(const G4DiffractiveStringBuilder &right) const;
};
#endif
@@ -50,8 +50,8 @@ class G4PartonPair
private:
G4PartonPair(const G4PartonPair &right);
int operator==(const G4PartonPair &right) const;
int operator!=(const G4PartonPair &right) const;
G4bool operator==(const G4PartonPair &right) const;
G4bool operator!=(const G4PartonPair &right) const;
public:
void SetPartons(G4Parton* P1, G4Parton* P2);
@@ -66,8 +66,8 @@ class G4QGSDiffractiveExcitation
G4ThreeVector GaussianPt(G4double AveragePt2, G4double maxPtSquare) const;
const G4QGSDiffractiveExcitation & operator=(const G4QGSDiffractiveExcitation &right);
int operator==(const G4QGSDiffractiveExcitation &right) const;
int operator!=(const G4QGSDiffractiveExcitation &right) const;
G4bool operator==(const G4QGSDiffractiveExcitation &right) const;
G4bool operator!=(const G4QGSDiffractiveExcitation &right) const;
};
#endif
@@ -36,8 +36,8 @@ class G4QGSMParameters
private:
G4QGSMParameters(const G4QGSMParameters &right);
int operator==(const G4QGSMParameters &right) const;
int operator!=(const G4QGSMParameters &right) const;
G4bool operator==(const G4QGSMParameters &right) const;
G4bool operator!=(const G4QGSMParameters &right) const;
};
#endif
@@ -49,8 +49,8 @@ class G4QGSParticipants : public G4VParticipants
const G4QGSParticipants & operator=(const G4QGSParticipants &right);
virtual ~G4QGSParticipants();
int operator==(const G4QGSParticipants &right) const;
int operator!=(const G4QGSParticipants &right) const;
G4bool operator==(const G4QGSParticipants &right) const;
G4bool operator!=(const G4QGSParticipants &right) const;
virtual void DoLorentzBoost(G4ThreeVector aBoost)
{
@@ -59,8 +59,8 @@ class G4QuarkExchange
G4ThreeVector GaussianPt(G4double widthSquare, G4double maxPtSquare) const;
const G4QuarkExchange & operator=(const G4QuarkExchange &right);
int operator==(const G4QuarkExchange &right) const;
int operator!=(const G4QuarkExchange &right) const;
G4bool operator==(const G4QuarkExchange &right) const;
G4bool operator!=(const G4QuarkExchange &right) const;
};
#endif
@@ -61,8 +61,8 @@ class G4SingleDiffractiveExcitation : public G4QGSDiffractiveExcitation
G4ThreeVector GaussianPt(G4double widthSquare, G4double maxPtSquare) const;
const G4SingleDiffractiveExcitation & operator=(const G4SingleDiffractiveExcitation &right);
int operator==(const G4SingleDiffractiveExcitation &right) const;
int operator!=(const G4SingleDiffractiveExcitation &right) const;
G4bool operator==(const G4SingleDiffractiveExcitation &right) const;
G4bool operator!=(const G4SingleDiffractiveExcitation &right) const;
};
#endif
@@ -42,8 +42,8 @@ class G4SoftStringBuilder
private:
G4SoftStringBuilder(const G4SoftStringBuilder &right);
G4int operator==(const G4SoftStringBuilder &right) const;
G4int operator!=(const G4SoftStringBuilder &right) const;
G4bool operator==(const G4SoftStringBuilder &right) const;
G4bool operator!=(const G4SoftStringBuilder &right) const;
};
#endif
@@ -1718,7 +1718,8 @@ G4bool G4QGSParticipants::DeterminePartonMomenta()
G4cout<<" "<<tmp<<" "<<SumZ<<" (z-fraction)"<<G4endl;
#endif
tmp.setPx(-SumPx); tmp.setPy(-SumPy);
Mt = std::sqrt(aPtVector.mag2()+sqr(VaqM_pr));
//Uzhi 2019 Mt = std::sqrt(aPtVector.mag2()+sqr(VaqM_pr));
Mt = std::sqrt( sqr(SumPx) + sqr(SumPy) + sqr(VaqM_pr) ); //Uzhi 2019
ProjSumMt += Mt;
tmp.setPz(1.-SumZ);
@@ -1824,7 +1825,8 @@ G4bool G4QGSParticipants::DeterminePartonMomenta()
G4cout<<" "<<tmp<<" "<<SumZw<<" (sum z-fracs) "<<SumZ<<" (total z-sum) "<<G4endl;
#endif
tmp.setPx(-SumPx); tmp.setPy(-SumPy);
Mt=std::sqrt(aPtVector.mag2()+sqr(VqqM_tr));
//Uzhi 2019 Mt=std::sqrt(aPtVector.mag2()+sqr(VqqM_tr));
Mt=std::sqrt( sqr(SumPx) + sqr(SumPy) + sqr(VqqM_tr) ); //Uzhi 2019
TargSumMt += Mt;
tmp.setPz((*i)->Get4Momentum().pz()*(1.0 - SumZ));
+7
View File
@@ -16,6 +16,13 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
- Mar. 11, 2019 Gabriele Cosmo (procman-V10-04-05)
- Fixed typos in printouts in G4ProcessTableMessenger, G4ProcessManager
and G4VRest*Process.
- Jan. 31, 2019 Ivana Hrivnacova
- Merged GitHub PR #4: all Boolean operators now return G4bool.
- Nov. 24, 2018 Hisaya Kurashige (procman-V10-04-04)
- Fix a bug in G4ProcessTableMessenger.cc (Coverity 98892)

Some files were not shown because too many files have changed in this diff Show More