Import Geant4 1.1.0 source tree
This commit is contained in:
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4ProcessManager.cc,v 1.10.4.1 1999/12/07 20:52:48 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
// $Id: G4ProcessManager.cc,v 1.10.4.1.2.5 1999/12/14 09:16:49 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-01 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
@@ -26,15 +26,11 @@
|
||||
#include "G4ProcessManagerMessenger.hh"
|
||||
#include "G4ProcessManager.hh"
|
||||
#include "G4StateManager.hh"
|
||||
#include <iomanip.h>
|
||||
#include "g4std/iomanip"
|
||||
#include "G4ProcessTable.hh"
|
||||
#include "G4ios.hh"
|
||||
|
||||
#ifdef WIN32
|
||||
# include <Strstrea.h>
|
||||
#else
|
||||
# include <strstream.h>
|
||||
#endif
|
||||
#include "g4std/strstream"
|
||||
|
||||
|
||||
|
||||
@@ -51,12 +47,12 @@ G4ProcessManager::G4ProcessManager(const G4ParticleDefinition* aParticleType):
|
||||
verboseLevel(1)
|
||||
{
|
||||
char errMsg[1024];
|
||||
ostrstream errOs(errMsg,1024);
|
||||
G4std::ostrstream errOs(errMsg,1024);
|
||||
// create the process List
|
||||
theProcessList = new G4ProcessVector();
|
||||
if ( theProcessList == 0) {
|
||||
errOs << "G4ProcessManager::G4ProcessManager():";
|
||||
errOs << " can not create G4ProcessVector " << endl;
|
||||
errOs << " can not create G4ProcessVector " << G4endl;
|
||||
G4Exception(errMsg);
|
||||
}
|
||||
|
||||
@@ -65,7 +61,7 @@ G4ProcessManager::G4ProcessManager(const G4ParticleDefinition* aParticleType):
|
||||
theProcVector[i] = new G4ProcessVector();
|
||||
if ( theProcVector[i] == 0) {
|
||||
errOs << "G4ProcessManager::G4ProcessManager():";
|
||||
errOs << " can not create G4ProcessVector " << endl;
|
||||
errOs << " can not create G4ProcessVector " << G4endl;
|
||||
G4Exception(errMsg);
|
||||
}
|
||||
}
|
||||
@@ -89,7 +85,7 @@ G4ProcessManager::G4ProcessManager(G4ProcessManager &right)
|
||||
verboseLevel = right.verboseLevel;
|
||||
#ifdef G4VERBOSE
|
||||
if (GetVerboseLevel() > 2) {
|
||||
G4cout << "G4ProcessManagerMessenger:: copy constructor " <<endl;
|
||||
G4cout << "G4ProcessManagerMessenger:: copy constructor " <<G4endl;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -140,7 +136,7 @@ G4ProcessManager::G4ProcessManager():
|
||||
numberOfProcesses(0)
|
||||
{
|
||||
if (GetVerboseLevel()>0) {
|
||||
G4cout << "G4ProcessManager: default constructor is called !!" <<endl;
|
||||
G4cout << "G4ProcessManager: default constructor is called !!" <<G4endl;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -175,7 +171,7 @@ G4ProcessManager::~G4ProcessManager()
|
||||
fProcessManagerMessenger = 0;
|
||||
#ifdef G4VERBOSE
|
||||
if (GetVerboseLevel() > 1) {
|
||||
G4cout << "G4ProcessManagerMessenger is deleted" << endl;
|
||||
G4cout << "G4ProcessManagerMessenger is deleted" << G4endl;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -200,14 +196,14 @@ G4int G4ProcessManager::GetProcessVectorIndex(
|
||||
G4cout << " G4ProcessManager::GetProcessVectorIndex:";
|
||||
G4cout << "particle[" << theParticleType->GetParticleName() << "] " ;
|
||||
G4cout << "process[" << aProcess->GetProcessName() << "]" ;
|
||||
G4cout << endl;
|
||||
G4cout << G4endl;
|
||||
if (idxProc <0) {
|
||||
G4cout << " is not registered yet ";
|
||||
}
|
||||
if (ivec <0) {
|
||||
G4cout << " illegal DoIt Index [= " << idx << "," << typ << "]";
|
||||
}
|
||||
G4cout << endl;
|
||||
G4cout << G4endl;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -223,10 +219,10 @@ G4ProcessAttribute* G4ProcessManager::GetAttribute(G4int index) const
|
||||
if (GetVerboseLevel()>0) {
|
||||
G4cout << "G4ProcessManager::GetAttribute():";
|
||||
G4cout << " particle[" << theParticleType->GetParticleName() << "]";
|
||||
G4cout << endl;
|
||||
G4cout << " index out of range " << endl;
|
||||
G4cout << G4endl;
|
||||
G4cout << " index out of range " << G4endl;
|
||||
G4cout << " #processes[" << numberOfProcesses << "]";
|
||||
G4cout << " index [" << index << "]" << endl;
|
||||
G4cout << " index [" << index << "]" << G4endl;
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
@@ -251,8 +247,8 @@ G4ProcessAttribute* G4ProcessManager::GetAttribute(G4int index) const
|
||||
if (GetVerboseLevel()>0) {
|
||||
G4cout << "G4ProcessManager::GetAttribute():";
|
||||
G4cout << " particle[" << theParticleType->GetParticleName() << "]";
|
||||
G4cout << endl;
|
||||
G4cout << "Warning:: attribute vector index is inconsistent with process List index" << endl;
|
||||
G4cout << G4endl;
|
||||
G4cout << "Warning:: attribute vector index is inconsistent with process List index" << G4endl;
|
||||
}
|
||||
#endif
|
||||
// re-ordering attribute vector
|
||||
@@ -293,7 +289,7 @@ G4int G4ProcessManager::InsertAt(G4int ip, G4VProcess* process, G4int ivec)
|
||||
} else {
|
||||
#ifdef G4VERBOSE
|
||||
if (GetVerboseLevel()>0) {
|
||||
G4cout << " G4ProcessManager::InsertAt : No Process Attribute " << endl;
|
||||
G4cout << " G4ProcessManager::InsertAt : No Process Attribute " << G4endl;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -328,7 +324,7 @@ G4int G4ProcessManager::RemoveAt(G4int ip, G4VProcess* process, G4int ivec)
|
||||
}else {
|
||||
#ifdef G4VERBOSE
|
||||
if (GetVerboseLevel()>0) {
|
||||
G4cout << " G4ProcessManager::RemoveAt : No Process Attribute " << endl;
|
||||
G4cout << " G4ProcessManager::RemoveAt : No Process Attribute " << G4endl;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -370,8 +366,8 @@ G4int G4ProcessManager::AddProcess(
|
||||
if ( !aProcess->IsApplicable(*theParticleType) ) {
|
||||
#ifdef G4VERBOSE
|
||||
if (GetVerboseLevel()>1) {
|
||||
G4cout << aErrorMessage << endl;
|
||||
G4cout << "This process is not applicable to this particle" << endl;
|
||||
G4cout << aErrorMessage << G4endl;
|
||||
G4cout << "This process is not applicable to this particle" << G4endl;
|
||||
}
|
||||
#endif
|
||||
// G4Exception((const char*)aErrorMessage);
|
||||
@@ -380,7 +376,7 @@ G4int G4ProcessManager::AddProcess(
|
||||
|
||||
#ifdef G4VERBOSE
|
||||
if (GetVerboseLevel()>2) {
|
||||
G4cout << aErrorMessage << endl;
|
||||
G4cout << aErrorMessage << G4endl;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -435,11 +431,11 @@ G4int G4ProcessManager::AddProcess(
|
||||
|
||||
#ifdef G4VERBOSE
|
||||
if (verboseLevel>2) {
|
||||
G4cout << aErrorMessage << endl;
|
||||
G4cout << aErrorMessage << G4endl;
|
||||
G4cout << aProcess->GetProcessName() << " is inserted at "<< ip;
|
||||
G4cout << " in ProcessVetor[" << ivec<< "]";
|
||||
G4cout << " with Ordering parameter = " ;
|
||||
G4cout << pAttr->ordProcVector[ivec] << endl;
|
||||
G4cout << pAttr->ordProcVector[ivec] << G4endl;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -482,7 +478,7 @@ G4VProcess* G4ProcessManager::RemoveProcess(G4int index)
|
||||
G4cerr << "particle["<<theParticleType->GetParticleName()<<"] " ;
|
||||
G4cerr << "process["<<removedProcess->GetProcessName()<< "] " ;
|
||||
G4cerr << "bad index in attribute ";
|
||||
G4cerr << idx << "->" << pVector->index(removedProcess) << endl;
|
||||
G4cerr << idx << "->" << pVector->index(removedProcess) << G4endl;
|
||||
}
|
||||
#endif
|
||||
G4Exception((const char*)(aErrorMessage));
|
||||
@@ -498,7 +494,7 @@ G4VProcess* G4ProcessManager::RemoveProcess(G4int index)
|
||||
G4cerr << "particle["<<theParticleType->GetParticleName()<<"] " ;
|
||||
G4cerr << "process["<<removedProcess->GetProcessName()<< "] " ;
|
||||
G4cerr << "index(=" << idx << ") of process vector";
|
||||
G4cerr << "[size:" << pVector->entries() << "] out of range" <<endl;
|
||||
G4cerr << "[size:" << pVector->entries() << "] out of range" <<G4endl;
|
||||
}
|
||||
#endif
|
||||
G4Exception((const char*)(aErrorMessage));
|
||||
@@ -549,7 +545,7 @@ G4int G4ProcessManager::GetProcessOrdering(
|
||||
if (verboseLevel>0) {
|
||||
G4cout << "G4ProcessManager::SetProcessOrdering: ";
|
||||
G4cout << " illegal DoIt Index [= " << idDoIt << "]";
|
||||
G4cout << endl;
|
||||
G4cout << G4endl;
|
||||
}
|
||||
#endif
|
||||
return -1;
|
||||
@@ -579,7 +575,7 @@ void G4ProcessManager::SetProcessOrdering(
|
||||
if (GetVerboseLevel()>2) {
|
||||
G4cout << aErrorMessage ;
|
||||
G4cout << "particle[" + theParticleType->GetParticleName() +"] " ;
|
||||
G4cout <<"process[" + aProcess->GetProcessName() + "]"<< endl;
|
||||
G4cout <<"process[" + aProcess->GetProcessName() + "]"<< G4endl;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -588,11 +584,11 @@ void G4ProcessManager::SetProcessOrdering(
|
||||
if (ivec <0 ) {
|
||||
#ifdef G4VERBOSE
|
||||
if (verboseLevel>0) {
|
||||
G4cout << aErrorMessage << endl;
|
||||
G4cout << aErrorMessage << G4endl;
|
||||
G4cout << "particle[" + theParticleType->GetParticleName() +"] " ;
|
||||
G4cout << "process[" + aProcess->GetProcessName() + "]"<< endl;
|
||||
G4cout << "process[" + aProcess->GetProcessName() + "]"<< G4endl;
|
||||
G4cout << " illegal DoIt Index [= " << idDoIt << "]";
|
||||
G4cout << endl;
|
||||
G4cout << G4endl;
|
||||
}
|
||||
#endif
|
||||
return;
|
||||
@@ -626,13 +622,13 @@ void G4ProcessManager::SetProcessOrdering(
|
||||
pAttr->idxProcVector[ivec] = ip;
|
||||
#ifdef G4VERBOSE
|
||||
if (verboseLevel>2) {
|
||||
G4cout << aErrorMessage << endl;
|
||||
G4cout << aErrorMessage << G4endl;
|
||||
G4cout << "particle[" + theParticleType->GetParticleName() +"] " ;
|
||||
G4cout <<"process[" + aProcess->GetProcessName() + "]"<< endl;
|
||||
G4cout <<"process[" + aProcess->GetProcessName() + "]"<< G4endl;
|
||||
G4cout << aProcess->GetProcessName() << " is inserted at "<< ip;
|
||||
G4cout << " in ProcessVetor[" << ivec<< "]";
|
||||
G4cout << " with Ordering parameter = " << ordDoIt ;
|
||||
G4cout << endl;
|
||||
G4cout << G4endl;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -656,7 +652,7 @@ void G4ProcessManager::SetProcessOrderingToFirst(
|
||||
if (verboseLevel>0) {
|
||||
G4cout << "G4ProcessManager::SetProcessOrdering: ";
|
||||
G4cout << " illegal DoIt Index [= " << idDoIt << "]";
|
||||
G4cout << endl;
|
||||
G4cout << G4endl;
|
||||
}
|
||||
#endif
|
||||
return;
|
||||
@@ -689,7 +685,7 @@ void G4ProcessManager::SetProcessOrderingToFirst(
|
||||
G4cout << "G4ProcessManager::SetProcessOrdering: ";
|
||||
G4cout << aProcess->GetProcessName() << " is inserted at top ";
|
||||
G4cout << " in ProcessVetor[" << ivec<< "]";
|
||||
G4cout << endl;
|
||||
G4cout << G4endl;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -722,7 +718,7 @@ G4VProcess* G4ProcessManager::InActivateProcess(G4int index)
|
||||
} else if (currentState == Init ) {
|
||||
G4cout << "Init ";
|
||||
}
|
||||
G4cout << "state !" << endl;
|
||||
G4cout << "state !" << G4endl;
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
@@ -757,7 +753,7 @@ G4VProcess* G4ProcessManager::InActivateProcess(G4int index)
|
||||
G4cerr << "particle["<<theParticleType->GetParticleName()<<"] " ;
|
||||
G4cerr << "process["<<pProcess->GetProcessName()<<"] " ;
|
||||
G4cerr << "bad index in attribute ";
|
||||
G4cerr << idx << "->" << pVector->index(pProcess) << endl;
|
||||
G4cerr << idx << "->" << pVector->index(pProcess) << G4endl;
|
||||
}
|
||||
#endif
|
||||
G4Exception((const char*)aErrorMessage);
|
||||
@@ -771,7 +767,7 @@ G4VProcess* G4ProcessManager::InActivateProcess(G4int index)
|
||||
G4cerr << "particle["<<theParticleType->GetParticleName()<<"] " ;
|
||||
G4cerr << "process["<<pProcess->GetProcessName()<<"] " ;
|
||||
G4cerr << "index(=" << idx << ") of process vector";
|
||||
G4cerr << "[size:" << pVector->entries() << "] out of range" << endl;
|
||||
G4cerr << "[size:" << pVector->entries() << "] out of range" << G4endl;
|
||||
}
|
||||
#endif
|
||||
G4Exception((const char*)aErrorMessage);
|
||||
@@ -786,7 +782,7 @@ G4VProcess* G4ProcessManager::InActivateProcess(G4int index)
|
||||
G4cout << aErrorMessage;
|
||||
G4cout << "particle["<<theParticleType->GetParticleName()<<"] " ;
|
||||
G4cout << "process["<<pProcess->GetProcessName()<<"] " ;
|
||||
G4cout << "The process is already inactive" << endl;
|
||||
G4cout << "The process is already inactive" << G4endl;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -807,7 +803,7 @@ G4VProcess* G4ProcessManager::ActivateProcess(G4int index)
|
||||
} else if (currentState == Init ) {
|
||||
G4cout << "Init ";
|
||||
}
|
||||
G4cout << "state !" << endl;
|
||||
G4cout << "state !" << G4endl;
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
@@ -825,8 +821,8 @@ G4VProcess* G4ProcessManager::ActivateProcess(G4int index)
|
||||
if (pAttr->isActive) {
|
||||
#ifdef G4VERBOSE
|
||||
if (GetVerboseLevel()>0) {
|
||||
G4cout << aErrorMessage << endl;
|
||||
G4cout << "The process is already active" << endl;
|
||||
G4cout << aErrorMessage << G4endl;
|
||||
G4cout << "The process is already active" << G4endl;
|
||||
}
|
||||
#endif
|
||||
} else {
|
||||
@@ -847,7 +843,7 @@ G4VProcess* G4ProcessManager::ActivateProcess(G4int index)
|
||||
G4cerr << "particle["<<theParticleType->GetParticleName()<<"] " ;
|
||||
G4cerr << "process["<<pProcess->GetProcessName()<<"] " ;
|
||||
G4cerr << "bad index in attribute " << idx << "->";
|
||||
G4cerr << pVector->index(pProcess) << endl;
|
||||
G4cerr << pVector->index(pProcess) << G4endl;
|
||||
}
|
||||
#endif
|
||||
G4Exception((const char*)aErrorMessage);
|
||||
@@ -861,7 +857,7 @@ G4VProcess* G4ProcessManager::ActivateProcess(G4int index)
|
||||
G4cerr << "particle["<<theParticleType->GetParticleName()<<"] " ;
|
||||
G4cerr << "process["<<pProcess->GetProcessName()<<"] " ;
|
||||
G4cerr << "index(=" << idx <<")of process vector";
|
||||
G4cerr << "[size:" << pVector->entries() << "] out of range" << endl;
|
||||
G4cerr << "[size:" << pVector->entries() << "] out of range" << G4endl;
|
||||
}
|
||||
#endif
|
||||
G4Exception((const char*)aErrorMessage);
|
||||
@@ -893,7 +889,7 @@ void G4ProcessManager::DumpInfo()
|
||||
// particle type
|
||||
G4String* aMessage = new G4String("G4ProcessManager:");
|
||||
*aMessage += "particle[" + theParticleType->GetParticleName() + "]";
|
||||
G4cout << *aMessage << endl;
|
||||
G4cout << *aMessage << G4endl;
|
||||
delete aMessage;
|
||||
|
||||
// loop over all processes
|
||||
@@ -911,28 +907,28 @@ void G4ProcessManager::DumpInfo()
|
||||
} else {
|
||||
G4cout << " InActive ";
|
||||
}
|
||||
G4cout << endl;
|
||||
G4cout << G4endl;
|
||||
|
||||
#ifdef G4VERBOSE
|
||||
if (verboseLevel>0) {
|
||||
// order parameter
|
||||
G4cout << " Ordering:: ";
|
||||
G4cout << " AtRest AlongStep PostStep ";
|
||||
G4cout << endl;
|
||||
G4cout << G4endl;
|
||||
G4cout << " ";
|
||||
G4cout << " GetPIL/ DoIt GetPIL/ DoIt GetPIL/ DoIt ";
|
||||
G4cout << endl;
|
||||
G4cout << " Ordering:: " << endl;
|
||||
G4cout << G4endl;
|
||||
G4cout << " Ordering:: " << G4endl;
|
||||
G4cout << " index ";
|
||||
for (G4int idx2 = 0; idx2 <6 ; idx2++) {
|
||||
G4cout << setw(8) << pAttr->idxProcVector[idx2] <<":";
|
||||
G4cout << G4std::setw(8) << pAttr->idxProcVector[idx2] <<":";
|
||||
}
|
||||
G4cout << endl;
|
||||
G4cout << G4endl;
|
||||
G4cout << " parameter ";
|
||||
for (G4int idx3 = 0; idx3 <6 ; idx3++) {
|
||||
G4cout << setw(8) << pAttr->ordProcVector[idx3] <<":";
|
||||
G4cout << G4std::setw(8) << pAttr->ordProcVector[idx3] <<":";
|
||||
}
|
||||
G4cout << endl;
|
||||
G4cout << G4endl;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user