Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
LXeDetectorMessenger.cc
이 파일의 문서화 페이지로 가기
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 // $Id: LXeDetectorMessenger.cc 104474 2017-06-01 07:35:19Z gcosmo $
27 //
30 //
31 //
32 #include "LXeDetectorMessenger.hh"
34 
37 #include "G4UIcmdWithAnInteger.hh"
38 #include "G4UIcommand.hh"
39 #include "G4UIdirectory.hh"
40 #include "G4UIcmdWithABool.hh"
41 #include "G4UIcmdWithADouble.hh"
42 #include "G4Scintillation.hh"
43 
44 #include "G4RunManager.hh"
45 
46 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
47 
49  : fLXeDetector(detector)
50 {
51  //Setup a command directory for detector controls with guidance
52  fDetectorDir = new G4UIdirectory("/LXe/detector/");
53  fDetectorDir->SetGuidance("Detector geometry control");
54 
55  fVolumesDir = new G4UIdirectory("/LXe/detector/volumes/");
56  fVolumesDir->SetGuidance("Enable/disable volumes");
57 
58  //Various commands for modifying detector geometry
60  new G4UIcmdWith3VectorAndUnit("/LXe/detector/dimensions",this);
61  fDimensionsCmd->SetGuidance("Set the dimensions of the detector volume.");
62  fDimensionsCmd->SetParameterName("scint_x","scint_y","scint_z",false);
66 
68  ("/LXe/detector/housingThickness",this);
69  fHousingThicknessCmd->SetGuidance("Set the thickness of the housing.");
70  fHousingThicknessCmd->SetParameterName("d_mtl",false);
74 
76  ("/LXe/detector/pmtRadius",this);
77  fPmtRadiusCmd->SetGuidance("Set the radius of the PMTs.");
78  fPmtRadiusCmd->SetParameterName("radius",false);
82 
83  fNxCmd = new G4UIcmdWithAnInteger("/LXe/detector/nx",this);
84  fNxCmd->SetGuidance("Set the number of PMTs along the x-dimension.");
85  fNxCmd->SetParameterName("nx",false);
87  fNxCmd->SetToBeBroadcasted(false);
88 
89  fNyCmd = new G4UIcmdWithAnInteger("/LXe/detector/ny",this);
90  fNyCmd->SetGuidance("Set the number of PMTs along the y-dimension.");
91  fNyCmd->SetParameterName("ny",false);
93  fNyCmd->SetToBeBroadcasted(false);
94 
95  fNzCmd = new G4UIcmdWithAnInteger("/LXe/detector/nz",this);
96  fNzCmd->SetGuidance("Set the number of PMTs along the z-dimension.");
97  fNzCmd->SetParameterName("nz",false);
99  fNzCmd->SetToBeBroadcasted(false);
100 
101  fSphereCmd = new G4UIcmdWithABool("/LXe/detector/volumes/sphere",this);
102  fSphereCmd->SetGuidance("Enable/Disable the sphere.");
105 
106  fReflectivityCmd = new G4UIcmdWithADouble("/LXe/detector/reflectivity",this);
107  fReflectivityCmd->SetGuidance("Set the reflectivity of the housing.");
110 
111  fWlsCmd = new G4UIcmdWithABool("/LXe/detector/volumes/wls",this);
112  fWlsCmd->SetGuidance("Enable/Disable the WLS slab");
114  fWlsCmd->SetToBeBroadcasted(false);
115 
116  fLxeCmd = new G4UIcmdWithABool("/LXe/detector/volumes/lxe",this);
117  fLxeCmd->SetGuidance("Enable/Disable the main detector volume.");
119  fLxeCmd->SetToBeBroadcasted(false);
120 
121  fNFibersCmd = new G4UIcmdWithAnInteger("/LXe/detector/nfibers",this);
122  fNFibersCmd->SetGuidance("Set the number of WLS fibers in the WLS slab.");
125 
126  fMainScintYield=new G4UIcmdWithADouble("/LXe/detector/MainScintYield",this);
127  fMainScintYield->SetGuidance("Set scinitillation yield of main volume.");
128  fMainScintYield->SetGuidance("Specified in photons/MeV");
131 
132  fWLSScintYield = new G4UIcmdWithADouble("/LXe/detector/WLSScintYield",this);
133  fWLSScintYield->SetGuidance("Set scintillation yield of WLS Slab");
134  fWLSScintYield->SetGuidance("Specified in photons/MeV");
137 
138  fDefaultsCmd = new G4UIcommand("/LXe/detector/defaults",this);
139  fDefaultsCmd->SetGuidance("Set all detector geometry values to defaults.");
142 }
143 
144 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
145 
147 {
148  delete fDimensionsCmd;
149  delete fHousingThicknessCmd;
150  delete fPmtRadiusCmd;
151  delete fNxCmd;
152  delete fNyCmd;
153  delete fNzCmd;
154  delete fDetectorDir;
155  delete fVolumesDir;
156  delete fSphereCmd;
157  delete fWlsCmd;
158  delete fLxeCmd;
159  delete fNFibersCmd;
160  delete fReflectivityCmd;
161  delete fMainScintYield;
162  delete fWLSScintYield;
163  delete fDefaultsCmd;
164 }
165 
166 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
167 
169 {
170  if( command == fDimensionsCmd ){
172  }
173  else if (command == fHousingThicknessCmd){
175  ->GetNewDoubleValue(newValue));
176  }
177  else if (command == fPmtRadiusCmd){
179  }
180  else if (command == fNxCmd){
182  }
183  else if (command == fNyCmd){
185  }
186  else if (command == fNzCmd){
188  }
189  else if (command == fSphereCmd){
191  }
192  else if (command == fReflectivityCmd){
195  }
196  else if (command == fWlsCmd){
198  }
199  else if (command == fLxeCmd){
201  }
202  else if (command == fNFibersCmd){
204  }
205  else if (command == fMainScintYield){
206  fLXeDetector->
207  SetMainScintYield(fMainScintYield->GetNewDoubleValue(newValue));
208  }
209  else if (command == fWLSScintYield){
211  }
212  else if (command == fDefaultsCmd){
214 
215  G4RunManager::GetRunManager()->ReinitializeGeometry(); //Add here this line
216  }
217 }
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161
static G4RunManager * GetRunManager()
Definition: G4RunManager.cc:80
G4UIcmdWith3VectorAndUnit * fDimensionsCmd
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
G4UIcmdWithAnInteger * fNFibersCmd
G4UIcmdWithADouble * fReflectivityCmd
Definition of the LXeDetectorMessenger class.
G4UIcmdWithADouble * fMainScintYield
static G4double GetNewDoubleValue(const char *paramString)
G4UIcmdWithABool * fSphereCmd
G4UIcmdWithABool * fLxeCmd
static G4bool GetNewBoolValue(const char *paramString)
static G4double GetNewDoubleValue(const char *paramString)
G4UIcmdWithADoubleAndUnit * fHousingThicknessCmd
LXeDetectorConstruction * fLXeDetector
G4UIcmdWithAnInteger * fNzCmd
Definition of the LXeDetectorConstruction class.
G4UIcmdWithADoubleAndUnit * fPmtRadiusCmd
virtual void SetNewValue(G4UIcommand *, G4String)
void ReinitializeGeometry(G4bool destroyFirst=false, G4bool prop=true)
G4UIcmdWithAnInteger * fNxCmd
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
static G4int GetNewIntValue(const char *paramString)
G4UIcmdWithAnInteger * fNyCmd
G4UIcmdWithADouble * fWLSScintYield
void SetDefaultUnit(const char *defUnit)
static G4ThreeVector GetNew3VectorValue(const char *paramString)
void SetParameterName(const char *theNameX, const char *theNameY, const char *theNameZ, G4bool omittable, G4bool currentAsDefault=false)
LXeDetectorMessenger(LXeDetectorConstruction *)
G4UIcmdWithABool * fWlsCmd
G4UIdirectory * fDetectorDir
void AvailableForStates(G4ApplicationState s1)
Definition: G4UIcommand.cc:242
void SetToBeBroadcasted(G4bool val)
Definition: G4UIcommand.hh:184
void SetDefaultUnit(const char *defUnit)