Public Member Functions | Private Attributes | List of all members
EDepSim::UserRunActionMessenger Class Reference

#include <EDepSimUserRunActionMessenger.hh>

Inheritance diagram for EDepSim::UserRunActionMessenger:

Public Member Functions

 UserRunActionMessenger (EDepSim::UserRunAction *)
 
virtual ~UserRunActionMessenger ()
 
void SetNewValue (G4UIcommand *, G4String)
 Handle messages from the UI processor. More...
 
G4String GetPath ()
 Get the base directory for the messenger commands. More...
 

Private Attributes

EDepSim::UserRunActionfUserRunAction
 
G4UIdirectory * fDir
 
G4UIcmdWithAnInteger * fRandomSeedCmd
 
G4UIcmdWithoutParameter * fTimeRandomSeedCmd
 
G4UIcmdWithoutParameter * fShowRandomSeedCmd
 
G4UIcmdWithAnInteger * fDetSimRunIdCmd
 
G4UIcmdWithAnInteger * fDetSimSubrunIdCmd
 

Detailed Description

Definition at line 19 of file EDepSimUserRunActionMessenger.hh.

Constructor & Destructor Documentation

EDepSim::UserRunActionMessenger::UserRunActionMessenger ( EDepSim::UserRunAction rdm)

Definition at line 15 of file EDepSimUserRunActionMessenger.cc.

17  : fUserRunAction(rdm) {
18 
19  fDir = new G4UIdirectory("/edep/random/");
20  fDir->SetGuidance("Control of the random seed number.");
21 
23  = new G4UIcmdWithAnInteger("/edep/random/randomSeed",this);
24  fRandomSeedCmd->SetGuidance("Sets the random number generator seed"
25  " using a single integer.");
26 
28  = new G4UIcmdWithoutParameter("/edep/random/timeRandomSeed",this);
29  fTimeRandomSeedCmd->SetGuidance("Sets the random number generator seed"
30  " using the system time.");
31 
33  = new G4UIcmdWithoutParameter("/edep/random/showRandomSeed",this);
34  fShowRandomSeedCmd->SetGuidance("Show the random number seed.");
35 
37  = new G4UIcmdWithAnInteger("/edep/runId",this);
38  fDetSimRunIdCmd->SetGuidance("This is the first run id that will be used by"
39  " GEANT. GEANT will automatically increment"
40  " the run id every time it starts a new"
41  " internal run so care must be taken if you"
42  " depend on this to pass-through the run id.");
43 
45  = new G4UIcmdWithAnInteger("/edep/subrunId",this);
46  fDetSimSubrunIdCmd->SetGuidance("Set the sub run context field for"
47  " documentation purposes. This has no"
48  " internal meaning.");
49 }
EDepSim::UserRunActionMessenger::~UserRunActionMessenger ( )
virtual

Definition at line 51 of file EDepSimUserRunActionMessenger.cc.

51  {
52  delete fDir;
53  delete fRandomSeedCmd;
54  delete fTimeRandomSeedCmd;
55  delete fShowRandomSeedCmd;
56  delete fDetSimRunIdCmd;
57  delete fDetSimSubrunIdCmd;
58 }

Member Function Documentation

G4String EDepSim::UserRunActionMessenger::GetPath ( )

Get the base directory for the messenger commands.

Definition at line 86 of file EDepSimUserRunActionMessenger.cc.

86  {
87  return fDir->GetCommandPath();
88 }
void EDepSim::UserRunActionMessenger::SetNewValue ( G4UIcommand *  command,
G4String  newValue 
)

Handle messages from the UI processor.

Definition at line 60 of file EDepSimUserRunActionMessenger.cc.

61  {
62  if (command == fRandomSeedCmd) {
63  long seed = fRandomSeedCmd->GetNewIntValue(newValue);
64  fUserRunAction->SetSeed(seed);
65  }
66  else if (command == fTimeRandomSeedCmd) {
68  }
69  else if (command == fShowRandomSeedCmd) {
70  long seed = fUserRunAction->GetSeed();
71  EDepSimLog("### Random number seed: " << seed);
72  }
73  else if (command == fDetSimRunIdCmd) {
74  int runId = fDetSimRunIdCmd->GetNewIntValue(newValue);
76  }
77  else if (command == fDetSimSubrunIdCmd) {
78  int subrunId = fDetSimSubrunIdCmd->GetNewIntValue(newValue);
80  }
81  else {
82  EDepSimThrow("EDepSim::UserRunActionMessenger:: Unimplemented command");
83  }
84 }
#define EDepSimLog(outStream)
Definition: EDepSimLog.hh:717
int command
#define EDepSimThrow(message)
Print an error message, and then throw an exception.
void SetTimeSeed()
Build a seed for the generator based on the system time.
long GetSeed(void) const
Get the seed that started the low level random generator.

Member Data Documentation

G4UIcmdWithAnInteger* EDepSim::UserRunActionMessenger::fDetSimRunIdCmd
private

Definition at line 38 of file EDepSimUserRunActionMessenger.hh.

G4UIcmdWithAnInteger* EDepSim::UserRunActionMessenger::fDetSimSubrunIdCmd
private

Definition at line 39 of file EDepSimUserRunActionMessenger.hh.

G4UIdirectory* EDepSim::UserRunActionMessenger::fDir
private

Definition at line 34 of file EDepSimUserRunActionMessenger.hh.

G4UIcmdWithAnInteger* EDepSim::UserRunActionMessenger::fRandomSeedCmd
private

Definition at line 35 of file EDepSimUserRunActionMessenger.hh.

G4UIcmdWithoutParameter* EDepSim::UserRunActionMessenger::fShowRandomSeedCmd
private

Definition at line 37 of file EDepSimUserRunActionMessenger.hh.

G4UIcmdWithoutParameter* EDepSim::UserRunActionMessenger::fTimeRandomSeedCmd
private

Definition at line 36 of file EDepSimUserRunActionMessenger.hh.

EDepSim::UserRunAction* EDepSim::UserRunActionMessenger::fUserRunAction
private

Definition at line 32 of file EDepSimUserRunActionMessenger.hh.


The documentation for this class was generated from the following files: