Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4OpticalPhysicsMessenger Class Reference

#include <G4OpticalPhysicsMessenger.hh>

Inheritance diagram for G4OpticalPhysicsMessenger:
Collaboration 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, 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 76 of file G4OpticalPhysicsMessenger.hh.

Constructor & Destructor Documentation

G4OpticalPhysicsMessenger::G4OpticalPhysicsMessenger ( G4OpticalPhysics opticalPhysics)

Definition at line 60 of file G4OpticalPhysicsMessenger.cc.

62  : G4UImessenger(),
63  fOpticalPhysics(opticalPhysics),
64  fSelectedProcessIndex(kNoProcess),
65  fActivateProcessCmd(0),
66  fSetOpProcessVerboseCmd(0),
67  fSetCerenkovMaxPhotonsCmd(0),
68  fSetCerenkovMaxBetaChangeCmd(0),
69  fSetCerenkovStackPhotonsCmd(0),
70  fSetScintillationYieldFactorCmd(0),
71  fSetScintillationByParticleTypeCmd(0),
72  fSetScintillationTrackInfoCmd(0),
73  fSetScintillationStackPhotonsCmd(0),
74  fSetWLSTimeProfileCmd(0),
75  fSetTrackSecondariesFirstCmd(0),
76  fSetFiniteRiseTimeCmd(0),
77  fSetInvokeSDCmd(0)
78 {
79  G4bool toBeBroadcasted = false;
80  fDir = new G4UIdirectory("/process/optical/defaults/",toBeBroadcasted);
81  fDir->SetGuidance("Commands related to the optical physics simulation engine.");
82  fDir2 = new G4UIdirectory("/process/optical/",toBeBroadcasted);
83  fDir2->SetGuidance("Commands related to the optical physics simulation engine.");
84 
85  fActivateProcessCmd= new G4UIcommand("/process/optical/processActivation", this);
86  fActivateProcessCmd->SetGuidance("Activate/deactivate the specified optical process");
87  G4UIparameter* par = new G4UIparameter("proc_name",'s',false);
88  G4String candidates;
89  for ( G4int i=0; i<kNoProcess; i++ ) {
90  candidates += G4OpticalProcessName(i);
91  candidates += G4String(" ");
92  }
93  par->SetParameterCandidates(candidates);
94  par->SetGuidance("the process name");
95  fActivateProcessCmd->SetParameter(par);
96  par = new G4UIparameter("flag",'b',true);
97  par->SetDefaultValue(true);
98  par->SetGuidance("activation flag");
99  fActivateProcessCmd->SetParameter(par);
100  fActivateProcessCmd->AvailableForStates(G4State_PreInit);
101 
102 
103  fSetOpProcessVerboseCmd = new G4UIcmdWithAnInteger("/process/optical/verbose", this);
104  fSetOpProcessVerboseCmd->SetGuidance("Set default verbosity level for optical processes");
105  fSetOpProcessVerboseCmd->SetParameterName("ver", true);
106  fSetOpProcessVerboseCmd->SetDefaultValue(1);
107  fSetOpProcessVerboseCmd->SetRange("ver>=0");
108  fSetOpProcessVerboseCmd->AvailableForStates(G4State_PreInit);
109 
110 
111  fSetTrackSecondariesFirstCmd = new G4UIcommand("/process/optical/setTrackSecondariesFirst", this);
112  fSetTrackSecondariesFirstCmd->SetGuidance("Activate/deactivate tracking of secondaries before finishing their parent track");
113  par = new G4UIparameter("proc_name",'s',false);
114  par->SetParameterCandidates(candidates);
115  fSetTrackSecondariesFirstCmd->SetParameter(par);
116  par = new G4UIparameter("flag",'b',false);
117  par->SetDefaultValue(true);
118  fSetTrackSecondariesFirstCmd->SetParameter(par);
119  fSetTrackSecondariesFirstCmd->AvailableForStates(G4State_PreInit);
120 
121  //This are repetition of process specific ui commands needed by ATLICE and VMC
122  //(UI messages needed to exist in PreInit state before actual processes are instantiated)
123  fSetCerenkovMaxPhotonsCmd = new G4UIcmdWithAnInteger("/process/optical/defaults/cerenkov/setMaxPhotons", this);
124  fSetCerenkovMaxPhotonsCmd->SetGuidance("Set default maximum number of photons per step");
125  fSetCerenkovMaxPhotonsCmd->SetGuidance("Note this command is used to set the default value,");
126  fSetCerenkovMaxPhotonsCmd->SetGuidance("if process is not active command will not have effect.");
127  fSetCerenkovMaxPhotonsCmd->SetParameterName("CerenkovMaxPhotons", false);
128  fSetCerenkovMaxPhotonsCmd->SetRange("CerenkovMaxPhotons>=0");
129  fSetCerenkovMaxPhotonsCmd->AvailableForStates(G4State_PreInit);
130 
131  fSetCerenkovMaxBetaChangeCmd = new G4UIcmdWithADouble("/process/optical/defaults/cerenkov/setMaxBetaChange", this);
132  fSetCerenkovMaxBetaChangeCmd->SetGuidance("Set default maximum change of beta of parent particle per step");
133  fSetCerenkovMaxBetaChangeCmd->SetGuidance("Note this command is used to set the default value,");
134  fSetCerenkovMaxBetaChangeCmd->SetGuidance("if process is not active command will not have effect.");
135  fSetCerenkovMaxBetaChangeCmd->SetParameterName("CerenkovMaxBetaChange", false);
136  fSetCerenkovMaxBetaChangeCmd->SetRange("CerenkovMaxBetaChange>=0");
137  fSetCerenkovMaxBetaChangeCmd->AvailableForStates(G4State_PreInit);
138 
139  fSetCerenkovStackPhotonsCmd = new G4UIcmdWithABool("/process/optical/defaults/cerenkov/setStackPhotons", this);
140  fSetCerenkovStackPhotonsCmd->SetGuidance("Set default whether or not to stack secondary Cerenkov photons");
141  fSetCerenkovStackPhotonsCmd->SetGuidance("Note this command is used to set the default value,");
142  fSetCerenkovStackPhotonsCmd->SetGuidance("if process is not active command will not have effect.");
143  fSetCerenkovStackPhotonsCmd->SetParameterName("CerenkovStackPhotons", true);
144  fSetCerenkovStackPhotonsCmd->AvailableForStates(G4State_PreInit);
145 
146  fSetScintillationYieldFactorCmd = new G4UIcmdWithADouble("/process/optical/defaults/scintillation/setYieldFactor", this);
147  fSetScintillationYieldFactorCmd->SetGuidance("Set scintillation yield factor");
148  fSetScintillationYieldFactorCmd->SetGuidance("Note this command is used to set the default value,");
149  fSetScintillationYieldFactorCmd->SetGuidance("if process is not active command will not have effect.");
150  fSetScintillationYieldFactorCmd->SetParameterName("ScintillationYieldFactor", false);
151  fSetScintillationYieldFactorCmd->SetRange("ScintillationYieldFactor>=0");
152  fSetScintillationYieldFactorCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
153 
154  fSetScintillationByParticleTypeCmd = new G4UIcmdWithABool("/process/optical/defaults/scintillation/setByParticleType", this);
155  fSetScintillationByParticleTypeCmd->SetGuidance("Activate/Inactivate scintillation process by particle type");
156  fSetScintillationByParticleTypeCmd->SetGuidance("Note this command is used to set the default value,");
157  fSetScintillationByParticleTypeCmd->SetGuidance("if process is not active command will not have effect.");
158  fSetScintillationByParticleTypeCmd->SetParameterName("ScintillationByParticleTypeActivation", false);
159  fSetScintillationByParticleTypeCmd->AvailableForStates(G4State_PreInit);
160 
161  fSetScintillationTrackInfoCmd = new G4UIcmdWithABool("/process/optical/defaults/scintillation/setTrackInfo", this);
162  fSetScintillationTrackInfoCmd->SetGuidance("Activate/Inactivate scintillation TrackInformation");
163  fSetScintillationTrackInfoCmd->SetParameterName("ScintillationTrackInfo", false);
164  fSetScintillationTrackInfoCmd->AvailableForStates(G4State_PreInit);
165 
166  fSetFiniteRiseTimeCmd = new G4UIcmdWithABool("/process/optical/defaults/scintillation/setFiniteRiseTime", this);
167  fSetFiniteRiseTimeCmd->SetGuidance("Set option of a finite rise-time for G4Scintillation");
168  fSetFiniteRiseTimeCmd->SetGuidance("If set, the G4Scintillation process expects the user to have set the constant material property FAST/SLOWSCINTILLATIONRISETIME");
169  fSetFiniteRiseTimeCmd->SetGuidance("Note this command is used to set the default value,");
170  fSetFiniteRiseTimeCmd->SetGuidance("if process is not active command will not have effect.");
171  fSetFiniteRiseTimeCmd->SetParameterName("FiniteRiseTime", false);
172  fSetFiniteRiseTimeCmd->AvailableForStates(G4State_PreInit);
173 
174  fSetScintillationStackPhotonsCmd = new G4UIcmdWithABool("/process/optical/defaults/scintillation/setStackPhotons", this);
175  fSetScintillationStackPhotonsCmd->SetGuidance("Set default whether or not to stack secondary Scintillation photons");
176  fSetScintillationStackPhotonsCmd->SetGuidance("Note this command is used to set the default value,");
177  fSetScintillationStackPhotonsCmd->SetGuidance("if process is not active command will not have effect.");
178  fSetScintillationStackPhotonsCmd->SetParameterName("ScintillationStackPhotons", true);
179  fSetScintillationStackPhotonsCmd->AvailableForStates(G4State_PreInit);
180 
181  fSetWLSTimeProfileCmd = new G4UIcmdWithAString("/process/optical/defaults/wls/setTimeProfile", this);
182  fSetWLSTimeProfileCmd->SetGuidance("Set the WLS time profile (delta or exponential)");
183  fSetWLSTimeProfileCmd->SetParameterName("WLSTimeProfile", false);
184  fSetWLSTimeProfileCmd->SetCandidates("delta exponential");
185  fSetWLSTimeProfileCmd->AvailableForStates(G4State_PreInit);
186 
187  fSetInvokeSDCmd = new G4UIcmdWithABool("/process/optical/defaults/boundary/setInvokeSD", this);
188  fSetInvokeSDCmd->SetGuidance("Set option for calling InvokeSD in G4OpBoundaryProcess");
189  fSetInvokeSDCmd->SetParameterName("InvokeSD", false);
190  fSetInvokeSDCmd->AvailableForStates(G4State_PreInit);
191 }
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetParameter(G4UIparameter *const newParameter)
Definition: G4UIcommand.hh:152
Number of processes, no selected process.
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetParameterCandidates(const char *theString)
void SetDefaultValue(const char *theDefaultValue)
int G4int
Definition: G4Types.hh:78
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
bool G4bool
Definition: G4Types.hh:79
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:240
G4String G4OpticalProcessName(G4int)
Return the name for a given optical process index.
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetCandidates(const char *candidateList)
void SetDefaultValue(G4int defVal)
void SetGuidance(const char *theGuidance)

