Geant4  10.03
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 //
28 //
29 
32 #include "G4UIdirectory.hh"
34 #include "G4UIcmdWithAString.hh"
36 #include "G4UIcmdWith3Vector.hh"
37 #include "G4RunManager.hh"
38 
39 #include "G4ios.hh"
40 
44 :fTarget(mpga){
45  fMyXtalDirectory = new G4UIdirectory("/xtal/");
46  fMyXtalDirectory->SetGuidance("Xtal setup control commands.");
47 
48  fXtalMaterialCmd = new G4UIcmdWithAString("/xtal/setMaterial",
49  this);
50  fXtalMaterialCmd->SetGuidance("Set Xtal material.");
51  fXtalMaterialCmd->SetParameterName("xMat",true);
53 
55  new G4UIcmdWith3VectorAndUnit("/xtal/setCurvRadius",this);
56  fXtalCurvatureRadiusCmd->SetGuidance("Set Xtal curvature radius.");
58  "xtalcry",
59  "xtalcrz",
60  true);
63 
64  fXtalSizeCmd = new G4UIcmdWith3VectorAndUnit("/xtal/setSize",this);
65  fXtalSizeCmd->SetGuidance("Set Xtal size.");
66  fXtalSizeCmd->SetParameterName("xtalSizeX",
67  "xtalSizeY",
68  "xtalSizeZ",
69  true);
72 
73  fXtalAngleCmd = new G4UIcmdWith3VectorAndUnit("/xtal/setAngle",this);
74  fXtalAngleCmd->SetGuidance("Set Xtal angles in the world.");
75  fXtalAngleCmd->SetParameterName("xtalAngleX",
76  "xtalAngleY",
77  "xtalAngleZ",
78  true);
81 
82  fXtalCellSizeCmd = new G4UIcmdWith3VectorAndUnit("/xtal/setCellSize",this);
83  fXtalCellSizeCmd->SetGuidance("Set Xtal cell size.");
84  fXtalCellSizeCmd->SetParameterName("xtalCellSizeX",
85  "xtalCellSizeY",
86  "xtalCellSizeZ",
87  true);
88  fXtalCellSizeCmd->SetDefaultValue(G4ThreeVector(5.431,5.431,5.431));
89  fXtalCellSizeCmd->SetDefaultUnit("angstrom");
90 
92  new G4UIcmdWith3VectorAndUnit("/xtal/setCellAngle",this);
93  fXtalCellAngleCmd->SetGuidance("Set Xtal cell angles in the world.");
94  fXtalCellAngleCmd->SetParameterName("xtalCellAngleX",
95  "xtalCellAngleY",
96  "xtalCellAngleZ",
97  true);
100 
102  new G4UIcmdWithADoubleAndUnit("/xtal/setThermVibr",this);
103  fXtalCellThermalVibration->SetGuidance("Thermal vibration amplitude");
104  fXtalCellThermalVibration->SetParameterName("xtalThermVibr",true);
107 
108  fXtalMillerCmd = new G4UIcmdWith3Vector("/xtal/setMiller",this);
109  fXtalMillerCmd->SetGuidance("Set Miller Indexes");
110  fXtalMillerCmd->SetParameterName("xtalMiller1",
111  "xtalMiller2",
112  "xtalMiller3",
113  true);
115 
116  fAddXtal = new G4UIcmdWithAString("/addxtal",this);
117  fAddXtal->SetGuidance("Add Xtal.");
118  fAddXtal->SetParameterName("addxtal",true);
119 }
120 
121 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
122 
125  delete fXtalMaterialCmd;
126  delete fXtalMillerCmd;
128  delete fXtalSizeCmd;
129  delete fXtalAngleCmd;
130  delete fXtalCellSizeCmd;
131  delete fXtalCellAngleCmd;
132  delete fAddXtal;
133 }
134 
135 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
136 
138  G4UIcommand *command,
139  G4String newValue){
140  if(command==fXtalMaterialCmd ){
141  fTarget->SetXtalMaterial(newValue);
142  }
143  if(command==fXtalCurvatureRadiusCmd ){
146  }
147  if(command==fXtalSizeCmd ){
149  }
150  if(command==fXtalAngleCmd ){
152  }
153  if(command==fXtalCellSizeCmd ){
156  }
157  if(command==fXtalCellAngleCmd ){
160  }
161  if(command==fXtalCellThermalVibration ){
164  }
165  if(command==fXtalMillerCmd ){
167  }
168  if(command==fAddXtal ){
170  }
171 
172 }
173 
174 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
175 
177  G4UIcommand * command){
178  G4String cv;
179 
180  if( command==fXtalMaterialCmd ){
181  cv = fTarget->GetXtalMaterial();
182  }
183  if( command==fXtalCurvatureRadiusCmd ){
186  }
187  if( command==fXtalSizeCmd ){
189  }
190  if( command==fXtalAngleCmd ){
192  }
193  if( command==fXtalCellSizeCmd ){
195  fTarget->GetXtalCellSize(),"angstrom");
196  }
197  if( command==fXtalCellAngleCmd ){
199  fTarget->GetXtalCellAngle(),"deg");
200  }
201  if( command==fXtalCellThermalVibration ){
204  }
205  if( command==fXtalMillerCmd ){
207  }
208 
209  return cv;
210 }
211 
212 //....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)
Definition of the ExExChDetectorConstructionMessenger class.
ExExChDetectorConstructionMessenger(ExExChDetectorConstruction *mpga)
void SetDefaultValue(G4ThreeVector defVal)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
Definition of the ExExChDetectorConstruction class.