Import Geant4 10.6.0 source tree
This commit is contained in:
@@ -23,23 +23,17 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// G4ProcTblElement inline methods implementation
|
||||
//
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// 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
|
||||
// Author: H.Kurashige, 04.08.1998
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
/////////////
|
||||
inline
|
||||
G4bool G4ProcTblElement::Contains(const G4ProcessManager* pManager) const
|
||||
{
|
||||
G4ProcMgrVector::iterator i;
|
||||
for (i = pProcMgrVector->begin(); i!= pProcMgrVector->end(); ++i) {
|
||||
for (auto i = pProcMgrVector->cbegin(); i!= pProcMgrVector->cend(); ++i)
|
||||
{
|
||||
if (*i==pManager) return true;
|
||||
}
|
||||
return false;
|
||||
@@ -50,8 +44,8 @@ inline
|
||||
G4int G4ProcTblElement::GetIndex(const G4ProcessManager* pManager) const
|
||||
{
|
||||
G4int index = 0;
|
||||
G4ProcMgrVector::iterator i;
|
||||
for (i = pProcMgrVector->begin(); i!= pProcMgrVector->end(); ++i) {
|
||||
for (auto i = pProcMgrVector->cbegin(); i!= pProcMgrVector->cend(); ++i)
|
||||
{
|
||||
if (*i==pManager) return index;
|
||||
index +=1;
|
||||
}
|
||||
@@ -63,17 +57,20 @@ inline
|
||||
inline
|
||||
G4int G4ProcTblElement::Length() const
|
||||
{
|
||||
return pProcMgrVector->size();
|
||||
return G4int(pProcMgrVector->size());
|
||||
}
|
||||
|
||||
//////////////////////////
|
||||
inline
|
||||
G4ProcessManager* G4ProcTblElement::GetProcessManager(G4int index) const
|
||||
{
|
||||
if ((index < G4int(pProcMgrVector->size())) && (index>=0)){
|
||||
if ((index < G4int(pProcMgrVector->size())) && (index>=0))
|
||||
{
|
||||
return (*pProcMgrVector)[index];
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -97,9 +94,10 @@ inline
|
||||
inline
|
||||
void G4ProcTblElement::Remove(G4ProcessManager* aProcMgr)
|
||||
{
|
||||
G4ProcMgrVector::iterator i;
|
||||
for (i = pProcMgrVector->begin(); i!= pProcMgrVector->end(); ++i) {
|
||||
if (*i==aProcMgr){
|
||||
for (auto i = pProcMgrVector->cbegin(); i!= pProcMgrVector->cend(); ++i)
|
||||
{
|
||||
if (*i==aProcMgr)
|
||||
{
|
||||
pProcMgrVector->erase(i);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -23,26 +23,20 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// ---------------- G4ProcessManager -----------------
|
||||
//
|
||||
// Class Description:
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
// History: first implementation, based on object model of
|
||||
// 2nd December 1995, G.Cosmo
|
||||
// ---------------- G4ProcessManager -----------------
|
||||
// Class Description
|
||||
// It collects all physics a particle can undertake as seven vectors.
|
||||
// These vectors are
|
||||
// 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
|
||||
// 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
|
||||
@@ -51,26 +45,22 @@
|
||||
// processes at rest, for which the Tracking will select the
|
||||
// occurrence of the process which returns the shortest mean
|
||||
// life-time from the GetPhysicalInteractionLength()).
|
||||
//
|
||||
// History:
|
||||
// revised by G.Cosmo, 06 May 1996
|
||||
// Added vector of processes at rest, 06 May 1996
|
||||
// ------------------------------------------------------------
|
||||
// New Physics scheme 8 Jan. 1997 H.Kurahige
|
||||
// Add SetProcessOrdering methods 27 Mar 1998 H.Kurahige
|
||||
// Add copy constructor (deep copy) 28 June 1998 H.Kurashige
|
||||
// Add GetProcessActivation 3 May. 1999 H.Kurashige
|
||||
// Use STL vector instead of RW vector 1. Mar 00 H.Kurashige
|
||||
// Modify G4ProcessVectorOrdering to fix FindInsedrtPosition 15 Feb. 2005
|
||||
// Add
|
||||
// ------------------------------------------------------------
|
||||
|
||||
#ifndef G4ProcessManager_h
|
||||
#define G4ProcessManager_h 1
|
||||
// - 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
|
||||
// --------------------------------------------------------------------
|
||||
#ifndef G4ProcessManager_hh
|
||||
#define G4ProcessManager_hh 1
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4ios.hh"
|
||||
#include <vector>
|
||||
|
||||
#include "G4VProcess.hh"
|
||||
#include "G4ProcessVector.hh"
|
||||
@@ -82,29 +72,28 @@ class G4ProcessAttribute;
|
||||
// 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
|
||||
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
|
||||
{
|
||||
|
||||
public:
|
||||
// copy constructor
|
||||
G4ProcessManager(G4ProcessManager &right);
|
||||
@@ -138,26 +127,26 @@ class G4ProcessManager
|
||||
// --------------------------------------
|
||||
|
||||
G4ProcessVector* GetProcessVector(
|
||||
G4ProcessVectorDoItIndex idx,
|
||||
G4ProcessVectorTypeIndex typ = typeGPIL
|
||||
) const;
|
||||
G4ProcessVectorDoItIndex idx,
|
||||
G4ProcessVectorTypeIndex typ = typeGPIL
|
||||
) const;
|
||||
// Returns the address of the vector of processes
|
||||
|
||||
G4ProcessVector* GetAtRestProcessVector(
|
||||
G4ProcessVectorTypeIndex typ = typeGPIL
|
||||
G4ProcessVectorTypeIndex typ = typeGPIL
|
||||
) const;
|
||||
// Returns the address of the vector of processes for
|
||||
// AtRestGetPhysicalInteractionLength idx =0
|
||||
// AtRestGetPhysicalDoIt idx =1
|
||||
G4ProcessVector* GetAlongStepProcessVector(
|
||||
G4ProcessVectorTypeIndex typ = typeGPIL
|
||||
G4ProcessVectorTypeIndex typ = typeGPIL
|
||||
) const;
|
||||
// Returns the address of the vector of processes for
|
||||
// AlongStepGetPhysicalInteractionLength idx =0
|
||||
// AlongStepGetPhysicalDoIt idx =1
|
||||
|
||||
G4ProcessVector* GetPostStepProcessVector(
|
||||
G4ProcessVectorTypeIndex typ = typeGPIL
|
||||
G4ProcessVectorTypeIndex typ = typeGPIL
|
||||
) const;
|
||||
// Returns the address of the vector of processes for
|
||||
// PostStepGetPhysicalInteractionLength idx =0
|
||||
@@ -165,21 +154,21 @@ class G4ProcessManager
|
||||
|
||||
G4int GetProcessVectorIndex(
|
||||
G4VProcess* aProcess,
|
||||
G4ProcessVectorDoItIndex idx,
|
||||
G4ProcessVectorTypeIndex typ = typeGPIL
|
||||
) const;
|
||||
G4ProcessVectorDoItIndex idx,
|
||||
G4ProcessVectorTypeIndex typ = typeGPIL
|
||||
) const;
|
||||
G4int GetAtRestIndex(
|
||||
G4VProcess* aProcess,
|
||||
G4ProcessVectorTypeIndex typ = typeGPIL
|
||||
) const;
|
||||
G4ProcessVectorTypeIndex typ = typeGPIL
|
||||
) const;
|
||||
G4int GetAlongStepIndex(
|
||||
G4VProcess* aProcess,
|
||||
G4ProcessVectorTypeIndex typ = typeGPIL
|
||||
) const;
|
||||
G4ProcessVectorTypeIndex typ = typeGPIL
|
||||
) const;
|
||||
G4int GetPostStepIndex(
|
||||
G4VProcess* aProcess,
|
||||
G4ProcessVectorTypeIndex typ = typeGPIL
|
||||
) const;
|
||||
G4VProcess* aProcess,
|
||||
G4ProcessVectorTypeIndex typ = typeGPIL
|
||||
) const;
|
||||
// Returns the index for GPIL/DoIt process vector of the process
|
||||
|
||||
G4int AddProcess(
|
||||
@@ -220,14 +209,14 @@ class G4ProcessManager
|
||||
// Note: AddProcess method should precede these methods
|
||||
|
||||
G4int GetProcessOrdering(
|
||||
G4VProcess *aProcess,
|
||||
G4ProcessVectorDoItIndex idDoIt
|
||||
G4VProcess *aProcess,
|
||||
G4ProcessVectorDoItIndex idDoIt
|
||||
);
|
||||
|
||||
void SetProcessOrdering(
|
||||
G4VProcess *aProcess,
|
||||
G4ProcessVectorDoItIndex idDoIt,
|
||||
G4int ordDoIt = ordDefault
|
||||
G4VProcess *aProcess,
|
||||
G4ProcessVectorDoItIndex idDoIt,
|
||||
G4int ordDoIt = ordDefault
|
||||
);
|
||||
// Set ordering parameter for DoIt specified by typeDoIt.
|
||||
// If a process with same ordering parameter exists,
|
||||
@@ -237,18 +226,18 @@ class G4ProcessManager
|
||||
// even if you set ordDoIt = 0
|
||||
|
||||
void SetProcessOrderingToFirst(
|
||||
G4VProcess *aProcess,
|
||||
G4ProcessVectorDoItIndex idDoIt
|
||||
);
|
||||
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.
|
||||
|
||||
void SetProcessOrderingToSecond(
|
||||
G4VProcess *aProcess,
|
||||
G4ProcessVectorDoItIndex idDoIt
|
||||
);
|
||||
G4VProcess *aProcess,
|
||||
G4ProcessVectorDoItIndex idDoIt
|
||||
);
|
||||
// Set ordering parameter to 1 for DoIt specified by idDoIt
|
||||
// and the rpocess will be added just after
|
||||
// the processes with ordering parameter equal to zero
|
||||
@@ -256,9 +245,9 @@ class G4ProcessManager
|
||||
// a process called later will be .
|
||||
|
||||
void SetProcessOrderingToLast(
|
||||
G4VProcess *aProcess,
|
||||
G4ProcessVectorDoItIndex idDoIt
|
||||
);
|
||||
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,
|
||||
@@ -317,7 +306,7 @@ class G4ProcessManager
|
||||
// in theProcVector[ivec]
|
||||
|
||||
G4int GetProcessVectorId(G4ProcessVectorDoItIndex idx,
|
||||
G4ProcessVectorTypeIndex typ = typeGPIL) const;
|
||||
G4ProcessVectorTypeIndex typ = typeGPIL) const;
|
||||
|
||||
void CheckOrderingParameters(G4VProcess*) const;
|
||||
// check consistencies between ordering parameters and
|
||||
@@ -365,7 +354,7 @@ class G4ProcessManager
|
||||
static G4ThreadLocal G4ProcessManagerMessenger* fProcessManagerMessenger;
|
||||
static G4ThreadLocal G4int counterOfObjects;
|
||||
};
|
||||
|
||||
#include "G4ProcessManager.icc"
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -23,13 +23,9 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
// G4ProcessManager inline function members implementation
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
// -----------------------------------------
|
||||
// inlined function members implementation
|
||||
// -----------------------------------------
|
||||
inline
|
||||
void G4ProcessManager::SetParticleType(const G4ParticleDefinition* aParticle)
|
||||
{
|
||||
@@ -51,7 +47,7 @@ inline
|
||||
inline
|
||||
G4int G4ProcessManager::GetProcessIndex(G4VProcess* aProcess) const
|
||||
{
|
||||
G4int idx = theProcessList->index(aProcess);
|
||||
G4int idx = G4int(theProcessList->index(aProcess));
|
||||
if (idx>=numberOfProcesses) idx = -1;
|
||||
return idx;
|
||||
}
|
||||
@@ -81,32 +77,38 @@ inline
|
||||
) const
|
||||
{
|
||||
G4int ivec = GetProcessVectorId(idx, typ);
|
||||
if ( ivec >=0 ) {
|
||||
if ( ivec >=0 )
|
||||
{
|
||||
return theProcVector[ivec];
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
inline
|
||||
G4ProcessVector* G4ProcessManager::GetAtRestProcessVector(G4ProcessVectorTypeIndex typ) const
|
||||
G4ProcessVector*
|
||||
G4ProcessManager::GetAtRestProcessVector(G4ProcessVectorTypeIndex typ) const
|
||||
{
|
||||
if (typ == typeGPIL) { return theProcVector[0]; }
|
||||
else { return theProcVector[1]; }
|
||||
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]; }
|
||||
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]; }
|
||||
else { return theProcVector[5]; }
|
||||
}
|
||||
|
||||
inline
|
||||
@@ -137,19 +139,19 @@ inline
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
@@ -160,7 +162,6 @@ inline
|
||||
return (G4ParticleDefinition* )theParticleType;
|
||||
}
|
||||
|
||||
|
||||
inline
|
||||
void G4ProcessManager::SetVerboseLevel(G4int value)
|
||||
{
|
||||
@@ -172,4 +173,3 @@ inline
|
||||
{
|
||||
return verboseLevel;
|
||||
}
|
||||
|
||||
|
||||
@@ -52,11 +52,16 @@
|
||||
|
||||
#include "G4ProcTblElement.hh"
|
||||
#include "G4ProcessVector.hh"
|
||||
#include "G4ThreadLocalSingleton.hh"
|
||||
|
||||
class G4UImessenger;
|
||||
class G4ProcessTableMessenger;
|
||||
|
||||
class G4ProcessTable
|
||||
{
|
||||
|
||||
friend class G4ThreadLocalSingleton<G4ProcessTable>;
|
||||
|
||||
public:
|
||||
G4ProcessTable();
|
||||
// Constructors
|
||||
@@ -153,13 +158,7 @@ class G4ProcessTable
|
||||
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
|
||||
|
||||
public: // with description
|
||||
G4UImessenger* CreateMessenger();
|
||||
void DeleteMessenger();
|
||||
// These methods are used by RunManager to let the process table
|
||||
// know the timing of creation/destructuion of messengers
|
||||
|
||||
|
||||
public: // with description
|
||||
void SetVerboseLevel(G4int value);
|
||||
G4int GetVerboseLevel() const;
|
||||
|
||||
@@ -23,11 +23,10 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// G4ProcessTable inline methods implementation
|
||||
//
|
||||
//
|
||||
// History:
|
||||
// Use STL vector instead of RW vector 1. Mar 00 H.Kurashige
|
||||
//
|
||||
// Author: H.Kurashige
|
||||
// --------------------------------------------------------------------
|
||||
#include "G4ParticleTable.hh"
|
||||
|
||||
//////////////////////////
|
||||
@@ -48,12 +47,12 @@ inline
|
||||
inline
|
||||
G4int G4ProcessTable::Length() const
|
||||
{
|
||||
return fProcTblVector->size();
|
||||
return G4int(fProcTblVector->size());
|
||||
}
|
||||
|
||||
//////////////////////////
|
||||
inline
|
||||
G4ProcessTable::G4ProcNameVector* G4ProcessTable::GetNameList()
|
||||
G4ProcessTable::G4ProcNameVector* G4ProcessTable::GetNameList()
|
||||
{
|
||||
return fProcNameVector;
|
||||
}
|
||||
@@ -65,81 +64,82 @@ inline
|
||||
return fProcTblVector;
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////
|
||||
inline
|
||||
G4VProcess* G4ProcessTable::FindProcess(const G4String& processName,
|
||||
const G4ParticleDefinition* particle)
|
||||
const
|
||||
const G4ParticleDefinition* particle) const
|
||||
{
|
||||
if ( particle == 0 ) return 0;
|
||||
else return FindProcess(processName, particle->GetProcessManager());
|
||||
if ( particle == 0 )
|
||||
return nullptr;
|
||||
else
|
||||
return FindProcess(processName, particle->GetProcessManager());
|
||||
}
|
||||
|
||||
//////////////////////////
|
||||
inline
|
||||
G4VProcess* G4ProcessTable::FindProcess(const G4String& processName,
|
||||
const G4String& particleName) const
|
||||
const G4String& particleName) const
|
||||
{
|
||||
return FindProcess(processName,
|
||||
G4ParticleTable::GetParticleTable()->FindParticle(particleName));
|
||||
G4ParticleTable::GetParticleTable()->FindParticle(particleName));
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////
|
||||
inline
|
||||
void G4ProcessTable::SetProcessActivation(
|
||||
const G4String& processName,
|
||||
G4ParticleDefinition* particle,
|
||||
G4bool fActive)
|
||||
{
|
||||
if ( particle != 0 ) {
|
||||
SetProcessActivation(processName, particle->GetProcessManager(), fActive);
|
||||
}
|
||||
}
|
||||
void G4ProcessTable::SetProcessActivation(const G4String& processName,
|
||||
G4ParticleDefinition* particle,
|
||||
G4bool fActive)
|
||||
{
|
||||
if ( particle != nullptr )
|
||||
{
|
||||
SetProcessActivation(processName, particle->GetProcessManager(), fActive);
|
||||
}
|
||||
}
|
||||
//////////////////////////
|
||||
inline
|
||||
void G4ProcessTable::SetProcessActivation(
|
||||
const G4String& processName,
|
||||
const G4String& particleName,
|
||||
G4bool fActive )
|
||||
void G4ProcessTable::SetProcessActivation(const G4String& processName,
|
||||
const G4String& particleName,
|
||||
G4bool fActive )
|
||||
{
|
||||
if (particleName == "ALL" ) {
|
||||
if (particleName == "ALL" )
|
||||
{
|
||||
SetProcessActivation( processName , fActive);
|
||||
} else {
|
||||
SetProcessActivation(
|
||||
processName,
|
||||
G4ParticleTable::GetParticleTable()->FindParticle(particleName),
|
||||
fActive );
|
||||
}
|
||||
else
|
||||
{
|
||||
SetProcessActivation(processName,
|
||||
G4ParticleTable::GetParticleTable()->FindParticle(particleName),
|
||||
fActive );
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////
|
||||
inline
|
||||
void G4ProcessTable::SetProcessActivation(
|
||||
G4ProcessType processType,
|
||||
G4ParticleDefinition* particle,
|
||||
G4bool fActive)
|
||||
{
|
||||
if ( particle != 0 ) {
|
||||
SetProcessActivation( processType, particle->GetProcessManager(), fActive);
|
||||
}
|
||||
}
|
||||
void G4ProcessTable::SetProcessActivation(G4ProcessType processType,
|
||||
G4ParticleDefinition* particle,
|
||||
G4bool fActive)
|
||||
{
|
||||
if ( particle != nullptr )
|
||||
{
|
||||
SetProcessActivation( processType, particle->GetProcessManager(), fActive);
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////
|
||||
inline
|
||||
void G4ProcessTable::SetProcessActivation(
|
||||
G4ProcessType processType,
|
||||
const G4String& particleName ,
|
||||
G4bool fActive)
|
||||
void G4ProcessTable::SetProcessActivation(G4ProcessType processType,
|
||||
const G4String& particleName ,
|
||||
G4bool fActive)
|
||||
{
|
||||
if ((particleName == "ALL" )||(particleName == "all" )) {
|
||||
if ((particleName == "ALL" )||(particleName == "all" ))
|
||||
{
|
||||
SetProcessActivation( processType, fActive );
|
||||
} else {
|
||||
SetProcessActivation(
|
||||
processType,
|
||||
G4ParticleTable::GetParticleTable()->FindParticle(particleName),
|
||||
fActive );
|
||||
}
|
||||
else
|
||||
{
|
||||
SetProcessActivation(processType,
|
||||
G4ParticleTable::GetParticleTable()->FindParticle(particleName),
|
||||
fActive );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,18 +23,16 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// G4ProcessVector
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
// Class Description
|
||||
// This class is a container for pointers to physics process objects.
|
||||
// ------------------------------------------------------------
|
||||
//
|
||||
// This class is a container for pointers to physics process objects.
|
||||
|
||||
#ifndef G4ProcessVector_h
|
||||
#define G4ProcessVector_h 1
|
||||
// --------------------------------------------------------------------
|
||||
#ifndef G4ProcessVector_hh
|
||||
#define G4ProcessVector_hh 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4ios.hh"
|
||||
@@ -45,6 +43,7 @@ class G4VProcess;
|
||||
class G4ProcessVector
|
||||
{
|
||||
public:
|
||||
|
||||
// Constructors
|
||||
G4ProcessVector();
|
||||
explicit G4ProcessVector(size_t);
|
||||
@@ -53,20 +52,21 @@ class G4ProcessVector
|
||||
// Destructor.
|
||||
virtual ~G4ProcessVector();
|
||||
|
||||
//assignment operator
|
||||
// assignment operator
|
||||
G4ProcessVector & operator=(const G4ProcessVector &right);
|
||||
|
||||
// equal operator
|
||||
// equality operator
|
||||
G4bool operator==(const G4ProcessVector &right) const;
|
||||
|
||||
public: // With Description
|
||||
|
||||
// Returns the number of items
|
||||
G4int entries() const;
|
||||
G4int length() const;
|
||||
G4int size() const;
|
||||
size_t entries() const;
|
||||
size_t length() const;
|
||||
size_t size() const;
|
||||
|
||||
// Returns the position of the element
|
||||
G4int index(G4VProcess* aProcess) const;
|
||||
size_t index(G4VProcess* aProcess) const;
|
||||
|
||||
// Returns "true" if the element exists
|
||||
G4bool contains(G4VProcess* aProcess) const;
|
||||
@@ -95,7 +95,7 @@ class G4ProcessVector
|
||||
G4VProcess* & operator()(G4int i);
|
||||
|
||||
protected:
|
||||
// Use STL Vector
|
||||
|
||||
typedef std::vector<G4VProcess*> G4ProcVector;
|
||||
|
||||
G4ProcVector * pProcVector;
|
||||
@@ -104,20 +104,3 @@ class G4ProcessVector
|
||||
#include "G4ProcessVector.icc"
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -23,29 +23,31 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// G4ProcessVector inline methods implementation
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
inline G4bool G4ProcessVector::operator==(const G4ProcessVector &right) const
|
||||
{
|
||||
return (this == (G4ProcessVector *) &right);
|
||||
}
|
||||
|
||||
inline G4int G4ProcessVector::entries() const
|
||||
inline size_t G4ProcessVector::entries() const
|
||||
{
|
||||
return pProcVector->size();
|
||||
}
|
||||
|
||||
inline G4int G4ProcessVector::size() const
|
||||
inline size_t G4ProcessVector::size() const
|
||||
{
|
||||
return pProcVector->size();
|
||||
}
|
||||
|
||||
inline G4int G4ProcessVector::length() const
|
||||
inline size_t G4ProcessVector::length() const
|
||||
{
|
||||
return pProcVector->size();
|
||||
}
|
||||
|
||||
inline G4int G4ProcessVector::index(G4VProcess* aProcess) const
|
||||
inline size_t G4ProcessVector::index(G4VProcess* aProcess) const
|
||||
{
|
||||
G4ProcVector::iterator it;
|
||||
size_t j=0;
|
||||
|
||||
Reference in New Issue
Block a user