Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4OpticalPhysicsMessenger Class Reference

#include <G4OpticalPhysicsMessenger.hh>

+ Inheritance diagram for G4OpticalPhysicsMessenger:

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)
 
virtual ~G4UImessenger ()
 
virtual G4String GetCurrentValue (G4UIcommand *command)
 
virtual void SetNewValue (G4UIcommand *command, G4String newValue)
 
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)
 
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::G4OpticalPhysicsMessenger ( G4OpticalPhysics opticalPhysics)

Definition at line 59 of file G4OpticalPhysicsMessenger.cc.

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->SetGuidance("Commands related to the optical physics simulation engine.");
78
79 fSelectOpProcessCmd
80 = new G4UIcmdWithAString("/optics_engine/selectOpProcess", this);
81 fSelectOpProcessCmd
82 ->SetGuidance("Select optical process for applying use/verbose/trackfirst commands");
83 fSelectOpProcessCmd->SetParameterName("OpProcess", false);
84 G4String candidates;
85 for ( G4int i=0; i<kNoProcess; i++ ) {
86 candidates += G4OpticalProcessName(i);
87 candidates += G4String(" ");
88 }
89 fSelectOpProcessCmd->SetCandidates(candidates);
91
92 fSetOpProcessUseCmd
93 = new G4UIcmdWithABool("/optics_engine/setOpProcessUse", this);
94 fSetOpProcessUseCmd->SetGuidance("Use/Not use selected optical process");
95 fSetOpProcessUseCmd->SetParameterName("OpProcessUse", false);
96 fSetOpProcessUseCmd->AvailableForStates(G4State_PreInit);
97
98 fSetOpProcessVerboseCmd
99 = new G4UIcmdWithAnInteger("/optics_engine/setOpProcessVerbose", this);
100 fSetOpProcessVerboseCmd->SetGuidance("Set verbosity level for selected optical process");
101 fSetOpProcessVerboseCmd->SetParameterName("OpProcessVerbose", false);
102 fSetOpProcessVerboseCmd->SetRange("OpProcessVerbose>=0");
104
105 fSetCerenkovMaxPhotonsCmd
106 = new G4UIcmdWithAnInteger("/optics_engine/setCerenkovMaxPhotons", this);
107 fSetCerenkovMaxPhotonsCmd->SetGuidance("Set maximum number of photons per step");
108 fSetCerenkovMaxPhotonsCmd->SetParameterName("CerenkovMaxPhotons", false);
109 fSetCerenkovMaxPhotonsCmd->SetRange("CerenkovMaxPhotons>=0");
111
112 fSetCerenkovMaxBetaChangeCmd
113 = new G4UIcmdWithADouble("/optics_engine/setCerenkovMaxBetaChange", this);
114 fSetCerenkovMaxBetaChangeCmd
115 ->SetGuidance("Set maximum change of beta of parent particle per step");
116 fSetCerenkovMaxBetaChangeCmd->SetParameterName("CerenkovMaxBetaChange", false);
117 fSetCerenkovMaxBetaChangeCmd->SetRange("CerenkovMaxBetaChange>=0");
119
120 fSetScintillationYieldFactorCmd
121 = new G4UIcmdWithADouble("/optics_engine/setScintillationYieldFactor", this);
122 fSetScintillationYieldFactorCmd->SetGuidance("Set scintillation yield factor");
123 fSetScintillationYieldFactorCmd->SetParameterName("ScintillationYieldFactor", false);
124 fSetScintillationYieldFactorCmd->SetRange("ScintillationYieldFactor>=0");
126
127 fSetScintillationByParticleTypeCmd
128 = new G4UIcmdWithABool("/optics_engine/setScintillationByParticleType", this);
129 fSetScintillationByParticleTypeCmd->SetGuidance("Activate/Inactivate scintillation process by particle type");
130 fSetScintillationByParticleTypeCmd->SetParameterName("ScintillationByParticleTypeActivation", false);
132
133// fSetOpticalSurfaceModelCmd
134// = new G4UIcmdWithAString("/optics_engine/setOpticalSurfaceModel", this);
135// fSetOpticalSurfaceModelCmd
136// ->SetGuidance("Set optical surface model (glisur or unified)");
137// fSetOpticalSurfaceModelCmd->SetParameterName("OpticalSurfaceModel", false);
138// fSetOpticalSurfaceModelCmd->SetCandidates("glisur unified");
139// fSetOpticalSurfaceModelCmd->AvailableForStates(G4State_PreInit, G4State_Idle, G4State_GeomClosed, G4State_EventProc);
140
141 fSetWLSTimeProfileCmd
142 = new G4UIcmdWithAString("/optics_engine/setWLSTimeProfile", this);
143 fSetWLSTimeProfileCmd
144 ->SetGuidance("Set the WLS time profile (delta or exponential)");
145 fSetWLSTimeProfileCmd->SetParameterName("WLSTimeProfile", false);
146 fSetWLSTimeProfileCmd->SetCandidates("delta exponential");
148
149 fSetTrackSecondariesFirstCmd
150 = new G4UIcmdWithABool("/optics_engine/setTrackSecondariesFirst", this);
151 fSetTrackSecondariesFirstCmd
152 ->SetGuidance("Set option to track secondaries before finishing their parent track");
153 fSetTrackSecondariesFirstCmd->SetParameterName("TrackSecondariesFirst", false);
155
156 fSetFiniteRiseTimeCmd
157 = new G4UIcmdWithABool("/optics_engine/setFiniteRiseTime", this);
158 fSetFiniteRiseTimeCmd
159 ->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");
160 fSetFiniteRiseTimeCmd->SetParameterName("FiniteRiseTime", false);
162}
@ G4State_EventProc
@ G4State_Idle
@ G4State_GeomClosed
@ G4State_PreInit
@ kNoProcess
Number of processes, no selected process.
G4String G4OpticalProcessName(G4int)
Return the name for a given optical process index.
int G4int
Definition: G4Types.hh:66
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetCandidates(const char *candidateList)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:156
void SetRange(const char *rs)
Definition: G4UIcommand.hh:120
void AvailableForStates(G4ApplicationState s1)
Definition: G4UIcommand.cc:219

