Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PassiveProtonBeamLineMessenger Class Reference

#include <PassiveProtonBeamLineMessenger.hh>

Inheritance diagram for PassiveProtonBeamLineMessenger:
Collaboration diagram for PassiveProtonBeamLineMessenger:

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
 
G4bool CommandsShouldBeInMaster () 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
 
G4bool commandsShouldBeInMaster
 

Detailed Description

Definition at line 41 of file PassiveProtonBeamLineMessenger.hh.

Constructor & Destructor Documentation

PassiveProtonBeamLineMessenger::PassiveProtonBeamLineMessenger ( PassiveProtonBeamLine beamLine)

Definition at line 36 of file PassiveProtonBeamLineMessenger.cc.

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

Definition at line 124 of file PassiveProtonBeamLineMessenger.cc.

125 {
126  delete innerRadiusFinalCollimatorCmd;
127  delete outerRadiusStopperCmd;
128  delete secondScatteringFoilXSizeCmd;
129  delete firstScatteringFoilXSizeCmd;
130  delete rangeShifterXPositionCmd;
131  delete rangeShifterXSizeCmd;
132  delete rangeShifterMatCmd;
133  delete modulatorAngleCmd;
134  delete finalCollimatorDir;
135  delete rangeStopperDir;
136  delete secondScatteringFoilDir;
137  delete firstScatteringFoilDir;
138  delete rangeShifterDir;
139  delete beamLineDir;
140  delete modulatorDir;
141 }

Member Function Documentation

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

Reimplemented from G4UImessenger.

Definition at line 146 of file PassiveProtonBeamLineMessenger.cc.

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

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