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

#include <Em10DetectorMessenger.hh>

Inheritance diagram for Em10DetectorMessenger:
G4UImessenger

Public Member Functions

 Em10DetectorMessenger (Em10DetectorConstruction *)
 
 ~Em10DetectorMessenger ()
 
void SetNewValue (G4UIcommand *, G4String)
 
void SetNewValue (G4UIcommand *, G4int)
 
- 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 51 of file Em10DetectorMessenger.hh.

Constructor & Destructor Documentation

Em10DetectorMessenger::Em10DetectorMessenger ( Em10DetectorConstruction Em10Det)

Definition at line 45 of file Em10DetectorMessenger.cc.

References G4UIcommand::AvailableForStates(), G4State_Idle, G4State_PreInit, G4UIcmdWithADoubleAndUnit::SetDefaultUnit(), G4UIcmdWithAnInteger::SetDefaultValue(), G4UIcmdWithAString::SetDefaultValue(), G4UIcommand::SetGuidance(), G4UIcmdWithAString::SetParameterName(), G4UIcmdWithAnInteger::SetParameterName(), G4UIcmdWithADoubleAndUnit::SetParameterName(), and G4UIcommand::SetRange().

46 :G4UImessenger(),
47  Em10Detector(Em10Det)
48 {
49  Em10detDir = new G4UIdirectory("/XTRdetector/");
50  Em10detDir->SetGuidance("Em10 detector control.");
51 
52  AbsMaterCmd = new G4UIcmdWithAString("/XTRdetector/setAbsMat",this);
53  AbsMaterCmd->SetGuidance("Select Material of the Absorber.");
54  AbsMaterCmd->SetParameterName("choice",true);
55  AbsMaterCmd->SetDefaultValue("Xe");
56  AbsMaterCmd->AvailableForStates(G4State_Idle);
57 
58  RadiatorMaterCmd = new G4UIcmdWithAString("/XTRdetector/setRadMat",this);
59  RadiatorMaterCmd->SetGuidance("Select Material of the XTR radiator.");
60  RadiatorMaterCmd->SetParameterName("choice",true);
61  RadiatorMaterCmd->SetDefaultValue("CH2");
62  RadiatorMaterCmd->AvailableForStates(G4State_Idle);
63 
64  DetectorSetUpCmd = new G4UIcmdWithAString("/XTRdetector/setup",this);
65  DetectorSetUpCmd->SetGuidance("Select setup for comparison with experiment");
66  DetectorSetUpCmd->SetParameterName("choice",true);
67  DetectorSetUpCmd->SetDefaultValue("simpleALICE");
69 
70  ModelCmd = new G4UIcmdWithAnInteger("/XTRdetector/setModel",this);
71  ModelCmd->SetGuidance("Select Model for XTR");
72  ModelCmd->SetParameterName("choice",true);
73  ModelCmd->SetDefaultValue(0);
74  // ModelCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
76 
77  FoilNumCmd = new G4UIcmdWithAnInteger("/XTRdetector/setFoilNum",this);
78  FoilNumCmd->SetGuidance("Select foil number for XTR");
79  FoilNumCmd->SetParameterName("choice",true);
80  FoilNumCmd->SetDefaultValue(0);
82 
83  WorldMaterCmd = new G4UIcmdWithAString("/XTRdetector/setWorldMat",this);
84  WorldMaterCmd->SetGuidance("Select Material of the World.");
85  WorldMaterCmd->SetParameterName("wchoice",true);
86  WorldMaterCmd->SetDefaultValue("Air");
87  WorldMaterCmd->AvailableForStates(G4State_Idle);
88 
89  AbsThickCmd = new G4UIcmdWithADoubleAndUnit("/XTRdetector/setAbsThick",this);
90  AbsThickCmd->SetGuidance("Set Thickness of the Absorber");
91  AbsThickCmd->SetParameterName("SizeZ",false,false);
92  AbsThickCmd->SetDefaultUnit("mm");
93  AbsThickCmd->SetRange("SizeZ>0.");
94  AbsThickCmd->AvailableForStates(G4State_Idle);
95 
96  RadiatorThickCmd = new G4UIcmdWithADoubleAndUnit("/XTRdetector/setRadThick",this);
97  RadiatorThickCmd->SetGuidance("Set Thickness of XTR radiator");
98  RadiatorThickCmd->SetParameterName("SizeZ",false,false);
99  RadiatorThickCmd->SetDefaultUnit("mm");
100  RadiatorThickCmd->SetRange("SizeZ>0.");
101  RadiatorThickCmd->AvailableForStates(G4State_Idle);
102 
103  GasGapThickCmd = new G4UIcmdWithADoubleAndUnit("/XTRdetector/setGasGapThick",this);
104  GasGapThickCmd->SetGuidance("Set Thickness of XTR gas gaps");
105  GasGapThickCmd->SetParameterName("SizeZ",false,false);
106  GasGapThickCmd->SetDefaultUnit("mm");
107  GasGapThickCmd->SetRange("SizeZ>0.");
108  GasGapThickCmd->AvailableForStates(G4State_Idle);
109 
110  AbsRadCmd = new G4UIcmdWithADoubleAndUnit("/XTRdetector/setAbsRad",this);
111  AbsRadCmd->SetGuidance("Set radius of the Absorber");
112  AbsRadCmd->SetParameterName("SizeR",false,false);
113  AbsRadCmd->SetDefaultUnit("mm");
114  AbsRadCmd->SetRange("SizeR>0.");
115  AbsRadCmd->AvailableForStates(G4State_Idle);
116 
117  AbsZposCmd = new G4UIcmdWithADoubleAndUnit("/XTRdetector/setAbsZpos",this);
118  AbsZposCmd->SetGuidance("Set Z pos. of the Absorber");
119  AbsZposCmd->SetParameterName("Zpos",false,false);
120  AbsZposCmd->SetDefaultUnit("mm");
121  AbsZposCmd->AvailableForStates(G4State_Idle);
122 
123  WorldZCmd = new G4UIcmdWithADoubleAndUnit("/XTRdetector/setWorldZ",this);
124  WorldZCmd->SetGuidance("Set Z size of the World");
125  WorldZCmd->SetParameterName("WSizeZ",false,false);
126  WorldZCmd->SetDefaultUnit("mm");
127  WorldZCmd->SetRange("WSizeZ>0.");
128  WorldZCmd->AvailableForStates(G4State_Idle);
129 
130  WorldRCmd = new G4UIcmdWithADoubleAndUnit("/XTRdetector/setWorldR",this);
131  WorldRCmd->SetGuidance("Set R size of the World");
132  WorldRCmd->SetParameterName("WSizeR",false,false);
133  WorldRCmd->SetDefaultUnit("mm");
134  WorldRCmd->SetRange("WSizeR>0.");
135  WorldRCmd->AvailableForStates(G4State_Idle);
136 
137  UpdateCmd = new G4UIcmdWithoutParameter("/XTRdetector/update",this);
138  UpdateCmd->SetGuidance("Update calorimeter geometry.");
139  UpdateCmd->SetGuidance("This command MUST be applied before \"beamOn\" ");
140  UpdateCmd->SetGuidance("if you changed geometrical value(s).");
141  UpdateCmd->AvailableForStates(G4State_Idle);
142 
143  MagFieldCmd = new G4UIcmdWithADoubleAndUnit("/XTRdetector/setField",this);
144  MagFieldCmd->SetGuidance("Define magnetic field.");
145  MagFieldCmd->SetGuidance("Magnetic field will be in Z direction.");
146  MagFieldCmd->SetParameterName("Bz",false,false);
147  MagFieldCmd->SetDefaultUnit("tesla");
148  MagFieldCmd->AvailableForStates(G4State_Idle);
149  /*
150  ElectronCutCmd = new G4UIcmdWithADoubleAndUnit("/XTRdetector/setElectronCut",this);
151  ElectronCutCmd->SetGuidance("Set electron cut in mm for vertex region");
152  ElectronCutCmd->SetParameterName("ElectronCut",false,false);
153  ElectronCutCmd->SetDefaultUnit("mm");
154  ElectronCutCmd->SetRange("ElectronCut>0.");
155  ElectronCutCmd->AvailableForStates(G4State_Idle);
156 
157 
158  PositronCutCmd = new G4UIcmdWithADoubleAndUnit("/XTRdetector/setPositronCut",this);
159  PositronCutCmd->SetGuidance("Set positron cut in mm for vertex region");
160  PositronCutCmd->SetParameterName("PositronCut",false,false);
161  PositronCutCmd->SetDefaultUnit("mm");
162  PositronCutCmd->SetRange("PositronCut>0.");
163  PositronCutCmd->AvailableForStates(G4State_Idle);
164 
165 
166  GammaCutCmd = new G4UIcmdWithADoubleAndUnit("/XTRdetector/setGammaCut",this);
167  GammaCutCmd->SetGuidance("Set gamma cut in mm for vertex region");
168  GammaCutCmd->SetParameterName("GammaCut",false,false);
169  GammaCutCmd->SetDefaultUnit("mm");
170  GammaCutCmd->SetRange("GammaCut>0.");
171  GammaCutCmd->AvailableForStates(G4State_Idle);
172  */
173 
174 }
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetRange(const char *rs)
Definition: G4UIcommand.hh:125
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161
void AvailableForStates(G4ApplicationState s1)
Definition: G4UIcommand.cc:225
void SetDefaultValue(const char *defVal)
void SetDefaultUnit(const char *defUnit)
void SetDefaultValue(G4int defVal)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
Em10DetectorMessenger::~Em10DetectorMessenger ( )

