Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
PassiveProtonBeamLineMessenger Class Reference

#include <PassiveProtonBeamLineMessenger.hh>

Inheritance diagram for PassiveProtonBeamLineMessenger:
G4UImessenger

Public Member Functions

 PassiveProtonBeamLineMessenger (PassiveProtonBeamLine *)
 
 ~PassiveProtonBeamLineMessenger ()
 
void SetNewValue (G4UIcommand *, G4String)
 
- Public Member Functions inherited from G4UImessenger
 G4UImessenger ()
 
 G4UImessenger (const G4String &path, const G4String &dsc, G4bool commandsToBeBroadcasted=true)
 
virtual ~G4UImessenger ()
 
virtual G4String GetCurrentValue (G4UIcommand *command)
 
G4bool operator== (const G4UImessenger &messenger) const
 

Additional Inherited Members

- Protected Member Functions inherited from G4UImessenger
G4String ItoS (G4int i)
 
G4String DtoS (G4double a)
 
G4String BtoS (G4bool b)
 
G4int StoI (G4String s)
 
G4double StoD (G4String s)
 
G4bool StoB (G4String s)
 
void AddUIcommand (G4UIcommand *newCommand)
 
void CreateDirectory (const G4String &path, const G4String &dsc, G4bool commandsToBeBroadcasted=true)
 
template<typename T >
T * CreateCommand (const G4String &cname, const G4String &dsc)
 
- Protected Attributes inherited from G4UImessenger
G4UIdirectorybaseDir
 
G4String baseDirName
 

Detailed Description

Definition at line 47 of file PassiveProtonBeamLineMessenger.hh.

Constructor & Destructor Documentation

PassiveProtonBeamLineMessenger::PassiveProtonBeamLineMessenger ( PassiveProtonBeamLine beamLine)

Definition at line 42 of file PassiveProtonBeamLineMessenger.cc.

References G4State_Idle, and G4State_PreInit.

43 :passiveProton(beamLine)
44 
45 {
46  changeTheBeamLineDir = new G4UIdirectory("/ChangeBeamLine/");
47  changeTheBeamLineDir -> SetGuidance("Command to change the transport beam line");
48 
49  changeTheBeamLineNameCmd = new G4UIcmdWithAString("/ChangeBeamLine/beamLineName",this);
50  changeTheBeamLineNameCmd -> SetGuidance("Insert the name of the beam line you want simulate");
51  changeTheBeamLineNameCmd -> SetParameterName("List",false);
52  changeTheBeamLineNameCmd -> AvailableForStates(G4State_PreInit);
53 
54  modulatorDir = new G4UIdirectory("/modulator/");
55  modulatorDir -> SetGuidance("Command to rotate the modulator wheel");
56 
57  beamLineDir = new G4UIdirectory("/beamLine/");
58  beamLineDir -> SetGuidance("set specification of range shifter");
59 
60  rangeShifterDir = new G4UIdirectory("/beamLine/RangeShifter/");
61  rangeShifterDir -> SetGuidance("set specification of range shifter");
62 
63  firstScatteringFoilDir = new G4UIdirectory("/beamLine/ScatteringFoil1/");
64  firstScatteringFoilDir -> SetGuidance("set specification of first scattering foil");
65 
66  secondScatteringFoilDir = new G4UIdirectory("/beamLine/ScatteringFoil2/");
67  secondScatteringFoilDir -> SetGuidance("set specification of second scattering foil");
68 
69  rangeStopperDir = new G4UIdirectory("/beamLine/Stopper/");
70  rangeStopperDir -> SetGuidance("set specification of stopper");
71 
72  finalCollimatorDir = new G4UIdirectory("/beamLine/FinalCollimator/");
73  finalCollimatorDir -> SetGuidance("set specification of final collimator");
74 
75  modulatorAngleCmd = new G4UIcmdWithADoubleAndUnit("/modulator/angle",this);
76  modulatorAngleCmd -> SetGuidance("Set Modulator Angle");
77  modulatorAngleCmd -> SetParameterName("Size",false);
78  modulatorAngleCmd -> SetRange("Size>=0.");
79  modulatorAngleCmd -> SetUnitCategory("Angle");
80  modulatorAngleCmd -> AvailableForStates(G4State_Idle);
81 
82  rangeShifterMatCmd = new G4UIcmdWithAString("/beamLine/RangeShifter/RSMat",this);
83  rangeShifterMatCmd -> SetGuidance("Set material of range shifter");
84  rangeShifterMatCmd -> SetParameterName("choice",false);
85  rangeShifterMatCmd -> AvailableForStates(G4State_Idle);
86 
87  rangeShifterXSizeCmd = new G4UIcmdWithADoubleAndUnit("/beamLine/RangeShifter/thickness",this);
88  rangeShifterXSizeCmd -> SetGuidance("Set half of the thickness of range shifter along X axis");
89  rangeShifterXSizeCmd -> SetParameterName("Size",false);
90  rangeShifterXSizeCmd -> SetDefaultUnit("mm");
91  rangeShifterXSizeCmd -> SetUnitCandidates("mm cm m");
92  rangeShifterXSizeCmd -> AvailableForStates(G4State_Idle);
93 
94  rangeShifterXPositionCmd = new G4UIcmdWithADoubleAndUnit("/beamLine/RangeShifter/position",this);
95  rangeShifterXPositionCmd -> SetGuidance("Set position of range shifter");
96  rangeShifterXPositionCmd -> SetParameterName("Size",false);
97  rangeShifterXPositionCmd -> SetDefaultUnit("mm");
98  rangeShifterXPositionCmd -> SetUnitCandidates("mm cm m");
99  rangeShifterXPositionCmd -> AvailableForStates(G4State_Idle);
100 
101  firstScatteringFoilXSizeCmd = new G4UIcmdWithADoubleAndUnit("/beamLine/ScatteringFoil1/thickness",this);
102  firstScatteringFoilXSizeCmd -> SetGuidance("Set half thickness of first scattering foil");
103  firstScatteringFoilXSizeCmd -> SetParameterName("Size",false);
104  firstScatteringFoilXSizeCmd -> SetDefaultUnit("mm");
105  firstScatteringFoilXSizeCmd -> SetUnitCandidates("mm cm m");
106  firstScatteringFoilXSizeCmd -> AvailableForStates(G4State_Idle);
107 
108  secondScatteringFoilXSizeCmd = new G4UIcmdWithADoubleAndUnit("/beamLine/ScatteringFoil2/thickness",this);
109  secondScatteringFoilXSizeCmd -> SetGuidance("Set half thickness of second scattering foil");
110  secondScatteringFoilXSizeCmd -> SetParameterName("Size",false);
111  secondScatteringFoilXSizeCmd -> SetDefaultUnit("mm");
112  secondScatteringFoilXSizeCmd -> SetUnitCandidates("mm cm m");
113  secondScatteringFoilXSizeCmd -> AvailableForStates(G4State_Idle);
114 
115  outerRadiusStopperCmd = new G4UIcmdWithADoubleAndUnit("/beamLine/Stopper/outRadius",this);
116  outerRadiusStopperCmd -> SetGuidance("Set size of outer radius");
117  outerRadiusStopperCmd -> SetParameterName("Size",false);
118  outerRadiusStopperCmd -> SetDefaultUnit("mm");
119  outerRadiusStopperCmd -> SetUnitCandidates("mm cm m");
120  outerRadiusStopperCmd -> AvailableForStates(G4State_Idle);
121 
122  innerRadiusFinalCollimatorCmd = new G4UIcmdWithADoubleAndUnit("/beamLine/FinalCollimator/halfInnerRad",this);
123  innerRadiusFinalCollimatorCmd -> SetGuidance("Set size of inner radius ( max 21.5 mm)");
124  innerRadiusFinalCollimatorCmd -> SetParameterName("Size",false);
125  innerRadiusFinalCollimatorCmd -> SetDefaultUnit("mm");
126  innerRadiusFinalCollimatorCmd -> SetUnitCandidates("mm cm m");
127  innerRadiusFinalCollimatorCmd -> AvailableForStates(G4State_Idle);
128 }
PassiveProtonBeamLineMessenger::~PassiveProtonBeamLineMessenger ( )

