Geant4 VMC
Version 6.8
Toggle main menu visibility
Loading...
Searching...
No Matches
source
run
src
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
"
18
#include "
TG4UICmdWithAComplexString.h
"
19
20
#include <G4UIcmdWithABool.hh>
21
#include <G4UIcmdWithAString.hh>
22
#include <G4UIcmdWithoutParameter.hh>
23
#include <G4UIdirectory.hh>
24
25
//_____________________________________________________________________________
26
TG4RunMessenger::TG4RunMessenger
(
TG4RunManager
* runManager)
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
);
56
fRootCommandCmd
->SetDefaultValue(
" "
);
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
//_____________________________________________________________________________
73
TG4RunMessenger::~TG4RunMessenger
()
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
//_____________________________________________________________________________
90
void
TG4RunMessenger::SetNewValue
(
G4UIcommand
* command, G4String newValue)
91
{
93
94
if
(command ==
fRootCmd
) {
95
fRunManager
->StartRootUI();
96
}
97
else
if
(command ==
fRootMacroCmd
) {
98
fRunManager
->ProcessRootMacro(newValue);
99
}
100
else
if
(command ==
fRootCommandCmd
) {
101
fRunManager
->ProcessRootCommand(newValue);
102
}
103
else
if
(command ==
fUseRootRandomCmd
) {
104
fRunManager
->UseRootRandom(
fUseRootRandomCmd
->GetNewBoolValue(newValue));
105
}
106
else
if
(command ==
fG3DefaultsCmd
) {
107
fRunManager
->UseG3Defaults();
108
}
109
}
TG4Globals.h
Definition of the TG4Globals class and basic container types.
TG4RunManager.h
Definition of the TG4RunManager.h class.
TG4RunMessenger.h
Definition of the TG4RunMessenger class.
TG4UICmdWithAComplexString.h
Definition of the TG4UICmdWithAComplexString class.
G4UIcommand
G4UImessenger
TG4RunManager
Geant4 implementation of the TVirtualMC interface methods for access to Geant4 at run level.
Definition
TG4RunManager.h:45
TG4RunMessenger::TG4RunMessenger
TG4RunMessenger()
Not implemented.
TG4RunMessenger::fG3DefaultsCmd
G4UIcmdWithoutParameter * fG3DefaultsCmd
command: g3Defaults
Definition
TG4RunMessenger.h:66
TG4RunMessenger::fRunManager
TG4RunManager * fRunManager
associated class
Definition
TG4RunMessenger.h:59
TG4RunMessenger::fRootCmd
G4UIcmdWithoutParameter * fRootCmd
command: root
Definition
TG4RunMessenger.h:62
TG4RunMessenger::SetNewValue
virtual void SetNewValue(G4UIcommand *command, G4String string)
Definition
TG4RunMessenger.cxx:90
TG4RunMessenger::~TG4RunMessenger
virtual ~TG4RunMessenger()
Definition
TG4RunMessenger.cxx:73
TG4RunMessenger::fDirectory
G4UIdirectory * fDirectory
command directory
Definition
TG4RunMessenger.h:60
TG4RunMessenger::fRootCommandCmd
TG4UICmdWithAComplexString * fRootCommandCmd
command: rootCmd
Definition
TG4RunMessenger.h:64
TG4RunMessenger::fUseRootRandomCmd
G4UIcmdWithABool * fUseRootRandomCmd
command: useRootRandom
Definition
TG4RunMessenger.h:65
TG4RunMessenger::fRootMacroCmd
G4UIcmdWithAString * fRootMacroCmd
command: rootMacro
Definition
TG4RunMessenger.h:63
TG4UICmdWithAComplexString
G4 command that takes up to three string values.
Definition
TG4UICmdWithAComplexString.h:30
Generated on
for Geant4 VMC by
1.17.0