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

#include <G4OpticalPhysicsMessenger.hh>

Inheritance diagram for G4OpticalPhysicsMessenger:
G4UImessenger

Public Member Functions

 G4OpticalPhysicsMessenger (G4OpticalPhysics *)
 
virtual ~G4OpticalPhysicsMessenger ()
 
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
 

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 74 of file G4OpticalPhysicsMessenger.hh.

Constructor & Destructor Documentation

G4OpticalPhysicsMessenger::G4OpticalPhysicsMessenger ( G4OpticalPhysics opticalPhysics)

Definition at line 59 of file G4OpticalPhysicsMessenger.cc.

References G4UIcommand::AvailableForStates(), G4OpticalPhysicsMessenger(), G4OpticalProcessName(), G4State_Idle, G4State_PreInit, kNoProcess, G4UIcmdWithAString::SetCandidates(), G4UIcmdWithAnInteger::SetDefaultValue(), G4UIcommand::SetGuidance(), G4UIcmdWithAString::SetParameterName(), G4UIcmdWithAnInteger::SetParameterName(), G4UIcmdWithABool::SetParameterName(), and G4UIcommand::SetRange().

Referenced by G4OpticalPhysicsMessenger().

61  : G4UImessenger(),
62  fOpticalPhysics(opticalPhysics),
63  fSelectedProcessIndex(kNoProcess),
64  fSelectOpProcessCmd(0),
65  fSetOpProcessUseCmd(0),
66  fSetOpProcessVerboseCmd(0),
67  fSetCerenkovMaxPhotonsCmd(0),
68  fSetCerenkovMaxBetaChangeCmd(0),
69  fSetScintillationYieldFactorCmd(0),
70  fSetScintillationByParticleTypeCmd(0),
71 // fSetOpticalSurfaceModelCmd(0),
72  fSetWLSTimeProfileCmd(0),
73  fSetTrackSecondariesFirstCmd(0),
74  fSetFiniteRiseTimeCmd(0)
75 {
76  fDir = new G4UIdirectory("/optics_engine/");
77  fDir->
78  SetGuidance("Commands related to the optical physics simulation engine.");
79 
80  fSelectOpProcessCmd
81  = new G4UIcmdWithAString("/optics_engine/selectOpProcess", this);
82  fSelectOpProcessCmd
83  ->SetGuidance("Select optical process for applying use/verbose/trackfirst commands");
84  fSelectOpProcessCmd->SetParameterName("OpProcess", false);
85  G4String candidates;
86  for ( G4int i=0; i<kNoProcess; i++ ) {
87  candidates += G4OpticalProcessName(i);
88  candidates += G4String(" ");
89  }
90  fSelectOpProcessCmd->SetCandidates(candidates);
91  fSelectOpProcessCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
92 
93  fSetOpProcessUseCmd
94  = new G4UIcmdWithABool("/optics_engine/setOpProcessUse", this);
95  fSetOpProcessUseCmd->SetGuidance("Use/Not use selected optical process");
96  fSetOpProcessUseCmd->SetParameterName("OpProcessUse", false);
97  fSetOpProcessUseCmd->AvailableForStates(G4State_PreInit);
98 
99  fSetOpProcessVerboseCmd
100  = new G4UIcmdWithAnInteger("/optics_engine/setOpProcessVerbose", this);
101  fSetOpProcessVerboseCmd->SetGuidance("Set verbosity level for selected optical process");
102  fSetOpProcessVerboseCmd->SetParameterName("OpProcessVerbose", true);
103  fSetOpProcessVerboseCmd->SetDefaultValue(1);
104  fSetOpProcessVerboseCmd->SetRange("OpProcessVerbose>=0");
105  fSetOpProcessVerboseCmd->AvailableForStates(G4State_PreInit);
106 
107  fSetCerenkovMaxPhotonsCmd
108  = new G4UIcmdWithAnInteger("/optics_engine/setCerenkovMaxPhotons", this);
109  fSetCerenkovMaxPhotonsCmd->SetGuidance("Set maximum number of photons per step");
110  fSetCerenkovMaxPhotonsCmd->SetParameterName("CerenkovMaxPhotons", false);
111  fSetCerenkovMaxPhotonsCmd->SetRange("CerenkovMaxPhotons>=0");
112  fSetCerenkovMaxPhotonsCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
113 
114  fSetCerenkovMaxBetaChangeCmd
115  = new G4UIcmdWithADouble("/optics_engine/setCerenkovMaxBetaChange", this);
116  fSetCerenkovMaxBetaChangeCmd
117  ->SetGuidance("Set maximum change of beta of parent particle per step");
118  fSetCerenkovMaxBetaChangeCmd->
119  SetParameterName("CerenkovMaxBetaChange", false);
120  fSetCerenkovMaxBetaChangeCmd->SetRange("CerenkovMaxBetaChange>=0");
121  fSetCerenkovMaxBetaChangeCmd->
122  AvailableForStates(G4State_PreInit, G4State_Idle);
123 
124  fSetScintillationYieldFactorCmd
125  = new G4UIcmdWithADouble("/optics_engine/setScintillationYieldFactor", this);
126  fSetScintillationYieldFactorCmd->
127  SetGuidance("Set scintillation yield factor");
128  fSetScintillationYieldFactorCmd->
129  SetParameterName("ScintillationYieldFactor", false);
130  fSetScintillationYieldFactorCmd->SetRange("ScintillationYieldFactor>=0");
131  fSetScintillationYieldFactorCmd->
132  AvailableForStates(G4State_PreInit, G4State_Idle);
133 
134  fSetScintillationByParticleTypeCmd
135  = new G4UIcmdWithABool("/optics_engine/setScintillationByParticleType", this);
136  fSetScintillationByParticleTypeCmd->
137  SetGuidance("Activate/Inactivate scintillation process by particle type");
138  fSetScintillationByParticleTypeCmd->
139  SetParameterName("ScintillationByParticleTypeActivation", false);
140  fSetScintillationByParticleTypeCmd->
141  AvailableForStates(G4State_PreInit, G4State_Idle);
142 
143 // fSetOpticalSurfaceModelCmd
144 // = new G4UIcmdWithAString("/optics_engine/setOpticalSurfaceModel", this);
145 // fSetOpticalSurfaceModelCmd
146 // ->SetGuidance("Set optical surface model (glisur or unified)");
147 // fSetOpticalSurfaceModelCmd->SetParameterName("OpticalSurfaceModel", false);
148 // fSetOpticalSurfaceModelCmd->SetCandidates("glisur unified");
149 // fSetOpticalSurfaceModelCmd->
150 // AvailableForStates(G4State_PreInit, G4State_Idle);
151 
152  fSetWLSTimeProfileCmd
153  = new G4UIcmdWithAString("/optics_engine/setWLSTimeProfile", this);
154  fSetWLSTimeProfileCmd
155  ->SetGuidance("Set the WLS time profile (delta or exponential)");
156  fSetWLSTimeProfileCmd->SetParameterName("WLSTimeProfile", false);
157  fSetWLSTimeProfileCmd->SetCandidates("delta exponential");
158  fSetWLSTimeProfileCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
159 
160  fSetTrackSecondariesFirstCmd
161  = new G4UIcmdWithABool("/optics_engine/setTrackSecondariesFirst", this);
162  fSetTrackSecondariesFirstCmd
163  ->SetGuidance("Set option to track secondaries before finishing their parent track");
164  fSetTrackSecondariesFirstCmd->
165  SetParameterName("TrackSecondariesFirst", false);
166  fSetTrackSecondariesFirstCmd->
167  AvailableForStates(G4State_PreInit, G4State_Idle);
168 
169  fSetFiniteRiseTimeCmd
170  = new G4UIcmdWithABool("/optics_engine/setFiniteRiseTime", this);
171  fSetFiniteRiseTimeCmd
172  ->SetGuidance("Set option of a finite rise-time for G4Scintillation - If set, the G4Scintillation process expects the user to have set the constant material property FAST/SLOWSCINTILLATIONRISETIME");
173  fSetFiniteRiseTimeCmd->SetParameterName("FiniteRiseTime", false);
174  fSetFiniteRiseTimeCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
175 }
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
Number of processes, no selected process.
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
int G4int
Definition: G4Types.hh:78
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
G4String G4OpticalProcessName(G4int)
Return the name for a given optical process index.
void SetCandidates(const char *candidateList)
void SetDefaultValue(G4int defVal)
G4OpticalPhysicsMessenger::~G4OpticalPhysicsMessenger ( )
virtual

