Import Geant4 10.5.0 source tree
This commit is contained in:
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ProcTblElement.cc 71231 2013-06-12 13:06:28Z gcosmo $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
@@ -40,7 +39,7 @@
|
||||
|
||||
// default constructor ////////////////////////
|
||||
G4ProcTblElement::G4ProcTblElement()
|
||||
:pProcess(0),pProcMgrVector(0)
|
||||
:pProcess(nullptr),pProcMgrVector(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -53,7 +52,7 @@ G4ProcTblElement::G4ProcTblElement(G4VProcess* aProcess):
|
||||
|
||||
// copy constructor //////////////////////////
|
||||
G4ProcTblElement::G4ProcTblElement(const G4ProcTblElement &right)
|
||||
:pProcess(0),pProcMgrVector(0)
|
||||
:pProcess(nullptr),pProcMgrVector(nullptr)
|
||||
{
|
||||
*this = right;
|
||||
}
|
||||
@@ -62,7 +61,7 @@ G4ProcTblElement::G4ProcTblElement(const G4ProcTblElement &right)
|
||||
// destructor ////////////////////////
|
||||
G4ProcTblElement::~G4ProcTblElement()
|
||||
{
|
||||
if (pProcMgrVector != 0) {
|
||||
if (pProcMgrVector != nullptr) {
|
||||
pProcMgrVector->clear();
|
||||
delete pProcMgrVector;
|
||||
}
|
||||
@@ -75,7 +74,7 @@ G4ProcTblElement & G4ProcTblElement::operator=(const G4ProcTblElement &right)
|
||||
if (this != &right) {
|
||||
pProcess = right.pProcess;
|
||||
// copy all contents in pProcMgrVector
|
||||
if (pProcMgrVector != 0) {
|
||||
if (pProcMgrVector != nullptr) {
|
||||
pProcMgrVector->clear();
|
||||
delete pProcMgrVector;
|
||||
}
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ProcessAttribute.cc 71231 2013-06-12 13:06:28Z gcosmo $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
@@ -39,37 +38,40 @@
|
||||
|
||||
#include "G4ProcessAttribute.hh"
|
||||
|
||||
// default constructor //////////////////////////
|
||||
G4ProcessAttribute::G4ProcessAttribute():
|
||||
isActive(true)
|
||||
pProcess(nullptr),
|
||||
isActive(true),
|
||||
idxProcessList(-1)
|
||||
{
|
||||
pProcess = 0;
|
||||
idxProcessList = -1;
|
||||
// clear
|
||||
for (G4int idx=0; idx<G4ProcessManager::SizeOfProcVectorArray; idx++){
|
||||
idxProcVector[idx] = -1;
|
||||
ordProcVector[idx] = -1;
|
||||
}
|
||||
}
|
||||
|
||||
// copy constructor //////////////////////////
|
||||
G4ProcessAttribute::G4ProcessAttribute(const G4ProcessAttribute &right)
|
||||
:isActive(true)
|
||||
G4ProcessAttribute::G4ProcessAttribute(const G4ProcessAttribute &right):
|
||||
pProcess(right.pProcess),
|
||||
isActive(right.isActive),
|
||||
idxProcessList(right.idxProcessList)
|
||||
{
|
||||
pProcess = right.pProcess;
|
||||
idxProcessList = right.idxProcessList;
|
||||
// copy all contents in idxProcVector[] and ordProcVector[]
|
||||
// deep copy
|
||||
for (G4int idx=0; idx<G4ProcessManager::SizeOfProcVectorArray; idx++){
|
||||
idxProcVector[idx] = right.idxProcVector[idx];
|
||||
ordProcVector[idx] = right.ordProcVector[idx];
|
||||
}
|
||||
isActive = right.isActive;
|
||||
}
|
||||
|
||||
G4ProcessAttribute::~G4ProcessAttribute()
|
||||
// destructor ///////////////////////
|
||||
G4ProcessAttribute::~G4ProcessAttribute()
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
// assignment operator //////////
|
||||
G4ProcessAttribute & G4ProcessAttribute::operator=(const G4ProcessAttribute &right)
|
||||
{
|
||||
if (this != &right) {
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ProcessManager.cc 107935 2017-12-14 09:04:59Z gcosmo $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
@@ -58,14 +57,16 @@ G4ThreadLocal G4int G4ProcessManager::counterOfObjects = 0;
|
||||
|
||||
// ///////////////////////////////////////
|
||||
G4ProcessManager::G4ProcessManager(const G4ParticleDefinition* aParticleType):
|
||||
theAttrVector(nullptr),
|
||||
theParticleType(aParticleType),
|
||||
numberOfProcesses(0),
|
||||
theProcessList(nullptr),
|
||||
duringTracking(false),
|
||||
verboseLevel(1)
|
||||
{
|
||||
// create the process List
|
||||
theProcessList = new G4ProcessVector();
|
||||
if ( theProcessList == 0) {
|
||||
if ( theProcessList == nullptr) {
|
||||
G4Exception( "G4ProcessManager::G4ProcessManager()","ProcMan012",
|
||||
FatalException, "Can not create G4ProcessList ");
|
||||
}
|
||||
@@ -73,7 +74,7 @@ G4ProcessManager::G4ProcessManager(const G4ParticleDefinition* aParticleType):
|
||||
//create process vector
|
||||
for (G4int i=0; i<SizeOfProcVectorArray; ++i) {
|
||||
theProcVector[i] = new G4ProcessVector();
|
||||
if ( theProcVector[i] == 0) {
|
||||
if ( theProcVector[i] == nullptr) {
|
||||
G4Exception( "G4ProcessManager::G4ProcessManager()","ProcMan012",
|
||||
FatalException, "Can not create G4ProcessVector ");
|
||||
}
|
||||
@@ -83,7 +84,7 @@ G4ProcessManager::G4ProcessManager(const G4ParticleDefinition* aParticleType):
|
||||
theAttrVector = new G4ProcessAttrVector();
|
||||
|
||||
// create Process Manager Messenger
|
||||
if (fProcessManagerMessenger == 0){
|
||||
if (fProcessManagerMessenger == nullptr){
|
||||
fProcessManagerMessenger = new G4ProcessManagerMessenger();
|
||||
}
|
||||
|
||||
@@ -97,9 +98,11 @@ G4ProcessManager::G4ProcessManager(const G4ParticleDefinition* aParticleType):
|
||||
}
|
||||
|
||||
// ///////////////////////////////////////
|
||||
G4ProcessManager::G4ProcessManager(G4ProcessManager &right)
|
||||
: theParticleType(right.theParticleType),
|
||||
G4ProcessManager::G4ProcessManager(G4ProcessManager &right):
|
||||
theAttrVector(nullptr),
|
||||
theParticleType(right.theParticleType),
|
||||
numberOfProcesses(0),
|
||||
theProcessList(nullptr),
|
||||
duringTracking(false),
|
||||
verboseLevel(right.verboseLevel)
|
||||
{
|
||||
@@ -112,7 +115,7 @@ G4ProcessManager::G4ProcessManager(G4ProcessManager &right)
|
||||
// create the process List and ProcessAttr Vector
|
||||
theProcessList = new G4ProcessVector();
|
||||
theAttrVector = new G4ProcessAttrVector();
|
||||
if ( ( theProcessList == 0) || (theAttrVector == 0) ){
|
||||
if ( ( theProcessList == nullptr) || (theAttrVector == nullptr) ){
|
||||
G4Exception( "G4ProcessManager::G4ProcessManager() [coopy constructor]",
|
||||
"ProcMan011",FatalException, "Can not create G4ProcessList ");
|
||||
}
|
||||
@@ -133,7 +136,7 @@ G4ProcessManager::G4ProcessManager(G4ProcessManager &right)
|
||||
for (G4int i=0; i<SizeOfProcVectorArray; ++i) {
|
||||
// create i-th ProcessVector in theProcVector
|
||||
theProcVector[i] = new G4ProcessVector();
|
||||
if ( theProcVector[i] == 0) {
|
||||
if ( theProcVector[i] == nullptr ) {
|
||||
G4Exception( "G4ProcessManager::G4ProcessManager() [coopy constructor]",
|
||||
"ProcMan011",FatalException, "Can not create G4ProcessVector ");
|
||||
}
|
||||
@@ -144,7 +147,7 @@ G4ProcessManager::G4ProcessManager(G4ProcessManager &right)
|
||||
// copy j-th process in i-th ProcessVector
|
||||
theProcVector[i]->insert((*src)[j]);
|
||||
//add aProcess and this ProcessManager into ProcesssTable
|
||||
if ( (*src)[j] !=0 ) {
|
||||
if ( (*src)[j] != nullptr ) {
|
||||
theProcessTable->Insert((*src)[j], this);
|
||||
}
|
||||
}
|
||||
@@ -161,21 +164,20 @@ G4ProcessManager::G4ProcessManager(G4ProcessManager &right)
|
||||
|
||||
// ///////////////////////////////////////
|
||||
G4ProcessManager::G4ProcessManager():
|
||||
theParticleType(0),
|
||||
theAttrVector(nullptr),
|
||||
theParticleType(nullptr),
|
||||
numberOfProcesses(0),
|
||||
theProcessList(nullptr),
|
||||
duringTracking(false),
|
||||
verboseLevel(1)
|
||||
{
|
||||
// clear the process List and ProcessAttr Vector
|
||||
theProcessList = 0;
|
||||
theAttrVector = 0;
|
||||
|
||||
G4Exception("G4ProcessManager::G4ProcessManager()","ProcMan111",
|
||||
JustWarning,"Default constructor is called");
|
||||
|
||||
//create process vector
|
||||
for (G4int i=0; i<SizeOfProcVectorArray; ++i) {
|
||||
theProcVector[i] = new G4ProcessVector();
|
||||
theProcVector[i] = nullptr;
|
||||
}
|
||||
|
||||
for (G4int i=0; i<NDoit; ++i) {
|
||||
@@ -187,10 +189,6 @@ G4ProcessManager::G4ProcessManager():
|
||||
// ///////////////////////////////////////
|
||||
G4ProcessManager & G4ProcessManager::operator=(const G4ProcessManager &)
|
||||
{
|
||||
// clear the process List and ProcessAttr Vector
|
||||
theProcessList = 0;
|
||||
theAttrVector = 0;
|
||||
|
||||
G4Exception("G4ProcessManager::operator=","ProcMan112",
|
||||
JustWarning,"Assignemnet operator is called");
|
||||
|
||||
@@ -220,9 +218,9 @@ G4ProcessManager::~G4ProcessManager()
|
||||
|
||||
// delete messenger if this object is last one
|
||||
if ( counterOfObjects == 0 ){
|
||||
if (fProcessManagerMessenger != 0){
|
||||
if (fProcessManagerMessenger != nullptr){
|
||||
delete fProcessManagerMessenger;
|
||||
fProcessManagerMessenger = 0;
|
||||
fProcessManagerMessenger = nullptr;
|
||||
#ifdef G4VERBOSE
|
||||
if (GetVerboseLevel() > 1) {
|
||||
G4cout << "G4ProcessManagerMessenger is deleted" << G4endl;
|
||||
@@ -281,17 +279,17 @@ G4ProcessAttribute* G4ProcessManager::GetAttribute(G4int index) const
|
||||
G4cout << " index [" << index << "]" << G4endl;
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// check process pointer is not 0
|
||||
// check process pointer is not null
|
||||
G4VProcess* aProcess = (*theProcessList)[index];
|
||||
if (aProcess == 0) {
|
||||
if (aProcess == nullptr) {
|
||||
G4String aErrorMessage("Bad ProcessList: Null Pointer for");
|
||||
aErrorMessage += theParticleType->GetParticleName() ;
|
||||
G4Exception("G4ProcessManager::GetAttribute()","ProcMan012",
|
||||
FatalException,aErrorMessage);
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//find the process attribute
|
||||
@@ -310,7 +308,7 @@ G4ProcessAttribute* G4ProcessManager::GetAttribute(G4int index) const
|
||||
}
|
||||
#endif
|
||||
// re-ordering attribute vector
|
||||
G4ProcessAttribute *pAttr = 0;
|
||||
G4ProcessAttribute *pAttr = nullptr;
|
||||
G4ProcessAttrVector::iterator itr;
|
||||
for (itr = theAttrVector->begin(); itr!= theAttrVector->end(); ++itr) {
|
||||
if ( (*itr)->idxProcessList == index) {
|
||||
@@ -341,7 +339,7 @@ G4int G4ProcessManager::InsertAt(G4int ip, G4VProcess* process, G4int ivec)
|
||||
//correct index in ProcessAttributes of processes
|
||||
for (G4int iproc=0; iproc<numberOfProcesses; iproc++) {
|
||||
G4ProcessAttribute* aAttr = (*theAttrVector)[iproc];
|
||||
if (aAttr != 0) {
|
||||
if (aAttr != nullptr) {
|
||||
if (aAttr->idxProcVector[ivec] >= ip){
|
||||
aAttr->idxProcVector[ivec] += 1;
|
||||
}
|
||||
@@ -369,7 +367,7 @@ G4int G4ProcessManager::RemoveAt(G4int ip, G4VProcess* , G4int ivec)
|
||||
// correct index
|
||||
for(G4int iproc=0; iproc<numberOfProcesses; iproc++) {
|
||||
G4ProcessAttribute* aAttr = (*theAttrVector)[iproc];
|
||||
if (aAttr != 0) {
|
||||
if (aAttr != nullptr) {
|
||||
if (ip < aAttr->idxProcVector[ivec]) {
|
||||
aAttr->idxProcVector[ivec] -=1;
|
||||
} else if (ip == aAttr->idxProcVector[ivec]) {
|
||||
@@ -518,7 +516,7 @@ G4VProcess* G4ProcessManager::RemoveProcess(G4int index)
|
||||
{
|
||||
//find the process attribute
|
||||
G4ProcessAttribute* pAttr = GetAttribute(index);
|
||||
if (pAttr == 0) return 0;
|
||||
if (pAttr == nullptr) return nullptr;
|
||||
|
||||
// remove process
|
||||
G4VProcess* removedProcess = (*theProcessList)[index];
|
||||
@@ -536,7 +534,7 @@ G4VProcess* G4ProcessManager::RemoveProcess(G4int index)
|
||||
anErrorMessage += "process[" + removedProcess->GetProcessName() + "] " ;
|
||||
G4Exception( "G4ProcessManager::RemoveProcess()","Fatal Error",
|
||||
FatalException,anErrorMessage);
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
} else if (idx<0) {
|
||||
// corresponding DoIt is not active
|
||||
@@ -547,7 +545,7 @@ G4VProcess* G4ProcessManager::RemoveProcess(G4int index)
|
||||
anErrorMessage += "process[" + removedProcess->GetProcessName() + "] " ;
|
||||
G4Exception( "G4ProcessManager::RemoveProcess()","ProcMan012",
|
||||
FatalException,anErrorMessage);
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
pAttr->isActive = false;
|
||||
@@ -595,7 +593,7 @@ G4int G4ProcessManager::GetProcessOrdering(
|
||||
if (ivec >=0 ) {
|
||||
// get attribute
|
||||
G4ProcessAttribute* pAttr = GetAttribute(aProcess);
|
||||
if (pAttr != 0) {
|
||||
if (pAttr != nullptr) {
|
||||
return pAttr->ordProcVector[ivec];
|
||||
}
|
||||
}
|
||||
@@ -638,7 +636,7 @@ void G4ProcessManager::SetProcessOrdering(
|
||||
if (ordDoIt>ordLast) ordDoIt=ordLast;
|
||||
// get attribute
|
||||
G4ProcessAttribute* pAttr = GetAttribute(aProcess);
|
||||
if (pAttr == 0) {
|
||||
if (pAttr == nullptr) {
|
||||
// can not get process attribute
|
||||
return;
|
||||
|
||||
@@ -705,7 +703,7 @@ void G4ProcessManager::SetProcessOrderingToFirst(
|
||||
|
||||
// get attribute
|
||||
G4ProcessAttribute* pAttr = GetAttribute(aProcess);
|
||||
if (pAttr == 0) {
|
||||
if (pAttr == nullptr) {
|
||||
return;
|
||||
} else {
|
||||
G4int ip = pAttr->idxProcVector[ivec];
|
||||
@@ -787,7 +785,7 @@ void G4ProcessManager::SetProcessOrderingToSecond(
|
||||
|
||||
// get attribute
|
||||
G4ProcessAttribute* pAttr = GetAttribute(aProcess);
|
||||
if (pAttr == 0) {
|
||||
if (pAttr == nullptr) {
|
||||
// can not get process attribute
|
||||
return;
|
||||
} else {
|
||||
@@ -881,12 +879,12 @@ G4VProcess* G4ProcessManager::InActivateProcess(G4int index)
|
||||
G4cout << "state !" << G4endl;
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//find the process attribute
|
||||
G4ProcessAttribute* pAttr = GetAttribute(index);
|
||||
if (pAttr == 0) return 0;
|
||||
if (pAttr == nullptr) return nullptr;
|
||||
|
||||
// remove process
|
||||
G4VProcess* pProcess = (*theProcessList)[index];
|
||||
@@ -905,14 +903,14 @@ G4VProcess* G4ProcessManager::InActivateProcess(G4int index)
|
||||
} else if ((idx >= 0) && (idx < pVector->entries())) {
|
||||
//check pointer and set to 0
|
||||
if ((*pVector)[idx]== pProcess) {
|
||||
(*pVector)[idx]= 0;
|
||||
(*pVector)[idx]= nullptr;
|
||||
} else {
|
||||
G4String anErrorMessage("Bad ProcessList: Bad index in attribute");
|
||||
anErrorMessage += "for particle[" + theParticleType->GetParticleName() + "] ";
|
||||
anErrorMessage += "process[" + pProcess->GetProcessName() + "] " ;
|
||||
G4Exception( "G4ProcessManager::InactivateProcess():","ProcMan012",
|
||||
FatalException,anErrorMessage);
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
} else {
|
||||
// idx is out of range
|
||||
@@ -921,7 +919,7 @@ G4VProcess* G4ProcessManager::InActivateProcess(G4int index)
|
||||
anErrorMessage += "process[" + pProcess->GetProcessName() + "] " ;
|
||||
G4Exception( "G4ProcessManager::InactivateProcess():","ProcMan012",
|
||||
FatalException,anErrorMessage);
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
pAttr->isActive = false;
|
||||
@@ -946,12 +944,12 @@ G4VProcess* G4ProcessManager::ActivateProcess(G4int index)
|
||||
G4cout << "state !" << G4endl;
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//find the process attribute
|
||||
G4ProcessAttribute* pAttr = GetAttribute(index);
|
||||
if (pAttr == 0) return 0;
|
||||
if (pAttr == nullptr) return nullptr;
|
||||
|
||||
// remove process
|
||||
G4VProcess* pProcess = (*theProcessList)[index];
|
||||
@@ -965,7 +963,7 @@ G4VProcess* G4ProcessManager::ActivateProcess(G4int index)
|
||||
// corresponding DoIt is not active
|
||||
} else if ((idx >= 0) && (idx < pVector->entries())) {
|
||||
//check pointer and set
|
||||
if ((*pVector)[idx]== 0) {
|
||||
if ((*pVector)[idx]== nullptr) {
|
||||
(*pVector)[idx] = pProcess;
|
||||
} else {
|
||||
G4String anErrorMessage("Bad ProcessList: Bad index in attribute");
|
||||
@@ -973,7 +971,7 @@ G4VProcess* G4ProcessManager::ActivateProcess(G4int index)
|
||||
anErrorMessage += "process[" + pProcess->GetProcessName() + "] " ;
|
||||
G4Exception( "G4ProcessManager::ActivateProcess():","ProcMan012",
|
||||
FatalException,anErrorMessage);
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
} else {
|
||||
// idx is out of range
|
||||
@@ -982,7 +980,7 @@ G4VProcess* G4ProcessManager::ActivateProcess(G4int index)
|
||||
anErrorMessage += "process[" + pProcess->GetProcessName() + "] " ;
|
||||
G4Exception("G4ProcessManager::ActivateProcess():","ProcMan012",
|
||||
FatalException,anErrorMessage);
|
||||
return 0;
|
||||
return nullptr;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1155,9 +1153,9 @@ G4VProcess* G4ProcessManager::GetProcess(const G4String& processName) const
|
||||
/////////////////////////////////////////////
|
||||
void G4ProcessManager::CheckOrderingParameters(G4VProcess* aProcess) const
|
||||
{
|
||||
if (aProcess==0) return;
|
||||
if (aProcess == nullptr) return;
|
||||
G4ProcessAttribute* pAttr = GetAttribute(aProcess);
|
||||
if (pAttr ==0) {
|
||||
if (pAttr == nullptr) {
|
||||
#ifdef G4VERBOSE
|
||||
if (GetVerboseLevel()>0) {
|
||||
G4cout << "G4ProcessManager::CheckOrderingParameters ";
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ProcessManagerMessenger.cc 108134 2018-01-09 13:29:12Z gcosmo $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
@@ -61,12 +60,12 @@
|
||||
|
||||
G4ProcessManagerMessenger::G4ProcessManagerMessenger(G4ParticleTable* pTable)
|
||||
:theParticleTable(pTable),
|
||||
currentParticle(0),
|
||||
currentProcess(0),
|
||||
theManager(0),
|
||||
theProcessList(0)
|
||||
currentParticle(nullptr),
|
||||
currentProcess(nullptr),
|
||||
theManager(nullptr),
|
||||
theProcessList(nullptr)
|
||||
{
|
||||
if ( theParticleTable == 0) theParticleTable = G4ParticleTable::GetParticleTable();
|
||||
if ( theParticleTable == nullptr) theParticleTable = G4ParticleTable::GetParticleTable();
|
||||
|
||||
//Commnad /particle/process
|
||||
thisDirectory = new G4UIdirectory("/particle/process/");
|
||||
@@ -129,8 +128,8 @@ G4ParticleDefinition* G4ProcessManagerMessenger::SetCurrentParticle()
|
||||
G4String particleName = G4UImanager::GetUIpointer()->GetCurrentStringValue("/particle/select");
|
||||
|
||||
currentParticle = theParticleTable->FindParticle(particleName);
|
||||
if (currentParticle == 0) {
|
||||
theManager = 0;
|
||||
if (currentParticle == nullptr) {
|
||||
theManager = nullptr;
|
||||
G4cout << "G4ProcessManagerMessenger::SetCurrentParticle() ";
|
||||
G4cout << particleName << " not found " << G4endl;
|
||||
} else {
|
||||
@@ -143,7 +142,7 @@ G4ParticleDefinition* G4ProcessManagerMessenger::SetCurrentParticle()
|
||||
void G4ProcessManagerMessenger::SetNewValue(G4UIcommand * command,G4String newValue)
|
||||
{
|
||||
G4ExceptionDescription ed;
|
||||
if (SetCurrentParticle()==0) {
|
||||
if (SetCurrentParticle()== nullptr) {
|
||||
ed << "Particle is not selected yet !! Command ignored.";
|
||||
command->CommandFailed(ed);
|
||||
return;
|
||||
@@ -155,7 +154,7 @@ void G4ProcessManagerMessenger::SetNewValue(G4UIcommand * command,G4String newVa
|
||||
theManager->DumpInfo();
|
||||
} else if ( index < theManager->GetProcessListLength()){
|
||||
currentProcess = (*theProcessList)(index);
|
||||
if (currentProcess == 0) {
|
||||
if (currentProcess == nullptr) {
|
||||
ed << " no process at index of " << index
|
||||
<< " in the Process Vector";
|
||||
command->CommandFailed(ed);
|
||||
@@ -165,7 +164,7 @@ void G4ProcessManagerMessenger::SetNewValue(G4UIcommand * command,G4String newVa
|
||||
} else {
|
||||
ed << " illegal index !!! ";
|
||||
command->CommandFailed(ed);
|
||||
currentProcess = 0;
|
||||
currentProcess = nullptr;
|
||||
}
|
||||
|
||||
} else if( command==activateCmd ) {
|
||||
@@ -190,7 +189,7 @@ void G4ProcessManagerMessenger::SetNewValue(G4UIcommand * command,G4String newVa
|
||||
|
||||
} else if ( index < theManager->GetProcessListLength()){
|
||||
currentProcess = (*theProcessList)(index);
|
||||
if (currentProcess == 0) {
|
||||
if (currentProcess == nullptr) {
|
||||
ed << " no process at index of " << index
|
||||
<< " in the Process Vector";
|
||||
command->CommandFailed(ed);
|
||||
@@ -200,7 +199,7 @@ void G4ProcessManagerMessenger::SetNewValue(G4UIcommand * command,G4String newVa
|
||||
} else {
|
||||
ed << " illegal index !!! ";
|
||||
command->CommandFailed(ed);
|
||||
currentProcess = 0;
|
||||
currentProcess = nullptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -208,7 +207,7 @@ void G4ProcessManagerMessenger::SetNewValue(G4UIcommand * command,G4String newVa
|
||||
|
||||
G4String G4ProcessManagerMessenger::GetCurrentValue(G4UIcommand * command)
|
||||
{
|
||||
if(SetCurrentParticle() == 0) return "";
|
||||
if(SetCurrentParticle() == nullptr) return "";
|
||||
|
||||
if( command==verboseCmd ){
|
||||
//Commnad /particle/process/Verbose
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ProcessTable.cc 91916 2015-08-11 07:03:22Z gcosmo $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
@@ -41,7 +40,8 @@
|
||||
#include "G4ProcessTable.hh"
|
||||
|
||||
// constructor //////////////////////////
|
||||
G4ProcessTable::G4ProcessTable():verboseLevel(1)
|
||||
G4ProcessTable::G4ProcessTable()
|
||||
:verboseLevel(1)
|
||||
{
|
||||
#ifdef G4VERBOSE
|
||||
if (verboseLevel>1){
|
||||
@@ -51,21 +51,19 @@ G4ProcessTable::G4ProcessTable():verboseLevel(1)
|
||||
fProcTblVector = new G4ProcTableVector();
|
||||
fProcNameVector = new G4ProcNameVector();
|
||||
tmpTblVector = new G4ProcTableVector();
|
||||
fProcTblMessenger = 0;
|
||||
fProcTblMessenger = nullptr;
|
||||
}
|
||||
|
||||
// copy constructor //////////////////////////
|
||||
G4ProcessTable::G4ProcessTable(const G4ProcessTable &)
|
||||
:verboseLevel(1)
|
||||
{
|
||||
fProcTblVector = 0;
|
||||
fProcNameVector = 0;
|
||||
tmpTblVector = 0;
|
||||
fProcTblMessenger = 0;
|
||||
fProcTblVector = nullptr;
|
||||
fProcNameVector = nullptr;
|
||||
tmpTblVector = nullptr;
|
||||
fProcTblMessenger = nullptr;
|
||||
#ifdef G4VERBOSE
|
||||
if (verboseLevel>0){
|
||||
G4cout << "-- G4ProcessTable copy constructor --" << G4endl;
|
||||
}
|
||||
G4cout << "-- G4ProcessTable copy constructor --" << G4endl;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -78,35 +76,35 @@ G4ProcessTable::~G4ProcessTable()
|
||||
}
|
||||
#endif
|
||||
|
||||
if ( tmpTblVector != 0) {
|
||||
if ( tmpTblVector != nullptr) {
|
||||
tmpTblVector ->clear();
|
||||
delete tmpTblVector;
|
||||
tmpTblVector = nullptr;
|
||||
}
|
||||
|
||||
if ( fProcTblVector != 0) {
|
||||
if ( fProcTblVector != nullptr) {
|
||||
G4ProcTableVector::iterator idx;
|
||||
|
||||
// destruction of processes has moved to G4VUserPhysicsList
|
||||
for (idx=fProcTblVector->begin(); idx!=fProcTblVector->end(); ++idx) {
|
||||
// delete all processes
|
||||
// delete (*idx)->GetProcess();
|
||||
delete (*idx);
|
||||
}
|
||||
fProcTblVector ->clear();
|
||||
delete fProcTblVector;
|
||||
fProcTblVector = nullptr;
|
||||
}
|
||||
|
||||
if ( fProcNameVector != 0) {
|
||||
if ( fProcNameVector != nullptr) {
|
||||
fProcNameVector ->clear();
|
||||
delete fProcNameVector;
|
||||
fProcNameVector = nullptr;
|
||||
}
|
||||
fProcessTable =0;
|
||||
fProcessTable = nullptr;
|
||||
}
|
||||
|
||||
/////////////////////////
|
||||
G4UImessenger* G4ProcessTable::CreateMessenger()
|
||||
{
|
||||
if (fProcTblMessenger == 0) {
|
||||
if (fProcTblMessenger == nullptr) {
|
||||
fProcTblMessenger = new G4ProcessTableMessenger(this);
|
||||
}
|
||||
return fProcTblMessenger;
|
||||
@@ -115,8 +113,9 @@ G4UImessenger* G4ProcessTable::CreateMessenger()
|
||||
/////////////////////////
|
||||
void G4ProcessTable::DeleteMessenger()
|
||||
{
|
||||
if (fProcTblMessenger != 0) {
|
||||
if (fProcTblMessenger != nullptr) {
|
||||
delete fProcTblMessenger;
|
||||
fProcTblMessenger = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -145,14 +144,18 @@ G4int G4ProcessTable::operator!=(const G4ProcessTable &right) const
|
||||
}
|
||||
|
||||
// Static class variable: ptr to single instance of class
|
||||
G4ThreadLocal G4ProcessTable* G4ProcessTable::fProcessTable =0;
|
||||
G4ThreadLocal G4ProcessTable* G4ProcessTable::fProcessTable = nullptr;
|
||||
|
||||
|
||||
//////////////////////////
|
||||
G4ProcessTable* G4ProcessTable::GetProcessTable()
|
||||
{
|
||||
static G4ThreadLocal G4ProcessTable *theProcessTable_G4MT_TLS_ = 0 ; if (!theProcessTable_G4MT_TLS_) theProcessTable_G4MT_TLS_ = new G4ProcessTable ; G4ProcessTable &theProcessTable = *theProcessTable_G4MT_TLS_;
|
||||
if (!fProcessTable){
|
||||
static G4ThreadLocal G4ProcessTable *theProcessTable_G4MT_TLS_ = nullptr ;
|
||||
if (theProcessTable_G4MT_TLS_ == nullptr) {
|
||||
theProcessTable_G4MT_TLS_ = new G4ProcessTable ;
|
||||
}
|
||||
G4ProcessTable &theProcessTable = *theProcessTable_G4MT_TLS_;
|
||||
if (fProcessTable == nullptr){
|
||||
fProcessTable = &theProcessTable;
|
||||
}
|
||||
return fProcessTable;
|
||||
@@ -162,7 +165,7 @@ G4ProcessTable* G4ProcessTable::GetProcessTable()
|
||||
G4int G4ProcessTable::Insert(G4VProcess* aProcess,
|
||||
G4ProcessManager* aProcMgr)
|
||||
{
|
||||
if ( (aProcess == 0) || ( aProcMgr == 0 ) ){
|
||||
if ( (aProcess == nullptr) || ( aProcMgr == nullptr ) ){
|
||||
#ifdef G4VERBOSE
|
||||
if (verboseLevel>0){
|
||||
G4cout << "G4ProcessTable::Insert : arguments are 0 pointer "
|
||||
@@ -183,7 +186,7 @@ G4int G4ProcessTable::Insert(G4VProcess* aProcess,
|
||||
|
||||
G4ProcTableVector::iterator itr;
|
||||
G4int idxTbl=0;
|
||||
G4ProcTblElement* anElement;
|
||||
G4ProcTblElement* anElement = nullptr;
|
||||
G4bool isFoundInTbl = false;
|
||||
// loop over all elements
|
||||
for (itr=fProcTblVector->begin(); itr!=fProcTblVector->end(); ++itr, ++idxTbl) {
|
||||
@@ -232,7 +235,7 @@ G4int G4ProcessTable::Insert(G4VProcess* aProcess,
|
||||
G4int G4ProcessTable::Remove( G4VProcess* aProcess,
|
||||
G4ProcessManager* aProcMgr)
|
||||
{
|
||||
if ( (aProcess == 0) || ( aProcMgr == 0 ) ){
|
||||
if ( (aProcess == nullptr) || ( aProcMgr == nullptr ) ){
|
||||
#ifdef G4VERBOSE
|
||||
if (verboseLevel>0){
|
||||
G4cout << "G4ProcessTable::Remove : arguments are 0 pointer "<< G4endl;
|
||||
@@ -251,7 +254,7 @@ G4int G4ProcessTable::Remove( G4VProcess* aProcess,
|
||||
|
||||
G4ProcTableVector::iterator itr;
|
||||
G4int idxTbl=0;
|
||||
G4ProcTblElement* anElement=0;
|
||||
G4ProcTblElement* anElement =nullptr;
|
||||
G4bool isFound = false;
|
||||
// loop over all elements
|
||||
for (itr=fProcTblVector->begin(); itr!=fProcTblVector->end(); ++itr, ++idxTbl) {
|
||||
@@ -319,7 +322,7 @@ G4VProcess* G4ProcessTable::FindProcess(const G4String& processName,
|
||||
G4ProcTableVector::iterator itr;
|
||||
G4int idxTbl = 0;
|
||||
G4bool isFound = false;
|
||||
G4ProcTblElement* anElement=0;
|
||||
G4ProcTblElement* anElement =nullptr;
|
||||
for (itr=fProcTblVector->begin(); itr!=fProcTblVector->end(); ++itr, ++idxTbl) {
|
||||
anElement = (*itr);
|
||||
// check name
|
||||
@@ -340,7 +343,7 @@ G4VProcess* G4ProcessTable::FindProcess(const G4String& processName,
|
||||
#endif
|
||||
|
||||
if (isFound) return anElement->GetProcess();
|
||||
else return 0;
|
||||
else return nullptr;
|
||||
}
|
||||
|
||||
///////////////
|
||||
@@ -352,7 +355,7 @@ G4ProcessTable::G4ProcTableVector* G4ProcessTable::Find(
|
||||
|
||||
G4ProcTableVector::iterator itr;
|
||||
G4bool isFound = false;
|
||||
G4ProcTblElement* anElement=0;
|
||||
G4ProcTblElement* anElement =nullptr;
|
||||
for (itr=fProcTblVector->begin(); itr!=fProcTblVector->end(); ++itr) {
|
||||
anElement = (*itr);
|
||||
// check name
|
||||
@@ -381,7 +384,7 @@ G4ProcessTable::G4ProcTableVector* G4ProcessTable::Find(
|
||||
|
||||
G4ProcTableVector::iterator itr;
|
||||
G4bool isFound = false;
|
||||
G4ProcTblElement* anElement=0;
|
||||
G4ProcTblElement* anElement =nullptr;
|
||||
for (itr=fProcTblVector->begin(); itr!=fProcTblVector->end(); ++itr) {
|
||||
anElement = (*itr);
|
||||
// check name
|
||||
@@ -488,7 +491,7 @@ void G4ProcessTable::SetProcessActivation(
|
||||
#endif
|
||||
|
||||
G4VProcess* process = FindProcess( processName, processManager);
|
||||
if ( process != 0) {
|
||||
if ( process != nullptr) {
|
||||
processManager->SetProcessActivation(process, fActive);
|
||||
#ifdef G4VERBOSE
|
||||
if (verboseLevel>1){
|
||||
@@ -572,15 +575,15 @@ void G4ProcessTable::DumpInfo(G4VProcess* process,
|
||||
{
|
||||
G4ProcTableVector::iterator itr;
|
||||
G4int idxTbl=0;
|
||||
G4ProcTblElement* anElement=0;
|
||||
G4ProcTblElement* anElement =nullptr;
|
||||
G4bool isFoundInTbl = false;
|
||||
G4ProcessManager* manager=0;
|
||||
G4ProcessManager* manager =nullptr;
|
||||
G4int idx;
|
||||
// loop over all elements
|
||||
for (itr=fProcTblVector->begin(); itr!=fProcTblVector->end(); ++itr, ++idxTbl) {
|
||||
anElement = (*itr);
|
||||
if (process == anElement->GetProcess() ){
|
||||
if (particle!=0) {
|
||||
if (particle != nullptr) {
|
||||
for (idx=0; idx<anElement->Length(); idx++){
|
||||
manager = anElement->GetProcessManager(idx);
|
||||
if (particle == manager->GetParticleType()) {
|
||||
@@ -600,7 +603,7 @@ void G4ProcessTable::DumpInfo(G4VProcess* process,
|
||||
process->SetVerboseLevel(verboseLevel);
|
||||
process->DumpInfo();
|
||||
process->SetVerboseLevel(tmpVerbose);
|
||||
if (particle==0) {
|
||||
if (particle == nullptr) {
|
||||
for (idx=0; idx<anElement->Length(); idx++){
|
||||
manager = anElement->GetProcessManager(idx);
|
||||
G4cout << " for " << manager->GetParticleType()->GetParticleName();
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ProcessTableMessenger.cc 108134 2018-01-09 13:29:12Z gcosmo $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
@@ -287,7 +286,7 @@ void G4ProcessTableMessenger::SetNewValue(G4UIcommand * command,G4String newValu
|
||||
// check 2nd argument
|
||||
currentParticleName = G4String(next());
|
||||
G4bool isParticleFound = false;
|
||||
G4ParticleDefinition* currentParticle = 0;
|
||||
G4ParticleDefinition* currentParticle = nullptr;
|
||||
if ( currentParticleName == "all" ) {
|
||||
isParticleFound = true;
|
||||
|
||||
@@ -325,7 +324,7 @@ void G4ProcessTableMessenger::SetNewValue(G4UIcommand * command,G4String newValu
|
||||
// process/activate , inactivate
|
||||
G4bool fActive = (command==activateCmd);
|
||||
if (isProcName) {
|
||||
if ( currentParticle == 0 ) {
|
||||
if ( currentParticle == nullptr ) {
|
||||
theProcessTable->SetProcessActivation(currentProcessName,
|
||||
fActive);
|
||||
} else {
|
||||
@@ -334,7 +333,7 @@ void G4ProcessTableMessenger::SetNewValue(G4UIcommand * command,G4String newValu
|
||||
fActive);
|
||||
}
|
||||
} else {
|
||||
if ( currentParticle == 0 ) {
|
||||
if ( currentParticle == nullptr ) {
|
||||
theProcessTable->SetProcessActivation(G4ProcessType(type),
|
||||
fActive);
|
||||
} else {
|
||||
@@ -403,8 +402,9 @@ void G4ProcessTableMessenger::SetNumberOfProcessType()
|
||||
if ( isFoundEndMark ) {
|
||||
NumberOfProcessType = idx;
|
||||
} else {
|
||||
G4Exception("G4ProcessTableMessenger::SetNumberOfProcessType()","ProcMan014",
|
||||
FatalException,"No End Mark");
|
||||
G4Exception("G4ProcessTableMessenger::SetNumberOfProcessType()",
|
||||
"ProcMan014",
|
||||
FatalException,"No End Mark");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ProcessVector.cc 71231 2013-06-12 13:06:28Z gcosmo $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
@@ -49,7 +48,7 @@ G4ProcessVector::G4ProcessVector(size_t siz)
|
||||
}
|
||||
|
||||
G4ProcessVector::G4ProcessVector(const G4ProcessVector& right)
|
||||
:pProcVector(0)
|
||||
:pProcVector(nullptr)
|
||||
{
|
||||
pProcVector = new G4ProcVector();
|
||||
|
||||
@@ -67,7 +66,7 @@ G4ProcessVector::~G4ProcessVector()
|
||||
{
|
||||
// delete pProcVector
|
||||
//
|
||||
if (pProcVector != 0 ){
|
||||
if (pProcVector != nullptr ){
|
||||
pProcVector->clear();
|
||||
delete pProcVector;
|
||||
}
|
||||
@@ -79,7 +78,7 @@ G4ProcessVector & G4ProcessVector::operator=(const G4ProcessVector & right)
|
||||
{
|
||||
if (this != &right){
|
||||
// delete pProcVector
|
||||
if (pProcVector != 0 ){
|
||||
if (pProcVector != nullptr ){
|
||||
pProcVector->clear();
|
||||
delete pProcVector;
|
||||
}
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VContinuousDiscreteProcess.cc 71231 2013-06-12 13:06:28Z gcosmo $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VContinuousProcess.cc 71231 2013-06-12 13:06:28Z gcosmo $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VDiscreteProcess.cc 71231 2013-06-12 13:06:28Z gcosmo $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VProcess.cc 105271 2017-07-18 07:35:12Z gcosmo $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
@@ -51,8 +50,8 @@
|
||||
#include "G4Log.hh"
|
||||
|
||||
G4VProcess::G4VProcess(const G4String& aName, G4ProcessType aType )
|
||||
: aProcessManager(0),
|
||||
pParticleChange(0),
|
||||
: aProcessManager(nullptr),
|
||||
pParticleChange(nullptr),
|
||||
theNumberOfInteractionLengthLeft(-1.0),
|
||||
currentInteractionLength(-1.0),
|
||||
theInitialNumberOfInteractionLength(-1.0),
|
||||
@@ -64,7 +63,7 @@ G4VProcess::G4VProcess(const G4String& aName, G4ProcessType aType )
|
||||
enableAlongStepDoIt(true),
|
||||
enablePostStepDoIt(true),
|
||||
verboseLevel(0),
|
||||
masterProcessShadow(0)
|
||||
masterProcessShadow(nullptr)
|
||||
|
||||
{
|
||||
pParticleChange = &aParticleChange;
|
||||
@@ -75,8 +74,8 @@ G4VProcess::~G4VProcess()
|
||||
}
|
||||
|
||||
G4VProcess::G4VProcess(const G4VProcess& right)
|
||||
: aProcessManager(0),
|
||||
pParticleChange(0),
|
||||
: aProcessManager(nullptr),
|
||||
pParticleChange(nullptr),
|
||||
theNumberOfInteractionLengthLeft(-1.0),
|
||||
currentInteractionLength(-1.0),
|
||||
theInitialNumberOfInteractionLength(-1.0),
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VRestContinuousDiscreteProcess.cc 71231 2013-06-12 13:06:28Z gcosmo $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VRestContinuousProcess.cc 71231 2013-06-12 13:06:28Z gcosmo $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VRestDiscreteProcess.cc 71231 2013-06-12 13:06:28Z gcosmo $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VRestProcess.cc 71231 2013-06-12 13:06:28Z gcosmo $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4WrapperProcess.cc 80787 2014-05-12 09:06:07Z gcosmo $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
@@ -38,7 +37,8 @@
|
||||
|
||||
G4WrapperProcess::G4WrapperProcess(const G4String& aName,
|
||||
G4ProcessType aType)
|
||||
: G4VProcess(aName,aType), pRegProcess((G4VProcess*)(0))
|
||||
: G4VProcess(aName,aType),
|
||||
pRegProcess(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ G4WrapperProcess::G4WrapperProcess(const G4WrapperProcess& right)
|
||||
|
||||
G4WrapperProcess::~G4WrapperProcess()
|
||||
{
|
||||
if (pRegProcess!=0) delete pRegProcess;
|
||||
if (pRegProcess!=nullptr) delete pRegProcess;
|
||||
}
|
||||
|
||||
void G4WrapperProcess::ResetNumberOfInteractionLengthLeft()
|
||||
|
||||
Reference in New Issue
Block a user