22#include <G4AnalysisUtilities.hh>
23#include <G4HadronicProcessStore.hh>
24#include <G4ParticleHPManager.hh>
25#include <G4UIcmdWithADouble.hh>
26#include <G4UIcmdWithADoubleAndUnit.hh>
27#include <G4UIcmdWithAString.hh>
28#include <G4UIcmdWithAnInteger.hh>
29#include <G4UIcmdWithoutParameter.hh>
30#include <G4UIdirectory.hh>
31#include <G4UnitsTable.hh>
37 fPhysicsList(physicsList),
39 fRangeElectronCutCmd(0),
40 fRangePositronCutCmd(0),
41 fRangeProtonCutCmd(0),
43 fSetGammaToMuonsCrossSectionFactorCmd(0),
44 fSetCrossSectionFactorCmd(0),
45 fPrintProcessMapCmd(0),
46 fPrintVolumeLimitsCmd(0),
47 fPrintGlobalCutsCmd(0),
48 fPrintGlobalControlsCmd(0),
49 fG4ParticleHPVerboseCmd(0),
50 fG4HadronicProcessStoreVerboseCmd(0)
55 fDirectory->SetGuidance(
"TGeant4 physics control commands.");
58 new G4UIcmdWithADoubleAndUnit(
"/mcPhysics/rangeCutForGamma",
this);
66 new G4UIcmdWithADoubleAndUnit(
"/mcPhysics/rangeCutForElectron",
this);
74 new G4UIcmdWithADoubleAndUnit(
"/mcPhysics/rangeCutForPositron",
this);
82 new G4UIcmdWithADoubleAndUnit(
"/mcPhysics/rangeCutForProton",
this);
89 fRangeAllCutCmd =
new G4UIcmdWithADoubleAndUnit(
"/mcPhysics/rangeCuts",
this);
99 "/mcPhysics/setGammaToMuonsCrossSectionFactor",
this);
100 G4String guidance =
"Set gamma to muons cross section factor";
103 "GammaToMuonsCrossSectionFactor",
false);
109 new G4UIcmdWithoutParameter(
"/mcPhysics/printAllProcess",
this);
111 "Print names for all instantiated processes.");
115 new G4UIcmdWithoutParameter(
"/mcPhysics/dumpAllProcess",
this);
120 new G4UIcmdWithoutParameter(
"/mcPhysics/printProcessMap",
this);
122 "Print mapping of G4 processes to VMC process codes and (G3-like) controls.");
126 new G4UIcmdWithAString(
"/mcPhysics/printVolumeLimits",
this);
128 "Print the limits set for the specified volume.");
133 new G4UIcmdWithoutParameter(
"/mcPhysics/printGlobalCuts",
this);
138 new G4UIcmdWithoutParameter(
"/mcPhysics/printGlobalControls",
this);
140 "Print global VMC (G3-like) process controls.");
144 new G4UIcmdWithAnInteger(
"/mcPhysics/g4ParticleHPVerbose",
this);
150 new G4UIcmdWithAnInteger(
"/mcPhysics/g4HadronicProcessStoreVerbose",
this);
152 "Set G4NeutronHPManager verbose level");
154 "HadronicProcessStoreVerbose",
false);
156 G4State_PreInit, G4State_Idle);
159 new G4UIcmdWithoutParameter(
"/mcPhysics/useLowLooperThresholds",
this);
161 "Set lower thresholds for killing particles looping in magnetic field.");
165 new G4UIcmdWithoutParameter(
"/mcPhysics/useHighLooperThresholds",
this);
167 "Set higher thresholds for killing particles looping in magnetic field.");
206 G4UIparameter* minEnergy =
new G4UIparameter(
"minEnergy",
'd',
false);
207 minEnergy->SetGuidance(
"Production cuts table minimum energy.");
209 G4UIparameter* minEnergyUnit =
new G4UIparameter(
"minEnergyUnit",
's',
false);
210 minEnergyUnit->SetGuidance(
"Production cuts table min energy unit.");
212 G4UIparameter* maxEnergy =
new G4UIparameter(
"maxEnergy",
'd',
false);
213 maxEnergy->SetGuidance(
"Production cuts table maximum energy.");
215 G4UIparameter* maxEnergyUnit =
new G4UIparameter(
"maxEnergyUnit",
's',
false);
216 maxEnergyUnit->SetGuidance(
"Production cuts table max energy unit.");
219 new G4UIcommand(
"/mcPhysics/productionCutsTableEnergyRange",
this);
221 "Set the production cuts table energy range.");
232 auto particleName =
new G4UIparameter(
"particleName",
's',
false);
233 particleName->SetGuidance(
"Particle name.");
235 auto processDef =
new G4UIparameter(
"processDef",
's',
false);
236 processDef->SetGuidance(
237 "Process name (default) or process type name "
238 "(if the last ommitable parameter is set to true");
240 auto factor =
new G4UIparameter(
"factor",
'd',
false);
241 factor->SetGuidance(
"Cross section scale factor.");
243 auto isProcessName =
new G4UIparameter(
"isProcessName",
'b',
true);
244 isProcessName->SetDefaultValue(
true);
245 isProcessName->SetGuidance(
246 "Set false if process is defined by its type name and not by its name.");
249 new G4UIcommand(
"/mcPhysics/setCrossSectionFactor",
this);
251 "Set the cross section scale factor for a selected particle "
252 "and hadronic process");
303 std::vector<G4String> parameters;
304 G4Analysis::Tokenize(newValue, parameters);
307 G4double minEnergy = G4UIcommand::ConvertToDouble(parameters[counter++]);
308 G4double minEUnit = G4UnitDefinition::GetValueOf(parameters[counter++]);
309 G4double maxEnergy = G4UIcommand::ConvertToDouble(parameters[counter++]);
310 G4double maxEUnit = G4UnitDefinition::GetValueOf(parameters[counter++]);
312 minEnergy * minEUnit, maxEnergy * maxEUnit);
315 G4double value = G4UIcommand::ConvertToDouble(newValue);
320 std::vector<G4String> parameters;
321 G4Analysis::Tokenize(newValue, parameters);
324 auto particleName = parameters[counter++];;
325 auto processDef = parameters[counter++];
326 auto factor = G4UIcommand::ConvertToDouble(parameters[counter++]);
327 auto isProcessName = G4UIcommand::ConvertToBool(parameters[counter++]);
329 particleName, processDef, factor, isProcessName);
350 G4ParticleHPManager::GetInstance()->SetVerboseLevel(
354 G4HadronicProcessStore::Instance()->SetVerbose(
Definition of the TG4ComposedPhysicsList class.
Definition of the TG4ComposedPhysicsMessenger class.
Definition of the TG4G3PhysicsManager class.
Definition of the TG4GeometryServices class.
Definition of the TG4PhysicsManager class.
Definition of the TG4ProcessMap class.
The Geant4 VMC physics list builder.
void SetCutForProton(G4double cut)
void SetGammaToMuonsCrossSectionFactor(G4double value)
void SetLooperThresholdsLevel(G4int level)
void DumpAllProcesses() const
void PrintAllProcesses() const
void SetProductionCutsTableEnergyRange(G4double min, G4double max)
void SetCutForGamma(G4double cut)
void SetCutForElectron(G4double cut)
void SetCutForPositron(G4double cut)
void SetCrossSectionFactor(const G4String &particleName, const G4String &processDef, G4double value, G4bool isProcessName)
virtual void SetNewValue(G4UIcommand *command, G4String string)
G4UIcmdWithADoubleAndUnit * fRangePositronCutCmd
rangeCutForPositron command
G4UIdirectory * fDirectory
command directory
G4UIcmdWithADouble * fSetGammaToMuonsCrossSectionFactorCmd
setGammaToMuonsCrossSectionFactor
G4UIcmdWithADoubleAndUnit * fRangeElectronCutCmd
rangeCutForElectron command
G4UIcommand * fSetCrossSectionFactorCmd
setCrossSectionFactor
G4UIcmdWithAnInteger * fG4ParticleHPVerboseCmd
g4ParticleHPVerbose command
G4UIcmdWithAString * fPrintVolumeLimitsCmd
printVolumeLimits command
void CreateSetCrossSectionFactorCmd()
void CreateProductionCutsTableEnergyRangeCmd()
G4UIcmdWithoutParameter * fPrintAllProcessesCmd
printAllProcess command
virtual ~TG4ComposedPhysicsMessenger()
G4UIcmdWithADoubleAndUnit * fRangeProtonCutCmd
rangeCutForProton command
G4UIcmdWithoutParameter * fPrintProcessMapCmd
printProcessMap command
TG4ComposedPhysicsList * fPhysicsList
associated class
G4UIcmdWithoutParameter * fUseHighLooperThresholdsCmd
useHigherLooperThresholds command
G4UIcmdWithoutParameter * fPrintGlobalControlsCmd
printGeneralControls command
G4UIcmdWithoutParameter * fDumpAllProcessesCmd
dumpAllProcess command
G4UIcmdWithAnInteger * fG4HadronicProcessStoreVerboseCmd
g4HadronicProcessStoreVerbose command
G4UIcommand * fProductionCutsTableEnergyRangeCmd
productionCutsTableEnergyRange command
G4UIcmdWithoutParameter * fUseLowLooperThresholdsCmd
useLowerLooperThresholds command
G4UIcmdWithADoubleAndUnit * fRangeAllCutCmd
rangeCuts command
TG4ComposedPhysicsMessenger()
Not implemented.
G4UIcmdWithoutParameter * fPrintGlobalCutsCmd
printGeneralCuts command
G4UIcmdWithADoubleAndUnit * fRangeGammaCutCmd
rangeCutForGamma command
TG4G3ControlVector * GetControlVector() const
static TG4G3PhysicsManager * Instance()
TG4G3CutVector * GetCutVector() const
static TG4GeometryServices * Instance()
void PrintVolumeLimits(const G4String &volumeName) const
void SetCutForProton(G4double cut)
static TG4PhysicsManager * Instance()
void SetCutForPositron(G4double cut)
void SetCutForElectron(G4double cut)
void SetCutForGamma(G4double cut)
static TG4ProcessMap * Instance()