7 #include <G4UIcmdWithADoubleAndUnit.hh>
8 #include <G4UIcmdWithAString.hh>
9 #include <G4UIcmdWithoutParameter.hh>
10 #include <G4UImanager.hh>
12 using namespace GroundPropagatorAG;
18 gammaCutCmd =
new G4UIcmdWithADoubleAndUnit(
"/physlist/CutGamma",
this);
23 gammaCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
25 electCutCmd =
new G4UIcmdWithADoubleAndUnit(
"/physlist/CutEl",
this);
30 electCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
32 posCutCmd =
new G4UIcmdWithADoubleAndUnit(
"/physlist/CutPos",
this);
33 posCutCmd->SetGuidance(
"Set positron cut.");
34 posCutCmd->SetParameterName(
"Pcut",
false);
37 posCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
39 pCutCmd =
new G4UIcmdWithADoubleAndUnit(
"/physlist/CutProt",
this);
40 pCutCmd->SetGuidance(
"Set proton cut.");
41 pCutCmd->SetParameterName(
"ProtCut",
false);
42 pCutCmd->SetUnitCategory(
"Length");
43 pCutCmd->SetRange(
"ProtCut>=0.0");
44 pCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
46 allCutCmd =
new G4UIcmdWithADoubleAndUnit(
"/physlist/CutsAll",
this);
47 allCutCmd->SetGuidance(
"Set cut for all.");
51 allCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
53 pListCmd =
new G4UIcmdWithAString(
"/physlist/Physics",
this);
54 pListCmd->SetGuidance(
"Add modula physics list.");
55 pListCmd->SetParameterName(
"PList",
false);
56 pListCmd->AvailableForStates(G4State_PreInit);
58 listCmd =
new G4UIcmdWithoutParameter(
"/physlist/ListPhysics",
this);
59 listCmd->SetGuidance(
"Available Physics Lists");
60 listCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
81 G4UImanager* UI = G4UImanager::GetUIpointer();
86 UI->ApplyCommand(
"/run/setCutForAGivenParticle gamma " + newValue);
93 UI->ApplyCommand(
"/run/setCutForAGivenParticle e- " + newValue);
100 UI->ApplyCommand(
"/run/setCutForAGivenParticle e+ " + newValue);
103 }
else if( command ==
pCutCmd ) {
107 UI->ApplyCommand(
"/run/setCutForAGivenParticle proton " + newValue);
113 G4double cut =
allCutCmd->GetNewDoubleValue(newValue);
119 UI->ApplyCommand(
"/run/setCut " + newValue);
124 G4String name = newValue;
125 if(name ==
"PHYSLIST") {
126 char* path = getenv(name);
128 name = G4String(path);
130 G4cerr <<
"### PhysicsListMessenger WARNING: "
131 <<
" environment variable PHYSLIST is not defined"
138 G4cerr <<
"### PhysicsListMessenger WARNING: "
139 <<
" /physlist/Physics UI command is not available "
140 <<
"for reference Physics List" << G4endl;
143 }
else if( command ==
listCmd ) {
147 G4cerr <<
"### PhysicsListMessenger WARNING: "
148 <<
" /physlist/ListPhysics UI command is not available "
149 <<
"for reference Physics List" << G4endl;
G4UIcmdWithAString * pListCmd
virtual ~PhysicsListMessenger()
void SetCutForElectron(G4double)
G4UIcmdWithADoubleAndUnit * gammaCutCmd
G4UIcmdWithADoubleAndUnit * posCutCmd
PhysicsList * pPhysicsList
PhysicsListMessenger(PhysicsList *p=0)
G4UIcmdWithADoubleAndUnit * allCutCmd
void SetCutForProton(G4double)
void SetNewValue(G4UIcommand *, G4String)
G4UIcmdWithADoubleAndUnit * pCutCmd
G4UIcmdWithoutParameter * listCmd
void AddPhysicsList(const G4String &name)
void SetCutForGamma(G4double)
G4UIcmdWithADoubleAndUnit * electCutCmd
void SetCutForPositron(G4double)