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

#include <LXeDetectorMessenger.hh>

Inheritance diagram for LXeDetectorMessenger:
Collaboration diagram for LXeDetectorMessenger:

Public Member Functions

 LXeDetectorMessenger (LXeDetectorConstruction *)
 
virtual ~LXeDetectorMessenger ()
 
virtual 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 47 of file LXeDetectorMessenger.hh.

Constructor & Destructor Documentation

LXeDetectorMessenger::LXeDetectorMessenger ( LXeDetectorConstruction detector)

Definition at line 48 of file LXeDetectorMessenger.cc.

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
59  fDimensionsCmd =
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);
63  fDimensionsCmd->SetDefaultUnit("cm");
65  fDimensionsCmd->SetToBeBroadcasted(false);
66 
67  fHousingThicknessCmd = new G4UIcmdWithADoubleAndUnit
68  ("/LXe/detector/housingThickness",this);
69  fHousingThicknessCmd->SetGuidance("Set the thickness of the housing.");
70  fHousingThicknessCmd->SetParameterName("d_mtl",false);
71  fHousingThicknessCmd->SetDefaultUnit("cm");
72  fHousingThicknessCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
73  fHousingThicknessCmd->SetToBeBroadcasted(false);
74 
75  fPmtRadiusCmd = new G4UIcmdWithADoubleAndUnit
76  ("/LXe/detector/pmtRadius",this);
77  fPmtRadiusCmd->SetGuidance("Set the radius of the PMTs.");
78  fPmtRadiusCmd->SetParameterName("radius",false);
79  fPmtRadiusCmd->SetDefaultUnit("cm");
81  fPmtRadiusCmd->SetToBeBroadcasted(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.");
104  fSphereCmd->SetToBeBroadcasted(false);
105 
106  fReflectivityCmd = new G4UIcmdWithADouble("/LXe/detector/reflectivity",this);
107  fReflectivityCmd->SetGuidance("Set the reflectivity of the housing.");
109  fReflectivityCmd->SetToBeBroadcasted(false);
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.");
124  fNFibersCmd->SetToBeBroadcasted(false);
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");
130  fMainScintYield->SetToBeBroadcasted(false);
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");
136  fWLSScintYield->SetToBeBroadcasted(false);
137 
138  fDefaultsCmd = new G4UIcommand("/LXe/detector/defaults",this);
139  fDefaultsCmd->SetGuidance("Set all detector geometry values to defaults.");
141  fDefaultsCmd->SetToBeBroadcasted(false);
142 }
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetDefaultUnit(const char *defUnit)
void SetToBeBroadcasted(G4bool val)
Definition: G4UIcommand.hh:184
void SetParameterName(const char *theNameX, const char *theNameY, const char *theNameZ, G4bool omittable, G4bool currentAsDefault=false)
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161
void AvailableForStates(G4ApplicationState s1)
Definition: G4UIcommand.cc:240
void SetDefaultUnit(const char *defUnit)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)

Here is the call graph for this function:

LXeDetectorMessenger::~LXeDetectorMessenger ( )
virtual

Definition at line 146 of file LXeDetectorMessenger.cc.

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 }

Member Function Documentation

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

Reimplemented from G4UImessenger.

Definition at line 168 of file LXeDetectorMessenger.cc.

169 {
170  if( command == fDimensionsCmd ){
171  fLXeDetector->SetDimensions(fDimensionsCmd->GetNew3VectorValue(newValue));
172  }
173  else if (command == fHousingThicknessCmd){
174  fLXeDetector->SetHousingThickness(fHousingThicknessCmd
175  ->GetNewDoubleValue(newValue));
176  }
177  else if (command == fPmtRadiusCmd){
178  fLXeDetector->SetPMTRadius(fPmtRadiusCmd->GetNewDoubleValue(newValue));
179  }
180  else if (command == fNxCmd){
181  fLXeDetector->SetNX(fNxCmd->GetNewIntValue(newValue));
182  }
183  else if (command == fNyCmd){
184  fLXeDetector->SetNY(fNyCmd->GetNewIntValue(newValue));
185  }
186  else if (command == fNzCmd){
187  fLXeDetector->SetNZ(fNzCmd->GetNewIntValue(newValue));
188  }
189  else if (command == fSphereCmd){
190  fLXeDetector->SetSphereOn(fSphereCmd->GetNewBoolValue(newValue));
191  }
192  else if (command == fReflectivityCmd){
193  fLXeDetector
194  ->SetHousingReflectivity(fReflectivityCmd->GetNewDoubleValue(newValue));
195  }
196  else if (command == fWlsCmd){
197  fLXeDetector->SetWLSSlabOn(fWlsCmd->GetNewBoolValue(newValue));
198  }
199  else if (command == fLxeCmd){
200  fLXeDetector->SetMainVolumeOn(fLxeCmd->GetNewBoolValue(newValue));
201  }
202  else if (command == fNFibersCmd){
203  fLXeDetector->SetNFibers(fNFibersCmd->GetNewIntValue(newValue));
204  }
205  else if (command == fMainScintYield){
206  fLXeDetector->
207  SetMainScintYield(fMainScintYield->GetNewDoubleValue(newValue));
208  }
209  else if (command == fWLSScintYield){
210  fLXeDetector->SetWLSScintYield(fWLSScintYield->GetNewDoubleValue(newValue));
211  }
212  else if (command == fDefaultsCmd){
213  fLXeDetector->SetDefaults();
214 
215  G4RunManager::GetRunManager()->ReinitializeGeometry(); //Add here this line
216  }
217 }
static G4int GetNewIntValue(const char *paramString)
static G4ThreeVector GetNew3VectorValue(const char *paramString)
static G4double GetNewDoubleValue(const char *paramString)
static G4bool GetNewBoolValue(const char *paramString)
static G4double GetNewDoubleValue(const char *paramString)
void ReinitializeGeometry(G4bool destroyFirst=false, G4bool prop=true)
static G4RunManager * GetRunManager()
Definition: G4RunManager.cc:79

Here is the call graph for this function:


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