Import Geant4 10.7.0 source tree
This commit is contained in:
@@ -44,6 +44,7 @@
|
||||
#include "G4ParticleGun.hh"
|
||||
#include "G4ParticleTable.hh"
|
||||
#include "G4ParticleDefinition.hh"
|
||||
#include "G4Profiler.hh"
|
||||
#include "G4TiMemory.hh"
|
||||
|
||||
using namespace CLHEP;
|
||||
@@ -71,7 +72,7 @@ TSPrimaryGeneratorAction::~TSPrimaryGeneratorAction() { delete fGun; }
|
||||
|
||||
void TSPrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
|
||||
{
|
||||
TIMEMORY_AUTO_TIMER("");
|
||||
G4USER_SCOPED_PROFILE(__FUNCTION__);
|
||||
static TSDetectorConstruction* detector = TSDetectorConstruction::Instance();
|
||||
|
||||
G4ThreeVector dir(0., 0., 1.);
|
||||
|
||||
@@ -202,43 +202,42 @@ void TSRun::RecordEvent(const G4Event* aEvent)
|
||||
else
|
||||
G4cout << " Error EvtMap Not Found " << G4endl;
|
||||
|
||||
TIMEMORY_AUTO_TIMER("[" + fCollNames.at(i) + "]");
|
||||
|
||||
G4USER_SCOPED_PROFILE(fCollNames.at(i));
|
||||
if(EvtMap)
|
||||
{
|
||||
//=== Sum up HitsMap of this event to HitsMap of RUN.===
|
||||
{
|
||||
TIMEMORY_BASIC_AUTO_TIMER("[standard_run_map]");
|
||||
G4USER_SCOPED_PROFILE("ThreadLocal");
|
||||
*fRunMaps[fCollID] += *EvtMap;
|
||||
}
|
||||
//=== Sum up HitsMap of this event to atomic HitsMap of RUN.===
|
||||
{
|
||||
TIMEMORY_BASIC_AUTO_TIMER("[atomic_run_map]");
|
||||
*fAtomicRunMaps[fCollID] += *EvtMap;
|
||||
}
|
||||
//=== Sum up HitsMap of this event to StatMap of RUN.===
|
||||
{
|
||||
TIMEMORY_BASIC_AUTO_TIMER("[stat_analysis_map]");
|
||||
G4USER_SCOPED_PROFILE("ThreadLocal/G4StatAnalysis");
|
||||
// G4StatAnalysis map
|
||||
*fStatMaps[fCollID] += *EvtMap;
|
||||
}
|
||||
//=== Sum up HitsMap of this event to MutexMap of RUN.===
|
||||
//=== Sum up HitsMap of this event to atomic HitsMap of RUN.===
|
||||
{
|
||||
TIMEMORY_BASIC_AUTO_TIMER("[convergence_test_map]");
|
||||
// G4ConvergenceTester run map
|
||||
static G4Mutex mtx = G4MUTEX_INITIALIZER;
|
||||
G4AutoLock lock(&mtx);
|
||||
*fConvMaps[fCollID] += *EvtMap;
|
||||
G4USER_SCOPED_PROFILE("Global/Atomic");
|
||||
*fAtomicRunMaps[fCollID] += *EvtMap;
|
||||
}
|
||||
//=== Sum up HitsMap of this event to MutexMap of RUN.===
|
||||
{
|
||||
TIMEMORY_BASIC_AUTO_TIMER("[mutex_run_map]");
|
||||
G4USER_SCOPED_PROFILE("Global/Mutex");
|
||||
// mutex run map
|
||||
static G4Mutex mtx = G4MUTEX_INITIALIZER;
|
||||
G4AutoLock lock(&mtx);
|
||||
for(const auto& itr : *EvtMap)
|
||||
fMutexRunMaps[fCollNames[fCollID]][itr.first] += *itr.second;
|
||||
}
|
||||
//=== Sum up HitsMap of this event to MutexMap of RUN.===
|
||||
{
|
||||
G4USER_SCOPED_PROFILE("Global/Mutex/G4ConvergenceTester");
|
||||
// G4ConvergenceTester run map
|
||||
static G4Mutex mtx = G4MUTEX_INITIALIZER;
|
||||
G4AutoLock lock(&mtx);
|
||||
*fConvMaps[fCollID] += *EvtMap;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,10 +65,10 @@ G4Run* TSRunAction::GenerateRun() { return new TSRun(fName); }
|
||||
|
||||
void TSRunAction::BeginOfRunAction(const G4Run* aRun)
|
||||
{
|
||||
G4int evts_to_process = aRun->GetNumberOfEventToBeProcessed();
|
||||
G4RunManager::GetRunManager()->SetPrintProgress(
|
||||
(evts_to_process > 100) ? evts_to_process / 100 : 1);
|
||||
if(IsMaster())
|
||||
// G4int evts_to_process = aRun->GetNumberOfEventToBeProcessed();
|
||||
// G4RunManager::GetRunManager()->SetPrintProgress(
|
||||
// (evts_to_process > 1000) ? evts_to_process / 1000 : 1);
|
||||
if(IsMaster() && aRun != nullptr)
|
||||
G4PrintEnv();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user