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

#include <LaserDrivenBeamLineMessenger.hh>

Inheritance diagram for LaserDrivenBeamLineMessenger:
Collaboration diagram for LaserDrivenBeamLineMessenger:

Public Member Functions

 LaserDrivenBeamLineMessenger (LaserDrivenBeamLine *)
 
 ~LaserDrivenBeamLineMessenger ()
 
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 LaserDrivenBeamLineMessenger.hh.

Constructor & Destructor Documentation

LaserDrivenBeamLineMessenger::LaserDrivenBeamLineMessenger ( LaserDrivenBeamLine laserDriven)

Definition at line 38 of file LaserDrivenBeamLineMessenger.cc.

39  :laserDrivenMessengerPointer(laserDriven)
40 {
41 // Messenger directories for the Energy Selector module
42  laserDrivenDir = new G4UIdirectory("/LaserDriven/");
43  laserDrivenDir -> SetGuidance("The Laser Driven Beam Line module of Hadrontherapy");
44 
45  // Messenger directories for the Energy Selector module
46  energySelectorDir = new G4UIdirectory("/LaserDriven/EnergySelector/");
47  energySelectorDir -> SetGuidance("The Energy selector (ESS) module of Hadrontherapy");
48 
49  FcollimatorDir = new G4UIdirectory("/LaserDriven/EnergySelector/FirstCollimator/");
50  FcollimatorDir -> SetGuidance("Define geometrical characteristics of the ESS first collimator");
51 
52  ScollimatorDir = new G4UIdirectory("/LaserDriven/EnergySelector/SecondCollimator/");
53  ScollimatorDir -> SetGuidance("Define geometrical characteristics of the ESS second collimator");
54 
55  slitDir = new G4UIdirectory("/LaserDriven/EnergySelector/Slit/");
56  slitDir -> SetGuidance("Define geometrical characteristics of the ESS slit");
57 
58  // Messenger directories for the Quadrupole module
59  quadrupoleDir = new G4UIdirectory("/LaserDriven/Quadrupoles/");
60  quadrupoleDir -> SetGuidance("The Quadrupoles module of Hadrontherapy");
61 
62  relativePosDir = new G4UIdirectory("/LaserDriven/Quadrupoles/xRelPosition/");
63  relativePosDir -> SetGuidance("Define the x relative positions of the quadrupoles");
64 
65  // ESS DISABLE
66  DisableESSCmd = new G4UIcmdWithoutParameter("/LaserDriven/EnergySelector/Disable", this);
67  DisableESSCmd -> SetGuidance("Disable the Energy Selector.");
68  DisableESSCmd -> SetGuidance("This command MUST be applied before \"beamOn\" ");
69  DisableESSCmd -> AvailableForStates(G4State_Idle);
70 
71  // THE FIRST ESS COLLIMATOR
72  //
73  // Diameter of the first collimator
74  FcollimatorRadiusCmd = new G4UIcmdWithADoubleAndUnit("/LaserDriven/EnergySelector/FirstCollimator/Radius", this);
75  FcollimatorRadiusCmd -> SetGuidance("Set the Radius of the first collimator");
76  FcollimatorRadiusCmd -> SetParameterName("Size",false);
77  FcollimatorRadiusCmd -> SetDefaultUnit("mm");
78  FcollimatorRadiusCmd -> SetUnitCandidates("mm cm m");
79  FcollimatorRadiusCmd -> AvailableForStates(G4State_Idle);
80 
81  // Thickness of the first collimator
82  FcollimatorThicknessCmd = new G4UIcmdWithADoubleAndUnit("/LaserDriven/EnergySelector/FirstCollimator/Thickness", this);
83  FcollimatorThicknessCmd -> SetGuidance("Set the thickness of the first collimator");
84  FcollimatorThicknessCmd -> SetParameterName("Size",false);
85  FcollimatorThicknessCmd -> SetDefaultUnit("mm");
86  FcollimatorThicknessCmd -> SetUnitCandidates("mm cm m");
87  FcollimatorThicknessCmd -> AvailableForStates(G4State_Idle);
88 
89  // Z Position of the first collimator hole
90  FcollimatorZpositionCmd = new G4UIcmdWithADoubleAndUnit("/LaserDriven/EnergySelector/FirstCollimator/zPosizion", this);
91  FcollimatorZpositionCmd -> SetGuidance("Set the Z position of the first collimator hole as respect the internal vacuum chamber center axis");
92  FcollimatorZpositionCmd -> SetParameterName("Size",false);
93  FcollimatorZpositionCmd -> SetDefaultUnit("mm");
94  FcollimatorZpositionCmd -> SetUnitCandidates("mm cm m");
95  FcollimatorZpositionCmd -> AvailableForStates(G4State_Idle);
96 
97  // THE SECOND ESS COLLIMATOR
98  //
99  // Diameter of the second collimator
100  ScollimatorRadiusCmd = new G4UIcmdWithADoubleAndUnit("/LaserDriven/EnergySelector/SecondCollimator/Radius", this);
101  ScollimatorRadiusCmd -> SetGuidance("Set the Radius of the second collimator");
102  ScollimatorRadiusCmd -> SetParameterName("Size",false);
103  ScollimatorRadiusCmd -> SetDefaultUnit("mm");
104  ScollimatorRadiusCmd -> SetUnitCandidates("mm cm m");
105  ScollimatorRadiusCmd -> AvailableForStates(G4State_Idle);
106 
107  // Thickness of the second collimator
108  ScollimatorThicknessCmd = new G4UIcmdWithADoubleAndUnit("/LaserDriven/EnergySelector/SecondCollimator/Thickness", this);
109  ScollimatorThicknessCmd -> SetGuidance("Set the thickness of the second collimator");
110  ScollimatorThicknessCmd -> SetParameterName("Size",false);
111  ScollimatorThicknessCmd -> SetDefaultUnit("mm");
112  ScollimatorThicknessCmd -> SetUnitCandidates("mm cm m");
113  ScollimatorThicknessCmd -> AvailableForStates(G4State_Idle);
114 
115  // Z Position of the second collimator hole
116  ScollimatorZpositionCmd = new G4UIcmdWithADoubleAndUnit("/LaserDriven/EnergySelector/SecondCollimator/zPosizion", this);
117  ScollimatorZpositionCmd -> SetGuidance("Set the Z position of the second collimator hole as respect the internal vacuum chamber center axis");
118  ScollimatorZpositionCmd -> SetParameterName("Size",false);
119  ScollimatorZpositionCmd -> SetDefaultUnit("mm");
120  ScollimatorZpositionCmd -> SetUnitCandidates("mm cm m");
121  ScollimatorZpositionCmd -> AvailableForStates(G4State_Idle);
122 
123  // THE SLIT
124  //
125  // Thickness Slit
126  SlitThicknessCmd = new G4UIcmdWithADoubleAndUnit("/LaserDriven/EnergySelector/Slit/thickness",this);
127  SlitThicknessCmd -> SetGuidance("Set the X dimension of the Slit, the maximum value is 10 mm");
128  SlitThicknessCmd -> SetParameterName("Size",false);
129  SlitThicknessCmd -> SetDefaultUnit("mm");
130  SlitThicknessCmd -> SetUnitCandidates("mm cm m");
131  SlitThicknessCmd -> AvailableForStates(G4State_Idle);
132 
133  //Hole dimension of the Slit (in Y direction)
134  holeSlitDimensionYCmd = new G4UIcmdWithADoubleAndUnit("/LaserDriven/EnergySelector/Slit/HoleDimensionY",this);
135  holeSlitDimensionYCmd -> SetGuidance("Set the Y dimension of the Slit Hole");
136  holeSlitDimensionYCmd -> SetParameterName("Size",false);
137  holeSlitDimensionYCmd -> SetDefaultUnit("mm");
138  holeSlitDimensionYCmd -> SetUnitCandidates("mm cm m");
139  holeSlitDimensionYCmd -> AvailableForStates(G4State_Idle);
140 
141  // Hole dimension of the Slit (in Z direction)
142  holeSlitDimensionZCmd = new G4UIcmdWithADoubleAndUnit("/LaserDriven/EnergySelector/Slit/HoleDimensionZ",this);
143  holeSlitDimensionZCmd -> SetGuidance("Set the Z dimension of the external part of magnet 4");
144  holeSlitDimensionZCmd -> SetParameterName("Size",false);
145  holeSlitDimensionZCmd -> SetDefaultUnit("mm");
146  holeSlitDimensionZCmd -> SetUnitCandidates("mm cm m");
147  holeSlitDimensionZCmd -> AvailableForStates(G4State_Idle);
148 
149  // Hole position of the Slit (in Z direction as respect the Slit body)
150  slitHolePositionZCmd = new G4UIcmdWithADoubleAndUnit("/LaserDriven/EnergySelector/Slit/HolePositionZ", this);
151  slitHolePositionZCmd -> SetGuidance("Set the Slit hole position in the Z direction as respect the Slit body center");
152  slitHolePositionZCmd -> SetParameterName("Size",false);
153  slitHolePositionZCmd -> SetDefaultUnit("mm");
154  slitHolePositionZCmd -> SetUnitCandidates("mm cm m");
155  slitHolePositionZCmd -> AvailableForStates(G4State_Idle);
156 
157 // Quadrupole system DISABLE
158  DisableQuadsCmd = new G4UIcmdWithoutParameter("/LaserDriven/Quadrupoles/DisableQuads", this);
159  DisableQuadsCmd -> SetGuidance("Disable the Quadrupole system.");
160  DisableQuadsCmd -> SetGuidance("This command MUST be applied before \"beamOn\" ");
161  DisableQuadsCmd -> AvailableForStates(G4State_Idle);
162 }
LaserDrivenBeamLineMessenger::~LaserDrivenBeamLineMessenger ( )