Definition at line 130 of file PassiveProtonBeamLineMessenger.cc.

131 {
132  delete innerRadiusFinalCollimatorCmd;
133  delete outerRadiusStopperCmd;
134  delete secondScatteringFoilXSizeCmd;
135  delete firstScatteringFoilXSizeCmd;
136  delete rangeShifterXPositionCmd;
137  delete rangeShifterXSizeCmd;
138  delete rangeShifterMatCmd;
139  delete modulatorAngleCmd;
140  delete finalCollimatorDir;
141  delete rangeStopperDir;
142  delete secondScatteringFoilDir;
143  delete firstScatteringFoilDir;
144  delete rangeShifterDir;
145  delete beamLineDir;
146  delete modulatorDir;
147 }

Member Function Documentation

void PassiveProtonBeamLineMessenger::SetNewValue ( G4UIcommand command,
G4String  newValue 
)
virtual

Reimplemented from G4UImessenger.

Definition at line 152 of file PassiveProtonBeamLineMessenger.cc.

153 {
154  if( command == modulatorAngleCmd )
155  { passiveProton -> SetModulatorAngle
156  (modulatorAngleCmd -> GetNewDoubleValue(newValue));}
157 
158  else if( command == rangeShifterMatCmd )
159  { passiveProton -> SetRSMaterial(newValue);}
160 
161  else if( command == rangeShifterXSizeCmd )
162  { passiveProton -> SetRangeShifterXSize
163  (rangeShifterXSizeCmd -> GetNewDoubleValue(newValue));}
164 
165  else if( command == rangeShifterXPositionCmd )
166  { passiveProton -> SetRangeShifterXPosition
167  (rangeShifterXPositionCmd -> GetNewDoubleValue(newValue));}
168 
169  else if( command == firstScatteringFoilXSizeCmd )
170  { passiveProton -> SetFirstScatteringFoilXSize
171  (firstScatteringFoilXSizeCmd -> GetNewDoubleValue(newValue));}
172 
173  else if( command == secondScatteringFoilXSizeCmd )
174  { passiveProton -> SetSecondScatteringFoilXSize
175  (secondScatteringFoilXSizeCmd -> GetNewDoubleValue(newValue));}
176 
177  else if( command == outerRadiusStopperCmd )
178  { passiveProton -> SetOuterRadiusStopper(
179  outerRadiusStopperCmd -> GetNewDoubleValue(newValue));}
180 
181  else if( command == innerRadiusFinalCollimatorCmd )
182  { passiveProton -> SetInnerRadiusFinalCollimator
183  (innerRadiusFinalCollimatorCmd -> GetNewDoubleValue(newValue));}
184 }

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