Referenced by G4OpticalPhysicsMessenger().

◆ ~G4OpticalPhysicsMessenger()

G4OpticalPhysicsMessenger::~G4OpticalPhysicsMessenger ( )
virtual

Definition at line 164 of file G4OpticalPhysicsMessenger.cc.

165{
166// Destructor
167
168 delete fDir;
169 delete fSelectOpProcessCmd;
170 delete fSetOpProcessUseCmd;
171 delete fSetOpProcessVerboseCmd;
172 delete fSetCerenkovMaxPhotonsCmd;
173 delete fSetCerenkovMaxBetaChangeCmd;
174 delete fSetScintillationYieldFactorCmd;
175 delete fSetScintillationByParticleTypeCmd;
176// delete fSetOpticalSurfaceModelCmd;
177 delete fSetWLSTimeProfileCmd;
178 delete fSetTrackSecondariesFirstCmd;
179 delete fSetFiniteRiseTimeCmd;
180}

Member Function Documentation

◆ SetNewValue()

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

Apply command to the associated object.

Reimplemented from G4UImessenger.

Definition at line 182 of file G4OpticalPhysicsMessenger.cc.

183{
184/// Apply command to the associated object.
185
186 if (command == fSelectOpProcessCmd) {
187 if ( newValue == "Cerenkov" ) {
188 fSelectedProcessIndex = kCerenkov;
189 } else if ( newValue == "Scintillation" ) {
190 fSelectedProcessIndex = kScintillation;
191 } else if ( newValue == "OpAbsorption" ) {
192 fSelectedProcessIndex = kAbsorption;
193 } else if ( newValue == "OpRayleigh" ) {
194 fSelectedProcessIndex = kRayleigh;
195 } else if ( newValue == "OpMieHG" ) {
196 fSelectedProcessIndex = kMieHG;
197 } else if ( newValue == "OpBoundary" ) {
198 fSelectedProcessIndex = kBoundary;
199 } else if ( newValue == "OpWLS" ) {
200 fSelectedProcessIndex = kWLS;
201 }
202 }
203 else if (command == fSetOpProcessUseCmd) {
204 fOpticalPhysics->
205 Configure(fSelectedProcessIndex,
206 fSetOpProcessUseCmd->GetNewBoolValue(newValue));
207 }
208 else if (command == fSetOpProcessVerboseCmd) {
209 if ( fSelectedProcessIndex < kNoProcess ) {
210 fOpticalPhysics->
211 SetProcessVerbose(fSelectedProcessIndex,
212 fSetOpProcessVerboseCmd->GetNewIntValue(newValue));
213 } else {
214 for ( G4int i=0; i<kNoProcess; i++ ) {
215 fOpticalPhysics->
216 SetProcessVerbose(i,fSetOpProcessVerboseCmd->GetNewIntValue(newValue));
217 }
218 }
219 }
220 else if (command == fSetCerenkovMaxPhotonsCmd) {
221 fOpticalPhysics
223 fSetCerenkovMaxPhotonsCmd->GetNewIntValue(newValue));
224 }
225 else if (command == fSetCerenkovMaxBetaChangeCmd) {
226 fOpticalPhysics
228 fSetCerenkovMaxBetaChangeCmd->GetNewDoubleValue(newValue));
229 }
230 else if (command == fSetScintillationYieldFactorCmd) {
231 fOpticalPhysics
233 fSetScintillationYieldFactorCmd->GetNewDoubleValue(newValue));
234 }
235 else if (command == fSetScintillationByParticleTypeCmd) {
236 fOpticalPhysics
238 fSetScintillationByParticleTypeCmd->GetNewBoolValue(newValue));
239 }
240 else if (command == fSetFiniteRiseTimeCmd) {
241 fOpticalPhysics
243 fSetFiniteRiseTimeCmd->GetNewBoolValue(newValue));
244 }
245// else if (command == fSetOpticalSurfaceModelCmd) {
246// if ( newValue == "glisur" ) {
247// fOpticalPhysics
248// ->SetOpticalSurfaceModel(glisur);
249// }
250// if ( newValue == "unified" ) {
251// fOpticalPhysics
252// ->SetOpticalSurfaceModel(unified);
253// }
254// }
255 else if (command == fSetWLSTimeProfileCmd) {
256 if ( newValue == "delta" ) {
257 fOpticalPhysics
258 ->SetWLSTimeProfile("delta"); }
259 if ( newValue == "exponential" ) {
260 fOpticalPhysics
261 ->SetWLSTimeProfile("exponential");
262 }
263 }
264 else if (command == fSetTrackSecondariesFirstCmd) {
265 fOpticalPhysics->SetTrackSecondariesFirst(fSelectedProcessIndex,
266 fSetTrackSecondariesFirstCmd->
267 GetNewBoolValue(newValue));
268 }
269}
@ kWLS
Wave Length Shifting process index.
@ kScintillation
Scintillation process index.
@ kRayleigh
Rayleigh scattering process index.
@ kAbsorption
Absorption process index.
@ kBoundary
Boundary process index.
@ kCerenkov
Cerenkov process index.
@ kMieHG
Mie scattering process index.
void SetMaxBetaChangePerStep(G4double)
void SetScintillationYieldFactor(G4double)
void SetScintillationByParticleType(G4bool)
void SetMaxNumPhotonsPerStep(G4int)
void SetTrackSecondariesFirst(G4OpticalProcessIndex, G4bool)
void SetWLSTimeProfile(G4String)
void SetFiniteRiseTime(G4bool)
static G4bool GetNewBoolValue(const char *paramString)
static G4double GetNewDoubleValue(const char *paramString)
static G4int GetNewIntValue(const char *paramString)

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