Skip to content

Commit

Permalink
Merge pull request #45986 from civanch/init_static_and_threadlocal_si…
Browse files Browse the repository at this point in the history
…ngletones

[SIM] improved initialisation
  • Loading branch information
cmsbuild committed Sep 13, 2024
2 parents e5de2f7 + 9390806 commit 6e31ebe
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions SimG4Core/Application/src/RunManagerMT.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
#include "G4ParticleTable.hh"
#include "G4CascadeInterface.hh"
#include "G4EmParameters.hh"
#include "G4LossTableManager.hh"
#include "G4HadronicParameters.hh"
#include "G4NuclearLevelData.hh"
#include <CLHEP/Units/SystemOfUnits.h>
Expand All @@ -51,6 +52,8 @@
#include "G4PhysicalVolumeStore.hh"
#include "G4Region.hh"
#include "G4RegionStore.hh"
#include "G4PhysListUtil.hh"
#include "G4PhysicsListHelper.hh"

#include <iostream>
#include <sstream>
Expand Down Expand Up @@ -85,6 +88,8 @@ RunManagerMT::RunManagerMT(edm::ParameterSet const& p)
m_UIsession = new CustomUIsession();
G4UImanager::GetUIpointer()->SetCoutDestination(m_UIsession);
G4UImanager::GetUIpointer()->SetMasterUIManager(true);
G4PhysListUtil::InitialiseParameters();
G4LossTableManager::Instance();
}

RunManagerMT::~RunManagerMT() { delete m_UIsession; }
Expand Down Expand Up @@ -150,6 +155,7 @@ void RunManagerMT::initG4(const DDCompactView* pDD,
G4HadronicParameters::Instance()->SetVerboseLevel(verb);
G4EmParameters::Instance()->SetVerbose(verb);
G4EmParameters::Instance()->SetWorkerVerbose(std::max(verb - 1, 0));
G4PhysicsListHelper::GetPhysicsListHelper();

// exotic particle physics
double monopoleMass = m_pPhysics.getUntrackedParameter<double>("MonopoleMass", 0);
Expand Down
4 changes: 4 additions & 0 deletions SimG4Core/Application/src/RunManagerMTWorker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@
#include "G4WorkerRunManagerKernel.hh"
#include "G4StateManager.hh"
#include "G4TransportationManager.hh"
#include "G4LossTableManager.hh"
#include "G4PhysListUtil.hh"
#include "G4Field.hh"
#include "G4FieldManager.hh"
#include "G4ScoringManager.hh"
Expand Down Expand Up @@ -187,6 +189,8 @@ RunManagerMTWorker::RunManagerMTWorker(const edm::ParameterSet& p, edm::Consumes
<< "', valid are MessageLogger, MessageLoggerThreadPrefix, FilePerThread";
}
G4UImanager::GetUIpointer()->SetCoutDestination(m_UIsession);
//G4PhysListUtil::InitialiseParameters();
//G4LossTableManager::Instance();

// sensitive detectors
std::vector<std::string> onlySDs = p.getParameter<std::vector<std::string>>("OnlySDs");
Expand Down

0 comments on commit 6e31ebe

Please sign in to comment.