Geant4 VMC
Version 6.8
Toggle main menu visibility
Loading...
Searching...
No Matches
source
event
src
TG4EventActionMessenger.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 "
TG4EventActionMessenger.h
"
16
#include "
TG4EventAction.h
"
17
#include "
TG4Globals.h
"
18
19
#include <G4UIcmdWithABool.hh>
20
#include <G4UIdirectory.hh>
21
22
//_____________________________________________________________________________
23
TG4EventActionMessenger::TG4EventActionMessenger
(
TG4EventAction
* eventAction)
24
:
G4UImessenger
(),
25
fEventAction
(eventAction),
26
fEventDirectory
(0),
27
fPrintMemoryCmd
(0),
28
fSaveRandomStatusCmd
(0)
29
{
31
32
fEventDirectory
=
new
G4UIdirectory(
"/mcEvent/"
);
33
fEventDirectory
->SetGuidance(
"TG4EventAction control commands."
);
34
35
fPrintMemoryCmd
=
new
G4UIcmdWithABool(
"/mcEvent/printMemory"
,
this
);
36
fPrintMemoryCmd
->SetGuidance(
"Print memory usage at the end of event"
);
37
fPrintMemoryCmd
->SetParameterName(
"PrintMemory"
,
false
);
38
fPrintMemoryCmd
->AvailableForStates(
39
G4State_PreInit, G4State_Init, G4State_Idle);
40
41
fSaveRandomStatusCmd
=
new
G4UIcmdWithABool(
"/mcEvent/saveRandom"
,
this
);
42
fSaveRandomStatusCmd
->SetGuidance(
"Save random engine status for each event"
);
43
fSaveRandomStatusCmd
->SetParameterName(
"SaveRandom"
,
false
);
44
fSaveRandomStatusCmd
->AvailableForStates(
45
G4State_PreInit, G4State_Init, G4State_Idle);
46
}
47
48
//_____________________________________________________________________________
49
TG4EventActionMessenger::~TG4EventActionMessenger
()
50
{
52
53
delete
fEventDirectory
;
54
delete
fPrintMemoryCmd
;
55
delete
fSaveRandomStatusCmd
;
56
}
57
58
//
59
// public methods
60
//
61
62
//_____________________________________________________________________________
63
void
TG4EventActionMessenger::SetNewValue
(
64
G4UIcommand
* command, G4String newValue)
65
{
67
68
if
(command ==
fPrintMemoryCmd
) {
69
fEventAction
->SetPrintMemory(
fPrintMemoryCmd
->GetNewBoolValue(newValue));
70
}
71
else
if
(command ==
fSaveRandomStatusCmd
) {
72
fEventAction
->SetSaveRandomStatus(
73
fSaveRandomStatusCmd
->GetNewBoolValue(newValue));
74
}
75
}
TG4EventActionMessenger.h
Definition of the TG4EventActionMessenger class.
TG4EventAction.h
Definition of the TG4EventAction class.
TG4Globals.h
Definition of the TG4Globals class and basic container types.
G4UIcommand
G4UImessenger
TG4EventActionMessenger::fPrintMemoryCmd
G4UIcmdWithABool * fPrintMemoryCmd
command: printMemory
Definition
TG4EventActionMessenger.h:54
TG4EventActionMessenger::fEventDirectory
G4UIdirectory * fEventDirectory
command directory
Definition
TG4EventActionMessenger.h:53
TG4EventActionMessenger::fSaveRandomStatusCmd
G4UIcmdWithABool * fSaveRandomStatusCmd
command: saveRandom
Definition
TG4EventActionMessenger.h:55
TG4EventActionMessenger::SetNewValue
virtual void SetNewValue(G4UIcommand *command, G4String string)
Definition
TG4EventActionMessenger.cxx:63
TG4EventActionMessenger::fEventAction
TG4EventAction * fEventAction
associated class
Definition
TG4EventActionMessenger.h:52
TG4EventActionMessenger::~TG4EventActionMessenger
virtual ~TG4EventActionMessenger()
Definition
TG4EventActionMessenger.cxx:49
TG4EventActionMessenger::TG4EventActionMessenger
TG4EventActionMessenger()
Not implemented.
TG4EventAction
Actions at the beginning and the end of event.
Definition
TG4EventAction.h:41
Generated on
for Geant4 VMC by
1.17.0