Definition at line 177 of file G4OpticalPhysicsMessenger.cc.

178 {
179 // Destructor
180 
181  delete fDir;
182  delete fSelectOpProcessCmd;
183  delete fSetOpProcessUseCmd;
184  delete fSetOpProcessVerboseCmd;
185  delete fSetCerenkovMaxPhotonsCmd;
186  delete fSetCerenkovMaxBetaChangeCmd;
187  delete fSetScintillationYieldFactorCmd;
188  delete fSetScintillationByParticleTypeCmd;
189 // delete fSetOpticalSurfaceModelCmd;
190  delete fSetWLSTimeProfileCmd;
191  delete fSetTrackSecondariesFirstCmd;
192  delete fSetFiniteRiseTimeCmd;
193 }

Member Function Documentation

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

Apply command to the associated object.

Reimplemented from G4UImessenger.

Definition at line 195 of file G4OpticalPhysicsMessenger.cc.

References Lesson1::Configure(), G4UIcmdWithABool::GetNewBoolValue(), G4UIcmdWithADouble::GetNewDoubleValue(), G4UIcmdWithAnInteger::GetNewIntValue(), kAbsorption, kBoundary, kCerenkov, kMieHG, kNoProcess, kRayleigh, kScintillation, kWLS, G4OpticalPhysics::SetFiniteRiseTime(), G4OpticalPhysics::SetMaxBetaChangePerStep(), G4OpticalPhysics::SetMaxNumPhotonsPerStep(), G4OpticalPhysics::SetScintillationByParticleType(), G4OpticalPhysics::SetScintillationYieldFactor(), G4OpticalPhysics::SetTrackSecondariesFirst(), and G4OpticalPhysics::SetWLSTimeProfile().

