Geant4 VMC Version 6.6
Loading...
Searching...
No Matches
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
16#include "TG4EventAction.h"
17#include "TG4Globals.h"
18
19#include <G4UIcmdWithABool.hh>
20#include <G4UIdirectory.hh>
21
22//_____________________________________________________________________________
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//_____________________________________________________________________________
57
58//
59// public methods
60//
61
62//_____________________________________________________________________________
64 G4UIcommand* command, G4String newValue)
65{
67
68 if (command == fPrintMemoryCmd) {
69 fEventAction->SetPrintMemory(fPrintMemoryCmd->GetNewBoolValue(newValue));
70 }
71 else if (command == fSaveRandomStatusCmd) {
73 fSaveRandomStatusCmd->GetNewBoolValue(newValue));
74 }
75}
Definition of the TG4EventActionMessenger class.
Definition of the TG4EventAction class.
Definition of the TG4Globals class and basic container types.
G4UIcmdWithABool * fPrintMemoryCmd
command: printMemory
G4UIdirectory * fEventDirectory
command directory
G4UIcmdWithABool * fSaveRandomStatusCmd
command: saveRandom
virtual void SetNewValue(G4UIcommand *command, G4String string)
TG4EventAction * fEventAction
associated class
TG4EventActionMessenger()
Not implemented.
Actions at the beginning and the end of event.
void SetPrintMemory(G4bool printMemory)
void SetSaveRandomStatus(G4bool saveRandomStatus)