Import Geant4 10.7.0 source tree
This commit is contained in:
@@ -23,304 +23,269 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// G4VParticleChange
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
// Abstract class for "Particle Change".
|
||||
//
|
||||
// The ParticleChange class contains the results after invocation
|
||||
// of a physics process. This includes final states of parent particle
|
||||
// (momentum, energy, etc) and secondary particles generated by the
|
||||
// interaction.
|
||||
// The tracking assumes that all the values of energy and momentum are
|
||||
// in global reference system, therefore all the needed Lorentz
|
||||
// transformations must have been already computed when filling the
|
||||
// data-members of this class.
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// Implemented for the new scheme 23 Mar. 1998 H.Kurahige
|
||||
//
|
||||
// Class Description
|
||||
// This class is the abstract class for ParticleChange.
|
||||
//-
|
||||
// The ParticleChange class ontains the results after invocation
|
||||
// of a physics process. This includes final states of parent
|
||||
// particle (momentum, energy, etc) and secondary particles generated
|
||||
// by the interaction.
|
||||
// The tracking assumes that all the values of energy and
|
||||
// momentum are in global reference system, therefore all the
|
||||
// needed Lorentz transformations must have been already Done
|
||||
// when filling the data-members of this class.
|
||||
//-
|
||||
//-
|
||||
// This abstract class has following four virtual methods
|
||||
// This abstract class has following four virtual methods:
|
||||
// virtual G4Step* UpdateStepForAtRest(G4Step* Step);
|
||||
// virtual G4Step* UpdateStepForAlongStep(G4Step* Step);
|
||||
// virtual G4Step* UpdateStepForPostStep(G4Step* Step);
|
||||
// virtual void Initialize(const G4Track&);
|
||||
// The UpdateStep methods return the pointer to the G4Step
|
||||
// after updating the given Step information by using final state
|
||||
// information of the track given by a physics process.
|
||||
// User must add methods to keep the final state information
|
||||
// in his derived class as well as implement UpdateStep methods
|
||||
// which he want to use.
|
||||
//-
|
||||
// The Initialize methods is provided to refresh the final
|
||||
// state information and should be called by each process
|
||||
// at the beginning of DoIt.
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// Implement Event Biasing Scheme 9 Nov.,98 H.Kurashige
|
||||
// add CheckIt 13 Apr.,99 H.Kurashige
|
||||
// add accuracy leveles 5 May, 99 H.Kurashige
|
||||
// add check secondaries 11 June, 03 H.Kurashige
|
||||
// add new methods of ProposeXXX 08 May, 04 H.Kurashige
|
||||
// remove obsolete methods of SetXXX 19 Sep, 04 H.Kurashige
|
||||
// add flag for first/last step in volume 30 Oct. 2006 H.Kurashige
|
||||
// add nonIonizingEnergyLoss 26 Mar 2007 H.Kurashige
|
||||
// modify/fix bugs related to weight 17 Sep. 2011 H.Kurashige
|
||||
// fix bugs related to weight 29 Apr. 2012 H.Kurashige
|
||||
// The UpdateStep methods return the pointer to the G4Step after updating
|
||||
// the given Step information by using final state information of the track
|
||||
// given by a physics process.
|
||||
// User must add methods to keep the final state information in the derived
|
||||
// class as well as implement UpdateStep() methods wished to use.
|
||||
//
|
||||
// The Initialize() methods are provided to refresh the final state
|
||||
// information and should be called by each process at the beginning of DoIt().
|
||||
|
||||
#ifndef G4VParticleChange_h
|
||||
#define G4VParticleChange_h 1
|
||||
// Author: Hisaya Kurashige, 23 March 1998
|
||||
// --------------------------------------------------------------------
|
||||
#ifndef G4VParticleChange_hh
|
||||
#define G4VParticleChange_hh 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4ios.hh"
|
||||
#include <cmath>
|
||||
|
||||
class G4Track;
|
||||
class G4Step;
|
||||
|
||||
#include "G4TrackFastVector.hh"
|
||||
#include "G4TrackStatus.hh"
|
||||
#include "G4SteppingControl.hh"
|
||||
#include "G4Step.hh"
|
||||
#include "G4Track.hh"
|
||||
|
||||
|
||||
class G4VParticleChange
|
||||
class G4VParticleChange
|
||||
{
|
||||
public:
|
||||
// default constructor
|
||||
|
||||
G4VParticleChange();
|
||||
// Default constructor
|
||||
|
||||
// destructor
|
||||
virtual ~G4VParticleChange();
|
||||
// Destructor
|
||||
|
||||
// equal/unequal operator
|
||||
G4bool operator==(const G4VParticleChange &right) const;
|
||||
G4bool operator!=(const G4VParticleChange &right) const;
|
||||
// "equal" means that teo objects have the same pointer.
|
||||
G4bool operator==(const G4VParticleChange& right) const;
|
||||
G4bool operator!=(const G4VParticleChange& right) const;
|
||||
// Equality operators; pointer comparison
|
||||
|
||||
// --- the following methods are for updating G4Step ---
|
||||
|
||||
protected:
|
||||
// hide copy constructor and assignment operaor as protected
|
||||
G4VParticleChange(const G4VParticleChange &right);
|
||||
G4VParticleChange & operator=(const G4VParticleChange &right);
|
||||
|
||||
public: // with description
|
||||
// --- the following methods are for updating G4Step -----
|
||||
virtual G4Step* UpdateStepForAtRest(G4Step* Step);
|
||||
virtual G4Step* UpdateStepForAlongStep(G4Step* Step);
|
||||
virtual G4Step* UpdateStepForPostStep(G4Step* Step);
|
||||
// Return the pointer to the G4Step after updating the Step information
|
||||
// by using final state information of the track given by a physics
|
||||
// process
|
||||
|
||||
protected: // with description
|
||||
G4Step* UpdateStepInfo(G4Step* Step);
|
||||
// Update the G4Step specific attributes
|
||||
// (i.e. SteppingControl, LocalEnergyDeposit, and TrueStepLength)
|
||||
// Return the pointer to the G4Step after updating the Step information
|
||||
// by using final state information of the track given by a physics
|
||||
// process
|
||||
|
||||
|
||||
public: // with description
|
||||
virtual void Initialize(const G4Track&);
|
||||
// This methods will be called by each process at the beginning of DoIt
|
||||
// if necessary.
|
||||
// This methods will be called by each process at the beginning
|
||||
// of DoIt() if necessary
|
||||
|
||||
// --- the following methods are for TruePathLength ---
|
||||
|
||||
G4double GetTrueStepLength() const;
|
||||
void ProposeTrueStepLength(G4double truePathLength);
|
||||
// Get/Propose theTrueStepLength
|
||||
|
||||
// --- the following methods are for LocalEnergyDeposit ---
|
||||
|
||||
G4double GetLocalEnergyDeposit() const;
|
||||
void ProposeLocalEnergyDeposit(G4double anEnergyPart);
|
||||
// Get/Propose the locally deposited energy
|
||||
|
||||
// --- the following methods are for nonIonizingEnergyDeposit ---
|
||||
|
||||
G4double GetNonIonizingEnergyDeposit() const;
|
||||
void ProposeNonIonizingEnergyDeposit(G4double anEnergyPart);
|
||||
// Get/Propose the non-ionizing deposited energy
|
||||
|
||||
// --- the following methods are for TrackStatus ---
|
||||
|
||||
G4TrackStatus GetTrackStatus() const;
|
||||
void ProposeTrackStatus(G4TrackStatus status);
|
||||
// Get/Propose the final TrackStatus of the current particle
|
||||
|
||||
// --- the following methods are for management of SteppingControl ---
|
||||
|
||||
G4SteppingControl GetSteppingControl() const;
|
||||
void ProposeSteppingControl(G4SteppingControl StepControlFlag);
|
||||
// Set/Propose a flag to control stepping manager behaviour
|
||||
|
||||
// --- the following methods are for management of initial/last step
|
||||
|
||||
G4bool GetFirstStepInVolume() const;
|
||||
G4bool GetLastStepInVolume() const;
|
||||
void ProposeFirstStepInVolume(G4bool flag);
|
||||
void ProposeLastStepInVolume(G4bool flag);
|
||||
|
||||
// --- the following methods are for management of secondaries ---
|
||||
|
||||
void Clear();
|
||||
// Clear the contents of this objects
|
||||
// This method should be called after the Tracking(Stepping)
|
||||
// manager removes all secondaries in theListOfSecondaries
|
||||
|
||||
void SetNumberOfSecondaries(G4int totSecondaries);
|
||||
// SetNumberOfSecondaries must be called just before AddSecondary()
|
||||
// in order to secure memory space for theListOfSecondaries
|
||||
// This method resets theNumberOfSecondaries to zero
|
||||
// (that will be incremented at every AddSecondary() call)
|
||||
|
||||
G4int GetNumberOfSecondaries() const;
|
||||
// Returns the number of secondaries current stored in G4TrackFastVector
|
||||
|
||||
G4Track* GetSecondary(G4int anIndex) const;
|
||||
// Returns the pointer to the generated secondary particle
|
||||
// which is specified by an Index
|
||||
|
||||
void AddSecondary(G4Track* aSecondary);
|
||||
// Adds a secondary particle to theListOfSecondaries
|
||||
|
||||
// --- the following methods are for management of weights ---
|
||||
|
||||
G4double GetWeight() const;
|
||||
G4double GetParentWeight() const;
|
||||
// Get weight of the parent (i.e. current) track
|
||||
|
||||
void ProposeWeight(G4double finalWeight);
|
||||
void ProposeParentWeight(G4double finalWeight);
|
||||
// Propose new weight of the parent (i.e. current) track
|
||||
// As for AlongStepDoIt, the parent weight will be set
|
||||
// in accumulated manner, i.e. - If two processes propose
|
||||
// weight of W1 and W2 respectively for the track with initial
|
||||
// weight of W0 the final weight is set to: (W1/W0) * (W2/W0) * W0
|
||||
|
||||
void SetSecondaryWeightByProcess(G4bool);
|
||||
G4bool IsSecondaryWeightSetByProcess() const;
|
||||
// In default (fSecondaryWeightByProcess flag is false),
|
||||
// the weight of secondary tracks will be set to the parent weight
|
||||
// If fSecondaryWeightByProcess flag is true, the weight of secondary
|
||||
// tracks will not be changed by the ParticleChange (i.e. the process
|
||||
// determine the secondary weight)
|
||||
// NOTE:
|
||||
// Make sure that only one process in AlongStepDoIt() proposes the
|
||||
// parent weight; if several processes in AlongStepDoIt() propose
|
||||
// the parent weight and add secondaties with fSecondaryWeightByProcess
|
||||
// is set to false, secondary weights may be wrong
|
||||
|
||||
void SetParentWeightByProcess(G4bool);
|
||||
G4bool IsParentWeightSetByProcess() const;
|
||||
// Obsolete
|
||||
|
||||
// --- Dump and debug methods ---
|
||||
|
||||
virtual void DumpInfo() const;
|
||||
// Print out information
|
||||
|
||||
void SetVerboseLevel(G4int vLevel);
|
||||
G4int GetVerboseLevel() const;
|
||||
|
||||
virtual G4bool CheckIt(const G4Track&);
|
||||
// CheckIt method is provided for debug
|
||||
|
||||
void ClearDebugFlag();
|
||||
void SetDebugFlag();
|
||||
G4bool GetDebugFlag() const;
|
||||
// CheckIt method is activated if debug flag is set
|
||||
// and 'G4VERBOSE' is defined
|
||||
|
||||
protected:
|
||||
|
||||
G4VParticleChange(const G4VParticleChange& right);
|
||||
G4VParticleChange& operator=(const G4VParticleChange& right);
|
||||
// Hidden copy constructor and assignment operator
|
||||
|
||||
G4Step* UpdateStepInfo(G4Step* Step);
|
||||
// Update the G4Step specific attributes
|
||||
// (i.e. SteppingControl, LocalEnergyDeposit, and TrueStepLength)
|
||||
|
||||
void InitializeTrueStepLength(const G4Track&);
|
||||
void InitializeLocalEnergyDeposit(const G4Track&);
|
||||
void InitializeSteppingControl(const G4Track&);
|
||||
void InitializeParentWeight(const G4Track&);
|
||||
void InitializeParentGlobalTime(const G4Track&);
|
||||
|
||||
void InitializeStatusChange(const G4Track&);
|
||||
void InitializeSecondaries(const G4Track&);
|
||||
void InitializeStepInVolumeFlags(const G4Track&);
|
||||
// ------------------------------------------------------
|
||||
|
||||
public: // with description
|
||||
//---- the following methods are for TruePathLength ----
|
||||
G4double GetTrueStepLength() const;
|
||||
void ProposeTrueStepLength(G4double truePathLength);
|
||||
// Get/Propose theTrueStepLength
|
||||
|
||||
//---- the following methods are for LocalEnergyDeposit ----
|
||||
G4double GetLocalEnergyDeposit() const;
|
||||
void ProposeLocalEnergyDeposit(G4double anEnergyPart);
|
||||
// Get/Propose the locally deposited energy
|
||||
|
||||
//---- the following methods are for nonIonizingEnergyDeposit ----
|
||||
G4double GetNonIonizingEnergyDeposit() const;
|
||||
void ProposeNonIonizingEnergyDeposit(G4double anEnergyPart);
|
||||
// Get/Propose the non-ionizing deposited energy
|
||||
|
||||
//---- the following methods are for TrackStatus -----
|
||||
G4TrackStatus GetTrackStatus() const;
|
||||
void ProposeTrackStatus(G4TrackStatus status);
|
||||
// Get/Propose the final TrackStatus of the current particle.
|
||||
// ------------------------------------------------------
|
||||
|
||||
//---- the following methods are for managements of SteppingControl --
|
||||
G4SteppingControl GetSteppingControl() const;
|
||||
void ProposeSteppingControl(G4SteppingControl StepControlFlag);
|
||||
// Set/Propose a flag to control stepping manager behavier
|
||||
// ------------------------------------------------------
|
||||
|
||||
//---- the following methods are for managements of initial/last step
|
||||
G4bool GetFirstStepInVolume() const;
|
||||
G4bool GetLastStepInVolume() const;
|
||||
void ProposeFirstStepInVolume(G4bool flag);
|
||||
void ProposeLastStepInVolume(G4bool flag);
|
||||
|
||||
//---- the following methods are for managements of secondaries --
|
||||
void Clear();
|
||||
// Clear the contents of this objects
|
||||
// This method should be called after the Tracking(Stepping)
|
||||
// manager removes all secondaries in theListOfSecondaries
|
||||
|
||||
void SetNumberOfSecondaries(G4int totSecondaries);
|
||||
// SetNumberOfSecondaries must be called just before AddSecondary()
|
||||
// in order to secure memory space for theListOfSecondaries
|
||||
// This method resets theNumberOfSecondaries to 0
|
||||
// (that will be incremented at every AddSecondary() call).
|
||||
|
||||
G4int GetNumberOfSecondaries() const;
|
||||
// Returns the number of secondaries current stored in
|
||||
// G4TrackFastVector.
|
||||
|
||||
G4Track* GetSecondary(G4int anIndex) const;
|
||||
// Returns the pointer to the generated secondary particle
|
||||
// which is specified by an Index.
|
||||
|
||||
void AddSecondary(G4Track* aSecondary);
|
||||
// Add a secondary particle to theListOfSecondaries.
|
||||
// ------------------------------------------------------
|
||||
|
||||
G4double GetWeight() const;
|
||||
G4double GetParentWeight() const ;
|
||||
// Get weight of the parent (i.e. current) track
|
||||
void ProposeWeight(G4double finalWeight);
|
||||
void ProposeParentWeight(G4double finalWeight);
|
||||
// Propse new weight of the parent (i.e. current) track
|
||||
// As for AlongStepDoIt, the parent weight will be set
|
||||
// in accumulated manner
|
||||
// i.e.) If two processes propose weight of W1 and W2 respectively
|
||||
// for the track with initial weight of W0
|
||||
// the final weight is set to
|
||||
// (W1/W0) * (W2/W0) * W0
|
||||
|
||||
void SetSecondaryWeightByProcess(G4bool);
|
||||
G4bool IsSecondaryWeightSetByProcess() const;
|
||||
// In default (fSecondaryWeightByProcess flag is false),
|
||||
// the weight of secondary tracks will be set to
|
||||
// the parent weight
|
||||
// If fSecondaryWeightByProcess flag is true,
|
||||
// the weight of secondary tracks will not be changed
|
||||
// by the ParticleChange
|
||||
// (i.e. the process determine the secodary weight)
|
||||
// NOTE:
|
||||
// Make sure that only one processe in AlongStepDoIt
|
||||
// proposes the parent weight,
|
||||
// If several processes in AlongStepDoIt proposes
|
||||
// the parent weight and add secondaties with
|
||||
// fSecondaryWeightByProcess is set to false,
|
||||
// secondary weights may be wrong
|
||||
|
||||
void SetParentWeightByProcess(G4bool);
|
||||
G4bool IsParentWeightSetByProcess() const;
|
||||
// Obsolete
|
||||
|
||||
virtual void DumpInfo() const;
|
||||
// Print out information
|
||||
|
||||
void SetVerboseLevel(G4int vLevel);
|
||||
G4int GetVerboseLevel() const;
|
||||
|
||||
protected:
|
||||
|
||||
G4TrackFastVector* theListOfSecondaries;
|
||||
// The vector of secondaries.
|
||||
|
||||
G4int theNumberOfSecondaries;
|
||||
// The total number of secondaries produced by each process.
|
||||
|
||||
G4int theSizeOftheListOfSecondaries;
|
||||
// TheSizeOftheListOfSecondaries;
|
||||
|
||||
G4TrackStatus theStatusChange;
|
||||
// The changed (final) track status of a given particle.
|
||||
|
||||
G4SteppingControl theSteppingControlFlag;
|
||||
// a flag to control stepping manager behavior
|
||||
|
||||
G4double theLocalEnergyDeposit;
|
||||
// It represents the part of the energy lost for discrete
|
||||
// or semi-continuous processes which is due to secondaries
|
||||
// not generated because they would have been below their cut
|
||||
// threshold.
|
||||
// The sum of the locally deposited energy + the delta-energy
|
||||
// coming from the continuous processes gives the
|
||||
// total energy loss localized in the current Step.
|
||||
|
||||
G4double theNonIonizingEnergyDeposit;
|
||||
// non-ionizing energu deposit is defined as
|
||||
// a part of local energy deposit, which does not cause
|
||||
// ionization of atoms
|
||||
|
||||
G4double theTrueStepLength;
|
||||
// The value of "True" Step Length
|
||||
|
||||
|
||||
G4bool theFirstStepInVolume;
|
||||
G4bool theLastStepInVolume;
|
||||
// flag for initial/last step
|
||||
|
||||
G4double theParentWeight;
|
||||
// Weight ofparent track
|
||||
G4bool isParentWeightProposed;
|
||||
// flags for Weight ofparent track
|
||||
G4bool fSetSecondaryWeightByProcess;
|
||||
// flag for setting weight of secondaries
|
||||
|
||||
G4double theParentGlobalTime;
|
||||
// global time of the parent.
|
||||
// This is used only for checking
|
||||
|
||||
G4int verboseLevel;
|
||||
// The Verbose level
|
||||
|
||||
public: // with description
|
||||
// CheckIt method is provided for debug
|
||||
virtual G4bool CheckIt(const G4Track&);
|
||||
|
||||
// CheckIt method is activated
|
||||
// if debug flag is set and 'G4VERBOSE' is defined
|
||||
void ClearDebugFlag();
|
||||
void SetDebugFlag();
|
||||
G4bool GetDebugFlag() const;
|
||||
|
||||
protected:
|
||||
// CheckSecondary method is provided for debug
|
||||
G4bool CheckSecondary(G4Track&);
|
||||
|
||||
// CheckSecondary method is provided for debug
|
||||
|
||||
G4double GetAccuracyForWarning() const;
|
||||
G4double GetAccuracyForException() const;
|
||||
|
||||
protected:
|
||||
G4bool debugFlag;
|
||||
|
||||
// accuracy levels
|
||||
protected:
|
||||
|
||||
static const G4double accuracyForWarning;
|
||||
static const G4double accuracyForException;
|
||||
static const G4double accuracyForException;
|
||||
// accuracy levels
|
||||
|
||||
G4TrackFastVector* theListOfSecondaries = nullptr;
|
||||
// The vector of secondaries
|
||||
|
||||
G4TrackStatus theStatusChange = fAlive;
|
||||
// The changed (final) track status of a given particle
|
||||
|
||||
G4SteppingControl theSteppingControlFlag = NormalCondition;
|
||||
// A flag to control stepping manager behavior
|
||||
|
||||
G4double theLocalEnergyDeposit = 0.0;
|
||||
// It represents the part of the energy lost for discrete
|
||||
// or semi-continuous processes which is due to secondaries
|
||||
// not generated because they would have been below their cut
|
||||
// threshold.
|
||||
// The sum of the locally deposited energy + the delta-energy
|
||||
// coming from the continuous processes gives the
|
||||
// total energy loss localized in the current Step
|
||||
|
||||
G4double theNonIonizingEnergyDeposit = 0.0;
|
||||
// Non-ionizing energu deposit is defined as a part of local
|
||||
// energy deposit, which does not cause ionization of atoms
|
||||
|
||||
G4double theTrueStepLength = 0.0;
|
||||
// The value of "True" Step Length
|
||||
|
||||
G4double theParentWeight = 1.0;
|
||||
// Weight ofparent track
|
||||
|
||||
G4double theParentGlobalTime = 0.0;
|
||||
// Global time of the parent.
|
||||
// This is used only for checking
|
||||
|
||||
G4int theNumberOfSecondaries = 0;
|
||||
// The total number of secondaries produced by each process.
|
||||
|
||||
G4int theSizeOftheListOfSecondaries = 0;
|
||||
// TheSizeOftheListOfSecondaries;
|
||||
|
||||
G4int verboseLevel = 1;
|
||||
// The Verbose level
|
||||
|
||||
G4bool theFirstStepInVolume = false;
|
||||
G4bool theLastStepInVolume = false;
|
||||
// Flag for initial/last step
|
||||
|
||||
G4bool isParentWeightProposed = false;
|
||||
// Flag for Weight of parent track
|
||||
G4bool fSetSecondaryWeightByProcess = false;
|
||||
// Flag for setting weight of secondaries
|
||||
|
||||
G4bool debugFlag = false;
|
||||
};
|
||||
|
||||
#include "G4Step.hh"
|
||||
#include "G4Track.hh"
|
||||
#include "G4VParticleChange.icc"
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user