197 {
198 /// Apply command to the associated object.
199 
200  if (command == fSelectOpProcessCmd) {
201  if ( newValue == "Cerenkov" ) {
202  fSelectedProcessIndex = kCerenkov;
203  } else if ( newValue == "Scintillation" ) {
204  fSelectedProcessIndex = kScintillation;
205  } else if ( newValue == "OpAbsorption" ) {
206  fSelectedProcessIndex = kAbsorption;
207  } else if ( newValue == "OpRayleigh" ) {
208  fSelectedProcessIndex = kRayleigh;
209  } else if ( newValue == "OpMieHG" ) {
210  fSelectedProcessIndex = kMieHG;
211  } else if ( newValue == "OpBoundary" ) {
212  fSelectedProcessIndex = kBoundary;
213  } else if ( newValue == "OpWLS" ) {
214  fSelectedProcessIndex = kWLS;
215  }
216  }
217  else if (command == fSetOpProcessUseCmd) {
218  fOpticalPhysics->
219  Configure(fSelectedProcessIndex,
220  fSetOpProcessUseCmd->GetNewBoolValue(newValue));
221  }
222  else if (command == fSetOpProcessVerboseCmd) {
223  if ( fSelectedProcessIndex < kNoProcess ) {
224  fOpticalPhysics->
225  SetProcessVerbose(fSelectedProcessIndex,
226  fSetOpProcessVerboseCmd->GetNewIntValue(newValue));
227  } else {
228  for ( G4int i=0; i<kNoProcess; i++ ) {
229  fOpticalPhysics->
230  SetProcessVerbose(i,fSetOpProcessVerboseCmd->GetNewIntValue(newValue));
231  }
232  }
233  }
234  else if (command == fSetCerenkovMaxPhotonsCmd) {
235  fOpticalPhysics
237  fSetCerenkovMaxPhotonsCmd->GetNewIntValue(newValue));
238  }
239  else if (command == fSetCerenkovMaxBetaChangeCmd) {
240  fOpticalPhysics
242  fSetCerenkovMaxBetaChangeCmd->GetNewDoubleValue(newValue));
243  }
244  else if (command == fSetScintillationYieldFactorCmd) {
245  fOpticalPhysics
247  fSetScintillationYieldFactorCmd->GetNewDoubleValue(newValue));
248  }
249  else if (command == fSetScintillationByParticleTypeCmd) {
250  fOpticalPhysics
252  fSetScintillationByParticleTypeCmd->GetNewBoolValue(newValue));
253  }
254  else if (command == fSetFiniteRiseTimeCmd) {
255  fOpticalPhysics
257  fSetFiniteRiseTimeCmd->GetNewBoolValue(newValue));
258  }
259 // else if (command == fSetOpticalSurfaceModelCmd) {
260 // if ( newValue == "glisur" ) {
261 // fOpticalPhysics
262 // ->SetOpticalSurfaceModel(glisur);
263 // }
264 // if ( newValue == "unified" ) {
265 // fOpticalPhysics
266 // ->SetOpticalSurfaceModel(unified);
267 // }
268 // }
269  else if (command == fSetWLSTimeProfileCmd) {
270  if ( newValue == "delta" ) {
271  fOpticalPhysics
272  ->SetWLSTimeProfile("delta"); }
273  if ( newValue == "exponential" ) {
274  fOpticalPhysics
275  ->SetWLSTimeProfile("exponential");
276  }
277  }
278  else if (command == fSetTrackSecondariesFirstCmd) {
279  fOpticalPhysics->SetTrackSecondariesFirst(fSelectedProcessIndex,
280  fSetTrackSecondariesFirstCmd->
281  GetNewBoolValue(newValue));
282  }
283 }
Number of processes, no selected process.
static G4int GetNewIntValue(const char *paramString)
void SetMaxBetaChangePerStep(G4double)
Scintillation process index.
Mie scattering process index.
void SetFiniteRiseTime(G4bool)
Absorption process index.
int G4int
Definition: G4Types.hh:78
static G4bool GetNewBoolValue(const char *paramString)
void SetScintillationByParticleType(G4bool)
def Configure
Definition: Lesson1.py:20
void SetMaxNumPhotonsPerStep(G4int)
static G4double GetNewDoubleValue(const char *paramString)
Wave Length Shifting process index.
Boundary process index.
void SetScintillationYieldFactor(G4double)
Cerenkov process index.
void SetWLSTimeProfile(G4String)
void SetTrackSecondariesFirst(G4OpticalProcessIndex, G4bool)
Rayleigh scattering process index.

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