Here is the call graph for this function:

Here is the caller graph for this function:

G4OpticalPhysicsMessenger::~G4OpticalPhysicsMessenger ( )
virtual

Definition at line 193 of file G4OpticalPhysicsMessenger.cc.

194 {
195 // Destructor
196 
197  delete fDir;
198  delete fDir2;
199  delete fActivateProcessCmd;
200  delete fSetOpProcessVerboseCmd;
201  delete fSetCerenkovMaxPhotonsCmd;
202  delete fSetCerenkovMaxBetaChangeCmd;
203  delete fSetCerenkovStackPhotonsCmd;
204  delete fSetScintillationYieldFactorCmd;
205  delete fSetScintillationByParticleTypeCmd;
206  delete fSetScintillationTrackInfoCmd;
207  delete fSetScintillationStackPhotonsCmd;
208  delete fSetWLSTimeProfileCmd;
209  delete fSetTrackSecondariesFirstCmd;
210  delete fSetFiniteRiseTimeCmd;
211  delete fSetInvokeSDCmd;
212 }

Member Function Documentation

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

Apply command to the associated object.

Reimplemented from G4UImessenger.

Definition at line 215 of file G4OpticalPhysicsMessenger.cc.

217 {
219  if (command == fActivateProcessCmd) {
220  std::istringstream is(newValue.data());
221  G4String pn;
222  G4String flag;
223  is >> pn >> flag;
224  if ( pn == "Cerenkov" ) {
225  fSelectedProcessIndex = kCerenkov;
226  } else if ( pn == "Scintillation" ) {
227  fSelectedProcessIndex = kScintillation;
228  } else if ( pn == "OpAbsorption" ) {
229  fSelectedProcessIndex = kAbsorption;
230  } else if ( pn == "OpRayleigh" ) {
231  fSelectedProcessIndex = kRayleigh;
232  } else if ( pn == "OpMieHG" ) {
233  fSelectedProcessIndex = kMieHG;
234  } else if ( pn == "OpBoundary" ) {
235  fSelectedProcessIndex = kBoundary;
236  } else if ( pn == "OpWLS" ) {
237  fSelectedProcessIndex = kWLS;
238  } else {
240  msg << "Not allowed process name: "<<pn<<" (UI: "<<newValue<<")";
241  G4Exception("G4OpticalPhysicsMessenger::SetNewValue(...)","Optical001",FatalException,msg);
242  }
244  fOpticalPhysics->Configure(fSelectedProcessIndex,value);
245  }
246  else if (command == fSetTrackSecondariesFirstCmd )
247  {
248  std::istringstream is(newValue.data());
249  G4String pn;
250  G4String flag;
251  is >> pn >> flag;
252  if ( pn == "Cerenkov" ) {
253  fSelectedProcessIndex = kCerenkov;
254  } else if ( pn == "Scintillation" ) {
255  fSelectedProcessIndex = kScintillation;
256  } else if ( pn == "OpAbsorption" ) {
257  fSelectedProcessIndex = kAbsorption;
258  } else if ( pn == "OpRayleigh" ) {
259  fSelectedProcessIndex = kRayleigh;
260  } else if ( pn == "OpMieHG" ) {
261  fSelectedProcessIndex = kMieHG;
262  } else if ( pn == "OpBoundary" ) {
263  fSelectedProcessIndex = kBoundary;
264  } else if ( pn == "OpWLS" ) {
265  fSelectedProcessIndex = kWLS;
266  } else {
268  msg << "Not allowed process name: "<<pn<<" (UI: "<<newValue<<")";
269  G4Exception("G4OpticalPhysicsMessenger::SetNewValue(...)","Optical001",FatalException,msg);
270  }
271  G4bool value = G4UIcommand::ConvertToBool(flag);
272  fOpticalPhysics->SetTrackSecondariesFirst(fSelectedProcessIndex,value);
273  }
274  else if (command == fSetOpProcessVerboseCmd) {
275  fOpticalPhysics->SetVerboseLevel(fSetOpProcessVerboseCmd->GetNewIntValue(newValue));
276  }
277  else if (command == fSetCerenkovMaxPhotonsCmd) {
278  fOpticalPhysics
280  fSetCerenkovMaxPhotonsCmd->GetNewIntValue(newValue));
281  }
282  else if (command == fSetCerenkovMaxBetaChangeCmd) {
283  fOpticalPhysics
285  fSetCerenkovMaxBetaChangeCmd->GetNewDoubleValue(newValue));
286  }
287  else if (command == fSetCerenkovStackPhotonsCmd) {
288  fOpticalPhysics
290  fSetCerenkovStackPhotonsCmd->GetNewBoolValue(newValue));
291  }
292  else if (command == fSetScintillationYieldFactorCmd) {
293  fOpticalPhysics
295  fSetScintillationYieldFactorCmd->GetNewDoubleValue(newValue));
296  }
297  else if (command == fSetScintillationByParticleTypeCmd) {
298  fOpticalPhysics
300  fSetScintillationByParticleTypeCmd->GetNewBoolValue(newValue));
301  }
302  else if (command == fSetScintillationTrackInfoCmd) {
303  fOpticalPhysics
305  fSetScintillationTrackInfoCmd->GetNewBoolValue(newValue));
306  }
307  else if (command == fSetFiniteRiseTimeCmd) {
308  fOpticalPhysics
310  fSetFiniteRiseTimeCmd->GetNewBoolValue(newValue));
311  }
312  else if (command == fSetScintillationStackPhotonsCmd) {
313  fOpticalPhysics
315  fSetScintillationStackPhotonsCmd->GetNewBoolValue(newValue));
316  }
317  else if (command == fSetWLSTimeProfileCmd) {
318  fOpticalPhysics->SetWLSTimeProfile(newValue);
319  }
320  else if (command == fSetInvokeSDCmd) {
321  fOpticalPhysics
322  ->SetInvokeSD(fSetInvokeSDCmd->GetNewBoolValue(newValue));
323  }
324 }
std::ostringstream G4ExceptionDescription
Definition: globals.hh:76
static G4int GetNewIntValue(const char *paramString)
void SetMaxBetaChangePerStep(G4double)
void SetInvokeSD(G4bool)
Scintillation process index.
Mie scattering process index.
void SetFiniteRiseTime(G4bool)
Absorption process index.
static G4bool GetNewBoolValue(const char *paramString)
void SetScintillationByParticleType(G4bool)
void SetMaxNumPhotonsPerStep(G4int)
const XML_Char int const XML_Char * value
Definition: expat.h:331
static G4bool ConvertToBool(const char *st)
Definition: G4UIcommand.cc:437
bool G4bool
Definition: G4Types.hh:79
void Configure(G4OpticalProcessIndex, G4bool)
static G4double GetNewDoubleValue(const char *paramString)
void SetVerboseLevel(G4int value)
Wave Length Shifting process index.
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
const char * data() const
Boundary process index.
void SetScintillationYieldFactor(G4double)
void SetScintillationStackPhotons(G4bool)
Cerenkov process index.
void SetScintillationTrackInfo(G4bool)
void SetWLSTimeProfile(G4String)
void SetTrackSecondariesFirst(G4OpticalProcessIndex, G4bool)
Rayleigh scattering process index.
void SetCerenkovStackPhotons(G4bool)

Here is the call graph for this function:


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