Geant4 VMC Version 6.6
Loading...
Searching...
No Matches
TG4RunMessenger.cxx
Go to the documentation of this file.
1//------------------------------------------------
2// The Geant4 Virtual Monte Carlo package
3// Copyright (C) 2007 - 2014 Ivana Hrivnacova
4// All rights reserved.
5//
6// For the licensing terms see geant4_vmc/LICENSE.
7// Contact: root-vmc@cern.ch
8//-------------------------------------------------
9
14
15#include "TG4RunMessenger.h"
16#include "TG4Globals.h"
17#include "TG4RunManager.h"
19
20#include <G4UIcmdWithABool.hh>
21#include <G4UIcmdWithAString.hh>
22#include <G4UIcmdWithoutParameter.hh>
23#include <G4UIdirectory.hh>
24
25//_____________________________________________________________________________
27 : G4UImessenger(),
28 fRunManager(runManager),
29 fDirectory(0),
30 fRootCmd(0),
31 fRootMacroCmd(0),
32 fRootCommandCmd(0),
33 fUseRootRandomCmd(0),
34 fG3DefaultsCmd(0)
35{
37
38 fDirectory = new G4UIdirectory("/mcControl/");
39 fDirectory->SetGuidance("TGeant4 control commands.");
40
41 fRootCmd = new G4UIcmdWithoutParameter("/mcControl/root", this);
42 fRootCmd->SetGuidance("Switch to Root interactive shell.");
43 fRootCmd->AvailableForStates(G4State_PreInit, G4State_Init, G4State_Idle,
44 G4State_GeomClosed, G4State_EventProc);
45
46 fRootMacroCmd = new G4UIcmdWithAString("/mcControl/rootMacro", this);
47 fRootMacroCmd->SetGuidance(
48 "Process Root macro with given name (from file name.C)");
49 fRootMacroCmd->SetParameterName("macroName", true);
50 fRootMacroCmd->AvailableForStates(G4State_PreInit, G4State_Init, G4State_Idle,
51 G4State_GeomClosed, G4State_EventProc);
52
53 fRootCommandCmd = new TG4UICmdWithAComplexString("/mcControl/rootCmd", this);
54 fRootCommandCmd->SetGuidance("Process Root command");
55 fRootCommandCmd->SetParameterName("command", false);
57 fRootCommandCmd->AvailableForStates(G4State_PreInit, G4State_Init,
58 G4State_Idle, G4State_GeomClosed, G4State_EventProc);
59
60 fUseRootRandomCmd = new G4UIcmdWithABool("/mcControl/useRootRandom", this);
61 fUseRootRandomCmd->SetGuidance(
62 "(In)Activate passing the random number seed from Root to Geant4");
63 fUseRootRandomCmd->SetParameterName("UseRootRandom", true);
64 fUseRootRandomCmd->AvailableForStates(G4State_PreInit);
65
66 fG3DefaultsCmd = new G4UIcmdWithoutParameter("/mcControl/g3Defaults", this);
67 fG3DefaultsCmd->SetGuidance("Set G3 default parameters (cut values,");
68 fG3DefaultsCmd->SetGuidance("tracking media max step values, ...)");
69 fG3DefaultsCmd->AvailableForStates(G4State_PreInit);
70}
71
72//_____________________________________________________________________________
74{
76
77 delete fDirectory;
78 delete fRootCmd;
79 delete fRootMacroCmd;
80 delete fRootCommandCmd;
81 delete fUseRootRandomCmd;
82 delete fG3DefaultsCmd;
83}
84
85//
86// public methods
87//
88
89//_____________________________________________________________________________
90void TG4RunMessenger::SetNewValue(G4UIcommand* command, G4String newValue)
91{
93
94 if (command == fRootCmd) {
96 }
97 else if (command == fRootMacroCmd) {
99 }
100 else if (command == fRootCommandCmd) {
102 }
103 else if (command == fUseRootRandomCmd) {
104 fRunManager->UseRootRandom(fUseRootRandomCmd->GetNewBoolValue(newValue));
105 }
106 else if (command == fG3DefaultsCmd) {
108 }
109}
Definition of the TG4Globals class and basic container types.
Definition of the TG4RunManager.h class.
Definition of the TG4RunMessenger class.
Definition of the TG4UICmdWithAComplexString class.
Geant4 implementation of the TVirtualMC interface methods for access to Geant4 at run level.
void UseRootRandom(G4bool useRootRandom)
void ProcessRootCommand(G4String command)
void ProcessRootMacro(G4String macroName)
TG4RunMessenger()
Not implemented.
G4UIcmdWithoutParameter * fG3DefaultsCmd
command: g3Defaults
TG4RunManager * fRunManager
associated class
G4UIcmdWithoutParameter * fRootCmd
command: root
virtual void SetNewValue(G4UIcommand *command, G4String string)
virtual ~TG4RunMessenger()
G4UIdirectory * fDirectory
command directory
TG4UICmdWithAComplexString * fRootCommandCmd
command: rootCmd
G4UIcmdWithABool * fUseRootRandomCmd
command: useRootRandom
G4UIcmdWithAString * fRootMacroCmd
command: rootMacro
G4 command that takes up to three string values.
void SetDefaultValue(const G4String &defVal)
void SetParameterName(const G4String &name, G4bool omittable)