4 // See the class description in the header file.
6 #include "TG4PhysicsListMessenger.h"
7 #include "TG4PhysicsList.h"
8 #include "TG4Globals.h"
10 #include <G4UIcmdWithABool.hh>
12 TG4PhysicsListMessenger::TG4PhysicsListMessenger(TG4PhysicsList* physicsList)
13 : fPhysicsList(physicsList)
17 = new G4UIcmdWithABool("/g4mc/setOptical", this);
18 fSetOpticalCmd->SetGuidance("Set Cerenkov and optical processes.");
19 fSetOpticalCmd->SetParameterName("OpticalControl", false);
20 fSetOpticalCmd->AvailableForStates(PreInit);
23 = new G4UIcmdWithABool("/g4mc/setHadron", this);
24 fSetHadronCmd->SetGuidance("Set hadron processes.");
25 fSetHadronCmd->SetParameterName("HadronControl", false);
26 fSetHadronCmd->AvailableForStates(PreInit);
29 = new G4UIcmdWithABool("/g4mc/setSpecialCuts", this);
30 fSetSpecialCutsCmd->SetGuidance("Set special cuts process.");
32 ->SetGuidance("!! Support for this option is under development.");
33 fSetSpecialCutsCmd->SetParameterName("SpecialCutsControl", false);
34 fSetSpecialCutsCmd->AvailableForStates(PreInit);
37 = new G4UIcmdWithABool("/g4mc/setSpecialFlags", this);
38 fSetSpecialFlagsCmd->SetGuidance("Set special flags process.");
40 ->SetGuidance("!! Support for this option is under development.");
41 fSetSpecialFlagsCmd->SetParameterName("SpecialFlagsControl", false);
42 fSetSpecialFlagsCmd->AvailableForStates(PreInit);
45 TG4PhysicsListMessenger::TG4PhysicsListMessenger(
46 const TG4PhysicsListMessenger& right) {
48 TG4Globals::Exception(
49 "TG4PhysicsListMessenger is protected from copying.");
52 TG4PhysicsListMessenger::~TG4PhysicsListMessenger() {
54 delete fSetOpticalCmd;
56 delete fSetSpecialCutsCmd;
57 delete fSetSpecialFlagsCmd;
62 TG4PhysicsListMessenger&
63 TG4PhysicsListMessenger::operator=(const TG4PhysicsListMessenger& right)
65 // check assignement to self
66 if (this == &right) return *this;
68 TG4Globals::Exception(
69 "TG4PhysicsListMessenger is protected from assigning.");
76 void TG4PhysicsListMessenger::SetNewValue(G4UIcommand* command,
79 // Applies command to the associated object.
82 if (command == fSetOpticalCmd) {
84 ->SetOptical(fSetOpticalCmd->GetNewBoolValue(newValues));
86 else if (command == fSetHadronCmd) {
88 ->SetHadron(fSetHadronCmd->GetNewBoolValue(newValues));
90 else if (command == fSetSpecialCutsCmd) {
92 ->SetSpecialCuts(fSetSpecialCutsCmd->GetNewBoolValue(newValues));
94 else if (command == fSetSpecialFlagsCmd) {
96 ->SetSpecialFlags(fSetSpecialFlagsCmd->GetNewBoolValue(newValues));