Import Geant4 11.3.0 source tree

This commit is contained in:
Gabriele Cosmo
2024-12-06 11:11:40 +01:00
parent e58e650b32
commit 32390e802b
1984 changed files with 98713 additions and 83996 deletions
@@ -6,6 +6,11 @@ It must **not** be used as a substitute for writing good git commit messages!
-------------------------------------------------------------------------------
## 2024-10-19 Vladimir Ivanchenko (hadr-man-V11-02-02)
- G4HadronicProcessStore - fixed minor memory leak at exit by addition of
G4ThreadLocalSingleton pattern and removed deletion of extra processes
to avoid double deletion at exit.
## 2024-05-27 Vladimir Ivanchenko (hadr-man-V11-02-01)
- G4HadronicProcessStore - fixed handling of rare processes: printout,
cross section maximum search, and deletion end of run.
@@ -75,7 +75,6 @@ public:
~G4HadronicProcessStore();
void Clean();
G4double GetCrossSectionPerAtom(
const G4ParticleDefinition* particle,
G4double kineticEnergy,
@@ -65,35 +65,29 @@
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
G4ThreadLocal G4HadronicProcessStore* G4HadronicProcessStore::instance = nullptr;
G4HadronicProcessStore* G4HadronicProcessStore::Instance()
{
static thread_local auto* _instance = new G4HadronicProcessStore{};
return _instance;
if (nullptr == instance) {
static G4ThreadLocalSingleton<G4HadronicProcessStore> inst;
instance = inst.Instance();
}
return instance;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
G4HadronicProcessStore::~G4HadronicProcessStore()
{
Clean();
delete theEPTestMessenger;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
void G4HadronicProcessStore::Clean()
{
for (auto const& itr : process)
delete itr;
process.clear();
for (auto const& itr : extraProcess)
delete itr;
extraProcess.clear();
for (auto const& it : ep_map)
delete it.second;
if (!process.empty()) {
for (auto const& itr : process) {
delete itr;
}
process.clear();
}
ep_map.clear();
m_map.clear();
p_map.clear();
@@ -464,7 +458,6 @@ void G4HadronicProcessStore::DeRegister(G4HadronicProcess* proc)
for(G4int i=0; i<n_proc; ++i) {
if(process[i] == proc) {
process[i] = nullptr;
DeRegisterExtraProcess((G4VProcess*)proc);
return;
}
}