1 |
|
2 |
#include "PrimaryGeneratorMessenger.hh" |
3 |
|
4 |
#include "PrimaryGeneratorAction.hh" |
5 |
#include "G4UIcmdWithAString.hh" |
6 |
|
7 |
|
8 |
|
9 |
PrimaryGeneratorMessenger::PrimaryGeneratorMessenger(PrimaryGeneratorAction* Gun) |
10 |
:Action(Gun) |
11 |
{ |
12 |
RndmCmd = new G4UIcmdWithAString("/gun/random",this); |
13 |
RndmCmd->SetGuidance("Shoot randomly the incident particle."); |
14 |
RndmCmd->SetGuidance(" Choice : on(default), off"); |
15 |
RndmCmd->SetParameterName("choice",true); |
16 |
RndmCmd->SetDefaultValue("on"); |
17 |
RndmCmd->SetCandidates("on off"); |
18 |
RndmCmd->AvailableForStates(G4State_PreInit,G4State_Idle); |
19 |
} |
20 |
|
21 |
|
22 |
|
23 |
PrimaryGeneratorMessenger::~PrimaryGeneratorMessenger() |
24 |
{ |
25 |
delete RndmCmd; |
26 |
} |
27 |
|
28 |
|
29 |
|
30 |
void PrimaryGeneratorMessenger::SetNewValue(G4UIcommand * command,G4String newValue) |
31 |
{ |
32 |
if( command == RndmCmd ) |
33 |
{ Action->SetRndmFlag(newValue);} |
34 |
} |
35 |
|
36 |
// 2005 by G.I.Vasilyev |