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"
15 #include "CLHEP/Units/PhysicalConstants.h"
22 : base_class(
name,pSvcLocator)
42 return StatusCode::SUCCESS;
50 G4PhysListFactory factory;
67 throw "PhysicsListInitializationError";
74 std::vector<IPhysicsOptionTool*> sortedPhysicsOptions;
81 sortedPhysicsOptions.push_back(&*physOptTool);
88 sortedPhysicsOptions.push_back(&*physOptTool);
95 sortedPhysicsOptions.push_back(&*physOptTool);
102 sortedPhysicsOptions.push_back(&*physOptTool);
109 ATH_MSG_ERROR(physOptTool->name() <<
"set as UnknownType. This tool will not be used to modify the physics list of this job.");
115 for (
auto& physOptTool: sortedPhysicsOptions)
118 m_physicsList->RegisterPhysics(physOptTool->GetPhysicsOption());
124 m_physicsList->RegisterPhysics(physDecayTool->GetPhysicsOption());
146 G4RunManager::GetRunManager()->SetUserInitialization(
m_physicsList);
154 ATH_MSG_WARNING(
"Physics list not initialized before calling ConstructProcess()");
163 std::vector<std::string> g4commands;
166 std::ostringstream oss;
168 g4commands.push_back(oss.str());
173 std::ostringstream oss;
175 g4commands.push_back(oss.str());
178 if(!g4commands.empty()) {
181 G4UImanager* ui = G4UImanager::GetUIpointer();
182 for (
const auto& g4command : g4commands) {
183 int returnCode = ui->ApplyCommand( g4command );
188 G4EmParameters* emp = G4EmParameters::Instance();
194 emp->SetApplyCuts(
true);
198 G4AntiNeutron::Definition()->SetPDGStable(
false);
208 case 0: {
ATH_MSG_DEBUG(
"G4 Command: " << commandString <<
" - Command Succeeded"); }
break;
209 case 100: {
ATH_MSG_ERROR(
"G4 Command: " << commandString <<
" - Command Not Found!"); }
break;
211 auto* stateManager = G4StateManager::GetStateManager();
212 ATH_MSG_DEBUG(
"G4 Command: " << commandString <<
" - Illegal Application State (" <<
213 stateManager->GetStateString(stateManager->GetCurrentState()) <<
")!");
215 case 300: {
ATH_MSG_ERROR(
"G4 Command: " << commandString <<
" - Parameter Out of Range!"); }
break;
216 case 400: {
ATH_MSG_ERROR(
"G4 Command: " << commandString <<
" - Parameter Unreadable!"); }
break;
217 case 500: {
ATH_MSG_ERROR(
"G4 Command: " << commandString <<
" - Parameter Out of Candidates!"); }
break;
218 case 600: {
ATH_MSG_ERROR(
"G4 Command: " << commandString <<
" - Alias Not Found!"); }
break;
219 default: {
ATH_MSG_ERROR(
"G4 Command: " << commandString <<
" - Unknown Status!"); }
break;