Definition at line 178 of file Em10DetectorMessenger.cc.

179 {
180  delete AbsMaterCmd;
181  delete ModelCmd;
182  delete FoilNumCmd;
183  delete AbsThickCmd;
184  delete RadiatorThickCmd;
185  delete GasGapThickCmd;
186  delete AbsRadCmd;
187  delete AbsZposCmd;
188  delete WorldMaterCmd;
189  delete RadiatorMaterCmd;
190  delete WorldZCmd;
191  delete WorldRCmd;
192  delete UpdateCmd;
193  delete MagFieldCmd;
194  delete Em10detDir;
195 }

Member Function Documentation

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

Reimplemented from G4UImessenger.

Definition at line 211 of file Em10DetectorMessenger.cc.

References G4UIcmdWithADoubleAndUnit::GetNewDoubleValue(), G4UIcmdWithAnInteger::GetNewIntValue(), Em10DetectorConstruction::SetAbsorberMaterial(), Em10DetectorConstruction::SetAbsorberRadius(), Em10DetectorConstruction::SetAbsorberThickness(), Em10DetectorConstruction::SetAbsorberZpos(), Em10DetectorConstruction::SetDetectorSetUp(), Em10DetectorConstruction::SetFoilNumber(), Em10DetectorConstruction::SetGasGapThickness(), Em10DetectorConstruction::SetMagField(), Em10DetectorConstruction::SetRadiatorMaterial(), Em10DetectorConstruction::SetRadiatorThickness(), Em10DetectorConstruction::SetWorldMaterial(), Em10DetectorConstruction::SetWorldSizeR(), Em10DetectorConstruction::SetWorldSizeZ(), and Em10DetectorConstruction::UpdateGeometry().

212 {
213  if( command == ModelCmd )
214  {
215  // Em10Detector->SetParametrisationModel(ModelCmd->GetNewIntValue(newValue));
216  // Em10Detector->ParametrisationModel();
217  }
218  if( command == FoilNumCmd )
219  {
220  Em10Detector->SetFoilNumber(FoilNumCmd->GetNewIntValue(newValue));
221  }
222  if( command == AbsMaterCmd )
223  { Em10Detector->SetAbsorberMaterial(newValue);}
224 
225  if( command == DetectorSetUpCmd )
226  { Em10Detector->SetDetectorSetUp(newValue);}
227 
228  if( command == RadiatorMaterCmd )
229  { Em10Detector->SetRadiatorMaterial(newValue);}
230 
231  if( command == WorldMaterCmd )
232  { Em10Detector->SetWorldMaterial(newValue);}
233 
234  if( command == AbsThickCmd )
235  { Em10Detector->SetAbsorberThickness(AbsThickCmd->GetNewDoubleValue(newValue));}
236 
237  if( command == RadiatorThickCmd )
238  { Em10Detector->SetRadiatorThickness(RadiatorThickCmd->
239  GetNewDoubleValue(newValue));}
240 
241  if( command == GasGapThickCmd )
242  { Em10Detector->SetGasGapThickness(GasGapThickCmd->
243  GetNewDoubleValue(newValue));}
244 
245  if( command == AbsRadCmd )
246  { Em10Detector->SetAbsorberRadius(AbsRadCmd->GetNewDoubleValue(newValue));}
247 
248  if( command == AbsZposCmd )
249  { Em10Detector->SetAbsorberZpos(AbsZposCmd->GetNewDoubleValue(newValue));}
250 
251  if( command == WorldZCmd )
252  { Em10Detector->SetWorldSizeZ(WorldZCmd->GetNewDoubleValue(newValue));}
253 
254  if( command == WorldRCmd )
255  { Em10Detector->SetWorldSizeR(WorldRCmd->GetNewDoubleValue(newValue));}
256 
257  if( command == UpdateCmd )
258  { Em10Detector->UpdateGeometry(); }
259 
260  if( command == MagFieldCmd )
261  { Em10Detector->SetMagField(MagFieldCmd->GetNewDoubleValue(newValue));}
262  /*
263  if( command == ElectronCutCmd )
264  {
265  Em10Detector->SetElectronCut(WorldRCmd->GetNewDoubleValue(newValue));
266  }
267  if( command == PositronCutCmd )
268  {
269  Em10Detector->SetPositronCut(WorldRCmd->GetNewDoubleValue(newValue));
270  }
271  if( command == GammaCutCmd )
272  {
273  Em10Detector->SetGammaCut(WorldRCmd->GetNewDoubleValue(newValue));
274  }
275  */
276 }
static G4int GetNewIntValue(const char *paramString)
static G4double GetNewDoubleValue(const char *paramString)
void Em10DetectorMessenger::SetNewValue ( G4UIcommand command,
G4int  newValue 
)

Definition at line 199 of file Em10DetectorMessenger.cc.

References Em10DetectorConstruction::Construct().

200 {
201  if( command == ModelCmd && newValue == 0 )
202  {
203  // Em10Detector->SetParametrisationModel(newValue);
204  Em10Detector->Construct();
205  }
206 }

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