Import Geant4 10.3.0 source tree
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4AdjointPrimaryGeneratorAction.cc 97327 2016-06-01 14:24:40Z gcosmo $
|
||||
// $Id: G4AdjointPrimaryGeneratorAction.cc 98735 2016-08-09 10:54:06Z gcosmo $
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Class Name: G4AdjointPrimaryGeneratorAction
|
||||
@@ -62,6 +62,9 @@ G4AdjointPrimaryGeneratorAction::G4AdjointPrimaryGeneratorAction()
|
||||
ListOfPrimaryFwdParticles.clear();
|
||||
ListOfPrimaryAdjParticles.clear();
|
||||
nb_fwd_gammas_per_event = 1;
|
||||
nb_adj_primary_gammas_per_event = 1;
|
||||
nb_adj_primary_electrons_per_event = 1;
|
||||
|
||||
}
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
@@ -92,6 +95,7 @@ void G4AdjointPrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
|
||||
E1=EminIon*A;
|
||||
E2=EmaxIon*A;
|
||||
}
|
||||
//Generate first the forwrad primaries
|
||||
theAdjointPrimaryGenerator->GenerateFwdPrimaryVertex(anEvent,ListOfPrimaryFwdParticles[index_particle],E1,E2);
|
||||
G4PrimaryVertex* fwdPrimVertex = anEvent->GetPrimaryVertex();
|
||||
|
||||
@@ -135,7 +139,7 @@ void G4AdjointPrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//Now generate the adjoint primaries
|
||||
G4PrimaryVertex* adjPrimVertex = new G4PrimaryVertex();
|
||||
adjPrimVertex->SetPosition(pos.x(),pos.y(),pos.z());
|
||||
adjPrimVertex->SetT0(0.);
|
||||
@@ -149,13 +153,39 @@ void G4AdjointPrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
|
||||
G4double adjoint_source_area = G4AdjointSimManager::GetInstance()->GetAdjointSourceArea();
|
||||
G4double adjoint_weight = weight_correction*ComputeEnergyDistWeight(ekin,E1,E2)*adjoint_source_area*pi;
|
||||
//if (ListOfPrimaryFwdParticles[index_particle] ==G4Gamma::Gamma()) adjoint_weight = adjoint_weight/3.;
|
||||
if (ListOfPrimaryAdjParticles[index_particle]->GetParticleName() == "adj_gamma") {
|
||||
//The weight will be corrected at the end of the track if splitted tracks are used
|
||||
adjoint_weight = adjoint_weight/nb_adj_primary_gammas_per_event;
|
||||
for (int i=0;i<nb_adj_primary_gammas_per_event-1;i++){
|
||||
G4PrimaryVertex* newAdjPrimVertex = new G4PrimaryVertex();
|
||||
newAdjPrimVertex->SetPosition(pos.x(),pos.y(),pos.z());
|
||||
newAdjPrimVertex->SetT0(0.);
|
||||
aPrimParticle = new G4PrimaryParticle(ListOfPrimaryAdjParticles[index_particle],
|
||||
-p.x(),-p.y(),-p.z());
|
||||
newAdjPrimVertex->SetPrimary(aPrimParticle);
|
||||
newAdjPrimVertex->SetWeight(adjoint_weight);
|
||||
anEvent->AddPrimaryVertex(newAdjPrimVertex);
|
||||
}
|
||||
}
|
||||
else if (ListOfPrimaryAdjParticles[index_particle]->GetParticleName() == "adj_electron") {
|
||||
//The weight will be corrected at the end of the track if splitted tracks are used
|
||||
adjoint_weight = adjoint_weight/nb_adj_primary_electrons_per_event;
|
||||
for (int i=0;i<nb_adj_primary_electrons_per_event-1;i++){
|
||||
G4PrimaryVertex* newAdjPrimVertex = new G4PrimaryVertex();
|
||||
newAdjPrimVertex->SetPosition(pos.x(),pos.y(),pos.z());
|
||||
newAdjPrimVertex->SetT0(0.);
|
||||
aPrimParticle = new G4PrimaryParticle(ListOfPrimaryAdjParticles[index_particle],
|
||||
-p.x(),-p.y(),-p.z());
|
||||
newAdjPrimVertex->SetPrimary(aPrimParticle);
|
||||
newAdjPrimVertex->SetWeight(adjoint_weight);
|
||||
anEvent->AddPrimaryVertex(newAdjPrimVertex);
|
||||
}
|
||||
}
|
||||
adjPrimVertex->SetWeight(adjoint_weight);
|
||||
|
||||
|
||||
|
||||
|
||||
//Call some methods of G4AdjointSimManager
|
||||
G4AdjointSimManager::GetInstance()->SetAdjointTrackingMode(true);
|
||||
|
||||
G4AdjointSimManager::GetInstance()->ClearEndOfAdjointTrackInfoVectors();
|
||||
|
||||
/* if ( !last_generated_part_was_adjoint ) {
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4AdjointSimManager.cc 97327 2016-06-01 14:24:40Z gcosmo $
|
||||
// $Id: G4AdjointSimManager.cc 98735 2016-08-09 10:54:06Z gcosmo $
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Class Name: G4AdjointCrossSurfChecker
|
||||
@@ -80,8 +80,8 @@ G4AdjointSimManager::G4AdjointSimManager():
|
||||
//----------------------
|
||||
theAdjointPrimaryGeneratorAction = new G4AdjointPrimaryGeneratorAction();
|
||||
theAdjointSteppingAction = new G4AdjointSteppingAction();
|
||||
theAdjointStackingAction = new G4AdjointStackingAction();
|
||||
theAdjointTrackingAction = new G4AdjointTrackingAction(theAdjointSteppingAction);
|
||||
theAdjointStackingAction = new G4AdjointStackingAction(theAdjointTrackingAction);
|
||||
theAdjointTrackingAction->SetListOfPrimaryFwdParticles(
|
||||
theAdjointPrimaryGeneratorAction->GetListOfPrimaryFwdParticles());
|
||||
//Create messenger
|
||||
@@ -158,7 +158,6 @@ void G4AdjointSimManager::RunAdjointSimulation(G4int nb_evt)
|
||||
//------------
|
||||
|
||||
nb_evt_of_last_run =nb_evt;
|
||||
G4cout<<"Test Sim Adjoint1"<<std::endl;
|
||||
G4RunManager::GetRunManager()->BeamOn(nb_evt*theAdjointPrimaryGeneratorAction->GetNbOfAdjointPrimaryTypes());
|
||||
//G4RunManager::GetRunManager()->BeamOn(theAdjointPrimaryGeneratorAction->GetNbOfAdjointPrimaryTypes()*2*nb_evt);
|
||||
|
||||
@@ -351,8 +350,9 @@ void G4AdjointSimManager::SetAdjointTrackingMode(G4bool aBool)//could be removed
|
||||
//
|
||||
G4bool G4AdjointSimManager::GetDidAdjParticleReachTheExtSource()
|
||||
{
|
||||
return theAdjointSteppingAction->GetDidAdjParticleReachTheExtSource();
|
||||
return (GetNbOfAdointTracksReachingTheExternalSurface()>0);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
std::vector<G4ParticleDefinition*>* G4AdjointSimManager::GetListOfPrimaryFwdParticles()
|
||||
@@ -368,34 +368,34 @@ size_t G4AdjointSimManager::GetNbOfPrimaryFwdParticles()
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
G4ThreeVector G4AdjointSimManager::GetPositionAtEndOfLastAdjointTrack(){
|
||||
return theAdjointTrackingAction->GetPositionAtEndOfLastAdjointTrack();
|
||||
G4ThreeVector G4AdjointSimManager::GetPositionAtEndOfLastAdjointTrack(size_t i){
|
||||
return theAdjointTrackingAction->GetPositionAtEndOfLastAdjointTrack(i);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
G4ThreeVector G4AdjointSimManager::GetDirectionAtEndOfLastAdjointTrack(){
|
||||
return theAdjointTrackingAction->GetDirectionAtEndOfLastAdjointTrack();
|
||||
G4ThreeVector G4AdjointSimManager::GetDirectionAtEndOfLastAdjointTrack(size_t i){
|
||||
return theAdjointTrackingAction->GetDirectionAtEndOfLastAdjointTrack(i);
|
||||
}
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
G4double G4AdjointSimManager::GetEkinAtEndOfLastAdjointTrack(){
|
||||
return theAdjointTrackingAction->GetEkinAtEndOfLastAdjointTrack();
|
||||
G4double G4AdjointSimManager::GetEkinAtEndOfLastAdjointTrack(size_t i){
|
||||
return theAdjointTrackingAction->GetEkinAtEndOfLastAdjointTrack(i);
|
||||
}
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
G4double G4AdjointSimManager::GetEkinNucAtEndOfLastAdjointTrack(){
|
||||
return theAdjointTrackingAction->GetEkinNucAtEndOfLastAdjointTrack();
|
||||
G4double G4AdjointSimManager::GetEkinNucAtEndOfLastAdjointTrack(size_t i){
|
||||
return theAdjointTrackingAction->GetEkinNucAtEndOfLastAdjointTrack(i);
|
||||
}
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
G4double G4AdjointSimManager::GetWeightAtEndOfLastAdjointTrack(){
|
||||
return theAdjointTrackingAction->GetWeightAtEndOfLastAdjointTrack();
|
||||
G4double G4AdjointSimManager::GetWeightAtEndOfLastAdjointTrack(size_t i){
|
||||
return theAdjointTrackingAction->GetWeightAtEndOfLastAdjointTrack(i);
|
||||
}
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
G4double G4AdjointSimManager::GetCosthAtEndOfLastAdjointTrack(){
|
||||
return theAdjointTrackingAction->GetCosthAtEndOfLastAdjointTrack();
|
||||
G4double G4AdjointSimManager::GetCosthAtEndOfLastAdjointTrack(size_t i){
|
||||
return theAdjointTrackingAction->GetCosthAtEndOfLastAdjointTrack(i);
|
||||
}
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
@@ -404,14 +404,25 @@ const G4String& G4AdjointSimManager::GetFwdParticleNameAtEndOfLastAdjointTrack()
|
||||
}
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
G4int G4AdjointSimManager::GetFwdParticlePDGEncodingAtEndOfLastAdjointTrack(){
|
||||
return theAdjointTrackingAction->GetFwdParticlePDGEncodingAtEndOfLastAdjointTrack();
|
||||
G4int G4AdjointSimManager::GetFwdParticlePDGEncodingAtEndOfLastAdjointTrack(size_t i){
|
||||
return theAdjointTrackingAction->GetFwdParticlePDGEncodingAtEndOfLastAdjointTrack(i);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
G4int G4AdjointSimManager::GetFwdParticleIndexAtEndOfLastAdjointTrack()
|
||||
{return theAdjointTrackingAction->GetLastFwdParticleIndex();
|
||||
G4int G4AdjointSimManager::GetFwdParticleIndexAtEndOfLastAdjointTrack(size_t i)
|
||||
{return theAdjointTrackingAction->GetLastFwdParticleIndex(i);
|
||||
}
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
size_t G4AdjointSimManager::GetNbOfAdointTracksReachingTheExternalSurface()
|
||||
{
|
||||
return theAdjointTrackingAction->GetNbOfAdointTracksReachingTheExternalSurface();
|
||||
}
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
void G4AdjointSimManager::ClearEndOfAdjointTrackInfoVectors()
|
||||
{theAdjointTrackingAction->ClearEndOfAdjointTrackInfoVectors();
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
@@ -447,6 +458,24 @@ void G4AdjointSimManager::RegisterAtEndOfAdjointTrack()
|
||||
|
||||
last_weight = theAdjointSteppingAction->GetLastWeight();
|
||||
|
||||
|
||||
|
||||
last_pos_vec.push_back(last_pos);
|
||||
last_direction_vec.push_back(last_direction);
|
||||
last_ekin_vec.push_back(last_ekin);
|
||||
last_ekin_nuc_vec.push_back(last_ekin_nuc);
|
||||
last_cos_th_vec.push_back(last_cos_th);
|
||||
last_weight_vec.push_back(last_weight);
|
||||
last_fwd_part_PDGEncoding_vec.push_back(last_fwd_part_PDGEncoding);
|
||||
last_fwd_part_index_vec.push_back(last_fwd_part_index);
|
||||
ID_of_last_particle_that_reach_the_ext_source++;
|
||||
ID_of_last_particle_that_reach_the_ext_source_vec.push_back(ID_of_last_particle_that_reach_the_ext_source);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* G4PhysicsLogVector* theWeightVector=0;
|
||||
if (last_fwd_part_name =="e-") theWeightVector=electron_last_weight_vector;
|
||||
else if (last_fwd_part_name =="gamma") theWeightVector=gamma_last_weight_vector;
|
||||
@@ -472,7 +501,7 @@ void G4AdjointSimManager::RegisterAtEndOfAdjointTrack()
|
||||
}
|
||||
*/
|
||||
|
||||
ID_of_last_particle_that_reach_the_ext_source++;
|
||||
|
||||
}
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
@@ -619,9 +648,20 @@ void G4AdjointSimManager::SetNbOfPrimaryFwdGammasPerEvent(G4int nb)
|
||||
}
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
void G4AdjointSimManager::SetNbAdjointPrimaryGammasPerEvent(G4int nb)
|
||||
{
|
||||
theAdjointPrimaryGeneratorAction->SetNbAdjointPrimaryGammasPerEvent(nb);
|
||||
}
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
void G4AdjointSimManager::SetNbAdjointPrimaryElectronsPerEvent(G4int nb)
|
||||
{
|
||||
theAdjointPrimaryGeneratorAction->SetNbAdjointPrimaryElectronsPerEvent(nb);
|
||||
}
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
void G4AdjointSimManager::BeginOfRunAction(const G4Run* aRun)
|
||||
{
|
||||
|
||||
/*
|
||||
if (!adjoint_sim_mode){
|
||||
if(fUserRunAction) fUserRunAction->BeginOfRunAction(aRun);
|
||||
@@ -631,7 +671,6 @@ void G4AdjointSimManager::BeginOfRunAction(const G4Run* aRun)
|
||||
}
|
||||
*/
|
||||
fUserRunAction->BeginOfRunAction(aRun);
|
||||
|
||||
}
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
@@ -649,3 +688,10 @@ void G4AdjointSimManager::EndOfRunAction(const G4Run* aRun)
|
||||
*/
|
||||
|
||||
}
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
G4ParticleDefinition* G4AdjointSimManager::GetLastGeneratedFwdPrimaryParticle(){
|
||||
return theAdjointPrimaryGeneratorAction->GetLastGeneratedFwdPrimaryParticle();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4AdjointSimMessenger.cc 81773 2014-06-05 08:35:38Z gcosmo $
|
||||
// $Id: G4AdjointSimMessenger.cc 98735 2016-08-09 10:54:06Z gcosmo $
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Class Name: G4AdjointCrossSurfChecker
|
||||
@@ -160,7 +160,7 @@ G4AdjointSimMessenger::G4AdjointSimMessenger(G4AdjointSimManager* pAdjointRunMan
|
||||
ConsiderParticleAsPrimaryCmd->SetCandidates("e- gamma proton ion");
|
||||
|
||||
NeglectParticleAsPrimaryCmd= new G4UIcmdWithAString("/adjoint/NeglectAsPrimary",this);
|
||||
NeglectParticleAsPrimaryCmd->SetGuidance("Remove the selected particle from the lits of primaries");
|
||||
NeglectParticleAsPrimaryCmd->SetGuidance("Remove the selected particle from the list of primaries");
|
||||
NeglectParticleAsPrimaryCmd->SetParameterName("particle",false);
|
||||
NeglectParticleAsPrimaryCmd->SetCandidates("e- gamma proton ion");
|
||||
|
||||
@@ -171,6 +171,19 @@ G4AdjointSimMessenger::G4AdjointSimMessenger(G4AdjointSimManager* pAdjointRunMan
|
||||
setNbOfPrimaryFwdGammasPerEventCmd->SetParameterName("Nb_gammas",false);
|
||||
setNbOfPrimaryFwdGammasPerEventCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
|
||||
setNbOfPrimaryAdjGammasPerEventCmd =
|
||||
new G4UIcmdWithAnInteger("/adjoint/SetNbOfPrimaryAdjGammasPerEvent",this);
|
||||
setNbOfPrimaryAdjGammasPerEventCmd->SetGuidance("Set the nb of primary fwd gamm generated on the adjoint source");
|
||||
setNbOfPrimaryAdjGammasPerEventCmd->SetParameterName("Nb_gammas",false);
|
||||
setNbOfPrimaryAdjGammasPerEventCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
|
||||
setNbOfPrimaryAdjElectronsPerEventCmd =
|
||||
new G4UIcmdWithAnInteger("/adjoint/SetNbOfPrimaryAdjElectronsPerEvent",this);
|
||||
setNbOfPrimaryAdjElectronsPerEventCmd->SetGuidance("Set the nb of primary fwd gamm generated on the adjoint source");
|
||||
setNbOfPrimaryAdjElectronsPerEventCmd->SetParameterName("Nb_gammas",false);
|
||||
setNbOfPrimaryAdjElectronsPerEventCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -326,6 +339,12 @@ void G4AdjointSimMessenger::SetNewValue(G4UIcommand* command,G4String newValue)
|
||||
else if ( command== setNbOfPrimaryFwdGammasPerEventCmd){
|
||||
theAdjointRunManager->SetNbOfPrimaryFwdGammasPerEvent(setNbOfPrimaryFwdGammasPerEventCmd->GetNewIntValue(newValue));
|
||||
}
|
||||
else if ( command== setNbOfPrimaryAdjGammasPerEventCmd){
|
||||
theAdjointRunManager->SetNbAdjointPrimaryGammasPerEvent(setNbOfPrimaryAdjGammasPerEventCmd->GetNewIntValue(newValue));
|
||||
}
|
||||
else if ( command== setNbOfPrimaryAdjElectronsPerEventCmd){
|
||||
theAdjointRunManager->SetNbAdjointPrimaryElectronsPerEvent(setNbOfPrimaryAdjElectronsPerEventCmd->GetNewIntValue(newValue));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@ void* G4MTRunManagerKernel::StartThread(void* context)
|
||||
//#ifdef G4MULTITHREADED
|
||||
// turnontpmalloc();
|
||||
//#endif
|
||||
|
||||
G4Threading::WorkerThreadJoinsPool();
|
||||
wThreadContext = static_cast<G4WorkerThread*>(context);
|
||||
G4MTRunManager* masterRM = G4MTRunManager::GetMasterRunManager();
|
||||
|
||||
@@ -215,6 +215,7 @@ void* G4MTRunManagerKernel::StartThread(void* context)
|
||||
wThreadContext->DestroyGeometryAndPhysicsVector();
|
||||
wThreadContext = 0;
|
||||
|
||||
G4Threading::WorkerThreadLeavesPool();
|
||||
return static_cast<void*>(0);
|
||||
}
|
||||
|
||||
|
||||
@@ -25,10 +25,8 @@
|
||||
//
|
||||
#include "G4PhysicsListWorkspace.hh"
|
||||
|
||||
//Note: G4PhysicsListWorkspacePool is typedef to G4TWorkspacePool<G4PhysicsListWorkspace>
|
||||
template<> G4ThreadLocal G4PhysicsListWorkspace* G4PhysicsListWorkspace::pool_type::fMyWorkspace = 0;
|
||||
|
||||
namespace {
|
||||
namespace
|
||||
{
|
||||
G4PhysicsListWorkspace::pool_type thePool;
|
||||
}
|
||||
|
||||
@@ -40,46 +38,43 @@ G4PhysicsListWorkspace::G4PhysicsListWorkspace(G4bool verbose)
|
||||
{
|
||||
|
||||
fpVUPLSIM =
|
||||
&const_cast<G4VUPLManager&>(G4VUserPhysicsList::GetSubInstanceManager());//.NewSubInstances();
|
||||
&const_cast<G4VUPLManager&>(G4VUserPhysicsList::GetSubInstanceManager());
|
||||
fpVPCSIM =
|
||||
&const_cast<G4VPCManager&>(G4VPhysicsConstructor::GetSubInstanceManager());//.NewSubInstances();
|
||||
&const_cast<G4VPCManager&>(G4VPhysicsConstructor::GetSubInstanceManager());
|
||||
fpVMPLSIM =
|
||||
&const_cast<G4VMPLManager&>(G4VModularPhysicsList::GetSubInstanceManager());//.SlaveCopySubInstanceArray();
|
||||
&const_cast<G4VMPLManager&>(G4VModularPhysicsList::GetSubInstanceManager());
|
||||
|
||||
// Copy information from master into PolyCone/Gon Sides in this thread.
|
||||
InitialiseWorkspace();
|
||||
|
||||
// Capture its address of ParticleDefinition split-class in this thread
|
||||
//fpPDefOffset = fpPDefSIM->GetOffset();
|
||||
fpVUPLOffset = fpVUPLSIM->GetOffset();
|
||||
fpVPCOffset = fpVPCSIM->GetOffset();
|
||||
fpVMPLOffset = fpVMPLSIM->GetOffset();
|
||||
fpVUPLOffset = fpVUPLSIM->GetOffset();
|
||||
fpVPCOffset = fpVPCSIM->GetOffset();
|
||||
fpVMPLOffset = fpVMPLSIM->GetOffset();
|
||||
}
|
||||
|
||||
G4PhysicsListWorkspace::~G4PhysicsListWorkspace()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Static methods
|
||||
// For with current (original) G4WorkerThread -- which uses static methods
|
||||
|
||||
void
|
||||
G4PhysicsListWorkspace::UseWorkspace()
|
||||
{
|
||||
if( fVerbose )
|
||||
G4cout << "G4PhysicsListWorkspace::UseWorkspace: Copying particles-definition Split-Class - Start " << G4endl;
|
||||
G4cout << "G4PhysicsListWorkspace::UseWorkspace: "
|
||||
<< "Copying particles-definition Split-Class - Start " << G4endl;
|
||||
|
||||
// Implementation copied from G4WorkerThread::BuildGeometryAndPhysicsVector()
|
||||
// Implementation copied from
|
||||
// G4WorkerThread::BuildGeometryAndPhysicsVector()
|
||||
|
||||
//Physics List related, split classes mechanism: instantiate sub-instance for this thread
|
||||
// Physics List related, split classes mechanism:
|
||||
// instantiate sub-instance for this thread
|
||||
fpVUPLSIM->UseWorkArea(fpVUPLOffset);
|
||||
fpVPCSIM->UseWorkArea(fpVPCOffset);
|
||||
fpVMPLSIM->UseWorkArea(fpVMPLOffset);
|
||||
}
|
||||
|
||||
void G4PhysicsListWorkspace::ReleaseWorkspace()
|
||||
// The opposite of Use Workspace - let go of it.
|
||||
{
|
||||
fpVUPLSIM->UseWorkArea(0);
|
||||
fpVPCSIM->UseWorkArea(0);
|
||||
@@ -94,12 +89,12 @@ void
|
||||
G4PhysicsListWorkspace::InitialiseWorkspace()
|
||||
{
|
||||
if( fVerbose )
|
||||
G4cout << "G4PhysicsListWorkspace::InitialiseWorkspace: "
|
||||
<< "Copying particles-definition Split-Class - Start " << G4endl;
|
||||
G4cout << "G4PhysicsListWorkspace::InitialiseWorkspace: "
|
||||
<< "Copying particles-definition Split-Class - Start " << G4endl;
|
||||
|
||||
//PhysicsList related, split classes mechanism:
|
||||
// PhysicsList related, split classes mechanism:
|
||||
// Do *NOT* instantiate sub-instance for this thread,
|
||||
// just copy the contents !!
|
||||
// just copy the contents !!
|
||||
fpVUPLSIM->NewSubInstances();
|
||||
fpVPCSIM->NewSubInstances();
|
||||
fpVMPLSIM->WorkerCopySubInstanceArray();
|
||||
@@ -108,8 +103,8 @@ G4PhysicsListWorkspace::InitialiseWorkspace()
|
||||
InitialisePhysicsList();
|
||||
|
||||
if( fVerbose )
|
||||
G4cout << "G4PhysicsListWorkspace::CreateAndUseWorkspace: "
|
||||
<< "Copying particles-definition Split-Class - Done!" << G4endl;
|
||||
G4cout << "G4PhysicsListWorkspace::CreateAndUseWorkspace: "
|
||||
<< "Copying particles-definition Split-Class - Done!" << G4endl;
|
||||
}
|
||||
|
||||
void G4PhysicsListWorkspace::DestroyWorkspace()
|
||||
|
||||
@@ -28,8 +28,37 @@
|
||||
#include "Randomize.hh"
|
||||
|
||||
template<>
|
||||
G4TemplateRNGHelper<long>* G4TemplateRNGHelper<long>::instance = 0;
|
||||
G4TemplateRNGHelper<G4long>* G4TemplateRNGHelper<G4long>::instance = 0;
|
||||
|
||||
template<>
|
||||
G4TemplateRNGHelper<G4String>* G4TemplateRNGHelper<G4String>::instance = 0;
|
||||
|
||||
template<class T>
|
||||
G4TemplateRNGHelper<T>* G4TemplateRNGHelper<T>::GetInstance()
|
||||
{
|
||||
if (!instance)
|
||||
{
|
||||
instance = new G4TemplateRNGHelper<T>();
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
template<>
|
||||
G4TemplateRNGHelper<G4long>* G4TemplateRNGHelper<G4long>::GetInstance()
|
||||
{
|
||||
if (!instance)
|
||||
{
|
||||
instance = new G4TemplateRNGHelper<G4long>();
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
template<>
|
||||
G4TemplateRNGHelper<G4String>* G4TemplateRNGHelper<G4String>::GetInstance()
|
||||
{
|
||||
if (!instance)
|
||||
{
|
||||
instance = new G4TemplateRNGHelper<G4String>();
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4RunManager.cc 95232 2016-02-01 14:31:22Z gcosmo $
|
||||
// $Id: G4RunManager.cc 99345 2016-09-19 06:51:23Z gcosmo $
|
||||
//
|
||||
//
|
||||
|
||||
@@ -562,9 +562,12 @@ void G4RunManager::Initialize()
|
||||
return;
|
||||
}
|
||||
|
||||
stateManager->SetNewState(G4State_Init);
|
||||
if(!geometryInitialized) InitializeGeometry();
|
||||
if(!physicsInitialized) InitializePhysics();
|
||||
initializedAtLeastOnce = true;
|
||||
if(stateManager->GetCurrentState()!=G4State_Idle)
|
||||
{ stateManager->SetNewState(G4State_Idle); }
|
||||
}
|
||||
|
||||
void G4RunManager::InitializeGeometry()
|
||||
@@ -578,16 +581,25 @@ void G4RunManager::InitializeGeometry()
|
||||
|
||||
if(verboseLevel>1) G4cout << "userDetector->Construct() start." << G4endl;
|
||||
|
||||
G4StateManager* stateManager = G4StateManager::GetStateManager();
|
||||
G4ApplicationState currentState = stateManager->GetCurrentState();
|
||||
if(currentState==G4State_PreInit || currentState==G4State_Idle)
|
||||
{ stateManager->SetNewState(G4State_Init); }
|
||||
kernel->DefineWorldVolume(userDetector->Construct(),false);
|
||||
userDetector->ConstructSDandField();
|
||||
nParallelWorlds = userDetector->ConstructParallelGeometries();
|
||||
userDetector->ConstructParallelSD();
|
||||
kernel->SetNumberOfParallelWorld(nParallelWorlds);
|
||||
geometryInitialized = true;
|
||||
stateManager->SetNewState(currentState);
|
||||
}
|
||||
|
||||
void G4RunManager::InitializePhysics()
|
||||
{
|
||||
G4StateManager* stateManager = G4StateManager::GetStateManager();
|
||||
G4ApplicationState currentState = stateManager->GetCurrentState();
|
||||
if(currentState==G4State_PreInit || currentState==G4State_Idle)
|
||||
{ stateManager->SetNewState(G4State_Init); }
|
||||
if(physicsList)
|
||||
{
|
||||
kernel->InitializePhysics();
|
||||
@@ -598,6 +610,7 @@ void G4RunManager::InitializePhysics()
|
||||
FatalException, "G4VUserPhysicsList is not defined!");
|
||||
}
|
||||
physicsInitialized = true;
|
||||
stateManager->SetNewState(currentState);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4RunManagerKernel.cc 95232 2016-02-01 14:31:22Z gcosmo $
|
||||
// $Id: G4RunManagerKernel.cc 99767 2016-10-05 08:54:01Z gcosmo $
|
||||
//
|
||||
//
|
||||
|
||||
@@ -233,6 +233,10 @@ numberOfParallelWorld(0),geometryNeedsToBeClosed(true),
|
||||
<< "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^" << G4endl
|
||||
<< G4endl;
|
||||
}
|
||||
|
||||
#ifdef G4MULTITHREADED
|
||||
G4UnitDefinition::GetUnitsTable().Synchronize();
|
||||
#endif
|
||||
}
|
||||
|
||||
void G4RunManagerKernel::SetupDefaultRegion()
|
||||
@@ -339,15 +343,26 @@ void G4RunManagerKernel::WorkerDefineWorldVolume(G4VPhysicalVolume* worldVol,
|
||||
{
|
||||
G4StateManager* stateManager = G4StateManager::GetStateManager();
|
||||
G4ApplicationState currentState = stateManager->GetCurrentState();
|
||||
if(!(currentState==G4State_Idle||currentState==G4State_PreInit))
|
||||
if(currentState!=G4State_Init)
|
||||
{
|
||||
G4Exception("G4RunManagerKernel::DefineWorldVolume",
|
||||
G4cout << "Current application state is "
|
||||
<< stateManager->GetStateString(currentState) << G4endl;
|
||||
if(!(currentState==G4State_Idle||currentState==G4State_PreInit))
|
||||
{
|
||||
G4Exception("G4RunManagerKernel::DefineWorldVolume",
|
||||
"DefineWorldVolumeAtIncorrectState",
|
||||
JustWarning,
|
||||
"Geant4 kernel is not PreInit or Idle state : Method ignored.");
|
||||
if(verboseLevel>1) G4cerr << "Current application state is "
|
||||
<< stateManager->GetStateString(currentState) << G4endl;
|
||||
return;
|
||||
FatalException,
|
||||
"Geant4 kernel is not Init state : Method ignored.");
|
||||
return;
|
||||
} else {
|
||||
//G4Exception("G4RunManagerKernel::DefineWorldVolume",
|
||||
// "DefineWorldVolumeAtIncorrectState",
|
||||
// JustWarning,
|
||||
// "Geant4 kernel is not Init state : Assuming Init state.");
|
||||
G4cout<<"Warning : Geant4 kernel is not Init state : Assuming Init state."
|
||||
<<G4endl;
|
||||
stateManager->SetNewState(G4State_Init);
|
||||
}
|
||||
}
|
||||
|
||||
currentWorld = worldVol;
|
||||
@@ -382,6 +397,7 @@ void G4RunManagerKernel::WorkerDefineWorldVolume(G4VPhysicalVolume* worldVol,
|
||||
}
|
||||
|
||||
geometryInitialized = true;
|
||||
stateManager->SetNewState(currentState);
|
||||
if(physicsInitialized && currentState!=G4State_Idle)
|
||||
{ stateManager->SetNewState(G4State_Idle); }
|
||||
}
|
||||
@@ -391,13 +407,26 @@ void G4RunManagerKernel::DefineWorldVolume(G4VPhysicalVolume* worldVol,
|
||||
{
|
||||
G4StateManager* stateManager = G4StateManager::GetStateManager();
|
||||
G4ApplicationState currentState = stateManager->GetCurrentState();
|
||||
if(!(currentState==G4State_Idle||currentState==G4State_PreInit))
|
||||
{
|
||||
G4Exception("G4RunManagerKernel::DefineWorldVolume",
|
||||
"Run00031",
|
||||
JustWarning,
|
||||
"Geant4 kernel is not PreInit or Idle state : Method ignored.");
|
||||
return;
|
||||
if(currentState!=G4State_Init)
|
||||
{
|
||||
G4cout << "Current application state is "
|
||||
<< stateManager->GetStateString(currentState) << G4endl;
|
||||
if(!(currentState==G4State_Idle||currentState==G4State_PreInit))
|
||||
{
|
||||
G4Exception("G4RunManagerKernel::DefineWorldVolume",
|
||||
"DefineWorldVolumeAtIncorrectState",
|
||||
FatalException,
|
||||
"Geant4 kernel is not Init state : Method ignored.");
|
||||
return;
|
||||
} else {
|
||||
//G4Exception("G4RunManagerKernel::DefineWorldVolume",
|
||||
// "DefineWorldVolumeAtIncorrectState",
|
||||
// JustWarning,
|
||||
// "Geant4 kernel is not Init state : Assuming Init state.");
|
||||
G4cout<<"Warning : Geant4 kernel is not Init state : Assuming Init state."
|
||||
<<G4endl;
|
||||
stateManager->SetNewState(G4State_Init);
|
||||
}
|
||||
}
|
||||
|
||||
// The world volume MUST NOT have a region defined by the user
|
||||
@@ -442,6 +471,7 @@ void G4RunManagerKernel::DefineWorldVolume(G4VPhysicalVolume* worldVol,
|
||||
}
|
||||
|
||||
geometryInitialized = true;
|
||||
stateManager->SetNewState(currentState);
|
||||
if(physicsInitialized && currentState!=G4State_Idle)
|
||||
{ stateManager->SetNewState(G4State_Idle); }
|
||||
}
|
||||
@@ -475,7 +505,7 @@ void G4RunManagerKernel::SetPhysics(G4VUserPhysicsList* uPhys)
|
||||
|
||||
void G4RunManagerKernel::SetupPhysics()
|
||||
{
|
||||
G4ParticleTable::GetParticleTable()->SetReadiness();
|
||||
G4ParticleTable::GetParticleTable()->SetReadiness();
|
||||
|
||||
physicsList->ConstructParticle();
|
||||
|
||||
@@ -504,6 +534,9 @@ void G4RunManagerKernel::SetupPhysics()
|
||||
if(particle->IsGeneralIon()) particle->SetParticleDefinitionID(gionId);
|
||||
}
|
||||
}
|
||||
#ifdef G4MULTITHREADED
|
||||
G4UnitDefinition::GetUnitsTable().Synchronize();
|
||||
#endif
|
||||
}
|
||||
|
||||
namespace {
|
||||
@@ -514,12 +547,26 @@ void G4RunManagerKernel::InitializePhysics()
|
||||
{
|
||||
G4StateManager* stateManager = G4StateManager::GetStateManager();
|
||||
G4ApplicationState currentState = stateManager->GetCurrentState();
|
||||
if(!(currentState==G4State_Idle||currentState==G4State_PreInit))
|
||||
{
|
||||
G4Exception("G4RunManagerKernel::InitializePhysics",
|
||||
"Run0011", JustWarning,
|
||||
"Geant4 kernel is not PreInit or Idle state : Method ignored.");
|
||||
return;
|
||||
if(currentState!=G4State_Init)
|
||||
{
|
||||
G4cout << "Current application state is "
|
||||
<< stateManager->GetStateString(currentState) << G4endl;
|
||||
if(!(currentState==G4State_Idle||currentState==G4State_PreInit))
|
||||
{
|
||||
G4Exception("G4RunManagerKernel::InitializePhysics",
|
||||
"InitializePhysicsIncorrectState",
|
||||
FatalException,
|
||||
"Geant4 kernel is not Init state : Method ignored.");
|
||||
return;
|
||||
} else {
|
||||
//G4Exception("G4RunManagerKernel::DefineWorldVolume",
|
||||
//"DefineWorldVolumeAtIncorrectState",
|
||||
//JustWarning,
|
||||
//"Geant4 kernel is not Init state : Assuming Init state.");
|
||||
G4cout<<"Warning : Geant4 kernel is not Init state : Assuming Init state."
|
||||
<<G4endl;
|
||||
stateManager->SetNewState(G4State_Init);
|
||||
}
|
||||
}
|
||||
|
||||
if(!physicsList)
|
||||
@@ -565,6 +612,10 @@ void G4RunManagerKernel::InitializePhysics()
|
||||
*********************/
|
||||
|
||||
physicsInitialized = true;
|
||||
#ifdef G4MULTITHREADED
|
||||
G4UnitDefinition::GetUnitsTable().Synchronize();
|
||||
#endif
|
||||
stateManager->SetNewState(currentState);
|
||||
if(geometryInitialized && currentState!=G4State_Idle)
|
||||
{ stateManager->SetNewState(G4State_Idle); }
|
||||
}
|
||||
@@ -622,6 +673,9 @@ G4bool G4RunManagerKernel::RunInitialization(G4bool fakeRun)
|
||||
|
||||
GetPrimaryTransformer()->CheckUnknown();
|
||||
|
||||
#ifdef G4MULTITHREADED
|
||||
G4UnitDefinition::GetUnitsTable().Synchronize();
|
||||
#endif
|
||||
stateManager->SetNewState(G4State_GeomClosed);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VModularPhysicsList.cc 85358 2014-10-28 10:02:44Z gcosmo $
|
||||
// $Id: G4VModularPhysicsList.cc 100421 2016-10-21 12:49:57Z gcosmo $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
@@ -40,12 +40,6 @@
|
||||
// in the class G4VMPLData.
|
||||
#define G4MT_physicsVector ((G4VMPLsubInstanceManager.offset[g4vmplInstanceID]).physicsVector)
|
||||
|
||||
template <class G4VMPLData> G4ThreadLocal
|
||||
G4int G4VUPLSplitter<G4VMPLData>::workertotalspace = 0;
|
||||
|
||||
template <class G4VMPLData> G4ThreadLocal
|
||||
G4VMPLData* G4VUPLSplitter<G4VMPLData>::offset = 0;
|
||||
|
||||
G4VMPLManager G4VModularPhysicsList::G4VMPLsubInstanceManager;
|
||||
|
||||
void G4VMPLData::initialize()
|
||||
@@ -88,8 +82,12 @@ G4VModularPhysicsList & G4VModularPhysicsList::operator=(const G4VModularPhysics
|
||||
fIsCheckedForRetrievePhysicsTable = right.fIsCheckedForRetrievePhysicsTable;
|
||||
fIsRestoredCutValues = right.fIsRestoredCutValues;
|
||||
directoryPhysicsTable = right.directoryPhysicsTable;
|
||||
fDisplayThreshold = static_cast<const G4VUserPhysicsList&>(right).GetSubInstanceManager().offset[right.GetInstanceID()]._fDisplayThreshold;
|
||||
fIsPhysicsTableBuilt = static_cast<const G4VUserPhysicsList&>(right).GetSubInstanceManager().offset[right.GetInstanceID()]._fIsPhysicsTableBuilt;
|
||||
//fDisplayThreshold = static_cast<const G4VUserPhysicsList&>(right).GetSubInstanceManager().offset[right.GetInstanceID()]._fDisplayThreshold;
|
||||
(this->subInstanceManager.offset[this->g4vuplInstanceID])._fDisplayThreshold=
|
||||
static_cast<const G4VUserPhysicsList&>(right).GetSubInstanceManager().offset[right.GetInstanceID()]._fDisplayThreshold;
|
||||
//fIsPhysicsTableBuilt = static_cast<const G4VUserPhysicsList&>(right).GetSubInstanceManager().offset[right.GetInstanceID()]._fIsPhysicsTableBuilt;
|
||||
(this->subInstanceManager.offset[this->g4vuplInstanceID])._fDisplayThreshold=
|
||||
static_cast<const G4VUserPhysicsList&>(right).GetSubInstanceManager().offset[right.GetInstanceID()]._fIsPhysicsTableBuilt;
|
||||
//fDisplayThreshold = right.fDisplayThreshold;
|
||||
fDisableCheckParticleList = right.fDisableCheckParticleList;
|
||||
verboseLevel = right.verboseLevel;
|
||||
|
||||
@@ -35,18 +35,6 @@
|
||||
|
||||
#include "G4VPhysicsConstructor.hh"
|
||||
|
||||
// This static member is thread local. For each thread, it holds the array
|
||||
// size of G4VPCData instances.
|
||||
//
|
||||
template <class G4VPCData> G4ThreadLocal
|
||||
G4int G4VUPLSplitter<G4VPCData>::workertotalspace = 0;
|
||||
|
||||
// This static member is thread local. For each thread, it points to the
|
||||
// array of G4VPCData instances.
|
||||
//
|
||||
template <class G4VPCData> G4ThreadLocal
|
||||
G4VPCData* G4VUPLSplitter<G4VPCData>::offset = 0;
|
||||
|
||||
// This field helps to use the class G4VPCManager
|
||||
//
|
||||
G4VPCManager G4VPhysicsConstructor::subInstanceManager;
|
||||
@@ -86,3 +74,9 @@ G4VPhysicsConstructor::G4VPhysicsConstructor(const G4String& name, G4int type)
|
||||
G4VPhysicsConstructor::~G4VPhysicsConstructor()
|
||||
{
|
||||
}
|
||||
|
||||
G4ParticleTable::G4PTblDicIterator* G4VPhysicsConstructor::GetParticleIterator() const
|
||||
{
|
||||
return (subInstanceManager.offset[g4vpcInstanceID])._aParticleIterator;
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VUserDetectorConstruction.cc 92599 2015-09-07 07:11:43Z gcosmo $
|
||||
// $Id: G4VUserDetectorConstruction.cc 101679 2016-11-21 09:30:00Z gcosmo $
|
||||
//
|
||||
|
||||
#include "G4VUserDetectorConstruction.hh"
|
||||
@@ -37,6 +37,7 @@
|
||||
#include "G4SDManager.hh"
|
||||
#include "G4MultiSensitiveDetector.hh"
|
||||
#include <assert.h>
|
||||
#include <sstream>
|
||||
|
||||
G4VUserDetectorConstruction::G4VUserDetectorConstruction()
|
||||
{;}
|
||||
@@ -241,7 +242,8 @@ void G4VUserDetectorConstruction::SetSensitiveDetector
|
||||
{
|
||||
assert(logVol!=nullptr&&aSD!=nullptr);
|
||||
|
||||
G4SDManager::GetSDMpointer()->AddNewDetector(aSD);
|
||||
//The aSD has already been added by user to the manager if needed
|
||||
//G4SDManager::GetSDMpointer()->AddNewDetector(aSD);
|
||||
|
||||
//New Logic: allow for "multiple" SDs being attached to a single LV.
|
||||
//To do that we use a special proxy SD called G4MultiSensitiveDetector
|
||||
@@ -255,7 +257,9 @@ void G4VUserDetectorConstruction::SetSensitiveDetector
|
||||
if ( msd != nullptr ) {
|
||||
msd->AddSD(aSD);
|
||||
} else {
|
||||
const G4String msdname = "/MultiSD_"+logVol->GetName();
|
||||
std::ostringstream mn;
|
||||
mn<<"/MultiSD_"<<logVol->GetName()<<"_"<<logVol;
|
||||
const G4String msdname = mn.str();
|
||||
msd = new G4MultiSensitiveDetector(msdname);
|
||||
//We need to register the proxy to have correct handling of IDs
|
||||
G4SDManager::GetSDMpointer()->AddNewDetector(msd);
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VUserPhysicsList.cc 89244 2015-03-27 16:27:51Z gcosmo $
|
||||
// $Id: G4VUserPhysicsList.cc 101155 2016-11-08 08:21:41Z gcosmo $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
@@ -81,14 +81,11 @@
|
||||
// This static member is thread local. For each thread, it holds the array
|
||||
// size of G4VUPLData instances.
|
||||
//
|
||||
template <class G4VUPLData> G4ThreadLocal
|
||||
G4int G4VUPLSplitter<G4VUPLData>::workertotalspace = 0;
|
||||
|
||||
// This static member is thread local. For each thread, it points to the
|
||||
// array of G4VUPLData instances.
|
||||
//
|
||||
template <class G4VUPLData> G4ThreadLocal
|
||||
G4VUPLData* G4VUPLSplitter<G4VUPLData>::offset = 0;
|
||||
#define G4MT_theMessenger ((this->subInstanceManager.offset[this->g4vuplInstanceID])._theMessenger)
|
||||
#define G4MT_thePLHelper ((this->subInstanceManager.offset[this->g4vuplInstanceID])._thePLHelper)
|
||||
#define fIsPhysicsTableBuilt ((this->subInstanceManager.offset[this->g4vuplInstanceID])._fIsPhysicsTableBuilt)
|
||||
#define fDisplayThreshold ((this->subInstanceManager.offset[this->g4vuplInstanceID])._fDisplayThreshold)
|
||||
#define theParticleIterator ((this->subInstanceManager.offset[this->g4vuplInstanceID])._theParticleIterator)
|
||||
|
||||
// This field helps to use the class G4VUPLManager
|
||||
//
|
||||
@@ -971,6 +968,12 @@ G4bool G4VUserPhysicsList::RegisterProcess(G4VProcess* process,
|
||||
return G4MT_thePLHelper->RegisterProcess(process, particle);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////
|
||||
G4ParticleTable::G4PTblDicIterator* G4VUserPhysicsList::GetParticleIterator() const
|
||||
{
|
||||
return (subInstanceManager.offset[g4vuplInstanceID])._theParticleIterator;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////
|
||||
void G4VUserPhysicsList::SetVerboseLevel(G4int value)
|
||||
{
|
||||
|
||||
@@ -370,8 +370,10 @@ G4Event* G4WorkerRunManager::GenerateEvent(G4int i_event)
|
||||
|
||||
if(printModulo > 0 && anEvent->GetEventID()%printModulo == 0 )
|
||||
{
|
||||
G4cout << "--> Event " << anEvent->GetEventID() << " starts with initial seeds ("
|
||||
<< s1 << "," << s2 << ")." << G4endl;
|
||||
G4cout << "--> Event " << anEvent->GetEventID() << " starts";
|
||||
if(eventHasToBeSeeded)
|
||||
{ G4cout << " with initial seeds (" << s1 << "," << s2 << ")"; }
|
||||
G4cout << "." << G4endl;
|
||||
}
|
||||
userPrimaryGeneratorAction->GeneratePrimaries(anEvent);
|
||||
return anEvent;
|
||||
|
||||
@@ -27,6 +27,13 @@
|
||||
#include "G4WorkerRunManager.hh"
|
||||
#include "G4MTRunManager.hh"
|
||||
|
||||
#include "G4GeometryWorkspace.hh"
|
||||
#include "G4GeometryWorkspacePool.hh"
|
||||
#include "G4SolidsWorkspace.hh"
|
||||
#include "G4SolidsWorkspacePool.hh"
|
||||
#include "G4ParticlesWorkspace.hh"
|
||||
#include "G4PhysicsListWorkspace.hh"
|
||||
|
||||
void G4WorkerThread::SetThreadId(G4int tid)
|
||||
{
|
||||
threadId = tid;
|
||||
@@ -47,13 +54,6 @@ G4int G4WorkerThread::GetNumberThreads() const
|
||||
return numThreads;
|
||||
}
|
||||
|
||||
#include "G4GeometryWorkspace.hh"
|
||||
#include "G4GeometryWorkspacePool.hh"
|
||||
#include "G4SolidsWorkspace.hh"
|
||||
#include "G4SolidsWorkspacePool.hh"
|
||||
#include "G4ParticlesWorkspace.hh"
|
||||
#include "G4PhysicsListWorkspace.hh"
|
||||
|
||||
void G4WorkerThread::BuildGeometryAndPhysicsVector()
|
||||
{
|
||||
// Initialise all split classes in the geometry with copy of data from master thread
|
||||
|
||||
Reference in New Issue
Block a user