Import Geant4 10.7.0.beta source tree
This commit is contained in:
@@ -27,23 +27,24 @@
|
||||
|
||||
namespace
|
||||
{
|
||||
G4PhysicsListWorkspace::pool_type thePool;
|
||||
G4PhysicsListWorkspace::pool_type thePool;
|
||||
}
|
||||
|
||||
G4PhysicsListWorkspace::pool_type*
|
||||
G4PhysicsListWorkspace::GetPool() { return &thePool; }
|
||||
G4PhysicsListWorkspace::pool_type* G4PhysicsListWorkspace::GetPool()
|
||||
{
|
||||
return &thePool;
|
||||
}
|
||||
|
||||
G4PhysicsListWorkspace::G4PhysicsListWorkspace(G4bool verbose)
|
||||
: fVerbose(verbose)
|
||||
: fVerbose(verbose)
|
||||
{
|
||||
|
||||
fpVUPLSIM =
|
||||
&const_cast<G4VUPLManager&>(G4VUserPhysicsList::GetSubInstanceManager());
|
||||
fpVPCSIM =
|
||||
&const_cast<G4VPCManager&>(G4VPhysicsConstructor::GetSubInstanceManager());
|
||||
fpVMPLSIM =
|
||||
&const_cast<G4VMPLManager&>(G4VModularPhysicsList::GetSubInstanceManager());
|
||||
|
||||
|
||||
// Copy information from master into PolyCone/Gon Sides in this thread.
|
||||
InitialiseWorkspace();
|
||||
|
||||
@@ -53,65 +54,59 @@ G4PhysicsListWorkspace::G4PhysicsListWorkspace(G4bool verbose)
|
||||
fpVMPLOffset = fpVMPLSIM->GetOffset();
|
||||
}
|
||||
|
||||
G4PhysicsListWorkspace::~G4PhysicsListWorkspace()
|
||||
{
|
||||
}
|
||||
G4PhysicsListWorkspace::~G4PhysicsListWorkspace() {}
|
||||
|
||||
void
|
||||
G4PhysicsListWorkspace::UseWorkspace()
|
||||
void G4PhysicsListWorkspace::UseWorkspace()
|
||||
{
|
||||
if( fVerbose )
|
||||
G4cout << "G4PhysicsListWorkspace::UseWorkspace: "
|
||||
<< "Copying particles-definition Split-Class - Start " << G4endl;
|
||||
if(fVerbose)
|
||||
G4cout << "G4PhysicsListWorkspace::UseWorkspace: "
|
||||
<< "Copying particles-definition Split-Class - Start " << G4endl;
|
||||
|
||||
// Implementation copied from
|
||||
// G4WorkerThread::BuildGeometryAndPhysicsVector()
|
||||
|
||||
// Physics List related, split classes mechanism:
|
||||
// instantiate sub-instance for this thread
|
||||
fpVUPLSIM->UseWorkArea(fpVUPLOffset);
|
||||
fpVPCSIM->UseWorkArea(fpVPCOffset);
|
||||
fpVMPLSIM->UseWorkArea(fpVMPLOffset);
|
||||
// Implementation copied from
|
||||
// G4WorkerThread::BuildGeometryAndPhysicsVector()
|
||||
|
||||
// Physics List related, split classes mechanism:
|
||||
// instantiate sub-instance for this thread
|
||||
fpVUPLSIM->UseWorkArea(fpVUPLOffset);
|
||||
fpVPCSIM->UseWorkArea(fpVPCOffset);
|
||||
fpVMPLSIM->UseWorkArea(fpVMPLOffset);
|
||||
}
|
||||
|
||||
void G4PhysicsListWorkspace::ReleaseWorkspace()
|
||||
{
|
||||
fpVUPLSIM->UseWorkArea(0);
|
||||
fpVPCSIM->UseWorkArea(0);
|
||||
fpVMPLSIM->UseWorkArea(0);
|
||||
fpVUPLSIM->UseWorkArea(0);
|
||||
fpVPCSIM->UseWorkArea(0);
|
||||
fpVMPLSIM->UseWorkArea(0);
|
||||
}
|
||||
|
||||
void G4PhysicsListWorkspace::InitialisePhysicsList()
|
||||
{
|
||||
}
|
||||
void G4PhysicsListWorkspace::InitialisePhysicsList() {}
|
||||
|
||||
void
|
||||
G4PhysicsListWorkspace::InitialiseWorkspace()
|
||||
void G4PhysicsListWorkspace::InitialiseWorkspace()
|
||||
{
|
||||
if( fVerbose )
|
||||
G4cout << "G4PhysicsListWorkspace::InitialiseWorkspace: "
|
||||
<< "Copying particles-definition Split-Class - Start " << G4endl;
|
||||
|
||||
// PhysicsList related, split classes mechanism:
|
||||
// Do *NOT* instantiate sub-instance for this thread,
|
||||
// just copy the contents !!
|
||||
fpVUPLSIM->NewSubInstances();
|
||||
fpVPCSIM->NewSubInstances();
|
||||
// The following line is fundamental! If we call NewSubInstances it will not work
|
||||
// See: https://jira-geant4.kek.jp/browse/DEV-284
|
||||
fpVMPLSIM->WorkerCopySubInstanceArray();
|
||||
if(fVerbose)
|
||||
G4cout << "G4PhysicsListWorkspace::InitialiseWorkspace: "
|
||||
<< "Copying particles-definition Split-Class - Start " << G4endl;
|
||||
|
||||
// Additional initialization if needed - beyond copying memory
|
||||
InitialisePhysicsList();
|
||||
|
||||
if( fVerbose )
|
||||
G4cout << "G4PhysicsListWorkspace::CreateAndUseWorkspace: "
|
||||
<< "Copying particles-definition Split-Class - Done!" << G4endl;
|
||||
// PhysicsList related, split classes mechanism:
|
||||
// Do *NOT* instantiate sub-instance for this thread,
|
||||
// just copy the contents !!
|
||||
fpVUPLSIM->NewSubInstances();
|
||||
fpVPCSIM->NewSubInstances();
|
||||
// The following line is fundamental! If we call NewSubInstances it will not
|
||||
// work See: https://jira-geant4.kek.jp/browse/DEV-284
|
||||
fpVMPLSIM->WorkerCopySubInstanceArray();
|
||||
|
||||
// Additional initialization if needed - beyond copying memory
|
||||
InitialisePhysicsList();
|
||||
|
||||
if(fVerbose)
|
||||
G4cout << "G4PhysicsListWorkspace::CreateAndUseWorkspace: "
|
||||
<< "Copying particles-definition Split-Class - Done!" << G4endl;
|
||||
}
|
||||
|
||||
void G4PhysicsListWorkspace::DestroyWorkspace()
|
||||
{
|
||||
fpVUPLSIM->FreeWorker();
|
||||
fpVPCSIM->FreeWorker();
|
||||
fpVMPLSIM->FreeWorker();
|
||||
fpVUPLSIM->FreeWorker();
|
||||
fpVPCSIM->FreeWorker();
|
||||
fpVMPLSIM->FreeWorker();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user