Definition at line 165 of file LaserDrivenBeamLineMessenger.cc.

166 {
167 
168  delete laserDrivenDir;
169  delete energySelectorDir;
170  delete FcollimatorDir;
171  delete ScollimatorDir;
172  delete slitDir;
173  delete quadrupoleDir;
174  delete relativePosDir;
175  delete DisableESSCmd;
176  delete FcollimatorRadiusCmd;
177  delete FcollimatorThicknessCmd;
178  delete FcollimatorZpositionCmd;
179  delete ScollimatorRadiusCmd;
180  delete ScollimatorThicknessCmd;
181  delete ScollimatorZpositionCmd;
182 
183  delete SlitThicknessCmd;
184  delete holeSlitDimensionYCmd;
185  delete holeSlitDimensionZCmd;
186  delete slitHolePositionZCmd;
187 
188  delete DisableQuadsCmd;
189 
190 }

Member Function Documentation

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

Reimplemented from G4UImessenger.

Definition at line 192 of file LaserDrivenBeamLineMessenger.cc.

193 {
194  if (command == DisableESSCmd)
195  {
196  laserDrivenMessengerPointer -> RemoveESS();
197  }
198  if( command == FcollimatorRadiusCmd )
199  {
200  laserDrivenMessengerPointer -> SetFirstCollimatorRadius
201  (FcollimatorRadiusCmd -> GetNewDoubleValue(newValue));
202  }
203  else if( command == FcollimatorThicknessCmd )
204  {
205  laserDrivenMessengerPointer -> SetFirstCollimatorThickness
206  (FcollimatorThicknessCmd -> GetNewDoubleValue(newValue));
207  }
208  else if( command == FcollimatorZpositionCmd )
209  {
210  laserDrivenMessengerPointer -> SetFirstCollimatorPositionZ
211  (FcollimatorZpositionCmd -> GetNewDoubleValue(newValue));
212  }
213  else if( command == ScollimatorRadiusCmd )
214  {
215  laserDrivenMessengerPointer -> SetSecondCollimatorRadius
216  (ScollimatorRadiusCmd -> GetNewDoubleValue(newValue));
217  }
218  else if( command == ScollimatorThicknessCmd )
219  {
220  laserDrivenMessengerPointer -> SetSecondCollimatorThickness
221  (ScollimatorThicknessCmd -> GetNewDoubleValue(newValue));
222  }
223  else if( command == ScollimatorZpositionCmd )
224  {
225  laserDrivenMessengerPointer -> SetSecondCollimatorPositionZ
226  (ScollimatorZpositionCmd -> GetNewDoubleValue(newValue));
227  }
228  else if( command == SlitThicknessCmd )
229  {
230  laserDrivenMessengerPointer -> SetThicknessSlit
231  (SlitThicknessCmd -> GetNewDoubleValue(newValue));
232  }
233  else if( command == holeSlitDimensionYCmd )
234  {
235  laserDrivenMessengerPointer -> SetSlitHoleDimensionY
236  (holeSlitDimensionYCmd -> GetNewDoubleValue(newValue));
237  }
238  else if( command == holeSlitDimensionZCmd )
239  {
240  laserDrivenMessengerPointer -> SetSlitHoleDimensionZ
241  (holeSlitDimensionZCmd -> GetNewDoubleValue(newValue));
242  }
243  else if( command == slitHolePositionZCmd )
244  {
245  laserDrivenMessengerPointer -> SetSlitHolePositionZ
246  (slitHolePositionZCmd -> GetNewDoubleValue(newValue));
247  }
248  else if (command==DisableQuadsCmd)
249  {
250  laserDrivenMessengerPointer -> RemoveQuads();
251  }
252 
253 }

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