Import Geant4 10.7.0.beta source tree

This commit is contained in:
Gabriele Cosmo
2020-06-26 10:23:25 +02:00
parent c02c370437
commit 67ba86d073
1871 changed files with 174422 additions and 131884 deletions
@@ -23,27 +23,16 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// G4ParticleTypes
//
// Description:
//
//
// ------------------------------------------------------------
// GEANT 4 class header file
//
// History: first implementation, based on object model of
// 4-th April 1996, G.Cosmo
// ----------------- G4ParticleTypes.hh -----------------
// Class Description
// Files including all existing particle definitions GEANT4 classes
//
// ****************************************************************
// Created, G.Cosmo, 19 September 1996
// Modified H.Kurashige 8 Mar. 1997
// Modified H.Kurashige 18 June 1997
// Moved from global/management, G.Cosmo, 1 December 1998
// ----------------------------------------------------------------
// Inclusion of all existing particle definitions
#ifndef G4ParticleTypes_h
#define G4ParticleTypes_h 1
// Created, G.Cosmo, 4 April 1996
// --------------------------------------------------------------------
#ifndef G4ParticleTypes_hh
#define G4ParticleTypes_hh 1
// Bosons
#include "G4ChargedGeantino.hh"
@@ -97,7 +86,6 @@
#include "G4AntiBsMesonZero.hh"
#include "G4Upsilon.hh"
// Barions
#include "G4Proton.hh"
#include "G4AntiProton.hh"
@@ -163,7 +151,7 @@
#include "G4AntiHe3.hh"
#include "G4AntiTriton.hh"
//ions
// Ions
#include "G4GenericIon.hh"
#endif
#endif
@@ -23,27 +23,21 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// G4ProcTblElement
//
// Class description:
//
//
// ------------------------------------------------------------
// GEANT 4 class header file
//
// History: first implementation, based on object model of
// 4th Aug 1998, H.Kurashige
// ------------------------------------------------------------
// Use STL vector instead of RW vector 1. Mar 00 H.Kurashige
//
// Class Description
// This class is used by G4ProcessTable ONLY for booking !!!
//
// This class is exclusively used by G4ProcessTable for booking.
#ifndef G4ProcTblElement_h
#define G4ProcTblElement_h 1
// Author: H.Kurashige, 4 August 1998
// --------------------------------------------------------------------
#ifndef G4ProcTblElement_hh
#define G4ProcTblElement_hh 1
#include <vector>
#include "globals.hh"
#include "G4ios.hh"
#include <vector>
#include "G4ParticleDefinition.hh"
#include "G4VProcess.hh"
@@ -51,56 +45,49 @@
class G4ProcTblElement
{
// this class is used by G4ProcessTable ONLY for booking !!!
friend class G4ProcessTable;
protected:
G4ProcTblElement();
using G4ProcMgrVector = std::vector<G4ProcessManager*>;
public:
G4ProcTblElement(const G4ProcTblElement& right);
G4ProcTblElement(G4VProcess* aProcess);
// Constructors
// Constructors
~G4ProcTblElement();
// Destructor
// Destructor
G4ProcTblElement & operator=(const G4ProcTblElement &right);
// Assignment operator
G4ProcTblElement& operator=(const G4ProcTblElement& right);
// Assignment operator
G4bool operator==(const G4ProcTblElement &right) const;
G4bool operator!=(const G4ProcTblElement &right) const;
// equal / unequal operator
G4bool operator==(const G4ProcTblElement& right) const;
G4bool operator!=(const G4ProcTblElement& right) const;
// Equality operators
protected:
// Use STL Vector
typedef std::vector<G4ProcessManager*> G4ProcMgrVector;
G4int Length() const ;
void Insert(G4ProcessManager* aProcMgr);
void Remove(G4ProcessManager* aProcMgr);
G4ProcTblElement();
G4VProcess* GetProcess() const;
const G4String& GetProcessName() const;
G4ProcessManager* GetProcessManager(G4int index) const;
inline G4int Length() const ;
inline void Insert(G4ProcessManager* aProcMgr);
inline void Remove(G4ProcessManager* aProcMgr);
inline
const G4ProcMgrVector* GetProcMgrVector() const
{ return pProcMgrVector;}
inline G4VProcess* GetProcess() const;
inline const G4String& GetProcessName() const;
inline G4ProcessManager* GetProcessManager(G4int index) const;
inline const G4ProcMgrVector* GetProcMgrVector() const;
G4int GetIndex(const G4ProcessManager* pManager) const ;
G4bool Contains(const G4ProcessManager* pManager) const ;
inline G4int GetIndex(const G4ProcessManager* pManager) const;
inline G4bool Contains(const G4ProcessManager* pManager) const;
private:
G4VProcess* pProcess;
// pointer to G4VProcess
G4ProcMgrVector* pProcMgrVector;
G4VProcess* pProcess = nullptr;
G4ProcMgrVector* pProcMgrVector = nullptr;
};
#include "G4ProcTblElement.icc"
#endif
@@ -28,9 +28,8 @@
// Author: H.Kurashige, 04.08.1998
// --------------------------------------------------------------------
/////////////
inline
G4bool G4ProcTblElement::Contains(const G4ProcessManager* pManager) const
G4bool G4ProcTblElement::Contains(const G4ProcessManager* pManager) const
{
for (auto i = pProcMgrVector->cbegin(); i!= pProcMgrVector->cend(); ++i)
{
@@ -39,9 +38,9 @@ inline
return false;
}
//////////////////////////
// --------------------------------------------------------------------
inline
G4int G4ProcTblElement::GetIndex(const G4ProcessManager* pManager) const
G4int G4ProcTblElement::GetIndex(const G4ProcessManager* pManager) const
{
G4int index = 0;
for (auto i = pProcMgrVector->cbegin(); i!= pProcMgrVector->cend(); ++i)
@@ -52,17 +51,16 @@ inline
return -1;
}
//////////////////////////
// --------------------------------------------------------------------
inline
G4int G4ProcTblElement::Length() const
G4int G4ProcTblElement::Length() const
{
return G4int(pProcMgrVector->size());
}
//////////////////////////
// --------------------------------------------------------------------
inline
G4ProcessManager* G4ProcTblElement::GetProcessManager(G4int index) const
G4ProcessManager* G4ProcTblElement::GetProcessManager(G4int index) const
{
if ((index < G4int(pProcMgrVector->size())) && (index>=0))
{
@@ -74,25 +72,23 @@ inline
}
}
//////////////////////////
// --------------------------------------------------------------------
inline
G4VProcess* G4ProcTblElement::GetProcess() const
G4VProcess* G4ProcTblElement::GetProcess() const
{
return pProcess;
}
//////////////////////////
// --------------------------------------------------------------------
inline
void G4ProcTblElement::Insert(G4ProcessManager* aProcMgr)
void G4ProcTblElement::Insert(G4ProcessManager* aProcMgr)
{
pProcMgrVector->push_back(aProcMgr);
}
//////////////////////////
// --------------------------------------------------------------------
inline
void G4ProcTblElement::Remove(G4ProcessManager* aProcMgr)
void G4ProcTblElement::Remove(G4ProcessManager* aProcMgr)
{
for (auto i = pProcMgrVector->cbegin(); i!= pProcMgrVector->cend(); ++i)
{
@@ -104,9 +100,16 @@ inline
}
}
//////////////////////////
// --------------------------------------------------------------------
inline
const G4String& G4ProcTblElement::GetProcessName() const
const G4String& G4ProcTblElement::GetProcessName() const
{
return pProcess->GetProcessName();
}
// --------------------------------------------------------------------
inline const std::vector<G4ProcessManager*>*
G4ProcTblElement::GetProcMgrVector() const
{
return pProcMgrVector;
}
@@ -23,24 +23,16 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// G4ProcessAttribute
//
// Class description:
//
//
// ------------------------------------------------------------
// GEANT 4 class header file
//
// History: first implementation, based on object model of
// 2nd December 1997, H.Kurashige
// ---------------- G4ProcessAttribute -----------------
// Class Description
// This class is used by G4ProcessManager ONLY for booking !!!
//
// History:
// adds copy constructor 27 June 1998 H.Kurashige
// ------------------------------------------------------------
// This class is used exclusively by G4ProcessManager for booking.
#ifndef G4ProcessAttribute_h
#define G4ProcessAttribute_h 1
// Author: H.Kurashige, 2 December 1997
// --------------------------------------------------------------------
#ifndef G4ProcessAttribute_hh
#define G4ProcessAttribute_hh 1
#include "globals.hh"
#include "G4ios.hh"
@@ -51,70 +43,58 @@ class G4VProcess;
class G4ProcessAttribute
{
// this class is used by G4ProcessManager ONLY for booking !!!
friend class G4ProcessManager;
public:
G4ProcessAttribute();
G4ProcessAttribute(const G4VProcess* aProcess);
G4ProcessAttribute(const G4ProcessAttribute &right);
// Constructors
G4ProcessAttribute(const G4ProcessAttribute& right);
// Constructors
~G4ProcessAttribute();
// Destructor
// Destructor
G4ProcessAttribute & operator=(const G4ProcessAttribute &right);
// Assignment operator
G4ProcessAttribute& operator=(const G4ProcessAttribute& right);
// Assignment operator
G4bool operator==(const G4ProcessAttribute &right) const;
G4bool operator!=(const G4ProcessAttribute &right) const;
// equal / unequal operator
inline G4bool operator==(const G4ProcessAttribute &right) const;
inline G4bool operator!=(const G4ProcessAttribute &right) const;
// Equality operators
protected:
G4VProcess* pProcess;
// pointer to G4VProcess
G4bool isActive;
// flag for activation/inactivation
G4VProcess* pProcess = nullptr;
// Pointer to G4VProcess
G4int idxProcessList;
// index to a ProcessVector for theProcessList and
G4bool isActive = true;
// Flag for activation/inactivation
G4int idxProcVector[G4ProcessManager::SizeOfProcVectorArray];
// index to ProcessVectors for "Doit"s and "GetPhysicalInteractionLength"s
// -1 : not applicable
G4int idxProcessList = -1;
// Index to a ProcessVector for theProcessList
G4int ordProcVector[G4ProcessManager::SizeOfProcVectorArray];
// ordering parameter
G4int idxProcVector[G4ProcessManager::SizeOfProcVectorArray];
// Index to ProcessVectors for Doit() and GetPhysicalInteractionLength()
// methods. A value of -1 means "not applicable"
G4int ordProcVector[G4ProcessManager::SizeOfProcVectorArray];
// Ordering parameter
};
// ------------------------
// Inline methods
// ------------------------
inline
G4ProcessAttribute::G4ProcessAttribute(const G4VProcess* aProcess):
pProcess((G4VProcess*)aProcess),
isActive(true),
idxProcessList(-1)
G4bool G4ProcessAttribute::operator==(const G4ProcessAttribute& right) const
{
for(size_t ii=0; ii<G4ProcessManager::SizeOfProcVectorArray; ii++){
idxProcVector[ii]=-1;
ordProcVector[ii]=0;
}
return this->pProcess == right.pProcess;
}
inline
G4bool G4ProcessAttribute::operator==(const G4ProcessAttribute &right) const
G4bool G4ProcessAttribute::operator!=(const G4ProcessAttribute& right) const
{
return this->pProcess == right.pProcess;
}
inline
G4bool G4ProcessAttribute::operator!=(const G4ProcessAttribute &right) const
{
return this->pProcess != right.pProcess;
return this->pProcess != right.pProcess;
}
#endif
@@ -23,36 +23,33 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// ---------------- G4ProcessManager -----------------
// G4ProcessManager
//
// Class Description:
//
// G4ProcessManager collects all physics a particle can undertake as
// vectors. These vectors are:
// one vector for all processes (called as "process List")
// two vectors for processes with AtRestGetPhysicalInteractionLength()
// and AtRestDoIt()
// two vectors for processes with AlongStepGetPhysicalInteractionLength()
// and AlongStepDoIt()
// two vectors for processes with PostStepGetPhysicalInteractionLength()
// and PostStepDoIt()
// The tracking will message three types of GetPhysicalInteractionLength()
// in order to limit the Step and select the occurrence of processes.
// It will message the corresponding DoIt() to apply the selected
// processes. In addition, the Tracking will limit the Step
// and select the occurrence of the processes according to
// the shortest physical interaction length computed (except for
// processes at rest, for which the Tracking will select the
// occurrence of the process which returns the shortest mean
// life-time from the GetPhysicalInteractionLength()).
// G4ProcessManager collects all physics a particle can undertake as
// vectors. These vectors are:
// - one vector for all processes (called as "process List")
// - two vectors for processes with AtRestGetPhysicalInteractionLength()
// and AtRestDoIt()
// - two vectors for processes with AlongStepGetPhysicalInteractionLength()
// and AlongStepDoIt()
// - two vectors for processes with PostStepGetPhysicalInteractionLength()
// and PostStepDoIt()
// The tracking will message three types of GetPhysicalInteractionLength()
// in order to limit the Step and select the occurrence of processes.
// It will message the corresponding DoIt() to apply the selected
// processes. In addition, the Tracking will limit the Step
// and select the occurrence of the processes according to
// the shortest physical interaction length computed (except for
// processes at rest, for which the Tracking will select the
// occurrence of the process which returns the shortest mean
// life-time from the GetPhysicalInteractionLength()).
// - First implementation, based on object model of
// 2nd December 1995, G.Cosmo
// - Revised; added vector of processes at rest
// 06 May 1996, G.Cosmo
// --------------------------------------------------------------------
// - New Physics scheme - 08.01.1997, H.Kurashige
// - Use STL vector instead of RW vector - 01.03.2000, H.Kurashige
// Authors:
// - 02.12.1995, G.Cosmo - First implementation, based on object model
// - 06.05.1996, G.Cosmo - Revised; added vector of processes at rest
// - 08.01.1997, H.Kurashige - New Physics scheme
// --------------------------------------------------------------------
#ifndef G4ProcessManager_hh
#define G4ProcessManager_hh 1
@@ -69,290 +66,284 @@
class G4ProcessManagerMessenger;
class G4ProcessAttribute;
// Indexes for ProcessVector
// Indexes for ProcessVector
//
enum G4ProcessVectorTypeIndex
{
typeGPIL = 0, // for GetPhysicalInteractionLength
typeDoIt =1 // for DoIt
typeGPIL = 0, // for GetPhysicalInteractionLength
typeDoIt =1 // for DoIt
};
enum G4ProcessVectorDoItIndex
{
idxAll = -1, // for all DoIt/GPIL
idxAtRest = 0, // for AtRestDoIt/GPIL
idxAlongStep = 1, // for AlongStepDoIt/GPIL
idxPostStep =2, // for AlongSTepDoIt/GPIL
NDoit =3
idxAll = -1, // for all DoIt/GPIL
idxAtRest = 0, // for AtRestDoIt/GPIL
idxAlongStep = 1, // for AlongStepDoIt/GPIL
idxPostStep =2, // for AlongSTepDoIt/GPIL
NDoit =3
};
// enumeration for Ordering Parameter
// Enumeration for Ordering Parameter
//
enum G4ProcessVectorOrdering
{
ordInActive = -1, // ordering parameter to indicate InActive DoIt
ordDefault = 1000, // default ordering parameter
ordLast = 9999 // ordering parameter to indicate the last DoIt
ordInActive = -1, // ordering parameter to indicate InActive DoIt
ordDefault = 1000, // default ordering parameter
ordLast = 9999 // ordering parameter to indicate the last DoIt
};
class G4ProcessManager
{
using G4ProcessAttrVector = std::vector<G4ProcessAttribute*>;
public:
// copy constructor
G4ProcessManager(G4ProcessManager &right);
private:
// hide default constructor and assignment operator
G4ProcessManager & operator=(const G4ProcessManager &right);
G4ProcessManager();
public:
G4ProcessManager(const G4ParticleDefinition* aParticleType);
G4ProcessManager(const G4ParticleDefinition* aParticleType);
// Constructor
~G4ProcessManager();
// Destructor
G4ProcessManager(G4ProcessManager& right);
// copy constructor
G4bool operator==(const G4ProcessManager &right) const;
G4bool operator!=(const G4ProcessManager &right) const;
G4ProcessManager() = delete;
G4ProcessManager& operator=(const G4ProcessManager&) = delete;
// Default constructor and assignment operator not allowed
public: // with description
G4ProcessVector* GetProcessList() const;
// Returns the address of the vector of all processes
~G4ProcessManager();
// Destructor
G4int GetProcessListLength() const;
// Returns the number of process in the ProcessVector
G4bool operator==(const G4ProcessManager &right) const;
G4bool operator!=(const G4ProcessManager &right) const;
G4int GetProcessIndex(G4VProcess *) const;
// Returns the index of the process in the process List
inline G4ProcessVector* GetProcessList() const;
// Returns the address of the vector of all processes
// --------------------------------------
inline G4int GetProcessListLength() const;
// Returns the number of process in the ProcessVector
G4ProcessVector* GetProcessVector(
inline G4int GetProcessIndex(G4VProcess*) const;
// Returns the index of the process in the process List
inline G4ProcessVector* GetProcessVector(
G4ProcessVectorDoItIndex idx,
G4ProcessVectorTypeIndex typ = typeGPIL
) const;
// Returns the address of the vector of processes
// Returns the address of the vector of processes
G4ProcessVector* GetAtRestProcessVector(
inline G4ProcessVector* GetAtRestProcessVector(
G4ProcessVectorTypeIndex typ = typeGPIL
) const;
// Returns the address of the vector of processes for
// Returns the address of the vector of processes for
// AtRestGetPhysicalInteractionLength idx =0
// AtRestGetPhysicalDoIt idx =1
G4ProcessVector* GetAlongStepProcessVector(
inline G4ProcessVector* GetAlongStepProcessVector(
G4ProcessVectorTypeIndex typ = typeGPIL
) const;
// Returns the address of the vector of processes for
// Returns the address of the vector of processes for
// AlongStepGetPhysicalInteractionLength idx =0
// AlongStepGetPhysicalDoIt idx =1
G4ProcessVector* GetPostStepProcessVector(
inline G4ProcessVector* GetPostStepProcessVector(
G4ProcessVectorTypeIndex typ = typeGPIL
) const;
// Returns the address of the vector of processes for
// Returns the address of the vector of processes for
// PostStepGetPhysicalInteractionLength idx =0
// PostStepGetPhysicalDoIt idx =1
G4int GetProcessVectorIndex(
G4int GetProcessVectorIndex(
G4VProcess* aProcess,
G4ProcessVectorDoItIndex idx,
G4ProcessVectorTypeIndex typ = typeGPIL
) const;
G4int GetAtRestIndex(
inline G4int GetAtRestIndex(
G4VProcess* aProcess,
G4ProcessVectorTypeIndex typ = typeGPIL
) const;
G4int GetAlongStepIndex(
inline G4int GetAlongStepIndex(
G4VProcess* aProcess,
G4ProcessVectorTypeIndex typ = typeGPIL
) const;
G4int GetPostStepIndex(
inline G4int GetPostStepIndex(
G4VProcess* aProcess,
G4ProcessVectorTypeIndex typ = typeGPIL
) const;
// Returns the index for GPIL/DoIt process vector of the process
// Returns the index for GPIL/DoIt process vector of the process
G4int AddProcess(
G4VProcess *aProcess,
G4int ordAtRestDoIt = ordInActive,
G4int ordAlongSteptDoIt = ordInActive,
G4int ordPostStepDoIt = ordInActive
);
// Add a process to the process List
// return values are index to the List. Negative return value
// indicates that the process has not be added due to some errors
// The first argument is a pointer to process.
// Following arguments are ordering parameters of the process in
// process vectors. If value is negative, the process is
// not added to the corresponding process vector.
G4int AddProcess( G4VProcess* aProcess,
G4int ordAtRestDoIt = ordInActive,
G4int ordAlongSteptDoIt = ordInActive,
G4int ordPostStepDoIt = ordInActive );
// Adds a process to the process List
// Return values is the index to the List. Negative return value
// indicates that the process has not been added due to some errors
// The first argument is a pointer to the process.
// Successive arguments are ordering parameters of the process in
// process vectors. If value is negative, the process is
// not added to the corresponding process vector
// following methods are provided for simple processes
// AtRestProcess has only AtRestDoIt
// ContinuousProcess has only AlongStepDoIt
// DiscreteProcess has only PostStepDoIt
// If the ording parameter is not specified, the process is
// added at the end of List of process vectors
// If a process with same ordering parameter exists,
// this new process will be added just after processes
// with same ordering parameter
// (except for processes assigned to LAST explicitly )
// for both DoIt and GetPhysicalInteractionLength
//
///////////////////////////////////////////////
// The following methods are provided for simple processes
// AtRestProcess has only AtRestDoIt
// ContinuousProcess has only AlongStepDoIt
// DiscreteProcess has only PostStepDoIt
// If the ordering parameter is not specified, the process is
// added at the end of List of process vectors
// If a process with same ordering parameter exists,
// this new process will be added just after processes
// with same ordering parameter (except for processes assigned to LAST
// explicitly) for both DoIt() and GetPhysicalInteractionLength()
///////////////////////////////////////////////
G4int AddRestProcess(G4VProcess *aProcess, G4int ord = ordDefault);
G4int AddDiscreteProcess(G4VProcess *aProcess, G4int ord = ordDefault);
G4int AddContinuousProcess(G4VProcess *aProcess, G4int ord = ordDefault);
inline G4int AddRestProcess(G4VProcess* aProcess, G4int ord=ordDefault);
inline G4int AddDiscreteProcess(G4VProcess* aProcess, G4int ord=ordDefault);
inline G4int AddContinuousProcess(G4VProcess* aProcess, G4int ord=ordDefault);
///////////////////////////////////////////////
// Alternative methods for setting ordering parameters
// Note: AddProcess() method should precede calls to these methods
///////////////////////////////////////////////
///////////////////////////////////////////////
// Methods for setting ordering parameters
// Altanative methods for setting ordering parameters
// Note: AddProcess method should precede these methods
G4int GetProcessOrdering(
G4VProcess* aProcess,
G4ProcessVectorDoItIndex idDoIt
);
G4int GetProcessOrdering(
G4VProcess *aProcess,
G4ProcessVectorDoItIndex idDoIt
);
void SetProcessOrdering(
G4VProcess *aProcess,
G4ProcessVectorDoItIndex idDoIt,
G4int ordDoIt = ordDefault
);
// Set ordering parameter for DoIt specified by typeDoIt.
void SetProcessOrdering(
G4VProcess* aProcess,
G4ProcessVectorDoItIndex idDoIt,
G4int ordDoIt = ordDefault
);
// Set ordering parameter for DoIt() specified by typeDoIt.
// If a process with same ordering parameter exists,
// this new process will be added just after processes
// with same ordering parameter
// Note: Ordering parameter will bet set to non-zero
// even if you set ordDoIt = 0
// even if you set ordDoIt = 0
void SetProcessOrderingToFirst(
G4VProcess *aProcess,
G4ProcessVectorDoItIndex idDoIt
);
void SetProcessOrderingToFirst(
G4VProcess* aProcess,
G4ProcessVectorDoItIndex idDoIt
);
// Set ordering parameter to the first of all processes
// for DoIt specified by idDoIt.
// Note: If you use this method for two processes,
// a process called later will be first.
// for DoIt() specified by idDoIt.
// Note: If you use this method for two processes,
// a process called later will be first
void SetProcessOrderingToSecond(
G4VProcess *aProcess,
G4ProcessVectorDoItIndex idDoIt
);
// Set ordering parameter to 1 for DoIt specified by idDoIt
// and the rpocess will be added just after
void SetProcessOrderingToSecond(
G4VProcess* aProcess,
G4ProcessVectorDoItIndex idDoIt
);
// Set ordering parameter to 1 for DoIt() specified by idDoIt
// and the process will be added just after
// the processes with ordering parameter equal to zero
// Note: If you use this method for two processes,
// a process called later will be .
// Note: If you use this method for two processes,
// a process called later will be first
void SetProcessOrderingToLast(
G4VProcess *aProcess,
G4ProcessVectorDoItIndex idDoIt
);
void SetProcessOrderingToLast(
G4VProcess* aProcess,
G4ProcessVectorDoItIndex idDoIt
);
// Set ordering parameter to the last of all processes
// for DoIt specified by idDoIt.
// Note: If you use this method for two processes,
// a process called later will precede.
// for DoIt() specified by idDoIt.
// Note: If you use this method for two processes,
// a process called later will precede.
G4VProcess* RemoveProcess(G4VProcess *aProcess);
G4VProcess* RemoveProcess(G4int index);
// Removes a process from the process List.
// return value is pointer to the removed process.
// (0 value will be returned in case of errors)
///////////////////////////////////////////////
G4VProcess* SetProcessActivation(G4VProcess *aProcess, G4bool fActive);
G4VProcess* SetProcessActivation(G4int index, G4bool fActive);
// Set activation flag.
// return value is pointer to the applied process.
// (0 value will be returned in case of errors)
G4VProcess* RemoveProcess(G4VProcess* aProcess);
G4VProcess* RemoveProcess(G4int index);
// Removes a process from the process List.
// Returns pointer to the removed process.
// (nullptr value will be returned in case of errors)
G4bool GetProcessActivation(G4VProcess *aProcess) const;
G4bool GetProcessActivation(G4int index) const;
// Get activation flag.
G4VProcess* SetProcessActivation(G4VProcess* aProcess, G4bool fActive);
G4VProcess* SetProcessActivation(G4int index, G4bool fActive);
// Set activation flag.
// Returns pointer to the applied process.
// (nullptr value will be returned in case of errors)
G4ParticleDefinition* GetParticleType() const;
// get the particle type
void SetParticleType(const G4ParticleDefinition*);
// set the particle type
G4bool GetProcessActivation(G4VProcess* aProcess) const;
G4bool GetProcessActivation(G4int index) const;
// Get activation flag.
G4VProcess* GetProcess (const G4String&) const;
// get process by process name
inline G4ParticleDefinition* GetParticleType() const;
// Get the particle type
inline void SetParticleType(const G4ParticleDefinition*);
// Set the particle type
void StartTracking(G4Track* aTrack=0);
void EndTracking();
// these two methods are used by G4TrackingManager
G4VProcess* GetProcess (const G4String&) const;
// Get process by process name
void StartTracking(G4Track* aTrack = nullptr);
void EndTracking();
// These two methods are used by G4TrackingManager
// in order to inform Start/End of tracking for each track
// to the process manager and all physics processes
// to the process manager and all physics processes
void DumpInfo();
inline void SetVerboseLevel(G4int value);
inline G4int GetVerboseLevel() const;
// Control flag for output message
// 0: Silent
// 1: Warning message
// 2: More
enum {SizeOfProcVectorArray = 6};
public:
enum {SizeOfProcVectorArray = 6};
private:
G4ProcessVector* theProcVector[SizeOfProcVectorArray];
// vector for processes with GetPhysicalInteractionLength/DoIt
typedef std::vector<G4ProcessAttribute*> G4ProcessAttrVector;
G4ProcessAttrVector* theAttrVector;
// vector for process attribute
G4int InsertAt(G4int position, G4VProcess* process, G4int ivec);
// Insert process at position in theProcVector[ivec]
protected: // with description
G4int InsertAt(G4int position, G4VProcess* process, G4int ivec);
// insert process at position in theProcVector[ivec]
G4int RemoveAt(G4int position, G4VProcess* process, G4int ivec);
// Remove process at position in theProcVector[ivec]
G4int RemoveAt(G4int position, G4VProcess* process, G4int ivec);
// remove process at position in theProcVector[ivec]
G4int FindInsertPosition(G4int ord, G4int ivec);
// find insert position according to ordering parameter
G4int FindInsertPosition(G4int ord, G4int ivec);
// Find insert position according to ordering parameter
// in theProcVector[ivec]
G4int GetProcessVectorId(G4ProcessVectorDoItIndex idx,
G4ProcessVectorTypeIndex typ = typeGPIL) const;
inline G4int GetProcessVectorId(G4ProcessVectorDoItIndex idx,
G4ProcessVectorTypeIndex typ = typeGPIL) const;
void CheckOrderingParameters(G4VProcess*) const;
// check consistencies between ordering parameters and
// validity of DoIt of the Process
void CheckOrderingParameters(G4VProcess*) const;
// Check consistencies between ordering parameters and
// validity of DoIt() of the Process
private:
G4ProcessAttribute* GetAttribute(G4int index) const;
G4ProcessAttribute* GetAttribute(G4VProcess *aProcess) const;
// get Pointer to ProcessAttribute
G4ProcessAttribute* GetAttribute(G4int index) const;
G4ProcessAttribute* GetAttribute(G4VProcess* aProcess) const;
// Get Pointer to ProcessAttribute
G4VProcess* ActivateProcess(G4int index);
G4VProcess* InActivateProcess(G4int index);
// Activate/InActivateProcess Process
void CreateGPILvectors();
void SetIndexToProcessVector(G4int ivec);
G4VProcess* ActivateProcess(G4int index);
G4VProcess* InActivateProcess(G4int index);
// Activate/InActivate process
private:
const G4ParticleDefinition* theParticleType;
// particle which has this process manager object
private:
G4int numberOfProcesses;
G4ProcessVector* theProcessList;
// vector for all processes (called as "process List")
G4ProcessVector* theProcVector[SizeOfProcVectorArray];
// Vector for processes with GetPhysicalInteractionLength()/DoIt()
private:
G4bool duringTracking;
void CreateGPILvectors();
void SetIndexToProcessVector(G4int ivec);
G4ProcessAttrVector* theAttrVector = nullptr;
// Vector for process attribute
G4bool isSetOrderingFirstInvoked[NDoit];
G4bool isSetOrderingLastInvoked[NDoit];
const G4ParticleDefinition* theParticleType = nullptr;
// Particle which has this process manager object
public: // with description
void DumpInfo();
G4int numberOfProcesses = 0;
G4ProcessVector* theProcessList = nullptr;
// Vector for all processes (called as "process List")
void SetVerboseLevel(G4int value);
G4int GetVerboseLevel() const;
// controle flag for output message
// 0: Silent
// 1: Warning message
// 2: More
G4bool duringTracking = false;
protected:
G4int verboseLevel;
G4bool isSetOrderingFirstInvoked[NDoit];
G4bool isSetOrderingLastInvoked[NDoit];
G4int verboseLevel = 1;
private:
static G4ThreadLocal G4ProcessManagerMessenger* fProcessManagerMessenger;
static G4ThreadLocal G4int counterOfObjects;
static G4ThreadLocal G4ProcessManagerMessenger* fProcessManagerMessenger;
static G4ThreadLocal G4int counterOfObjects;
};
#include "G4ProcessManager.icc"
@@ -24,28 +24,30 @@
// ********************************************************************
//
// G4ProcessManager inline function members implementation
//
// - 02.12.1995, G.Cosmo - First implementation, based on object model
// --------------------------------------------------------------------
inline
void G4ProcessManager::SetParticleType(const G4ParticleDefinition* aParticle)
void G4ProcessManager::SetParticleType(const G4ParticleDefinition* aParticle)
{
theParticleType = aParticle;
}
inline
G4ProcessVector* G4ProcessManager::GetProcessList() const
G4ProcessVector* G4ProcessManager::GetProcessList() const
{
return theProcessList;
}
inline
G4int G4ProcessManager::GetProcessListLength() const
G4int G4ProcessManager::GetProcessListLength() const
{
return numberOfProcesses;
}
inline
G4int G4ProcessManager::GetProcessIndex(G4VProcess* aProcess) const
G4int G4ProcessManager::GetProcessIndex(G4VProcess* aProcess) const
{
G4int idx = G4int(theProcessList->index(aProcess));
if (idx>=numberOfProcesses) idx = -1;
@@ -53,27 +55,34 @@ inline
}
inline
G4int G4ProcessManager::GetProcessVectorId(G4ProcessVectorDoItIndex idx,
G4ProcessVectorTypeIndex typ) const
G4int G4ProcessManager::GetProcessVectorId(G4ProcessVectorDoItIndex idx,
G4ProcessVectorTypeIndex typ) const
{
if ( idx == idxAtRest ) {
if ( idx == idxAtRest )
{
if (typ == typeGPIL) { return 0; }
else { return 1; }
} else if ( idx == idxAlongStep ) {
}
else if ( idx == idxAlongStep )
{
if (typ == typeGPIL) { return 2; }
else { return 3; }
} else if ( idx == idxPostStep ) {
}
else if ( idx == idxPostStep )
{
if (typ == typeGPIL) { return 4; }
else { return 5; }
} else {
}
else
{
return -1;
}
}
inline
G4ProcessVector* G4ProcessManager::GetProcessVector(
G4ProcessVectorDoItIndex idx,
G4ProcessVectorTypeIndex typ
G4ProcessVector* G4ProcessManager::GetProcessVector(
G4ProcessVectorDoItIndex idx,
G4ProcessVectorTypeIndex typ
) const
{
G4int ivec = GetProcessVectorId(idx, typ);
@@ -88,88 +97,88 @@ inline
}
inline
G4ProcessVector*
G4ProcessManager::GetAtRestProcessVector(G4ProcessVectorTypeIndex typ) const
G4ProcessVector*
G4ProcessManager::GetAtRestProcessVector(G4ProcessVectorTypeIndex typ) const
{
if (typ == typeGPIL) { return theProcVector[0]; }
else { return theProcVector[1]; }
}
inline
G4ProcessVector*
G4ProcessManager::GetAlongStepProcessVector(G4ProcessVectorTypeIndex typ) const
G4ProcessVector*
G4ProcessManager::GetAlongStepProcessVector(G4ProcessVectorTypeIndex typ) const
{
if (typ == typeGPIL) { return theProcVector[2]; }
else { return theProcVector[3]; }
}
inline
G4ProcessVector*
G4ProcessManager::GetPostStepProcessVector(G4ProcessVectorTypeIndex typ) const
G4ProcessVector*
G4ProcessManager::GetPostStepProcessVector(G4ProcessVectorTypeIndex typ) const
{
if (typ == typeGPIL) { return theProcVector[4]; }
else { return theProcVector[5]; }
}
inline
G4int G4ProcessManager::GetAtRestIndex(
G4VProcess* aProcess,
G4ProcessVectorTypeIndex typ
) const
G4int G4ProcessManager::GetAtRestIndex(
G4VProcess* aProcess,
G4ProcessVectorTypeIndex typ
) const
{
return GetProcessVectorIndex(aProcess, idxAtRest, typ);
}
inline
G4int G4ProcessManager::GetAlongStepIndex(
G4VProcess* aProcess,
G4ProcessVectorTypeIndex typ
) const
G4int G4ProcessManager::GetAlongStepIndex(
G4VProcess* aProcess,
G4ProcessVectorTypeIndex typ
) const
{
return GetProcessVectorIndex(aProcess, idxAlongStep, typ);
}
inline
G4int G4ProcessManager::GetPostStepIndex(
G4VProcess* aProcess,
G4ProcessVectorTypeIndex typ
) const
G4int G4ProcessManager::GetPostStepIndex(
G4VProcess* aProcess,
G4ProcessVectorTypeIndex typ
) const
{
return GetProcessVectorIndex(aProcess, idxPostStep, typ);
}
inline
G4int G4ProcessManager::AddRestProcess(G4VProcess* aProcess, G4int ord)
G4int G4ProcessManager::AddRestProcess(G4VProcess* aProcess, G4int ord)
{
return AddProcess(aProcess, ord, ordInActive, ordInActive);
}
inline
G4int G4ProcessManager::AddContinuousProcess(G4VProcess* aProcess, G4int ord)
G4int G4ProcessManager::AddContinuousProcess(G4VProcess* aProcess, G4int ord)
{
return AddProcess(aProcess, ordInActive, ord, ordInActive);
}
inline
G4int G4ProcessManager::AddDiscreteProcess(G4VProcess* aProcess, G4int ord)
G4int G4ProcessManager::AddDiscreteProcess(G4VProcess* aProcess, G4int ord)
{
return AddProcess(aProcess, ordInActive, ordInActive, ord);
}
inline
G4ParticleDefinition* G4ProcessManager::GetParticleType() const
G4ParticleDefinition* G4ProcessManager::GetParticleType() const
{
return (G4ParticleDefinition* )theParticleType;
return (G4ParticleDefinition*)theParticleType;
}
inline
void G4ProcessManager::SetVerboseLevel(G4int value)
void G4ProcessManager::SetVerboseLevel(G4int value)
{
verboseLevel = value;
}
inline
G4int G4ProcessManager::GetVerboseLevel() const
G4int G4ProcessManager::GetVerboseLevel() const
{
return verboseLevel;
return verboseLevel;
}
@@ -23,33 +23,27 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// G4ProcessManagerMessenger
//
// Class description:
//
// This is a messenger class to exchange information between
// the Process Manager and UI.
//
//---------------------------------------------------------------
//
// G4ProcessManagerMessenger.hh
//
// Class Description:
// This is a messenger class to interface to exchange information
// between ProcessManager and UI.
//-
// /particle/process/ Process Manager control commands.
// Commands :
// dump * dump process manager information.
// Verbose * Set Verbose Level for Process Manager and/or process
// Activate * Activate process
// /particle/process/ Process Manager control commands
// Commands :
// dump * dump process manager information
// verbose * Set Verbose Level for Process Manager and/or process
// activate * Activate process
// inactivate * Inctivate process
//
// History:
// 13 June 1997, H. Kurashige : The 1st version created.
// 10 Nov. 1997 H. Kurashige : fixed bugs
// 08 Jan. 1998, H. Kurashige : new UIcommand
//
//---------------------------------------------------------------
#ifndef G4ProcessManagerMessenger_h
#define G4ProcessManagerMessenger_h 1
// Author: H.Kurashige, 13 June 1997
//---------------------------------------------------------------------
#ifndef G4ProcessManagerMessenger_hh
#define G4ProcessManagerMessenger_hh 1
#include "G4UImessenger.hh"
#include "globals.hh"
class G4ParticleDefinition;
class G4ParticleTable;
@@ -62,47 +56,42 @@ class G4UIcmdWithoutParameter;
class G4UIcmdWithAnInteger;
class G4UIcommand;
#include "G4UImessenger.hh"
#include "globals.hh"
class G4ProcessManagerMessenger: public G4UImessenger
class G4ProcessManagerMessenger : public G4UImessenger
{
public:
G4ProcessManagerMessenger(G4ParticleTable* pTable = 0);
// constructor
G4ProcessManagerMessenger(G4ParticleTable* pTable = nullptr);
// Constructor
virtual ~G4ProcessManagerMessenger();
// destructor
// Destructor
public: // with description
virtual void SetNewValue(G4UIcommand * command,G4String newValues);
// set new value for command string
G4ProcessManagerMessenger(const G4ProcessManagerMessenger&) = delete;
G4ProcessManagerMessenger& operator=(const G4ProcessManagerMessenger&) = delete;
// Copy contructor and assignment operator not allowed
virtual G4String GetCurrentValue(G4UIcommand * command);
// get current value for command string
virtual void SetNewValue(G4UIcommand* command, G4String newValues);
// Set new value for command string
virtual G4String GetCurrentValue(G4UIcommand* command);
// Get current value for command string
private:
G4ProcessManagerMessenger(const G4ProcessManagerMessenger&)
: G4UImessenger() {};
// hide copy constructor as private
private:
G4ParticleDefinition* SetCurrentParticle();
// set particle currently concerned
const G4ParticleDefinition* SetCurrentParticle();
// Set particle currently concerned
private:
G4ParticleTable* theParticleTable;
G4ParticleDefinition* currentParticle;
G4VProcess* currentProcess;
G4ProcessManager* theManager;
G4ProcessVector* theProcessList;
G4ParticleTable* theParticleTable = nullptr;
const G4ParticleDefinition* currentParticle = nullptr;
G4VProcess* currentProcess = nullptr;
G4ProcessManager* theManager = nullptr;
G4ProcessVector* theProcessList = nullptr;
G4UIdirectory * thisDirectory;
G4UIcmdWithAnInteger * dumpCmd;
G4UIcommand * verboseCmd;
G4UIcmdWithAnInteger * activateCmd;
G4UIcmdWithAnInteger * inactivateCmd;
G4UIdirectory* thisDirectory = nullptr;
G4UIcmdWithAnInteger* dumpCmd = nullptr;
G4UIcommand* verboseCmd = nullptr;
G4UIcmdWithAnInteger* activateCmd = nullptr;
G4UIcmdWithAnInteger* inactivateCmd = nullptr;
};
#endif
@@ -23,33 +23,21 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// G4ProcessTable
//
// Class description:
//
// This class is used for "book keeping" of all processes
// which are registered for all particles
//
//
//
// ------------------------------------------------------------
// GEANT 4 class header file
//
// History: first implementation, based on object model of
// 4th Aug 1998, H.Kurashige
//
// Class Description
// This class is used for "book keeping" of all processes
// which are registered in all particles
//
// History:
// Added G4ProcessTableMesseneger 16 Aug. 1998, H.Kurashige
// Use STL vector instead of RW vector 1. Mar 00 H.Kurashige
//
// ------------------------------------------------------------
// Author: H.Kurashige, 4 August 1998
// --------------------------------------------------------------------
#ifndef G4ProcessTable_hh
#define G4ProcessTable_hh 1
#ifndef G4ProcessTable_h
#define G4ProcessTable_h 1
#include "globals.hh"
#include "G4ios.hh"
#include <vector>
#include "globals.hh"
#include "G4ProcTblElement.hh"
#include "G4ProcessVector.hh"
#include "G4ThreadLocalSingleton.hh"
@@ -59,132 +47,130 @@ class G4ProcessTableMessenger;
class G4ProcessTable
{
friend class G4ThreadLocalSingleton<G4ProcessTable>;
friend class G4ThreadLocalSingleton<G4ProcessTable>;
public:
public:
G4ProcessTable();
// Constructors
~G4ProcessTable();
// Destructor
private:
G4ProcessTable(const G4ProcessTable &right);
G4ProcessTable & operator=(const G4ProcessTable &right);
// Assignment operator
G4bool operator==(const G4ProcessTable &right) const;
G4bool operator!=(const G4ProcessTable &right) const;
// equal / unequal operator
using G4ProcTableVector = std::vector<G4ProcTblElement*>;
using G4ProcNameVector = std::vector<G4String>;
~G4ProcessTable();
// Destructor
G4ProcessTable(const G4ProcessTable&) = delete;
G4ProcessTable& operator=(const G4ProcessTable&) = delete;
G4bool operator==(const G4ProcessTable &right) const = delete;
G4bool operator!=(const G4ProcessTable &right) const = delete;
// Copy constructor and operators not allowed
public: // with description
static G4ProcessTable* GetProcessTable();
// return the pointer to G4ProcessTable object
// G4ProcessTable is a "singleton" and can get its pointer by this function
static G4ProcessTable* GetProcessTable();
// Return the pointer to the G4ProcessTable object
// As "singleton" one can get the instance pointer by this function
G4int Length() const;
// return the number of processes in the table
inline G4int Length() const;
// Return the number of processes in the table
G4int Insert(G4VProcess* aProcess, G4ProcessManager* aProcMgr);
G4int Remove(G4VProcess* aProcess, G4ProcessManager* aProcMgr);
// insert and remove methods
// each process object is registered with information of process managers
// that use it.
G4int Insert(G4VProcess* aProcess, G4ProcessManager* aProcMgr);
G4int Remove(G4VProcess* aProcess, G4ProcessManager* aProcMgr);
// Each process object is registered with information of process
// managers that use it
G4VProcess* FindProcess(const G4String& processName,
const G4String& particleName) const;
G4VProcess* FindProcess(const G4String& processName,
const G4ParticleDefinition* particle) const;
G4VProcess* FindProcess(const G4String& processName,
const G4ProcessManager* processManager) const;
// return the process pointer
G4VProcess* FindProcess(const G4String& processName,
const G4String& particleName) const;
inline G4VProcess* FindProcess(const G4String& processName,
const G4ParticleDefinition* particle) const;
G4VProcess* FindProcess(const G4String& processName,
const G4ProcessManager* processManager) const;
G4VProcess* FindProcess(G4ProcessType processType,
const G4ParticleDefinition* particle) const;
G4VProcess* FindProcess(G4int processSubType,
const G4ParticleDefinition* particle) const;
// Return the process pointer
void RegisterProcess(G4VProcess*);
void DeRegisterProcess(G4VProcess*);
// Implementation of registration mechanism
G4ProcessVector* FindProcesses();
G4ProcessVector* FindProcesses( const G4ProcessManager* processManager );
G4ProcessVector* FindProcesses( const G4String& processName );
G4ProcessVector* FindProcesses( G4ProcessType processType );
// return pointer of a process vector
// which includes processes specified
// Note:: User is responsible to delete this process vector object
inline G4ProcessVector* FindProcesses();
inline G4ProcessVector* FindProcesses( const G4ProcessManager* pManager );
inline G4ProcessVector* FindProcesses( const G4String& processName );
inline G4ProcessVector* FindProcesses( G4ProcessType processType );
// Return pointer of a process vector which includes processes specified
// Note: user is responsible to delete this process vector object
void SetProcessActivation( const G4String& processName,
G4bool fActive);
void SetProcessActivation( const G4String& processName,
const G4String& particleName,
G4bool fActive );
void SetProcessActivation( const G4String& processName,
G4ParticleDefinition* particle,
G4bool fActive );
void SetProcessActivation( const G4String& processName,
G4ProcessManager* processManager,
G4bool fActive );
void SetProcessActivation( G4ProcessType processType,
G4bool fActive );
void SetProcessActivation( G4ProcessType processType,
const G4String& particleName,
G4bool fActive );
void SetProcessActivation( G4ProcessType processType,
G4ParticleDefinition* particle,
G4bool fActive );
void SetProcessActivation( G4ProcessType processType,
G4ProcessManager* processManager,
G4bool fActive );
// These methods are provided to activate or inactivate processes
void SetProcessActivation( const G4String& processName,
G4bool fActive );
void SetProcessActivation( const G4String& processName,
const G4String& particleName,
G4bool fActive );
inline void SetProcessActivation( const G4String& processName,
const G4ParticleDefinition* particle,
G4bool fActive );
void SetProcessActivation( const G4String& processName,
G4ProcessManager* processManager,
G4bool fActive );
void SetProcessActivation( G4ProcessType processType,
G4bool fActive );
void SetProcessActivation( G4ProcessType processType,
const G4String& particleName,
G4bool fActive );
inline void SetProcessActivation( G4ProcessType processType,
const G4ParticleDefinition* particle,
G4bool fActive );
void SetProcessActivation( G4ProcessType processType,
G4ProcessManager* processManager,
G4bool fActive );
// These methods are provided to activate or inactivate processes
public:
typedef std::vector<G4ProcTblElement*> G4ProcTableVector;
typedef std::vector<G4String> G4ProcNameVector;
inline G4ProcNameVector* GetNameList();
// Return pointer of the list of process name
public: // with description
G4ProcNameVector* GetNameList();
// return pointer of the list of process name
inline G4ProcTableVector* GetProcTableVector();
// Return pointer of the vector of G4ProcTblElement
G4ProcTableVector* GetProcTableVector();
// return pointer of the vector of G4ProcTblElement
private:
G4ProcTableVector* Find( G4ProcTableVector* procTableVector,
const G4String& processName );
G4ProcTableVector* Find( G4ProcTableVector* procTableVector,
G4ProcessType processType );
// return pointer of a ProcTableVector
// which includes ProcTbleElement specified
G4ProcessVector* ExtractProcesses( G4ProcTableVector* procTableVector);
// extract all process objects from the process table
public: // with description
void DumpInfo(G4VProcess* process, G4ParticleDefinition* particle=0);
// dump out information of the process table
// second argument is used to specify processes designated by a particle
void DumpInfo(G4VProcess* process,
const G4ParticleDefinition* particle = nullptr);
// Dump out information of the process table. The second argument
// is used to specify processes designated by a particle
public: // with description
void SetVerboseLevel(G4int value);
G4int GetVerboseLevel() const;
// Set/Get controle flag for output message
// 0: Silent
// 1: Warning message
// 2: More
inline void SetVerboseLevel(G4int value);
inline G4int GetVerboseLevel() const;
// Set/Get control flag for output message
// 0: Silent
// 1: Warning message
// 2: More
private:
private:
static G4ThreadLocal G4ProcessTable* fProcessTable;
G4ProcessTableMessenger* fProcTblMessenger;
private:
G4ProcTableVector* fProcTblVector;
G4ProcNameVector* fProcNameVector;
// list of G4ProcTblElement
G4ProcessTable();
// Private default constructor
G4ProcTableVector* tmpTblVector;
// used only internaly for temporary buffer.
G4ProcTableVector* Find(const G4String& processName );
G4ProcTableVector* Find(G4ProcessType processType );
// Return pointer of a ProcTableVector which includes
// ProcTbleElement specified
private:
G4int verboseLevel;
// controle flag for output message
G4ProcessVector* ExtractProcesses(G4ProcTableVector*) const;
// Extract all process objects from the process table
private:
static G4ThreadLocal G4ProcessTable* fProcessTable;
G4ProcessTableMessenger* fProcTblMessenger = nullptr;
G4ProcTableVector* fProcTblVector = nullptr;
G4ProcNameVector* fProcNameVector = nullptr;
G4ProcTableVector* tmpTblVector = nullptr;
// Used only internally as temporary buffer
std::vector<G4VProcess*> fListProcesses;
// Used for registration of process instances
G4int verboseLevel = 1;
// Control flag for output message
};
#include "G4ProcessTable.icc"
#endif
@@ -25,121 +25,118 @@
//
// G4ProcessTable inline methods implementation
//
// Author: H.Kurashige
// Author: H.Kurashige, 4 August 1998
// --------------------------------------------------------------------
#include "G4ParticleTable.hh"
//////////////////////////
// --------------------------------------------------------------------
//
inline
void G4ProcessTable::SetVerboseLevel(G4int value)
void G4ProcessTable::SetVerboseLevel(G4int value)
{
verboseLevel = value;
}
//////////////////////////
// --------------------------------------------------------------------
//
inline
G4int G4ProcessTable::GetVerboseLevel() const
G4int G4ProcessTable::GetVerboseLevel() const
{
return verboseLevel;
}
//////////////////////////
// --------------------------------------------------------------------
//
inline
G4int G4ProcessTable::Length() const
G4int G4ProcessTable::Length() const
{
return G4int(fProcTblVector->size());
}
//////////////////////////
// --------------------------------------------------------------------
//
inline
G4ProcessTable::G4ProcNameVector* G4ProcessTable::GetNameList()
G4ProcessTable::G4ProcNameVector* G4ProcessTable::GetNameList()
{
return fProcNameVector;
return fProcNameVector;
}
//////////////////////////
// --------------------------------------------------------------------
//
inline
G4ProcessTable::G4ProcTableVector* G4ProcessTable::GetProcTableVector()
G4ProcessTable::G4ProcTableVector* G4ProcessTable::GetProcTableVector()
{
return fProcTblVector;
}
//////////////////////////
// --------------------------------------------------------------------
//
inline
G4VProcess* G4ProcessTable::FindProcess(const G4String& processName,
const G4ParticleDefinition* particle) const
G4VProcess*
G4ProcessTable::FindProcess(const G4String& processName,
const G4ParticleDefinition* particle) const
{
if ( particle == 0 )
return nullptr;
else
return FindProcess(processName, particle->GetProcessManager());
return (particle) ?
FindProcess(processName, particle->GetProcessManager()) : nullptr;
}
//////////////////////////
inline
G4VProcess* G4ProcessTable::FindProcess(const G4String& processName,
const G4String& particleName) const
{
return FindProcess(processName,
G4ParticleTable::GetParticleTable()->FindParticle(particleName));
}
//////////////////////////
inline
void G4ProcessTable::SetProcessActivation(const G4String& processName,
G4ParticleDefinition* particle,
G4bool fActive)
// --------------------------------------------------------------------
//
inline
void G4ProcessTable::SetProcessActivation(const G4String& processName,
const G4ParticleDefinition* particle,
G4bool fActive)
{
if ( particle != nullptr )
{
SetProcessActivation(processName, particle->GetProcessManager(), fActive);
}
}
//////////////////////////
inline
void G4ProcessTable::SetProcessActivation(const G4String& processName,
const G4String& particleName,
G4bool fActive )
{
if (particleName == "ALL" )
{
SetProcessActivation( processName , fActive);
}
else
{
SetProcessActivation(processName,
G4ParticleTable::GetParticleTable()->FindParticle(particleName),
fActive );
}
}
//////////////////////////
inline
void G4ProcessTable::SetProcessActivation(G4ProcessType processType,
G4ParticleDefinition* particle,
G4bool fActive)
// --------------------------------------------------------------------
//
inline
void G4ProcessTable::SetProcessActivation(G4ProcessType processType,
const G4ParticleDefinition* particle,
G4bool fActive)
{
if ( particle != nullptr )
{
SetProcessActivation( processType, particle->GetProcessManager(), fActive);
SetProcessActivation(processType, particle->GetProcessManager(), fActive);
}
}
//////////////////////////
// --------------------------------------------------------------------
//
inline
void G4ProcessTable::SetProcessActivation(G4ProcessType processType,
const G4String& particleName ,
G4bool fActive)
G4ProcessVector* G4ProcessTable::FindProcesses()
{
if ((particleName == "ALL" )||(particleName == "all" ))
{
SetProcessActivation( processType, fActive );
}
else
{
SetProcessActivation(processType,
G4ParticleTable::GetParticleTable()->FindParticle(particleName),
fActive );
}
return ExtractProcesses(fProcTblVector);
}
// --------------------------------------------------------------------
//
inline
G4ProcessVector*
G4ProcessTable::FindProcesses( const G4ProcessManager* pManager )
{
G4ProcessVector* procList = pManager->GetProcessList();
return new G4ProcessVector(*procList);
}
// --------------------------------------------------------------------
//
inline
G4ProcessVector* G4ProcessTable::FindProcesses( const G4String& processName )
{
G4ProcTableVector* pTblVector = Find(processName);
return ExtractProcesses(pTblVector);
}
// --------------------------------------------------------------------
//
inline
G4ProcessVector* G4ProcessTable::FindProcesses( G4ProcessType processType)
{
G4ProcTableVector* pTblVector = Find(processType);
return ExtractProcesses(pTblVector);
}
@@ -23,83 +23,72 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// G4ProcessTableMessenger
//
// Class description:
//
// Messenger class to exchange information between ProcessTable and UI.
//
//---------------------------------------------------------------
//
// G4ProcessTableMessenger.hh
//
// Class Description:
// This is a messenger class to interface to exchange information
// between ProcessTable and UI.
//-
// /process/ Process Table control commands.
// Commands :
// list * :Dump process name registered.
// verbose * :Set Verbose Level for Process Table
// activate * :Activate process
// inactivate * :Inctivate process
// dump * :Dump process information
//
// History:
// 15 Aug. 1998, H. Kurashige
//
//---------------------------------------------------------------
// list * : Dump process name registered.
// verbose * : Set Verbose Level for Process Table
// activate * : Activate process
// inactivate * : Inctivate process
// dump * : Dump process information
#ifndef G4ProcessTableMessenger_h
#define G4ProcessTableMessenger_h 1
class G4ProcessTable;
class G4UIdirectory;
class G4UIcmdWithoutParameter;
class G4UIcmdWithAnInteger;
class G4UIcmdWithAString;
// Author: H.Kurashige, 15 August 1998
// --------------------------------------------------------------------
#ifndef G4ProcessTableMessenger_hh
#define G4ProcessTableMessenger_hh 1
#include "G4UImessenger.hh"
#include "globals.hh"
#include "G4ProcessType.hh"
class G4ProcessTableMessenger: public G4UImessenger
class G4ProcessTable;
class G4UIdirectory;
class G4UIcmdWithoutParameter;
class G4UIcmdWithAnInteger;
class G4UIcmdWithAString;
class G4ProcessTableMessenger : public G4UImessenger
{
public:
G4ProcessTableMessenger(G4ProcessTable* pTable);
virtual ~G4ProcessTableMessenger();
public: // with description
G4ProcessTableMessenger(const G4ProcessTableMessenger&) = delete;
G4ProcessTableMessenger& operator=(const G4ProcessTableMessenger&) = delete;
virtual void SetNewValue(G4UIcommand * command,G4String newValues);
virtual G4String GetCurrentValue(G4UIcommand * command);
private:
G4ProcessTableMessenger(){}
G4String GetProcessTypeName(G4ProcessType aType) const;
G4int GetProcessType(const G4String& aTypeName) const;
static G4ThreadLocal G4int NumberOfProcessType;
static G4ThreadLocal G4int NumberOfProcessType;
void SetNumberOfProcessType();
private:
G4ProcessTableMessenger(const G4ProcessTableMessenger&)
: G4UImessenger() {};
G4ProcessTableMessenger(){};
private:
G4ProcessTable* theProcessTable;
G4ProcessTable* theProcessTable = nullptr;
G4UIdirectory * thisDirectory;
G4UIcmdWithAnInteger * verboseCmd;
G4UIcmdWithAString * listCmd;
G4UIcommand * dumpCmd;
G4UIcommand * activateCmd;
G4UIcommand * inactivateCmd;
G4UIcommand * procVerboseCmd;
G4UIdirectory* thisDirectory = nullptr;
G4UIcmdWithAnInteger* verboseCmd = nullptr;
G4UIcmdWithAString* listCmd = nullptr;
G4UIcommand* dumpCmd = nullptr;
G4UIcommand* activateCmd = nullptr;
G4UIcommand* inactivateCmd = nullptr;
G4UIcommand* procVerboseCmd = nullptr;
G4String currentProcessTypeName;
G4String currentProcessName;
G4String currentParticleName;
G4String currentProcessTypeName = "all";
G4String currentProcessName = "all";
G4String currentParticleName = "all";
};
#endif
@@ -23,21 +23,16 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// G4ProcessType
//
// Description:
//
//
//---------------------------------------------------------------
//
// G4ProcessType.hh
//
// Class Description:
// This is an enumerator to define process type
//
//
//---------------------------------------------------------------
// This is an enumerator to define process type
#ifndef G4ProcessType_h
#define G4ProcessType_h 1
// Author: H.Kurashige
// --------------------------------------------------------------------
#ifndef G4ProcessType_hh
#define G4ProcessType_hh 1
enum G4ProcessType
{
@@ -55,6 +50,5 @@ enum G4ProcessType
fPhonon,
fUCN
};
#endif
@@ -25,18 +25,19 @@
//
// G4ProcessVector
//
//
// Class Description
// Class description:
//
// This class is a container for pointers to physics process objects.
// A container for pointers to physics process objects.
// Authors: G.Cosmo, H.Kurashige - 1998
// --------------------------------------------------------------------
#ifndef G4ProcessVector_hh
#define G4ProcessVector_hh 1
#include <vector>
#include "globals.hh"
#include "G4ios.hh"
#include <vector>
class G4VProcess;
@@ -44,61 +45,59 @@ class G4ProcessVector
{
public:
// Constructors
G4ProcessVector();
explicit G4ProcessVector(size_t);
explicit G4ProcessVector(std::size_t);
G4ProcessVector(const G4ProcessVector &);
// Constructors
// Destructor.
virtual ~G4ProcessVector();
// Destructor
// assignment operator
G4ProcessVector & operator=(const G4ProcessVector &right);
G4ProcessVector& operator=(const G4ProcessVector& right);
// Assignment operator
// equality operator
G4bool operator==(const G4ProcessVector &right) const;
inline G4bool operator==(const G4ProcessVector& right) const;
// Equality operator
public: // With Description
// Returns the number of items
size_t entries() const;
size_t length() const;
size_t size() const;
inline std::size_t entries() const;
inline std::size_t length() const;
inline std::size_t size() const;
// Returns the number of items
// Returns the position of the element
size_t index(G4VProcess* aProcess) const;
std::size_t index(G4VProcess* aProcess) const;
// Returns the position of the element
// Returns "true" if the element exists
G4bool contains(G4VProcess* aProcess) const;
// Returns "true" if the element exists
// Insert an element
G4bool insert(G4VProcess* aProcess);
inline G4bool insert(G4VProcess* aProcess);
// Insert an element
// Insert an element at i-th position
G4bool insertAt(G4int i, G4VProcess* aProcess);
// Insert an element at i-th position
// Remove and returns the i-th element
G4VProcess* removeAt(G4int i);
// Remove and returns the i-th element
// Remove and returns the last element
G4VProcess* removeLast();
inline G4VProcess* removeLast();
// Remove and returns the last element
// Clear the collection by removing all items
void clear();
inline void clear();
// Clear the collection by removing all items
// returns const reference to the i-th item
G4VProcess* const& operator[](G4int i) const;
G4VProcess* const& operator()(G4int i) const;
inline G4VProcess* const& operator[](G4int i) const;
inline G4VProcess* const& operator()(G4int i) const;
// Returns const reference to the i-th item
// returns reference to the i-th item
G4VProcess* & operator[](G4int i);
G4VProcess* & operator()(G4int i);
inline G4VProcess* & operator[](G4int i);
inline G4VProcess* & operator()(G4int i);
// Returns reference to the i-th item
protected:
typedef std::vector<G4VProcess*> G4ProcVector;
using G4ProcVector = std::vector<G4VProcess*>;
G4ProcVector * pProcVector;
G4ProcVector* pProcVector = nullptr;
};
#include "G4ProcessVector.icc"
@@ -25,76 +25,35 @@
//
// G4ProcessVector inline methods implementation
//
// Authors: G.Cosmo, H.Kurashige - 1998
// --------------------------------------------------------------------
inline G4bool G4ProcessVector::operator==(const G4ProcessVector &right) const
inline G4bool G4ProcessVector::operator==(const G4ProcessVector& right) const
{
return (this == (G4ProcessVector *) &right);
}
inline size_t G4ProcessVector::entries() const
inline std::size_t G4ProcessVector::entries() const
{
return pProcVector->size();
}
inline size_t G4ProcessVector::size() const
inline std::size_t G4ProcessVector::size() const
{
return pProcVector->size();
}
inline size_t G4ProcessVector::length() const
inline std::size_t G4ProcessVector::length() const
{
return pProcVector->size();
}
inline size_t G4ProcessVector::index(G4VProcess* aProcess) const
{
G4ProcVector::iterator it;
size_t j=0;
for (it=pProcVector->begin();it!=pProcVector->end(); ++j,it++) {
if (*(*it)==*aProcess) return j;
}
return -1;
}
inline G4bool G4ProcessVector::contains(G4VProcess* aProcess) const
{
G4ProcVector::iterator it;
for (it=pProcVector->begin();it!=pProcVector->end(); it++) {
if (*(*it)==*aProcess) return true;
}
return false;
}
inline G4bool G4ProcessVector::insert(G4VProcess* aProcess)
{
pProcVector->push_back(aProcess);
return true;
}
inline G4bool G4ProcessVector::insertAt(G4int i,G4VProcess* aProcess)
{
if ( (i<0) || (i>G4int(pProcVector->size())) ) return false;
if (i==G4int(pProcVector->size())) {
pProcVector->push_back(aProcess);
} else {
G4ProcVector::iterator it=pProcVector->begin();
int j;
for(j=0;j!=i;++j) it++;
pProcVector->insert(it, aProcess);
}
return true;
}
inline G4VProcess* G4ProcessVector::removeAt(G4int i)
{
G4ProcVector::iterator it=pProcVector->begin();
for(size_t j=0;j<pProcVector->size() && G4int(j)<i;++j) it++;
G4VProcess* rValue = *it;
pProcVector->erase(it);
return rValue;
}
inline G4VProcess* G4ProcessVector::removeLast()
{
G4VProcess* rValue = pProcVector->back();
@@ -126,7 +85,3 @@ inline G4VProcess* & G4ProcessVector::operator()(G4int i)
{
return (*pProcVector)[i];
}
@@ -23,28 +23,19 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// G4VContinuousDiscreteProcess
//
//
// Class description:
//
// ------------------------------------------------------------
// GEANT 4 class header file
//
// Abstract class which defines the public behavior of
//
// Class Description
// discrete physics interactions.
//
// ------------------------------------------------------------
// New Physics scheme 8 Mar. 1997 H.Kurahige
// ------------------------------------------------------------
// fix bugs in GetGPILSelection() 24 Jan. 1998 H.Kurashige
// modified for new ParticleChange 12 Mar. 1998 H.Kurashige
// Fixed a bug in PostStepGetPhysicalInteractionLength
// 15 Apr. 2002 H.Kurashige
//
// Abstract class which defines the public behavior of
// discrete physics interactions.
#ifndef G4VContinuousDiscreteProcess_h
#define G4VContinuousDiscreteProcess_h 1
// Authors:
// - 2 December 1995, G.Cosmo - First implementation, based on object model
// - 8 January 1997, H.Kurashige - New Physics scheme
// --------------------------------------------------------------------
#ifndef G4VContinuousDiscreteProcess_hh
#define G4VContinuousDiscreteProcess_hh 1
#include "globals.hh"
#include "G4ios.hh"
@@ -53,90 +44,79 @@
class G4VContinuousDiscreteProcess : public G4VProcess
{
// Abstract class which defines the public behavior of
// discrete physics interactions.
public:
G4VContinuousDiscreteProcess(const G4String& ,
G4ProcessType aType = fNotDefined );
G4VContinuousDiscreteProcess(G4VContinuousDiscreteProcess &);
G4VContinuousDiscreteProcess(const G4String& ,
G4ProcessType aType = fNotDefined);
G4VContinuousDiscreteProcess(G4VContinuousDiscreteProcess &);
virtual ~G4VContinuousDiscreteProcess();
virtual ~G4VContinuousDiscreteProcess();
public :// with description
virtual G4double PostStepGetPhysicalInteractionLength(
G4VContinuousDiscreteProcess& operator=(const G4VContinuousDiscreteProcess&) = delete;
virtual G4double PostStepGetPhysicalInteractionLength(
const G4Track& track,
G4double previousStepSize,
G4ForceCondition* condition
);
G4double previousStepSize,
G4ForceCondition* condition
);
virtual G4VParticleChange* PostStepDoIt(
const G4Track& ,
const G4Step&
);
virtual G4VParticleChange* PostStepDoIt(
const G4Track& ,
const G4Step&
);
virtual G4double AlongStepGetPhysicalInteractionLength(
virtual G4double AlongStepGetPhysicalInteractionLength(
const G4Track&,
G4double previousStepSize,
G4double currentMinimumStep,
G4double& currentSafety,
G4double& currentSafety,
G4GPILSelection* selection
);
);
virtual G4VParticleChange* AlongStepDoIt(
const G4Track& ,
const G4Step&
);
// no operation in AtRestDoIt
virtual G4double AtRestGetPhysicalInteractionLength(
virtual G4VParticleChange* AlongStepDoIt(
const G4Track& ,
G4ForceCondition*
) { return -1.0; };
// no operation in AtRestDoIt
virtual G4VParticleChange* AtRestDoIt(
const G4Track& ,
const G4Step&
) {return 0;};
const G4Step&
);
protected:// with description
virtual G4double GetMeanFreePath(const G4Track& aTrack,
G4double previousStepSize,
G4ForceCondition* condition
)=0;
// Calculates from the macroscopic cross section a mean
// free path, the value is returned in units of distance.
virtual G4double AtRestGetPhysicalInteractionLength(
const G4Track& ,
G4ForceCondition*
) { return -1.0; }
// No operation in AtRestDoIt
virtual G4VParticleChange* AtRestDoIt(
const G4Track& ,
const G4Step&
) { return 0; }
// No operation in AtRestDoIt
protected:
virtual G4double GetMeanFreePath(const G4Track& aTrack,
G4double previousStepSize,
G4ForceCondition* condition )= 0;
// Calculates from the macroscopic cross-section a mean
// free path, the value is returned in units of distance
protected:// with description
virtual G4double GetContinuousStepLimit(const G4Track& aTrack,
G4double previousStepSize,
G4double currentMinimumStep,
G4double& currentSafety
)=0;
G4double& currentSafety ) = 0;
inline void SetGPILSelection(G4GPILSelection selection)
{ valueGPILSelection = selection; }
inline G4GPILSelection GetGPILSelection() const
{ return valueGPILSelection; }
private:
// this is the returnd value of G4GPILSelection in
// the arguments of AlongStepGPIL()
G4GPILSelection valueGPILSelection;
protected:// with description
// these two methods are set/get methods for valueGPILSelection
void SetGPILSelection(G4GPILSelection selection)
{ valueGPILSelection = selection;};
G4GPILSelection GetGPILSelection() const{return valueGPILSelection;};
private:
// hide default constructor and assignment operator as private
G4VContinuousDiscreteProcess();
G4VContinuousDiscreteProcess & operator=(const G4VContinuousDiscreteProcess &right);
G4VContinuousDiscreteProcess();
// Hidden default constructor
G4GPILSelection valueGPILSelection = CandidateForSelection;
// This is the returned value of G4GPILSelection in
// the arguments of AlongStepGPIL()
};
#endif
@@ -23,33 +23,19 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// G4VContinuousProcess
//
// Class description:
//
//
// ------------------------------------------------------------
// GEANT 4 class header file
//
// History: first implementation, based on object model of
// 2nd December 1995, G.Cosmo
// add G4VContinuousProcess(const G4String&) 24 Jul 1996, Hisaya kurashige
//
// Class Description
// Abstract class which defines the public behavior of
// Continuous physics interactions.
//
// ------------------------------------------------------------
// New Physics scheme 18 Dec. 1996 H.Kurahige
// ------------------------------------------------------------
// modified 25 Feb. 1997 H.Kurahige
// modified 8 Mar. 1997 H.Kurashige
// modified 22 Mar. 1997 H.Kurashige
// modified 26 Mar. 1997 H.Kurashige
// modified AlongStepGPIL etc. 17 Dec. 1997 H.Kurashige
// fix bugs in GetGPILSelection() 24 Jan. 1998 H.Kurashige
// modified for new ParticleChange 12 Mar. 1998 H.Kurashige
// Abstract class which defines the public behavior of
// Continuous physics interactions.
#ifndef G4VContinuousProcess_h
#define G4VContinuousProcess_h 1
// Authors:
// - 2 December 1995, G.Cosmo - First implementation, based on object model
// - 18 December 1996, H.Kurashige - New Physics scheme
// --------------------------------------------------------------------
#ifndef G4VContinuousProcess_hh
#define G4VContinuousProcess_hh 1
#include "globals.hh"
#include "G4ios.hh"
@@ -58,84 +44,77 @@
class G4VContinuousProcess : public G4VProcess
{
// Abstract class which defines the public behavior of
// Continuous physics interactions.
public:
G4VContinuousProcess(const G4String& ,
G4ProcessType aType = fNotDefined );
G4VContinuousProcess(G4VContinuousProcess &);
G4VContinuousProcess(const G4String& aName,
G4ProcessType aType = fNotDefined );
G4VContinuousProcess(G4VContinuousProcess &);
virtual ~G4VContinuousProcess();
virtual ~G4VContinuousProcess();
public: // with description
virtual G4double AlongStepGetPhysicalInteractionLength(
G4VContinuousProcess& operator=(const G4VContinuousProcess&) = delete;
virtual G4double AlongStepGetPhysicalInteractionLength(
const G4Track& track,
G4double previousStepSize,
G4double currentMinimumStep,
G4double& proposedSafety,
G4GPILSelection* selection
);
virtual G4VParticleChange* AlongStepDoIt(
const G4Track& ,
const G4Step&
);
// no operation in AtRestDoIt and PostStepDoIt
virtual G4double PostStepGetPhysicalInteractionLength(
const G4Track&,
G4double,
G4ForceCondition*
){ return -1.0; };
virtual G4double AtRestGetPhysicalInteractionLength(
const G4Track& ,
G4ForceCondition*
) { return -1.0; };
// no operation in AtRestDoIt and PostStepDoIt
virtual G4VParticleChange* AtRestDoIt(
const G4Track& ,
const G4Step&
) {return 0;};
virtual G4VParticleChange* PostStepDoIt(
const G4Track& ,
const G4Step&
) {return 0;};
protected: // with description
virtual G4double GetContinuousStepLimit(const G4Track& aTrack,
G4double previousStepSize,
G4double currentMinimumStep,
G4double& currentSafety
)=0;
// This pure virtual function is used to calculate step limit
// for AlongStep in the derived processes
G4double& proposedSafety,
G4GPILSelection* selection
);
virtual G4VParticleChange* AlongStepDoIt(
const G4Track& ,
const G4Step&
);
// no operation in AtRestDoIt and PostStepDoIt
//
virtual G4double PostStepGetPhysicalInteractionLength(
const G4Track&,
G4double,
G4ForceCondition*
) { return -1.0; }
virtual G4double AtRestGetPhysicalInteractionLength(
const G4Track& ,
G4ForceCondition*
) { return -1.0; }
// no operation in AtRestDoIt and PostStepDoIt
//
virtual G4VParticleChange* AtRestDoIt(
const G4Track& ,
const G4Step&
) { return 0; }
virtual G4VParticleChange* PostStepDoIt(
const G4Track& ,
const G4Step&
) { return 0; }
protected:
virtual G4double GetContinuousStepLimit( const G4Track& aTrack,
G4double previousStepSize,
G4double currentMinimumStep,
G4double& currentSafety ) = 0;
// This pure virtual function is used to calculate step limit
// for AlongStep in the derived processes
inline void SetGPILSelection(G4GPILSelection selection)
{ valueGPILSelection = selection; }
inline G4GPILSelection GetGPILSelection() const
{ return valueGPILSelection; }
private:
// this is the returnd value of G4GPILSelection in
// the arguments of AlongStepGPIL()
G4GPILSelection valueGPILSelection;
protected: // with description
// these two methods are set/get methods for valueGPILSelection
void SetGPILSelection(G4GPILSelection selection)
{ valueGPILSelection = selection;};
G4GPILSelection GetGPILSelection() const{return valueGPILSelection;};
private:
// hide default constructor and assignment operator as private
G4VContinuousProcess();
G4VContinuousProcess & operator=(const G4VContinuousProcess &right);
G4VContinuousProcess();
// Hidden default constructor
G4GPILSelection valueGPILSelection = CandidateForSelection;
// The returned value of G4GPILSelection in
// the arguments of AlongStepGPIL()
};
#endif
@@ -23,31 +23,19 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// G4VDiscreteProcess
//
// Class description:
//
// Abstract class which defines the public behavior of
// discrete physics interactions.
//
//
//
// ------------------------------------------------------------
// GEANT 4 class header file
//
// History: first implementation, based on object model of
// 2nd December 1995, G.Cosmo
// add G4VDiscreteProcess(const G4String&) 24 Jul 1996, Hisaya kurashige
//
// Class Description
// Abstract class which defines the public behavior of
// discrete physics interactions.
//
// ------------------------------------------------------------
// New Physics scheme 18 Dec. 1996 H.Kurahige
// ------------------------------------------------------------
// modified for new ParticleChange 12 Mar. 1998 H.Kurashige
// Fixed a bug in PostStepGetPhysicalInteractionLength
// 15 Apr. 2002 H.Kurashige
//
#ifndef G4VDiscreteProcess_h
#define G4VDiscreteProcess_h 1
// Authors:
// - 2 December 1995, G.Cosmo - First implementation, based on object model
// - 18 December 1996, H.Kurashige - New Physics scheme
// --------------------------------------------------------------------
#ifndef G4VDiscreteProcess_hh
#define G4VDiscreteProcess_hh 1
#include "globals.hh"
#include "G4ios.hh"
@@ -56,69 +44,66 @@
class G4VDiscreteProcess : public G4VProcess
{
// Abstract class which defines the public behavior of
// discrete physics interactions.
public:
G4VDiscreteProcess(const G4String& ,
G4ProcessType aType = fNotDefined );
G4VDiscreteProcess(G4VDiscreteProcess &);
G4VDiscreteProcess(const G4String& aName,
G4ProcessType aType = fNotDefined );
G4VDiscreteProcess(G4VDiscreteProcess&);
virtual ~G4VDiscreteProcess();
virtual ~G4VDiscreteProcess();
public :// with description
virtual G4double PostStepGetPhysicalInteractionLength(
G4VDiscreteProcess& operator=(const G4VDiscreteProcess&) = delete;
virtual G4double PostStepGetPhysicalInteractionLength(
const G4Track& track,
G4double previousStepSize,
G4ForceCondition* condition
);
virtual G4VParticleChange* PostStepDoIt(
const G4Track& ,
const G4Step&
);
// no operation in AtRestDoIt and AlongStepDoIt
virtual G4double AlongStepGetPhysicalInteractionLength(
const G4Track&,
G4double ,
G4double ,
G4double& ,
G4GPILSelection*
){ return -1.0; };
virtual G4double AtRestGetPhysicalInteractionLength(
const G4Track& ,
G4ForceCondition*
) { return -1.0; };
// no operation in AtRestDoIt and AlongStepDoIt
virtual G4VParticleChange* AtRestDoIt(
const G4Track& ,
const G4Step&
) {return 0;};
virtual G4VParticleChange* AlongStepDoIt(
const G4Track& ,
const G4Step&
) {return 0;};
protected:// with description
virtual G4double GetMeanFreePath(const G4Track& aTrack,
G4double previousStepSize,
G4double previousStepSize,
G4ForceCondition* condition
)=0;
// Calculates from the macroscopic cross section a mean
// free path, the value is returned in units of distance.
);
virtual G4VParticleChange* PostStepDoIt(
const G4Track& ,
const G4Step&
);
// No operation in AtRestDoIt and AlongStepDoIt
//
virtual G4double AlongStepGetPhysicalInteractionLength(
const G4Track&,
G4double ,
G4double ,
G4double& ,
G4GPILSelection*
) { return -1.0; }
virtual G4double AtRestGetPhysicalInteractionLength(
const G4Track& ,
G4ForceCondition*
) { return -1.0; }
// No operation in AtRestDoIt and AlongStepDoIt
//
virtual G4VParticleChange* AtRestDoIt(
const G4Track& ,
const G4Step&
) { return 0; }
virtual G4VParticleChange* AlongStepDoIt(
const G4Track& ,
const G4Step&
) { return 0; }
protected:
virtual G4double GetMeanFreePath( const G4Track& aTrack,
G4double previousStepSize,
G4ForceCondition* condition ) = 0;
// Calculates from the macroscopic cross-section a mean
// free path, the value is returned in units of distance
private:
// hide default constructor and assignment operator as private
G4VDiscreteProcess();
G4VDiscreteProcess & operator=(const G4VDiscreteProcess &right);
G4VDiscreteProcess();
// Hidden default constructor
};
#endif
+312 -331
View File
@@ -23,46 +23,26 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// G4VProcess
//
// Class description:
//
//
// ------------------------------------------------------------
// GEANT 4 class header file
//
// History: first implementation, based on object model of
// 2nd December 1995, G.Cosmo
//
// Class Description
// This class is the virtual class for physics process objects.
// It defines public methods which describe the behavior of
// a physics process.
//
// ------------------------------------------------------------
// New Physics scheme 18 Dec. 1996 H.Kurahige
// ------------------------------------------------------------
// change DoIt/GetPIL arguments type 20 Mar. 1997 H.Kurashige
// modified AlongStepGPIL 17 Dec. 1997 H.Kurashige
// modified for new ParticleChange 12 Mar. 1998 H.Kurashige
// Add process trype 27 Mar. 1998 H.Kurashige
// Remove thePhysicsTable 2 Aug. 1998 H.Kurashige
// Add PILfactor and GPIL 3 Nov. 2000 H.Kurashige
// Add Store/RetrievePhysicsTable 8 Nov. 2000 H.Kurashige
// Modify Store/RetrievePhysicsTable methods 9 Mar. 2001 H.Kurashige
// Added PreparePhysicsTable 20 Aug. 2004 H.Kurashige
// Added isXXXXDoItIsEnabled 2 Oct. 2007 H.Kurashige
// Added ProcessSubType 15 Nov. 2007 H.Kurashige
// This class is the virtual class for physics process objects.
// It defines public methods which describe the behavior of
// a physics process.
#ifndef G4VProcess_h
#define G4VProcess_h 1
// Authors:
// - 2 December 1995, G.Cosmo - First implementation, based on object model
// - 18 December 1996, H.Kurashige - New Physics scheme
// --------------------------------------------------------------------
#ifndef G4VProcess_hh
#define G4VProcess_hh 1
#include <cmath>
#include "globals.hh"
#include <cmath>
#include "G4ios.hh"
class G4ParticleDefinition;
class G4DynamicParticle;
class G4Track;
class G4Step;
#include "Randomize.hh"
#include "G4PhysicsTable.hh"
#include "G4VParticleChange.hh"
@@ -71,83 +51,80 @@ class G4Step;
#include "G4ParticleChange.hh"
#include "G4ProcessType.hh"
class G4ParticleDefinition;
class G4DynamicParticle;
class G4Track;
class G4Step;
class G4ProcessTable;
class G4VProcess
{
// A virtual class for physics process objects. It defines
// public methods which describe the behavior of a
// physics process.
private:
// hide default constructor and assignment operator as private
// do not hide default constructor for alpha version
// G4VProcess G4VProcess();
G4VProcess & operator=(const G4VProcess &right);
public:
public: // with description
// constructor requires the process name and type
G4VProcess(const G4String& aName = "NoName",
G4ProcessType aType = fNotDefined );
G4VProcess(const G4String& aName = "NoName",
G4ProcessType aType = fNotDefined);
// Constructor requires the process name and type
// copy constructor copys the name but does not copy the
// physics table (0 pointer is assigned)
G4VProcess(const G4VProcess &right);
G4VProcess(const G4VProcess& right);
// Copy constructor copies the name but does not copy the
// physics table (null pointer is assigned instead)
public:
// destructor
virtual ~G4VProcess();
virtual ~G4VProcess();
// Destructor
// equal opperators
G4bool operator==(const G4VProcess &right) const;
G4bool operator!=(const G4VProcess &right) const;
G4VProcess& operator=(const G4VProcess&) = delete;
public: // with description
////////////////////////////
// DoIt /////////////////
///////////////////////////
virtual G4VParticleChange* PostStepDoIt(
const G4Track& track,
const G4Step& stepData
) = 0;
G4bool operator==(const G4VProcess& right) const;
G4bool operator!=(const G4VProcess& right) const;
// Equality operators
virtual G4VParticleChange* AlongStepDoIt(
const G4Track& track,
const G4Step& stepData
) = 0;
virtual G4VParticleChange* AtRestDoIt(
const G4Track& track,
const G4Step& stepData
) = 0;
// A virtual base class function that has to be overridden
// by any subclass. The DoIt method actually performs the
// physics process and determines either momentum change
// of the production of secondaries etc.
// arguments
// const G4Track& track:
////////////////////////////
// DoIt /////////////////
////////////////////////////
virtual G4VParticleChange* PostStepDoIt(
const G4Track& track,
const G4Step& stepData
) = 0;
virtual G4VParticleChange* AlongStepDoIt(
const G4Track& track,
const G4Step& stepData
) = 0;
virtual G4VParticleChange* AtRestDoIt(
const G4Track& track,
const G4Step& stepData
) = 0;
// A virtual base class function that has to be overridden
// by any subclass. The DoIt() method actually performs the
// physics process and determines either momentum change
// of the production of secondaries etc.
// Arguments
// const G4Track& track:
// reference to the current G4Track information
// const G4Step& stepData:
// const G4Step& stepData:
// reference to the current G4Step information
//////////////////////////
// GPIL //////////////
/////////////////////////
virtual G4double AlongStepGetPhysicalInteractionLength(
//////////////////////////
// GPIL ///////////////
//////////////////////////
virtual G4double AlongStepGetPhysicalInteractionLength(
const G4Track& track,
G4double previousStepSize,
G4double currentMinimumStep,
G4double& proposedSafety,
G4double previousStepSize,
G4double currentMinimumStep,
G4double& proposedSafety,
G4GPILSelection* selection) = 0;
virtual G4double AtRestGetPhysicalInteractionLength(
virtual G4double AtRestGetPhysicalInteractionLength(
const G4Track& track,
G4ForceCondition* condition
) = 0;
G4ForceCondition* condition ) = 0;
virtual G4double PostStepGetPhysicalInteractionLength(
virtual G4double PostStepGetPhysicalInteractionLength(
const G4Track& track,
G4double previousStepSize,
G4ForceCondition* condition
) = 0;
G4double previousStepSize,
G4ForceCondition* condition ) = 0;
// Returns the Step-size (actual length) which is allowed
// by "this" process. (for AtRestGetPhysicalInteractionLength,
// return value is Step-time) The NumberOfInteractionLengthLeft is
@@ -174,252 +151,247 @@ class G4VProcess
// this value is used for transformation of
// true path length to geometrical path length
G4double GetCurrentInteractionLength() const;
inline G4double GetCurrentInteractionLength() const;
// Returns currentInteractionLength
////////// PIL factor ////////
void SetPILfactor(G4double value);
G4double GetPILfactor() const;
////////// PIL factor ////////
//
inline void SetPILfactor(G4double value);
inline G4double GetPILfactor() const;
// Set/Get factor for PhysicsInteractionLength
// which is passed to G4SteppingManager for both AtRest and PostStep
// These three GPIL methods are used by Stepping Manager.
// They invoke virtual GPIL methods listed above.
// As for AtRest and PostStep the returned value is multipled by thePILfactor
//
G4double AlongStepGPIL( const G4Track& track,
G4double previousStepSize,
G4double currentMinimumStep,
G4double& proposedSafety,
G4GPILSelection* selection );
// These three GPIL methods are used by Stepping Manager.
// They invoke virtual GPIL methods listed above.
// As for AtRest and PostStep the returned value is multipled by
// thePILfactor
//
inline G4double AlongStepGPIL( const G4Track& track,
G4double previousStepSize,
G4double currentMinimumStep,
G4double& proposedSafety,
G4GPILSelection* selection );
G4double AtRestGPIL( const G4Track& track,
G4ForceCondition* condition );
inline G4double AtRestGPIL( const G4Track& track,
G4ForceCondition* condition );
G4double PostStepGPIL( const G4Track& track,
G4double previousStepSize,
G4ForceCondition* condition );
inline G4double PostStepGPIL( const G4Track& track,
G4double previousStepSize,
G4ForceCondition* condition );
//////////////////////
virtual G4bool IsApplicable(const G4ParticleDefinition&){return true;}
virtual G4bool IsApplicable(const G4ParticleDefinition&) { return true; }
// Returns true if this process object is applicable to
// the particle type
// Process will not be registered to a particle if IsApplicable is false
// the particle type. Process will not be registered to a
// particle if IsApplicable is false
virtual void BuildPhysicsTable(const G4ParticleDefinition&){}
virtual void BuildPhysicsTable(const G4ParticleDefinition&) {}
// Messaged by the Particle definition (via the Process manager)
// whenever cross section tables have to be rebuilt (i.e. if new
// whenever cross-section tables have to be rebuilt (i.e. if new
// materials have been defined).
// It is overloaded by individual processes when they need physics
// tables.
// tables
virtual void PreparePhysicsTable(const G4ParticleDefinition&){}
virtual void PreparePhysicsTable(const G4ParticleDefinition&) {}
// Messaged by the Particle definition (via the Process manager)
// whenever cross section tables have to be prepare for rebuilt
// whenever cross-section tables have to be prepared for rebuild
// (i.e. if new materials have been defined).
// It is overloaded by individual processes when they need physics
// tables.
// tables
// Processes which Build physics tables independent of cuts
// (for example in their constructors)
// should preferably use private
// void BuildThePhysicsTable() and void PreparePhysicsTable().
// Not another BuildPhysicsTable, please.
// Processes which Build physics tables independent of cuts
// (for example in their constructors) should preferably use private
// void BuildThePhysicsTable() and void PreparePhysicsTable().
// *Not* another BuildPhysicsTable
virtual G4bool StorePhysicsTable(const G4ParticleDefinition* ,
const G4String&, G4bool){return true;}
virtual G4bool StorePhysicsTable(const G4ParticleDefinition* ,
const G4String&, G4bool) { return true; }
// Store PhysicsTable in a file.
// (return false in case of failure at I/O )
// Return false in case of failure at I/O
virtual G4bool RetrievePhysicsTable( const G4ParticleDefinition* ,
const G4String&, G4bool){return false;}
virtual G4bool RetrievePhysicsTable(const G4ParticleDefinition* ,
const G4String&, G4bool) { return false; }
// Retrieve Physics from a file.
// (return true if the Physics Table can be build by using file)
// (return false if the process has no functionality or in case of failure)
// File name should be defined by each process
// and the file should be placed under the directory specifed by the argument.
const G4String& GetPhysicsTableFileName(const G4ParticleDefinition* ,
const G4String& directory,
const G4String& tableName,
G4bool ascii =false);
// this method is utility for Store/RetreivePhysicsTable
// Return true if the Physics Table can be built by using file.
// Return false if the process has no functionality or in case
// of failure. File name should be defined by each process and the
// file should be placed under the directory specifed by the argument
////////////////////////////
const G4String& GetProcessName() const;
// Returns the name of the process.
const G4String& GetPhysicsTableFileName(const G4ParticleDefinition* ,
const G4String& directory,
const G4String& tableName,
G4bool ascii = false);
// This method is utility for Store/RetreivePhysicsTable
G4ProcessType GetProcessType() const;
// Returns the process type.
inline const G4String& GetProcessName() const;
// Returns the name of the process
void SetProcessType(G4ProcessType );
// Set the process type.
inline G4ProcessType GetProcessType() const;
// Returns the process type
G4int GetProcessSubType() const;
// Returns the process sub type.
inline void SetProcessType(G4ProcessType);
// Sets the process type
void SetProcessSubType(G4int );
// Set the process sub type.
inline G4int GetProcessSubType() const;
// Returns the process sub type
static const G4String& GetProcessTypeName(G4ProcessType );
// Returns the process type name
inline void SetProcessSubType(G4int);
// Sets the process sub type
virtual void StartTracking(G4Track*);
virtual void EndTracking();
// inform Start/End of tracking for each track to the physics process
static const G4String& GetProcessTypeName(G4ProcessType);
// Returns the process type name
public:
virtual void SetProcessManager(const G4ProcessManager*);
// A process manager set its own pointer when the process is registered
// the process Manager
virtual const G4ProcessManager* GetProcessManager();
virtual void StartTracking(G4Track*);
virtual void EndTracking();
// Inform Start/End of tracking for each track to the physics process
virtual void SetProcessManager(const G4ProcessManager*);
// A process manager sets its own pointer when the process
// is registered in the process Manager
virtual const G4ProcessManager* GetProcessManager();
// Get the process manager which the process belongs to
protected:
const G4ProcessManager* aProcessManager;
protected:
G4VParticleChange* pParticleChange;
// The pointer to G4VParticleChange object
// which is modified and returned by address by the DoIt() method.
// This pointer should be set in each physics process
// after construction of derived class object.
virtual void ResetNumberOfInteractionLengthLeft();
// Reset (determine the value of) NumberOfInteractionLengthLeft
G4ParticleChange aParticleChange;
// This object is kept for compatibility with old scheme
// This will be removed in future
inline G4double GetNumberOfInteractionLengthLeft() const;
// Get NumberOfInteractionLengthLeft
G4double theNumberOfInteractionLengthLeft;
// The flight length left for the current tracking particle
// in unit of "Interaction length".
inline G4double GetTotalNumberOfInteractionLengthTraversed() const;
// Get NumberOfInteractionLength after
// ResetNumberOfInteractionLengthLeft() is invoked
G4double currentInteractionLength;
// The InteractionLength in the current material
G4double theInitialNumberOfInteractionLength;
// The initial value when ResetNumberOfInteractionLengthLeft is invoked
public: // with description
virtual void ResetNumberOfInteractionLengthLeft();
// reset (determine the value of)NumberOfInteractionLengthLeft
G4double GetNumberOfInteractionLengthLeft() const;
// get NumberOfInteractionLengthLeft
G4double GetTotalNumberOfInteractionLengthTraversed() const;
// get NumberOfInteractionLength
// after ResetNumberOfInteractionLengthLeft is invoked
protected: // with description
void SubtractNumberOfInteractionLengthLeft(
G4double previousStepSize
);
// subtract NumberOfInteractionLengthLeft by the value corresponding to
// previousStepSize
void ClearNumberOfInteractionLengthLeft();
// clear NumberOfInteractionLengthLeft
// !!! This method should be at the end of PostStepDoIt()
// !!! and AtRestDoIt
public: // with description
// These methods indicate which DoIt is enabled
// These methods are used by G4ProcessManager to check
// that ordering parameters are set properly
G4bool isAtRestDoItIsEnabled() const;
G4bool isAlongStepDoItIsEnabled() const;
G4bool isPostStepDoItIsEnabled() const;
inline G4bool isAtRestDoItIsEnabled() const;
inline G4bool isAlongStepDoItIsEnabled() const;
inline G4bool isPostStepDoItIsEnabled() const;
// These methods indicate which DoIt is enabled.
// They are used by G4ProcessManager to check
// that ordering parameters are properly set
protected:
G4String theProcessName;
// The name of the process
virtual void DumpInfo() const;
// Dump out process information
G4String thePhysicsTableFileName;
virtual void ProcessDescription(std::ostream& outfile) const;
// Write out to html file for automatic documentation
G4ProcessType theProcessType;
// The type of the process
inline void SetVerboseLevel(G4int value);
inline G4int GetVerboseLevel() const;
// set/get control flag for output message
// 0: Silent
// 1: Warning message
// 2: More
G4int theProcessSubType;
// The sub type of the process
G4double thePILfactor;
// factor for PhysicsInteractionLength
// which is passed to G4SteppingManager
G4bool enableAtRestDoIt;
G4bool enableAlongStepDoIt;
G4bool enablePostStepDoIt;
public: // with description
virtual void DumpInfo() const;
// dump out process information
virtual void ProcessDescription(std::ostream& outfile) const;
// write out to html file for automatic documentation
public: // with description
void SetVerboseLevel(G4int value);
G4int GetVerboseLevel() const;
// set/get controle flag for output message
// 0: Silent
// 1: Warning message
// 2: More
protected:
G4int verboseLevel;
// controle flag for output message
private:
G4VProcess* masterProcessShadow;
//For multi-threaded: poitner to the instance of this process
// for the master thread
public:
virtual void SetMasterProcess( G4VProcess* masterP);
// Sets the master thread process instance
const G4VProcess* GetMasterProcess() const;
// Returns the master thread process instnace
// Can be used to initialize worker type processes
// instances from master one (e.g. to share a read-only table)
// if ( this != GetMasterProcess() ) { /*worker*/ }
// else { /* master or sequential */ }
virtual void SetMasterProcess(G4VProcess* masterP);
// Sets the master thread process instance
inline const G4VProcess* GetMasterProcess() const;
// Returns the master thread process instance.
// Can be used to initialise worker type processes
// instances from master one (e.g. to share a read-only table)
// if ( this != GetMasterProcess() ) { /*worker*/ }
// else { /* master or sequential */ }
virtual void BuildWorkerPhysicsTable(const G4ParticleDefinition& part);
// Messaged by the Particle definition (via the Process manager)
// in worker threads. See BuildWorkerBhyiscsTable method.
// Can be used to share among threads physics tables. Use GetMasterProcess
// to get pointer of master process from worker thread.
// By default this method makes a forward call to
// BuildPhysicsTable
// Messaged by the Particle definition (via the Process manager)
// in worker threads. See BuildWorkerPhyiscsTable() method.
// Can be used to share among threads physics tables.
// Use GetMasterProcess() to get pointer of master process from
// worker thread.
// By default this method makes a forward call to BuildPhysicsTable()
virtual void PrepareWorkerPhysicsTable(const G4ParticleDefinition&);
// Messaged by the Particle definition (via the Process manager)
// in worker threads. See PreparephysicsTable
// Can be used to share among threads physics tables. Use GetMasterProcess
// to get pointer of master process from worker thread
// By default this method makes a forward call
// to PreparePhysicsTable
// Messaged by the Particle definition (via the Process manager)
// in worker threads. See PreparephysicsTable().
// Can be used to share among threads physics tables.
// Use GetMasterProcess() to get pointer of master process from
// worker thread
// By default this method makes a forward call to PreparePhysicsTable()
protected:
inline void SubtractNumberOfInteractionLengthLeft(G4double prevStepSize);
// Subtract NumberOfInteractionLengthLeft by the value corresponding
// to previousStepSize
inline void ClearNumberOfInteractionLengthLeft();
// This method should be at the end of PostStepDoIt() and AtRestDoIt()!
protected:
const G4ProcessManager* aProcessManager = nullptr;
G4VParticleChange* pParticleChange = nullptr;
// The pointer to G4VParticleChange object
// which is modified and returned by address by the DoIt() method.
// This pointer should be set in each physics process
// after construction of derived class object
G4ParticleChange aParticleChange;
// This object is kept for compatibility with old scheme.
// May be removed in future
G4double theNumberOfInteractionLengthLeft = -1.0;
// The flight length left for the current tracking particle
// in unit of "Interaction length"
G4double currentInteractionLength = -1.0;
// The InteractionLength in the current material
G4double theInitialNumberOfInteractionLength = -1.0;
// The initial value when ResetNumberOfInteractionLengthLeft() is invoked
G4String theProcessName;
// The name of the process
G4String thePhysicsTableFileName;
G4ProcessType theProcessType = fNotDefined;
// The type of the process
G4int theProcessSubType = -1;
// The sub type of the process
G4double thePILfactor = 1.0;
// Factor for PhysicsInteractionLength
// which is passed to G4SteppingManager
G4int verboseLevel = 0;
// Controle flag for output message
G4bool enableAtRestDoIt = true;
G4bool enableAlongStepDoIt = true;
G4bool enablePostStepDoIt = true;
private:
G4VProcess();
// Hidden default constructor
private:
G4VProcess* masterProcessShadow = nullptr;
// For multi-threaded: pointer to the instance of this process
// for the master thread
G4ProcessTable* fProcessTable = nullptr;
};
// -----------------------------------------
// inlined function members implementation
// -----------------------------------------
#include "Randomize.hh"
inline
const G4String& G4VProcess::GetProcessName() const
const G4String& G4VProcess::GetProcessName() const
{
return theProcessName;
}
inline
G4ProcessType G4VProcess::GetProcessType() const
G4ProcessType G4VProcess::GetProcessType() const
{
return theProcessType;
}
inline
void G4VProcess::SetProcessType(G4ProcessType aType)
void G4VProcess::SetProcessType(G4ProcessType aType)
{
theProcessType = aType;
}
@@ -431,107 +403,113 @@ inline
}
inline
void G4VProcess::SetProcessSubType(G4int value)
void G4VProcess::SetProcessSubType(G4int value)
{
theProcessSubType = value;
theProcessSubType = value;
}
inline void G4VProcess::SetVerboseLevel(G4int value)
inline
void G4VProcess::SetVerboseLevel(G4int value)
{
verboseLevel = value;
}
inline G4int G4VProcess::GetVerboseLevel() const
inline
G4int G4VProcess::GetVerboseLevel() const
{
return verboseLevel;
}
inline void G4VProcess::ClearNumberOfInteractionLengthLeft()
inline
void G4VProcess::ClearNumberOfInteractionLengthLeft()
{
theInitialNumberOfInteractionLength = -1.0;
theNumberOfInteractionLengthLeft = -1.0;
}
inline G4double G4VProcess::GetNumberOfInteractionLengthLeft() const
inline
G4double G4VProcess::GetNumberOfInteractionLengthLeft() const
{
return theNumberOfInteractionLengthLeft;
}
inline G4double G4VProcess::GetTotalNumberOfInteractionLengthTraversed() const
inline
G4double G4VProcess::GetTotalNumberOfInteractionLengthTraversed() const
{
return theInitialNumberOfInteractionLength - theNumberOfInteractionLengthLeft;}
return theInitialNumberOfInteractionLength - theNumberOfInteractionLengthLeft;
}
inline G4double G4VProcess::GetCurrentInteractionLength() const
inline
G4double G4VProcess::GetCurrentInteractionLength() const
{
return currentInteractionLength;
}
inline void G4VProcess::SetPILfactor(G4double value)
inline
void G4VProcess::SetPILfactor(G4double value)
{
if (value>0.) {
thePILfactor = value;
}
if (value>0.) { thePILfactor = value; }
}
inline G4double G4VProcess::GetPILfactor() const
inline
G4double G4VProcess::GetPILfactor() const
{
return thePILfactor;
}
inline G4double G4VProcess::AlongStepGPIL( const G4Track& track,
G4double previousStepSize,
G4double currentMinimumStep,
G4double& proposedSafety,
G4GPILSelection* selection )
inline
G4double G4VProcess::AlongStepGPIL( const G4Track& track,
G4double previousStepSize,
G4double currentMinimumStep,
G4double& proposedSafety,
G4GPILSelection* selection )
{
G4double value
=AlongStepGetPhysicalInteractionLength(track, previousStepSize, currentMinimumStep, proposedSafety, selection);
return value;
return AlongStepGetPhysicalInteractionLength(track, previousStepSize,
currentMinimumStep, proposedSafety, selection);
}
inline G4double G4VProcess::AtRestGPIL( const G4Track& track,
inline
G4double G4VProcess::AtRestGPIL( const G4Track& track,
G4ForceCondition* condition )
{
G4double value
=AtRestGetPhysicalInteractionLength(track, condition);
return thePILfactor*value;
return thePILfactor * AtRestGetPhysicalInteractionLength(track, condition);
}
inline G4double G4VProcess::PostStepGPIL( const G4Track& track,
G4double previousStepSize,
inline
G4double G4VProcess::PostStepGPIL( const G4Track& track,
G4double previousStepSize,
G4ForceCondition* condition )
{
G4double value
=PostStepGetPhysicalInteractionLength(track, previousStepSize, condition);
return thePILfactor*value;
return thePILfactor *
PostStepGetPhysicalInteractionLength(track, previousStepSize, condition);
}
inline
void G4VProcess::SetProcessManager(const G4ProcessManager* procMan)
void G4VProcess::SetProcessManager(const G4ProcessManager* procMan)
{
aProcessManager = procMan;
aProcessManager = procMan;
}
inline
const G4ProcessManager* G4VProcess::GetProcessManager()
const G4ProcessManager* G4VProcess::GetProcessManager()
{
return aProcessManager;
return aProcessManager;
}
inline
G4bool G4VProcess::isAtRestDoItIsEnabled() const
G4bool G4VProcess::isAtRestDoItIsEnabled() const
{
return enableAtRestDoIt;
}
inline
G4bool G4VProcess::isAlongStepDoItIsEnabled() const
G4bool G4VProcess::isAlongStepDoItIsEnabled() const
{
return enableAlongStepDoIt;
}
inline
G4bool G4VProcess::isPostStepDoItIsEnabled() const
G4bool G4VProcess::isPostStepDoItIsEnabled() const
{
return enablePostStepDoIt;
}
@@ -539,34 +517,37 @@ inline
inline
const G4VProcess* G4VProcess::GetMasterProcess() const
{
return masterProcessShadow;
return masterProcessShadow;
}
inline
void G4VProcess::SubtractNumberOfInteractionLengthLeft(
G4double previousStepSize )
void G4VProcess::SubtractNumberOfInteractionLengthLeft( G4double prevStepSize )
{
if (currentInteractionLength>0.0) {
theNumberOfInteractionLengthLeft -= previousStepSize/currentInteractionLength;
if(theNumberOfInteractionLengthLeft<0.) {
if (currentInteractionLength>0.0)
{
theNumberOfInteractionLengthLeft -= prevStepSize/currentInteractionLength;
if(theNumberOfInteractionLengthLeft<0.)
{
theNumberOfInteractionLengthLeft=CLHEP::perMillion;
}
} else {
}
else
{
#ifdef G4VERBOSE
if (verboseLevel>0) {
if (verboseLevel>0)
{
G4cerr << "G4VProcess::SubtractNumberOfInteractionLengthLeft()";
G4cerr << " [" << theProcessName << "]" <<G4endl;
G4cerr << " currentInteractionLength = " << currentInteractionLength << " [mm]";
G4cerr << " previousStepSize = " << previousStepSize << " [mm]";
G4cerr << " currentInteractionLength = "
<< currentInteractionLength << " [mm]";
G4cerr << " previousStepSize = " << prevStepSize << " [mm]";
G4cerr << G4endl;
}
#endif
G4String msg = "Negative currentInteractionLength for ";
msg += theProcessName;
msg += theProcessName;
G4Exception("G4VProcess::SubtractNumberOfInteractionLengthLeft()",
"ProcMan201",EventMustBeAborted,
msg);
"ProcMan201", EventMustBeAborted, msg);
}
}
@@ -23,28 +23,19 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// G4VRestContinuousDiscreteProcess
//
// Class description:
//
//
// ------------------------------------------------------------
// GEANT 4 class header file
//
//
// Class Description
// Abstract class which defines the public behavior of
// continuous and discrete physics interactions.
//
// ------------------------------------------------------------
// New Physics scheme 8 Mar. 1997 H.Kurahige
// ------------------------------------------------------------
// fix bugs in GetGPILSelection() 24 Jan. 1998 H.Kurashige
// modified for new ParticleChange 12 Mar. 1998 H.Kurashige
// Fixed a bug in PostStepGetPhysicalInteractionLength
// 15 Apr. 2002 H.Kurashige
//
// Abstract class which defines the public behavior of
// continuous and discrete physics interactions.
#ifndef G4VRestContinuousDiscreteProcess_h
#define G4VRestContinuousDiscreteProcess_h 1
// Authors:
// - 2 December 1995, G.Cosmo - First implementation, based on object model
// - 8 January 1997, H.Kurashige - New Physics scheme
// --------------------------------------------------------------------
#ifndef G4VRestContinuousDiscreteProcess_hh
#define G4VRestContinuousDiscreteProcess_hh 1
#include "globals.hh"
#include "G4ios.hh"
@@ -53,92 +44,85 @@
class G4VRestContinuousDiscreteProcess : public G4VProcess
{
// Abstract class which defines the public behavior of
// discrete physics interactions.
public:
G4VRestContinuousDiscreteProcess(const G4String& ,
G4ProcessType aType = fNotDefined );
G4VRestContinuousDiscreteProcess(G4VRestContinuousDiscreteProcess &);
G4VRestContinuousDiscreteProcess(const G4String& ,
G4ProcessType aType = fNotDefined);
G4VRestContinuousDiscreteProcess(G4VRestContinuousDiscreteProcess &);
virtual ~G4VRestContinuousDiscreteProcess();
virtual ~G4VRestContinuousDiscreteProcess();
G4VRestContinuousDiscreteProcess& operator=(const G4VRestContinuousDiscreteProcess&) = delete;
public :// with description
virtual G4double PostStepGetPhysicalInteractionLength(
virtual G4double PostStepGetPhysicalInteractionLength(
const G4Track& track,
G4double previousStepSize,
G4ForceCondition* condition
);
virtual G4VParticleChange* PostStepDoIt(
const G4Track& ,
const G4Step&
);
virtual G4double AlongStepGetPhysicalInteractionLength(
const G4Track& track,
G4double previousStepSize,
G4double currentMinimumStep,
G4double& currentSafety,
G4GPILSelection* selection
);
virtual G4VParticleChange* AlongStepDoIt(
const G4Track& ,
const G4Step&
);
virtual G4double AtRestGetPhysicalInteractionLength(
const G4Track& ,
G4ForceCondition*
);
virtual G4VParticleChange* AtRestDoIt(
const G4Track& ,
const G4Step&
);
protected: // with description
virtual G4double GetMeanLifeTime(const G4Track& aTrack,G4ForceCondition* condition)=0;
// Calculates the mean life-time (i.e. for decays) of the
// particle at rest due to the occurrence of the given process,
// or converts the probability of interaction (i.e. for
// annihilation) into the life-time of the particle for the
// occurrence of the given process.
virtual G4double GetContinuousStepLimit(const G4Track& aTrack,
G4double previousStepSize,
G4double currentMinimumStep,
G4double& currentSafety
)=0;
private:
// this is the returnd value of G4GPILSelection in
// the arguments of AlongStepGPIL()
G4GPILSelection valueGPILSelection;
protected: // with description
// these two methods are set/get methods for valueGPILSelection
void SetGPILSelection(G4GPILSelection selection)
{ valueGPILSelection = selection;};
G4GPILSelection GetGPILSelection() const{return valueGPILSelection;};
protected: // with description
virtual G4double GetMeanFreePath(const G4Track& aTrack,
G4double previousStepSize,
G4ForceCondition* condition
)=0;
// Calculates from the macroscopic cross section a mean
// free path, the value is returned in units of distance.
);
private:
// hide default constructor and assignment operator as private
G4VRestContinuousDiscreteProcess();
G4VRestContinuousDiscreteProcess & operator=(const G4VRestContinuousDiscreteProcess &right);
virtual G4VParticleChange* PostStepDoIt(
const G4Track& ,
const G4Step&
);
virtual G4double AlongStepGetPhysicalInteractionLength(
const G4Track& track,
G4double previousStepSize,
G4double currentMinimumStep,
G4double& currentSafety,
G4GPILSelection* selection
);
virtual G4VParticleChange* AlongStepDoIt(
const G4Track& ,
const G4Step&
);
virtual G4double AtRestGetPhysicalInteractionLength(
const G4Track& ,
G4ForceCondition*
);
virtual G4VParticleChange* AtRestDoIt(
const G4Track& ,
const G4Step&
);
protected:
virtual G4double GetMeanLifeTime( const G4Track& aTrack,
G4ForceCondition* condition ) = 0;
// Calculates the mean life-time (i.e. for decays) of the
// particle at rest due to the occurrence of the given process,
// or converts the probability of interaction (i.e. for
// annihilation) into the life-time of the particle for the
// occurrence of the given process
virtual G4double GetContinuousStepLimit( const G4Track& aTrack,
G4double previousStepSize,
G4double currentMinimumStep,
G4double& currentSafety ) = 0;
virtual G4double GetMeanFreePath( const G4Track& aTrack,
G4double previousStepSize,
G4ForceCondition* condition ) = 0;
// Calculates from the macroscopic cross-section a mean
// free path, the value is returned in units of distance
inline void SetGPILSelection(G4GPILSelection selection)
{ valueGPILSelection = selection; }
inline G4GPILSelection GetGPILSelection() const
{ return valueGPILSelection; }
private:
G4VRestContinuousDiscreteProcess();
// Hidden default constructor
G4GPILSelection valueGPILSelection = CandidateForSelection;
// This is the returned value of G4GPILSelection in
// the arguments of AlongStepGPIL()
};
#endif
@@ -23,29 +23,19 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// G4VRestContinuousProcess
//
// Class description:
//
//
// ------------------------------------------------------------
// GEANT 4 class header file
//
//
// Class Description
// Abstract class which defines the public behavior of
// discrete physics interactions.
//
// ------------------------------------------------------------
// New Physics scheme 8 Mar. 1997 H.Kurahige
// ------------------------------------------------------------
// modified 26 Mar. 1997 H.Kurahige
// modified 16 Apr. 1997 L.Urban
// modified 18 Sep. 1997 H.Kurashige
// modified AlongStepGPIL etc. 17 Dec. 1997 H.Kurashige
// fix bugs in GetGPILSelection() 24 Jan. 1998 H.Kurashige
// modified for new ParticleChange 12 Mar. 1998 H.Kurashige
// Abstract class which defines the public behavior of
// discrete physics interactions.
#ifndef G4VRestContinuousProcess_h
#define G4VRestContinuousProcess_h 1
// Authors:
// - 2 December 1995, G.Cosmo - First implementation, based on object model
// - 8 January 1997, H.Kurashige - New Physics scheme
// --------------------------------------------------------------------
#ifndef G4VRestContinuousProcess_hh
#define G4VRestContinuousProcess_hh 1
#include "globals.hh"
#include "G4ios.hh"
@@ -54,95 +44,83 @@
class G4VRestContinuousProcess : public G4VProcess
{
// Abstract class which defines the public behavior of
// discrete physics interactions.
public:
G4VRestContinuousProcess(const G4String& ,
G4ProcessType aType = fNotDefined );
G4VRestContinuousProcess(G4VRestContinuousProcess &);
G4VRestContinuousProcess(const G4String& ,
G4ProcessType aType = fNotDefined);
G4VRestContinuousProcess(G4VRestContinuousProcess &);
virtual ~G4VRestContinuousProcess();
virtual ~G4VRestContinuousProcess();
public: // with description
G4VRestContinuousProcess& operator=(const G4VRestContinuousProcess&) = delete;
virtual G4double AtRestGetPhysicalInteractionLength(
virtual G4double AtRestGetPhysicalInteractionLength(
const G4Track& ,
G4ForceCondition*
);
G4ForceCondition*
);
virtual G4VParticleChange* AtRestDoIt(
const G4Track& ,
const G4Step&
);
virtual G4VParticleChange* AtRestDoIt(
const G4Track& ,
const G4Step&
);
virtual G4double AlongStepGetPhysicalInteractionLength(
virtual G4double AlongStepGetPhysicalInteractionLength(
const G4Track& track,
G4double previousStepSize,
G4double currentMinimumStep,
G4double& currentSafety,
G4GPILSelection* selection
);
virtual G4VParticleChange* AlongStepDoIt(
const G4Track& ,
const G4Step&
);
// no operation in PostStepDoIt
virtual G4double PostStepGetPhysicalInteractionLength(
const G4Track& ,
G4double ,
G4ForceCondition*
){ return -1.0; };
// no operation in PostStepDoIt
virtual G4VParticleChange* PostStepDoIt(
const G4Track& ,
const G4Step&
) {return 0;};
protected: // with description
virtual G4double GetContinuousStepLimit(const G4Track& aTrack,
G4double previousStepSize,
G4double previousStepSize,
G4double currentMinimumStep,
G4double& currentSafety
)=0;
// This pure virtual function is used to calculate step limit
// for AlongStep in the derived processes
G4double& currentSafety,
G4GPILSelection* selection
);
virtual G4VParticleChange* AlongStepDoIt(
const G4Track& ,
const G4Step&
);
virtual G4double PostStepGetPhysicalInteractionLength(
const G4Track& ,
G4double ,
G4ForceCondition*
) { return -1.0; }
// No operation in PostStepDoIt
virtual G4VParticleChange* PostStepDoIt(
const G4Track& ,
const G4Step&
) { return 0; }
// No operation in PostStepDoIt
protected:
virtual G4double GetContinuousStepLimit(const G4Track& aTrack,
G4double previousStepSize,
G4double currentMinimumStep,
G4double& currentSafety) = 0;
// This pure virtual function is used to calculate step limit
// for AlongStep in the derived processes
virtual G4double GetMeanLifeTime(const G4Track& aTrack,
G4ForceCondition* condition) = 0;
// Calculates the mean life-time (i.e. for decays) of the
// particle at rest due to the occurrence of the given process, or
// converts the probability of interaction (i.e. for annihilation) into
// the life-time of the particle for the occurrence of the given process
inline void SetGPILSelection(G4GPILSelection selection)
{ valueGPILSelection = selection; }
inline G4GPILSelection GetGPILSelection() const
{ return valueGPILSelection; }
private:
// this is the returnd value of G4GPILSelection in
// the arguments of AlongStepGPIL()
G4GPILSelection valueGPILSelection;
protected:// with description
// these two methods are set/get methods for valueGPILSelection
void SetGPILSelection(G4GPILSelection selection)
{ valueGPILSelection = selection;};
G4GPILSelection GetGPILSelection() const{return valueGPILSelection;};
protected: // with description
virtual G4double GetMeanLifeTime(const G4Track& aTrack,G4ForceCondition* condition)=0;
// Calculates the mean life-time (i.e. for decays) of the
// particle at rest due to the occurrence of the given process,
// or converts the probability of interaction (i.e. for
// annihilation) into the life-time of the particle for the
// occurrence of the given process.
private:
// hide default constructor and assignment operator as private
G4VRestContinuousProcess();
G4VRestContinuousProcess & operator=(const G4VRestContinuousProcess &right);
G4VRestContinuousProcess();
// Hidden default constructor
G4GPILSelection valueGPILSelection = CandidateForSelection;
// This is the returned value of G4GPILSelection in
// the arguments of AlongStepGPIL()
};
#endif
@@ -23,106 +23,93 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// G4VRestDiscreteProcess
//
// Class description:
//
//
// ------------------------------------------------------------
// GEANT 4 class header file
//
//
// Class Description
// Abstract class which defines the public behavior of
// rest + discrete physics interactions.
//
// ------------------------------------------------------------
// New Physics scheme 8 Mar. 1997 H.Kurahige
// ------------------------------------------------------------
// modified for new ParticleChange 12 Mar. 1998 H.Kurashige
// Fixed a bug in PostStepGetPhysicalInteractionLength
// 15 Apr. 2002 H.Kurashige
//
// Abstract class which defines the public behavior of
// rest + discrete physics interactions.
#ifndef G4VRestDiscreteProcess_h
#define G4VRestDiscreteProcess_h 1
// Authors:
// - 2 December 1995, G.Cosmo - First implementation, based on object model
// - 8 January 1997, H.Kurashige - New Physics scheme
// --------------------------------------------------------------------
#ifndef G4VRestDiscreteProcess_hh
#define G4VRestDiscreteProcess_hh 1
#include "globals.hh"
#include "G4ios.hh"
#include "G4VProcess.hh"
class G4VRestDiscreteProcess : public G4VProcess
{
// Abstract class which defines the public behavior of
// rest + discrete physics interactions.
public:
G4VRestDiscreteProcess(const G4String& ,
G4ProcessType aType = fNotDefined );
G4VRestDiscreteProcess(G4VRestDiscreteProcess &);
G4VRestDiscreteProcess(const G4String& ,
G4ProcessType aType = fNotDefined);
G4VRestDiscreteProcess(G4VRestDiscreteProcess&);
virtual ~G4VRestDiscreteProcess();
virtual ~G4VRestDiscreteProcess();
public :// with description
virtual G4double PostStepGetPhysicalInteractionLength(
G4VRestDiscreteProcess& operator=(const G4VRestDiscreteProcess&) = delete;
virtual G4double PostStepGetPhysicalInteractionLength(
const G4Track& track,
G4double previousStepSize,
G4double previousStepSize,
G4ForceCondition* condition
);
virtual G4VParticleChange* PostStepDoIt(
virtual G4VParticleChange* PostStepDoIt(
const G4Track& ,
const G4Step&
);
virtual G4double AtRestGetPhysicalInteractionLength(
virtual G4double AtRestGetPhysicalInteractionLength(
const G4Track& ,
G4ForceCondition*
);
virtual G4VParticleChange* AtRestDoIt(
virtual G4VParticleChange* AtRestDoIt(
const G4Track& ,
const G4Step&
);
// no operation in AlongStepDoIt
virtual G4double AlongStepGetPhysicalInteractionLength(
virtual G4double AlongStepGetPhysicalInteractionLength(
const G4Track&,
G4double ,
G4double ,
G4double& ,
G4GPILSelection*
){ return -1.0; };
) { return -1.0; }
// No operation in AlongStepDoIt
// no operation in AlongStepDoIt
virtual G4VParticleChange* AlongStepDoIt(
virtual G4VParticleChange* AlongStepDoIt(
const G4Track& ,
const G4Step&
) {return 0;};
) { return 0; }
// No operation in AlongStepDoIt
protected:// with description
virtual G4double GetMeanFreePath(const G4Track& aTrack,
G4double previousStepSize,
G4ForceCondition* condition
)=0;
// Calculates from the macroscopic cross section a mean
// free path, the value is returned in units of distance.
protected:
virtual G4double GetMeanLifeTime(const G4Track& aTrack,G4ForceCondition* condition)=0;
// Calculates the mean life-time (i.e. for decays) of the
// particle at rest due to the occurrence of the given process,
// or converts the probability of interaction (i.e. for
// annihilation) into the life-time of the particle for the
// occurrence of the given process.
virtual G4double GetMeanFreePath(const G4Track& aTrack,
G4double previousStepSize,
G4ForceCondition* condition) = 0;
// Calculates from the macroscopic cross-section a mean
// free path, the value is returned in units of distance
virtual G4double GetMeanLifeTime(const G4Track& aTrack,
G4ForceCondition* condition) = 0;
// Calculates the mean life-time (i.e. for decays) of the
// particle at rest due to the occurrence of the given process,
// or converts the probability of interaction (i.e. for
// annihilation) into the life-time of the particle for the
// occurrence of the given process
private:
// hide default constructor and assignment operator as private
G4VRestDiscreteProcess();
G4VRestDiscreteProcess & operator=(const G4VRestDiscreteProcess &right);
G4VRestDiscreteProcess();
// Hidden default constructor
};
#endif
@@ -23,106 +23,89 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//
// G4VRestProcess
//
// ------------------------------------------------------------
// GEANT 4 class header file
// Class description:
//
// History: first implementation, based on object model of
// 2nd December 1995, G.Cosmo
//
// Class Description
// Abstract class which defines the public behavior of
// physics interactions at rest.
//
// ------------------------------------------------------------
// New Physics scheme 18 Dec. 1996 H.Kurahige
// ------------------------------------------------------------
// modified 25 Feb. 1997 H.Kurahige
// modified 8 Mar. 1997 H.Kurahige
// modified 26 Mar. 1997 H.Kurahige
// modified 16 Apr. 1997 L.Urban
// modified 17 Dec. 1997 L.Urban
// modified for new ParticleChange 12 Mar. 1998 H.Kurashige
// Abstract class which defines the public behavior of
// physics interactions at rest.
#ifndef G4VRestProcess_h
#define G4VRestProcess_h 1
// Authors:
// - 2 December 1995, G.Cosmo - First implementation, based on object model
// - 18 December 1996, H.Kurashige - New Physics scheme
// --------------------------------------------------------------------
#ifndef G4VRestProcess_hh
#define G4VRestProcess_hh 1
#include "globals.hh"
#include "G4ios.hh"
#include "G4VProcess.hh"
class G4VRestProcess : public G4VProcess
{
// Abstract class which defines the public behavior of
// physics interactions at rest.
public:
G4VRestProcess(const G4String& ,
G4ProcessType aType = fNotDefined );
G4VRestProcess(G4VRestProcess& );
virtual ~G4VRestProcess();
G4VRestProcess(const G4String& aName,
G4ProcessType aType = fNotDefined);
G4VRestProcess(G4VRestProcess&);
public: // with description
virtual G4double AtRestGetPhysicalInteractionLength(
virtual ~G4VRestProcess();
G4VRestProcess& operator=(const G4VRestProcess&) = delete;
virtual G4double AtRestGetPhysicalInteractionLength(
const G4Track& track,
G4ForceCondition* condition
);
G4ForceCondition* condition
);
virtual G4VParticleChange* AtRestDoIt(
const G4Track& ,
const G4Step&
);
// no operation in PostStepDoIt and AlongStepDoIt
virtual G4double AlongStepGetPhysicalInteractionLength(
const G4Track&,
G4double ,
G4double ,
G4double& ,
G4GPILSelection*
){ return -1.0; };
virtual G4double PostStepGetPhysicalInteractionLength(
virtual G4VParticleChange* AtRestDoIt(
const G4Track& ,
G4double ,
G4ForceCondition*
) { return -1.0; };
const G4Step&
);
// no operation in PostStepDoIt and AlongStepDoIt
virtual G4VParticleChange* PostStepDoIt(
const G4Track& ,
const G4Step&
) {return 0;};
virtual G4double AlongStepGetPhysicalInteractionLength(
const G4Track&,
G4double ,
G4double ,
G4double& ,
G4GPILSelection*
) { return -1.0; }
// No operation in AlongStepGPIL
virtual G4VParticleChange* AlongStepDoIt(
const G4Track& ,
const G4Step&
) {return 0;};
protected: // with description
virtual G4double PostStepGetPhysicalInteractionLength(
const G4Track& ,
G4double ,
G4ForceCondition*
) { return -1.0; }
// No operation in PostStepGPIL
virtual G4double GetMeanLifeTime(const G4Track& aTrack,G4ForceCondition* condition)=0;
// Calculates the mean life-time (i.e. for decays) of the
// particle at rest due to the occurrence of the given process,
// or converts the probability of interaction (i.e. for
// annihilation) into the life-time of the particle for the
// occurrence of the given process.
virtual G4VParticleChange* PostStepDoIt(
const G4Track& ,
const G4Step&
) { return 0; }
// No operation in PostStepDoIt
private:
// hide default constructor and assignment operator as private
G4VRestProcess();
G4VRestProcess & operator=(const G4VRestProcess &right);
virtual G4VParticleChange* AlongStepDoIt(
const G4Track& ,
const G4Step&
) { return 0; }
// No operation in AlongStepDoIt
protected:
virtual G4double GetMeanLifeTime(const G4Track& aTrack,
G4ForceCondition* condition) = 0;
// Calculates the mean life-time (i.e. for decays) of the
// particle at rest due to the occurrence of the given process,
// or converts the probability of interaction (i.e. for
// annihilation) into the life-time of the particle for the
// occurrence of the given process
private:
G4VRestProcess();
// Hidden default constructor
};
#endif
@@ -23,22 +23,16 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// G4WrapperProcess
//
// Class description:
//
//
// ------------------------------------------------------------
// GEANT 4 class header file
//
// Class Description
//
// This class is the virtual class for wrapper process objects.
// Virtual class for wrapper process objects.
// ------------------------------------------------------------
// New Physics scheme 18 Dec. 1996 H.Kurahige
// ------------------------------------------------------------
#ifndef G4WrapperProcess_h
#define G4WrapperProcess_h 1
// Author: H.Kurahige, 18 December 1996
// --------------------------------------------------------------------
#ifndef G4WrapperProcess_hh
#define G4WrapperProcess_hh 1
#include "globals.hh"
#include "G4ios.hh"
@@ -46,159 +40,142 @@
class G4WrapperProcess : public G4VProcess
{
// A virtual class for wrapper process objects.
public:
private:
// hide default constructor and assignment operator as private
// do not hide default constructor for alpha version
inline G4WrapperProcess & operator=(const G4WrapperProcess &right);
G4WrapperProcess(const G4String& aName = "Wrapped",
G4ProcessType aType = fNotDefined);
// Constructor requires the process name and type
public: // with description
// constructor requires the process name and type
G4WrapperProcess(const G4String& aName = "Wrapped",
G4ProcessType aType = fNotDefined );
G4WrapperProcess(const G4WrapperProcess& right);
// Copy constructor copies the name but does not copy the
// physics table (null pointer is assigned)
// copy constructor copys the name but does not copy the
// physics table (0 pointer is assigned)
G4WrapperProcess(const G4WrapperProcess &right);
virtual ~G4WrapperProcess();
// Destructor
public:
// destructor
virtual ~G4WrapperProcess();
G4WrapperProcess& operator=(const G4WrapperProcess&) = delete;
// equality opperators
inline G4bool operator==(const G4WrapperProcess &right) const;
inline G4bool operator!=(const G4WrapperProcess &right) const;
inline G4bool operator==(const G4WrapperProcess& right) const;
inline G4bool operator!=(const G4WrapperProcess& right) const;
// Equality operators
public: // with description
virtual void RegisterProcess(G4VProcess*);
virtual void RegisterProcess(G4VProcess*);
virtual const G4VProcess* GetRegisteredProcess() const;
protected:
G4VProcess* pRegProcess;
////////////////////////////
// DoIt /////////////////
///////////////////////////
public: // with description
////////////////////////////
// DoIt /////////////////
///////////////////////////
virtual G4VParticleChange* PostStepDoIt(
virtual G4VParticleChange* PostStepDoIt(
const G4Track& track,
const G4Step& stepData
);
virtual G4VParticleChange* AlongStepDoIt(
virtual G4VParticleChange* AlongStepDoIt(
const G4Track& track,
const G4Step& stepData
);
virtual G4VParticleChange* AtRestDoIt(
virtual G4VParticleChange* AtRestDoIt(
const G4Track& track,
const G4Step& stepData
);
//////////////////////////
// GPIL //////////////
/////////////////////////
virtual G4double AlongStepGetPhysicalInteractionLength(
//////////////////////////
// GPIL //////////////
/////////////////////////
virtual G4double AlongStepGetPhysicalInteractionLength(
const G4Track& track,
G4double previousStepSize,
G4double currentMinimumStep,
G4double& proposedSafety,
G4GPILSelection* selection);
virtual G4double AtRestGetPhysicalInteractionLength(
virtual G4double AtRestGetPhysicalInteractionLength(
const G4Track& track,
G4ForceCondition* condition
);
virtual G4double PostStepGetPhysicalInteractionLength(
virtual G4double PostStepGetPhysicalInteractionLength(
const G4Track& track,
G4double previousStepSize,
G4ForceCondition* condition
) ;
);
//////////////////////
virtual G4bool IsApplicable(const G4ParticleDefinition&);
virtual G4bool IsApplicable(const G4ParticleDefinition&);
// Returns true if this process object is applicable to
// the particle type
// Process will not be registered to a particle if IsApplicable is false
virtual void BuildPhysicsTable(const G4ParticleDefinition&);
virtual void BuildPhysicsTable(const G4ParticleDefinition&);
// Messaged by the Particle definition (via the Process manager)
// whenever cross section tables have to be rebuilt (i.e. if new
// whenever cross-section tables have to be rebuilt (i.e. if new
// materials have been defined).
// It is overloaded by individual processes when they need physics
// tables.
// tables
// Processes which Build (for example in their
// constructors) physics tables independent of cuts
// should preferably use a
// private void BuildThePhysicsTable()
// function. Not another BuildPhysicsTable, please.
// Processes which build (for example in their constructors)
// physics tables independent of cuts should preferably use a private
// void BuildThePhysicsTable() function.
// **Not** another BuildPhysicsTable().
virtual void PreparePhysicsTable(const G4ParticleDefinition&);
virtual void PreparePhysicsTable(const G4ParticleDefinition&);
// Messaged by the Particle definition (via the Process manager)
// whenever cross section tables have to be prepare for rebuilt
// whenever cross-section tables have to be prepare for rebuilt
// (i.e. if new materials have been defined).
// It is overloaded by individual processes when they need physics
// tables.
// Processes which Build physics tables independent of cuts
// (for example in their constructors)
// should preferably use private
// void BuildThePhysicsTable() and void PreparePhysicsTable().
// Not another BuildPhysicsTable, please.
// tables
virtual G4bool StorePhysicsTable(const G4ParticleDefinition* ,
const G4String& directory,
G4bool ascii = false);
virtual G4bool StorePhysicsTable(const G4ParticleDefinition* ,
const G4String& directory,
G4bool ascii = false);
// Store PhysicsTable in a file.
// (return false in case of failure at I/O )
// Return false in case of failure at I/O
virtual G4bool RetrievePhysicsTable( const G4ParticleDefinition* ,
const G4String& directory,
G4bool ascii = false);
virtual G4bool RetrievePhysicsTable( const G4ParticleDefinition* ,
const G4String& directory,
G4bool ascii = false);
// Retrieve Physics from a file.
// (return true if the Physics Table can be build by using file)
// (return false if the process has no functionality or in case of failure)
// File name should be defined by each process
// and the file should be placed under the directory specifed by the argument.
////////////////////////////
virtual void StartTracking(G4Track*);
virtual void EndTracking();
// Return true if the Physics Table can be build by using file.
// Return false if the process has no functionality or in case of failure.
// File name should be defined by each process and the file should be
// placed under the directory specifed by the argument
virtual void StartTracking(G4Track*);
virtual void EndTracking();
// inform Start/End of tracking for each track to the physics process
public:
virtual void SetProcessManager(const G4ProcessManager*);
// A process manager set its own pointer when the process is registered
// the process Manager
virtual const G4ProcessManager* GetProcessManager();
virtual void SetProcessManager(const G4ProcessManager*);
// A process manager sets its own pointer when the process is registered
// in the process Manager
virtual const G4ProcessManager* GetProcessManager();
// Get the process manager which the process belongs to
public:
virtual void ResetNumberOfInteractionLengthLeft();
// reset (determine the value of)NumberOfInteractionLengthLeft
virtual void SetMasterProcess(G4VProcess* masterP);
// Needed for MT, forward call to underlying process
virtual void ResetNumberOfInteractionLengthLeft();
// Reset (determine the value of) NumberOfInteractionLengthLeft
virtual void SetMasterProcess(G4VProcess* masterP);
// Needed for MT, forward call to underlying process
protected:
G4VProcess* pRegProcess = nullptr;
};
inline
G4WrapperProcess & G4WrapperProcess::operator=(const G4WrapperProcess &)
{
G4Exception("G4WrapperProcess::operator=","Illegal operation",
JustWarning,"Assignment operator is called");
return *this;
}
// ------------------------
// Inline operators
// ------------------------
inline
G4bool G4WrapperProcess::operator==(const G4WrapperProcess &right) const
G4bool G4WrapperProcess::operator==(const G4WrapperProcess& right) const
{
return (this == &right);
}
inline
G4bool G4WrapperProcess::operator!=(const G4WrapperProcess &right) const
G4bool G4WrapperProcess::operator!=(const G4WrapperProcess& right) const
{
return (this != &right);
return (this != &right);
}
#endif