7 #include "G4VUserPhysicsList.hh"
8 #include "G4StateManager.hh"
9 #include "G4RunManager.hh"
10 #include "G4EmParameters.hh"
11 #include "G4UImanager.hh"
12 #include "G4PhysListFactory.hh"
13 #include "G4AntiNeutron.hh"
14 #include "G4HadronicProcessStore.hh"
16 #include "CLHEP/Units/PhysicalConstants.h"
23 : base_class(
name,pSvcLocator)
43 return StatusCode::SUCCESS;
51 G4PhysListFactory factory;
56 G4HadronicProcessStore::Instance()->SetVerbose(0);
73 throw "PhysicsListInitializationError";
80 std::vector<IPhysicsOptionTool*> sortedPhysicsOptions;
87 sortedPhysicsOptions.push_back(&*physOptTool);
94 sortedPhysicsOptions.push_back(&*physOptTool);
101 sortedPhysicsOptions.push_back(&*physOptTool);
108 sortedPhysicsOptions.push_back(&*physOptTool);
115 ATH_MSG_ERROR(physOptTool->name() <<
"set as UnknownType. This tool will not be used to modify the physics list of this job.");
121 for (
auto& physOptTool: sortedPhysicsOptions)
124 m_physicsList->RegisterPhysics(physOptTool->GetPhysicsOption());
130 m_physicsList->RegisterPhysics(physDecayTool->GetPhysicsOption());
152 G4RunManager::GetRunManager()->SetUserInitialization(
m_physicsList);
160 ATH_MSG_WARNING(
"Physics list not initialized before calling ConstructProcess()");
169 std::vector<std::string> g4commands;
172 std::ostringstream oss;
174 g4commands.push_back(oss.str());
179 std::ostringstream oss;
181 g4commands.push_back(oss.str());
184 if(!g4commands.empty()) {
187 G4UImanager* ui = G4UImanager::GetUIpointer();
188 for (
const auto& g4command : g4commands) {
189 int returnCode = ui->ApplyCommand( g4command );
194 G4EmParameters* emp = G4EmParameters::Instance();
200 emp->SetApplyCuts(
true);
204 G4AntiNeutron::Definition()->SetPDGStable(
false);
214 case 0: {
ATH_MSG_DEBUG(
"G4 Command: " << commandString <<
" - Command Succeeded"); }
break;
215 case 100: {
ATH_MSG_ERROR(
"G4 Command: " << commandString <<
" - Command Not Found!"); }
break;
217 auto* stateManager = G4StateManager::GetStateManager();
218 ATH_MSG_DEBUG(
"G4 Command: " << commandString <<
" - Illegal Application State (" <<
219 stateManager->GetStateString(stateManager->GetCurrentState()) <<
")!");
221 case 300: {
ATH_MSG_ERROR(
"G4 Command: " << commandString <<
" - Parameter Out of Range!"); }
break;
222 case 400: {
ATH_MSG_ERROR(
"G4 Command: " << commandString <<
" - Parameter Unreadable!"); }
break;
223 case 500: {
ATH_MSG_ERROR(
"G4 Command: " << commandString <<
" - Parameter Out of Candidates!"); }
break;
224 case 600: {
ATH_MSG_ERROR(
"G4 Command: " << commandString <<
" - Alias Not Found!"); }
break;
225 default: {
ATH_MSG_ERROR(
"G4 Command: " << commandString <<
" - Unknown Status!"); }
break;