Skip to content
Snippets Groups Projects
Commit 02517f06 authored by Witold Pokorski's avatar Witold Pokorski Committed by Dmitry Popov
Browse files

Patch for adept

parent e1962857
Branches
Tags
1 merge request!95Patch for adept
# Create imported target to help use VecGeom (a mess because the VecGeomConfig is...)
if(VecGeom_FOUND)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${VECGEOM_CXX_FLAGS}")
if(NOT TARGET VecGeom::vecgeom)
add_library(VecGeom::vecgeom UNKNOWN IMPORTED)
# VecGeom's config file is awful, so the following is neccessary...
......
......@@ -43,6 +43,8 @@
#include "G4Profiler.hh"
#include "G4TiMemory.hh"
#include "G4GlobalFastSimulationManager.hh"
G4ThreadLocal G4EventManager* G4EventManager::fpEventManager = nullptr;
G4EventManager* G4EventManager::GetEventManager()
......@@ -155,8 +157,12 @@ void G4EventManager::DoProcessing(G4Event* anEvent)
G4cout << "!!!!!!! Now start processing an event !!!!!!!" << G4endl;
}
#endif
do
{
G4VTrajectory* previousTrajectory;
while( (track=trackContainer->PopNextTrack(&previousTrajectory)) != nullptr )
{ // Loop checking 12.28.2015 M.Asai
......@@ -240,6 +246,11 @@ void G4EventManager::DoProcessing(G4Event* anEvent)
}
}
G4GlobalFastSimulationManager::GetGlobalFastSimulationManager()->Flush();
} while (trackContainer->GetNUrgentTrack() > 0);
#ifdef G4VERBOSE
if ( verboseLevel > 0 )
{
......
......@@ -140,6 +140,7 @@ public: // without description
const std::vector<G4VFastSimulationModel*>& GetFastSimulationModelList() const
{return ModelList;}
void FlushModels();
//----------------------------------------------
// Interface methods for the
......
......@@ -146,7 +146,7 @@ public: // Without description
void ActivateFastSimulationModel(const G4String&);
void InActivateFastSimulationModel(const G4String&);
void Flush();
private:
// Private construtor insures singleton class
......
......@@ -130,6 +130,10 @@ public: // With description
// described has "requests" the tracking will apply after your
// parameterisation has been invoked.
virtual
void Flush(){}
public: // Without description
// Useful public methods :
......
......@@ -155,6 +155,15 @@ G4FastSimulationManager::GetFastSimulationModel(const G4String& modelName,
return model;
}
void G4FastSimulationManager::FlushModels()
{
for (size_t iModel=0; iModel<ModelList.size(); iModel++)
{
ModelList[iModel]->Flush();
}
}
//------------------------------------------------------------------
// Interface trigger method for the G4ParameterisationManagerProcess
......
......@@ -147,6 +147,12 @@ void G4GlobalFastSimulationManager::InActivateFastSimulationModel(const G4String
G4cout << G4endl;
}
void G4GlobalFastSimulationManager::Flush()
{
// loop over all models (that need flushing?) and flush
for (size_t ifsm=0; ifsm<ManagedManagers.size(); ifsm++)
ManagedManagers[ifsm]->FlushModels();
}
// ---------------------------------
// -- display fast simulation setup:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment