Geant4  10.01.p03
ExExChDetectorConstructionMessenger.cc
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 
29 #include "G4UIdirectory.hh"
31 #include "G4UIcmdWithAString.hh"
33 #include "G4UIcmdWith3Vector.hh"
34 #include "G4RunManager.hh"
35 
36 #include "G4ios.hh"
37 
41 :fTarget(mpga){
42  fMyXtalDirectory = new G4UIdirectory("/xtal/");
43  fMyXtalDirectory->SetGuidance("Xtal setup control commands.");
44 
45  fXtalMaterialCmd = new G4UIcmdWithAString("/xtal/setMaterial",
46  this);
47  fXtalMaterialCmd->SetGuidance("Set Xtal material.");
48  fXtalMaterialCmd->SetParameterName("xMat",true);
50 
52  new G4UIcmdWith3VectorAndUnit("/xtal/setCurvRadius",this);
53  fXtalCurvatureRadiusCmd->SetGuidance("Set Xtal curvature radius.");
55  "xtalcry",
56  "xtalcrz",
57  true);
60 
61  fXtalSizeCmd = new G4UIcmdWith3VectorAndUnit("/xtal/setSize",this);
62  fXtalSizeCmd->SetGuidance("Set Xtal size.");
63  fXtalSizeCmd->SetParameterName("xtalSizeX",
64  "xtalSizeY",
65  "xtalSizeZ",
66  true);
69 
70  fXtalAngleCmd = new G4UIcmdWith3VectorAndUnit("/xtal/setAngle",this);
71  fXtalAngleCmd->SetGuidance("Set Xtal angles in the world.");
72  fXtalAngleCmd->SetParameterName("xtalAngleX",
73  "xtalAngleY",
74  "xtalAngleZ",
75  true);
78 
79  fXtalCellSizeCmd = new G4UIcmdWith3VectorAndUnit("/xtal/setCellSize",this);
80  fXtalCellSizeCmd->SetGuidance("Set Xtal cell size.");
81  fXtalCellSizeCmd->SetParameterName("xtalCellSizeX",
82  "xtalCellSizeY",
83  "xtalCellSizeZ",
84  true);
85  fXtalCellSizeCmd->SetDefaultValue(G4ThreeVector(5.431,5.431,5.431));
86  fXtalCellSizeCmd->SetDefaultUnit("angstrom");
87 
89  new G4UIcmdWith3VectorAndUnit("/xtal/setCellAngle",this);
90  fXtalCellAngleCmd->SetGuidance("Set Xtal cell angles in the world.");
91  fXtalCellAngleCmd->SetParameterName("xtalCellAngleX",
92  "xtalCellAngleY",
93  "xtalCellAngleZ",
94  true);
97 
99  new G4UIcmdWithADoubleAndUnit("/xtal/setThermVibr",this);
100  fXtalCellThermalVibration->SetGuidance("Thermal vibration amplitude");
101  fXtalCellThermalVibration->SetParameterName("xtalThermVibr",true);
104 
105  fXtalMillerCmd = new G4UIcmdWith3Vector("/xtal/setMiller",this);
106  fXtalMillerCmd->SetGuidance("Set Miller Indexes");
107  fXtalMillerCmd->SetParameterName("xtalMiller1",
108  "xtalMiller2",
109  "xtalMiller3",
110  true);
112 
113  fAddXtal = new G4UIcmdWithAString("/addxtal",this);
114  fAddXtal->SetGuidance("Add Xtal.");
115  fAddXtal->SetParameterName("addxtal",true);
116 }
117 
118 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
119 
122  delete fXtalMaterialCmd;
123  delete fXtalMillerCmd;
125  delete fXtalSizeCmd;
126  delete fXtalAngleCmd;
127  delete fXtalCellSizeCmd;
128  delete fXtalCellAngleCmd;
129  delete fAddXtal;
130 }
131 
132 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
133 
135  G4UIcommand *command,
136  G4String newValue){
137  if(command==fXtalMaterialCmd ){
138  fTarget->SetXtalMaterial(newValue);
139  }
140  if(command==fXtalCurvatureRadiusCmd ){
143  }
144  if(command==fXtalSizeCmd ){
146  }
147  if(command==fXtalAngleCmd ){
149  }
150  if(command==fXtalCellSizeCmd ){
153  }
154  if(command==fXtalCellAngleCmd ){
157  }
158  if(command==fXtalCellThermalVibration ){
161  }
162  if(command==fXtalMillerCmd ){
164  }
165  if(command==fAddXtal ){
167  }
168 
169 }
170 
171 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
172 
174  G4UIcommand * command){
175  G4String cv;
176 
177  if( command==fXtalMaterialCmd ){
178  cv = fTarget->GetXtalMaterial();
179  }
180  if( command==fXtalCurvatureRadiusCmd ){
183  }
184  if( command==fXtalSizeCmd ){
186  }
187  if( command==fXtalAngleCmd ){
189  }
190  if( command==fXtalCellSizeCmd ){
192  fTarget->GetXtalCellSize(),"angstrom");
193  }
194  if( command==fXtalCellAngleCmd ){
196  fTarget->GetXtalCellAngle(),"deg");
197  }
198  if( command==fXtalCellThermalVibration ){
201  }
202  if( command==fXtalMillerCmd ){
204  }
205 
206  return cv;
207 }
208 
209 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
CLHEP::Hep3Vector G4ThreeVector
void SetDefaultUnit(const char *defUnit)
void SetParameterName(const char *theNameX, const char *theNameY, const char *theNameZ, G4bool omittable, G4bool currentAsDefault=false)
static G4ThreeVector GetNew3VectorValue(const char *paramString)
static G4String ConvertToString(G4bool boolVal)
Definition: G4UIcommand.cc:371
static G4double GetNewDoubleValue(const char *paramString)
void SetParameterName(const char *theNameX, const char *theNameY, const char *theNameZ, G4bool omittable, G4bool currentAsDefault=false)
virtual G4String GetCurrentValue(G4UIcommand *command)
static G4ThreeVector GetNew3VectorValue(const char *paramString)
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161
virtual void SetNewValue(G4UIcommand *command, G4String newValues)
void SetDefaultValue(G4ThreeVector defVal)
void SetDefaultValue(const char *defVal)
void SetDefaultUnit(const char *defUnit)
void SetXtalMaterial(const G4String &name)
ExExChDetectorConstructionMessenger(ExExChDetectorConstruction *mpga)
void SetDefaultValue(G4ThreeVector defVal)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)