Geant4 Cross Reference

Cross-Referencing   Geant4
Geant4/processes/electromagnetic/utils/src/G4OpticalParametersMessenger.cc

Version: [ ReleaseNotes ] [ 1.0 ] [ 1.1 ] [ 2.0 ] [ 3.0 ] [ 3.1 ] [ 3.2 ] [ 4.0 ] [ 4.0.p1 ] [ 4.0.p2 ] [ 4.1 ] [ 4.1.p1 ] [ 5.0 ] [ 5.0.p1 ] [ 5.1 ] [ 5.1.p1 ] [ 5.2 ] [ 5.2.p1 ] [ 5.2.p2 ] [ 6.0 ] [ 6.0.p1 ] [ 6.1 ] [ 6.2 ] [ 6.2.p1 ] [ 6.2.p2 ] [ 7.0 ] [ 7.0.p1 ] [ 7.1 ] [ 7.1.p1 ] [ 8.0 ] [ 8.0.p1 ] [ 8.1 ] [ 8.1.p1 ] [ 8.1.p2 ] [ 8.2 ] [ 8.2.p1 ] [ 8.3 ] [ 8.3.p1 ] [ 8.3.p2 ] [ 9.0 ] [ 9.0.p1 ] [ 9.0.p2 ] [ 9.1 ] [ 9.1.p1 ] [ 9.1.p2 ] [ 9.1.p3 ] [ 9.2 ] [ 9.2.p1 ] [ 9.2.p2 ] [ 9.2.p3 ] [ 9.2.p4 ] [ 9.3 ] [ 9.3.p1 ] [ 9.3.p2 ] [ 9.4 ] [ 9.4.p1 ] [ 9.4.p2 ] [ 9.4.p3 ] [ 9.4.p4 ] [ 9.5 ] [ 9.5.p1 ] [ 9.5.p2 ] [ 9.6 ] [ 9.6.p1 ] [ 9.6.p2 ] [ 9.6.p3 ] [ 9.6.p4 ] [ 10.0 ] [ 10.0.p1 ] [ 10.0.p2 ] [ 10.0.p3 ] [ 10.0.p4 ] [ 10.1 ] [ 10.1.p1 ] [ 10.1.p2 ] [ 10.1.p3 ] [ 10.2 ] [ 10.2.p1 ] [ 10.2.p2 ] [ 10.2.p3 ] [ 10.3 ] [ 10.3.p1 ] [ 10.3.p2 ] [ 10.3.p3 ] [ 10.4 ] [ 10.4.p1 ] [ 10.4.p2 ] [ 10.4.p3 ] [ 10.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

Diff markup

Differences between /processes/electromagnetic/utils/src/G4OpticalParametersMessenger.cc (Version 11.3.0) and /processes/electromagnetic/utils/src/G4OpticalParametersMessenger.cc (Version 11.1.1)


  1 //                                                  1 //
  2 // *******************************************      2 // ********************************************************************
  3 // * License and Disclaimer                         3 // * License and Disclaimer                                           *
  4 // *                                                4 // *                                                                  *
  5 // * The  Geant4 software  is  copyright of th      5 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
  6 // * the Geant4 Collaboration.  It is provided      6 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
  7 // * conditions of the Geant4 Software License      7 // * conditions of the Geant4 Software License,  included in the file *
  8 // * LICENSE and available at  http://cern.ch/      8 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
  9 // * include a list of copyright holders.           9 // * include a list of copyright holders.                             *
 10 // *                                               10 // *                                                                  *
 11 // * Neither the authors of this software syst     11 // * Neither the authors of this software system, nor their employing *
 12 // * institutes,nor the agencies providing fin     12 // * institutes,nor the agencies providing financial support for this *
 13 // * work  make  any representation or  warran     13 // * work  make  any representation or  warranty, express or implied, *
 14 // * regarding  this  software system or assum     14 // * regarding  this  software system or assume any liability for its *
 15 // * use.  Please see the license in the file      15 // * use.  Please see the license in the file  LICENSE  and URL above *
 16 // * for the full disclaimer and the limitatio     16 // * for the full disclaimer and the limitation of liability.         *
 17 // *                                               17 // *                                                                  *
 18 // * This  code  implementation is the result      18 // * This  code  implementation is the result of  the  scientific and *
 19 // * technical work of the GEANT4 collaboratio     19 // * technical work of the GEANT4 collaboration.                      *
 20 // * By using,  copying,  modifying or  distri     20 // * By using,  copying,  modifying or  distributing the software (or *
 21 // * any work based  on the software)  you  ag     21 // * any work based  on the software)  you  agree  to acknowledge its *
 22 // * use  in  resulting  scientific  publicati     22 // * use  in  resulting  scientific  publications,  and indicate your *
 23 // * acceptance of all terms of the Geant4 Sof     23 // * acceptance of all terms of the Geant4 Software license.          *
 24 // *******************************************     24 // ********************************************************************
 25 //                                                 25 //
 26 //                                                 26 //
 27 //--------------------------------------------     27 //----------------------------------------------------------------------------
 28 //                                                 28 //
 29 // ClassName:   G4OpticalParametersMessenger       29 // ClassName:   G4OpticalParametersMessenger
 30 //                                                 30 //
 31 // Author:      P.Gumplinger 30.09.2009 //         31 // Author:      P.Gumplinger 30.09.2009 //
 32 //                                                 32 //
 33 // Modified:    P.Gumplinger 29.09.2011            33 // Modified:    P.Gumplinger 29.09.2011
 34 //              (based on code from I. Hrivnac     34 //              (based on code from I. Hrivnacova)
 35 //                                                 35 //
 36 //--------------------------------------------     36 //----------------------------------------------------------------------------
 37 //                                                 37 //
 38                                                    38 
 39 #include "G4OpticalParametersMessenger.hh"         39 #include "G4OpticalParametersMessenger.hh"
 40 #include "G4OpticalParameters.hh"                  40 #include "G4OpticalParameters.hh"
 41                                                    41 
 42 #include "G4UIcommand.hh"                          42 #include "G4UIcommand.hh"
 43 #include "G4UIdirectory.hh"                        43 #include "G4UIdirectory.hh"
 44 #include "G4UIcmdWithABool.hh"                     44 #include "G4UIcmdWithABool.hh"
 45 #include "G4UIcmdWithAString.hh"                   45 #include "G4UIcmdWithAString.hh"
 46 #include "G4UIcmdWithADouble.hh"                   46 #include "G4UIcmdWithADouble.hh"
 47 #include "G4UIcmdWithAnInteger.hh"                 47 #include "G4UIcmdWithAnInteger.hh"
 48 #include "G4UIcmdWithADoubleAndUnit.hh"            48 #include "G4UIcmdWithADoubleAndUnit.hh"
 49 #include "G4UImanager.hh"                          49 #include "G4UImanager.hh"
 50 #include "G4UIparameter.hh"                        50 #include "G4UIparameter.hh"
 51                                                    51 
 52 //....oooOO0OOooo........oooOO0OOooo........oo     52 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 53                                                    53 
 54 G4OpticalParametersMessenger::G4OpticalParamet     54 G4OpticalParametersMessenger::G4OpticalParametersMessenger(
 55   G4OpticalParameters* opticalParameters)          55   G4OpticalParameters* opticalParameters)
 56   : params(opticalParameters)                      56   : params(opticalParameters)
 57                                                    57 
 58 {                                                  58 {
 59   G4bool toBeBroadcasted = false;                  59   G4bool toBeBroadcasted = false;
 60   fDir = new G4UIdirectory("/process/optical/"     60   fDir = new G4UIdirectory("/process/optical/", toBeBroadcasted);
 61   fDir->SetGuidance(                               61   fDir->SetGuidance(
 62     "Commands related to the optical physics s     62     "Commands related to the optical physics simulation engine.");
 63                                                    63 
 64   fCerenkovDir =                                   64   fCerenkovDir =
 65     new G4UIdirectory("/process/optical/cerenk     65     new G4UIdirectory("/process/optical/cerenkov/", toBeBroadcasted);
 66   fCerenkovDir->SetGuidance("Cerenkov process      66   fCerenkovDir->SetGuidance("Cerenkov process commands");
 67   fScintDir =                                      67   fScintDir =
 68     new G4UIdirectory("/process/optical/scinti     68     new G4UIdirectory("/process/optical/scintillation/", toBeBroadcasted);
 69   fScintDir->SetGuidance("Scintillation proces     69   fScintDir->SetGuidance("Scintillation process commands");
 70   fWlsDir = new G4UIdirectory("/process/optica     70   fWlsDir = new G4UIdirectory("/process/optical/wls/", toBeBroadcasted);
 71   fWlsDir->SetGuidance("Wave length shifting p     71   fWlsDir->SetGuidance("Wave length shifting process commands");
 72   fWls2Dir = new G4UIdirectory("/process/optic     72   fWls2Dir = new G4UIdirectory("/process/optical/wls2/", toBeBroadcasted);
 73   fWls2Dir->SetGuidance("Second Wave length sh     73   fWls2Dir->SetGuidance("Second Wave length shifting process commands");
 74   fBoundaryDir =                                   74   fBoundaryDir =
 75     new G4UIdirectory("/process/optical/bounda     75     new G4UIdirectory("/process/optical/boundary/", toBeBroadcasted);
 76   fBoundaryDir->SetGuidance("Boundary scatteri     76   fBoundaryDir->SetGuidance("Boundary scattering commands");
 77   fMieDir = new G4UIdirectory("/process/optica     77   fMieDir = new G4UIdirectory("/process/optical/mie/", toBeBroadcasted);
 78   fMieDir->SetGuidance("Mie scattering process     78   fMieDir->SetGuidance("Mie scattering process commands");
 79   fAbsDir = new G4UIdirectory("/process/optica     79   fAbsDir = new G4UIdirectory("/process/optical/absorption/", toBeBroadcasted);
 80   fAbsDir->SetGuidance("absorption process com     80   fAbsDir->SetGuidance("absorption process commands");
 81   fRaylDir = new G4UIdirectory("/process/optic     81   fRaylDir = new G4UIdirectory("/process/optical/rayleigh/", toBeBroadcasted);
 82   fRaylDir->SetGuidance("Rayleigh scattering c     82   fRaylDir->SetGuidance("Rayleigh scattering commands");
 83                                                    83 
 84   // general commands                              84   // general commands
 85   fActivateProcessCmd =                            85   fActivateProcessCmd =
 86     new G4UIcommand("/process/optical/processA     86     new G4UIcommand("/process/optical/processActivation", this);
 87   fActivateProcessCmd->SetGuidance(                87   fActivateProcessCmd->SetGuidance(
 88     "Activate/deactivate the specified optical     88     "Activate/deactivate the specified optical process");
 89   auto par = new G4UIparameter("proc_name", 's     89   auto par = new G4UIparameter("proc_name", 's', false);
 90   G4String candidates;                             90   G4String candidates;
 91   for(G4int i = 0; i < kNoProcess; ++i)            91   for(G4int i = 0; i < kNoProcess; ++i)
 92   {                                                92   {
 93     candidates += G4OpticalProcessName(i);         93     candidates += G4OpticalProcessName(i);
 94     candidates += G4String(" ");                   94     candidates += G4String(" ");
 95   }                                                95   }
 96   par->SetParameterCandidates(candidates);         96   par->SetParameterCandidates(candidates);
 97   par->SetGuidance("the process name");            97   par->SetGuidance("the process name");
 98   fActivateProcessCmd->SetParameter(par);          98   fActivateProcessCmd->SetParameter(par);
 99   par = new G4UIparameter("flag", 'b', true);      99   par = new G4UIparameter("flag", 'b', true);
100   par->SetDefaultValue(true);                     100   par->SetDefaultValue(true);
101   par->SetGuidance("activation flag");            101   par->SetGuidance("activation flag");
102   fActivateProcessCmd->SetParameter(par);         102   fActivateProcessCmd->SetParameter(par);
103   fActivateProcessCmd->AvailableForStates(G4St    103   fActivateProcessCmd->AvailableForStates(G4State_PreInit);
104                                                   104 
105   fVerboseCmd = new G4UIcmdWithAnInteger("/pro    105   fVerboseCmd = new G4UIcmdWithAnInteger("/process/optical/verbose", this);
106   fVerboseCmd->SetGuidance("Set default verbos    106   fVerboseCmd->SetGuidance("Set default verbose level for optical processes");
107   fVerboseCmd->SetParameterName("ver", true);     107   fVerboseCmd->SetParameterName("ver", true);
108   fVerboseCmd->SetDefaultValue(1);                108   fVerboseCmd->SetDefaultValue(1);
109   fVerboseCmd->SetRange("ver>=0");                109   fVerboseCmd->SetRange("ver>=0");
110   fVerboseCmd->AvailableForStates(G4State_PreI    110   fVerboseCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
111                                                   111 
112   fDumpCmd = new G4UIcommand("/process/optical    112   fDumpCmd = new G4UIcommand("/process/optical/printParameters", this);
113   fDumpCmd->SetGuidance("Print all optical par    113   fDumpCmd->SetGuidance("Print all optical parameters.");
114                                                   114 
115   // Cerenkov ////////////////////                115   // Cerenkov ////////////////////
116   fCerenkovMaxPhotonsCmd =                        116   fCerenkovMaxPhotonsCmd =
117     new G4UIcmdWithAnInteger("/process/optical    117     new G4UIcmdWithAnInteger("/process/optical/cerenkov/setMaxPhotons", this);
118   fCerenkovMaxPhotonsCmd->SetGuidance("Set max    118   fCerenkovMaxPhotonsCmd->SetGuidance("Set maximum number of photons per step");
119   fCerenkovMaxPhotonsCmd->SetParameterName("Ce    119   fCerenkovMaxPhotonsCmd->SetParameterName("CerenkovMaxPhotons", false);
120   fCerenkovMaxPhotonsCmd->SetRange("CerenkovMa    120   fCerenkovMaxPhotonsCmd->SetRange("CerenkovMaxPhotons>=0");
121   fCerenkovMaxPhotonsCmd->AvailableForStates(G    121   fCerenkovMaxPhotonsCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
122                                                   122 
123   fCerenkovMaxBetaChangeCmd =                     123   fCerenkovMaxBetaChangeCmd =
124     new G4UIcmdWithADouble("/process/optical/c    124     new G4UIcmdWithADouble("/process/optical/cerenkov/setMaxBetaChange", this);
125   fCerenkovMaxBetaChangeCmd->SetGuidance(         125   fCerenkovMaxBetaChangeCmd->SetGuidance(
126     "Set maximum change of beta of parent part    126     "Set maximum change of beta of parent particle per step (in percent)");
127   fCerenkovMaxBetaChangeCmd->SetParameterName(    127   fCerenkovMaxBetaChangeCmd->SetParameterName("CerenkovMaxBetaChange", false);
128   fCerenkovMaxBetaChangeCmd->SetRange("Cerenko    128   fCerenkovMaxBetaChangeCmd->SetRange("CerenkovMaxBetaChange>=0");
129   fCerenkovMaxBetaChangeCmd->AvailableForState    129   fCerenkovMaxBetaChangeCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
130                                                   130 
131   fCerenkovStackPhotonsCmd =                      131   fCerenkovStackPhotonsCmd =
132     new G4UIcmdWithABool("/process/optical/cer    132     new G4UIcmdWithABool("/process/optical/cerenkov/setStackPhotons", this);
133   fCerenkovStackPhotonsCmd->SetGuidance(          133   fCerenkovStackPhotonsCmd->SetGuidance(
134     "Set whether or not to stack secondary Cer    134     "Set whether or not to stack secondary Cerenkov photons");
135   fCerenkovStackPhotonsCmd->AvailableForStates    135   fCerenkovStackPhotonsCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
136                                                   136 
137   fCerenkovTrackSecondariesFirstCmd = new G4UI    137   fCerenkovTrackSecondariesFirstCmd = new G4UIcmdWithABool(
138     "/process/optical/cerenkov/setTrackSeconda    138     "/process/optical/cerenkov/setTrackSecondariesFirst", this);
139   fCerenkovTrackSecondariesFirstCmd->SetGuidan    139   fCerenkovTrackSecondariesFirstCmd->SetGuidance(
140     "Whether to track secondary Cerenkov photo    140     "Whether to track secondary Cerenkov photons before the primary.");
141   fCerenkovTrackSecondariesFirstCmd->Available    141   fCerenkovTrackSecondariesFirstCmd->AvailableForStates(G4State_PreInit,
142                                                   142                                                         G4State_Idle);
143                                                   143 
144   fCerenkovVerboseLevelCmd =                      144   fCerenkovVerboseLevelCmd =
145     new G4UIcmdWithAnInteger("/process/optical    145     new G4UIcmdWithAnInteger("/process/optical/cerenkov/verbose", this);
146   fCerenkovVerboseLevelCmd->SetGuidance("Verbo    146   fCerenkovVerboseLevelCmd->SetGuidance("Verbose level for Cerenkov process.");
147   fCerenkovVerboseLevelCmd->SetParameterName("    147   fCerenkovVerboseLevelCmd->SetParameterName("verbose", true);
148   fCerenkovVerboseLevelCmd->SetRange("verbose     148   fCerenkovVerboseLevelCmd->SetRange("verbose >= 0 && verbose <= 2");
149   fCerenkovVerboseLevelCmd->SetDefaultValue(2)    149   fCerenkovVerboseLevelCmd->SetDefaultValue(2);
150   fCerenkovVerboseLevelCmd->AvailableForStates    150   fCerenkovVerboseLevelCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
151                                                   151 
152   // Scintillation //////////////////////////     152   // Scintillation //////////////////////////
153   fScintByParticleTypeCmd = new G4UIcmdWithABo    153   fScintByParticleTypeCmd = new G4UIcmdWithABool(
154     "/process/optical/scintillation/setByParti    154     "/process/optical/scintillation/setByParticleType", this);
155   fScintByParticleTypeCmd->SetGuidance(           155   fScintByParticleTypeCmd->SetGuidance(
156     "Activate/Inactivate scintillation process    156     "Activate/Inactivate scintillation process by particle type");
157   fScintByParticleTypeCmd->SetParameterName(      157   fScintByParticleTypeCmd->SetParameterName(
158     "ScintillationByParticleTypeActivation", f    158     "ScintillationByParticleTypeActivation", false);
159   fScintByParticleTypeCmd->AvailableForStates(    159   fScintByParticleTypeCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
160                                                   160 
161   fScintTrackInfoCmd =                            161   fScintTrackInfoCmd =
162     new G4UIcmdWithABool("/process/optical/sci    162     new G4UIcmdWithABool("/process/optical/scintillation/setTrackInfo", this);
163   fScintTrackInfoCmd->SetGuidance(                163   fScintTrackInfoCmd->SetGuidance(
164     "Activate/Inactivate scintillation TrackIn    164     "Activate/Inactivate scintillation TrackInformation");
165   fScintTrackInfoCmd->SetParameterName("Scinti    165   fScintTrackInfoCmd->SetParameterName("ScintillationTrackInfo", false);
166   fScintTrackInfoCmd->AvailableForStates(G4Sta    166   fScintTrackInfoCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
167                                                   167 
168   fScintFiniteRiseTimeCmd = new G4UIcmdWithABo    168   fScintFiniteRiseTimeCmd = new G4UIcmdWithABool(
169     "/process/optical/scintillation/setFiniteR    169     "/process/optical/scintillation/setFiniteRiseTime", this);
170   fScintFiniteRiseTimeCmd->SetGuidance(           170   fScintFiniteRiseTimeCmd->SetGuidance(
171     "Set option of a finite rise-time for G4Sc    171     "Set option of a finite rise-time for G4Scintillation");
172   fScintFiniteRiseTimeCmd->SetGuidance(           172   fScintFiniteRiseTimeCmd->SetGuidance(
173     "If set, the G4Scintillation process expec    173     "If set, the G4Scintillation process expects the user to have set the");
174   fScintFiniteRiseTimeCmd->SetGuidance(           174   fScintFiniteRiseTimeCmd->SetGuidance(
175     "constant material property SCINTILLATIONR    175     "constant material property SCINTILLATIONRISETIME{1,2,3}");
176   fScintFiniteRiseTimeCmd->SetParameterName("F    176   fScintFiniteRiseTimeCmd->SetParameterName("FiniteRiseTime", false);
177   fScintFiniteRiseTimeCmd->AvailableForStates(    177   fScintFiniteRiseTimeCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
178                                                   178 
179   fScintStackPhotonsCmd = new G4UIcmdWithABool    179   fScintStackPhotonsCmd = new G4UIcmdWithABool(
180     "/process/optical/scintillation/setStackPh    180     "/process/optical/scintillation/setStackPhotons", this);
181   fScintStackPhotonsCmd->SetGuidance(             181   fScintStackPhotonsCmd->SetGuidance(
182     "Set whether or not to stack secondary Sci    182     "Set whether or not to stack secondary Scintillation photons");
183   fScintStackPhotonsCmd->SetParameterName("Sci    183   fScintStackPhotonsCmd->SetParameterName("ScintillationStackPhotons", true);
184   fScintStackPhotonsCmd->SetDefaultValue(true)    184   fScintStackPhotonsCmd->SetDefaultValue(true);
185   fScintStackPhotonsCmd->AvailableForStates(G4    185   fScintStackPhotonsCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
186                                                   186 
187   fScintTrackSecondariesFirstCmd = new G4UIcmd    187   fScintTrackSecondariesFirstCmd = new G4UIcmdWithABool(
188     "/process/optical/scintillation/setTrackSe    188     "/process/optical/scintillation/setTrackSecondariesFirst", this);
189   fScintTrackSecondariesFirstCmd->SetGuidance(    189   fScintTrackSecondariesFirstCmd->SetGuidance(
190     "Whether to track scintillation secondarie    190     "Whether to track scintillation secondaries before primary.");
191   fScintTrackSecondariesFirstCmd->AvailableFor    191   fScintTrackSecondariesFirstCmd->AvailableForStates(G4State_PreInit,
192                                                   192                                                      G4State_Idle);
193                                                   193 
194   fScintVerboseLevelCmd =                         194   fScintVerboseLevelCmd =
195     new G4UIcmdWithAnInteger("/process/optical    195     new G4UIcmdWithAnInteger("/process/optical/scintillation/verbose", this);
196   fScintVerboseLevelCmd->SetGuidance(             196   fScintVerboseLevelCmd->SetGuidance(
197     "Verbose level for scintillation process."    197     "Verbose level for scintillation process.");
198   fScintVerboseLevelCmd->SetParameterName("ver    198   fScintVerboseLevelCmd->SetParameterName("verbose", true);
199   fScintVerboseLevelCmd->SetRange("verbose >=     199   fScintVerboseLevelCmd->SetRange("verbose >= 0 && verbose <= 2");
200   fScintVerboseLevelCmd->AvailableForStates(G4    200   fScintVerboseLevelCmd->AvailableForStates(G4State_Idle, G4State_PreInit);
201                                                   201 
202   // WLS   //////////////////////////////////     202   // WLS   //////////////////////////////////
203   fWLSTimeProfileCmd =                            203   fWLSTimeProfileCmd =
204     new G4UIcmdWithAString("/process/optical/w    204     new G4UIcmdWithAString("/process/optical/wls/setTimeProfile", this);
205   fWLSTimeProfileCmd->SetGuidance(                205   fWLSTimeProfileCmd->SetGuidance(
206     "Set the WLS time profile (delta or expone    206     "Set the WLS time profile (delta or exponential)");
207   fWLSTimeProfileCmd->SetParameterName("WLSTim    207   fWLSTimeProfileCmd->SetParameterName("WLSTimeProfile", false);
208   fWLSTimeProfileCmd->SetCandidates("delta exp    208   fWLSTimeProfileCmd->SetCandidates("delta exponential");
209   fWLSTimeProfileCmd->AvailableForStates(G4Sta    209   fWLSTimeProfileCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
210                                                   210 
211   fWLSVerboseLevelCmd =                           211   fWLSVerboseLevelCmd =
212     new G4UIcmdWithAnInteger("/process/optical    212     new G4UIcmdWithAnInteger("/process/optical/wls/verbose", this);
213   fWLSVerboseLevelCmd->SetGuidance("Verbose le    213   fWLSVerboseLevelCmd->SetGuidance("Verbose level for WLS process.");
214   fWLSVerboseLevelCmd->SetParameterName("verbo    214   fWLSVerboseLevelCmd->SetParameterName("verbose", true);
215   fWLSVerboseLevelCmd->SetRange("verbose >= 0     215   fWLSVerboseLevelCmd->SetRange("verbose >= 0 && verbose <= 2");
216   fWLSVerboseLevelCmd->SetDefaultValue(1);        216   fWLSVerboseLevelCmd->SetDefaultValue(1);
217   fWLSVerboseLevelCmd->AvailableForStates(G4St    217   fWLSVerboseLevelCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
218                                                   218 
219   // WLS2   //////////////////////////////////    219   // WLS2   //////////////////////////////////
220   fWLS2TimeProfileCmd =                           220   fWLS2TimeProfileCmd =
221     new G4UIcmdWithAString("/process/optical/w    221     new G4UIcmdWithAString("/process/optical/wls2/setTimeProfile", this);
222   fWLS2TimeProfileCmd->SetGuidance(               222   fWLS2TimeProfileCmd->SetGuidance(
223     "Set the WLS2 time profile (delta or expon    223     "Set the WLS2 time profile (delta or exponential)");
224   fWLS2TimeProfileCmd->SetParameterName("WLS2T    224   fWLS2TimeProfileCmd->SetParameterName("WLS2TimeProfile", false);
225   fWLS2TimeProfileCmd->SetCandidates("delta ex    225   fWLS2TimeProfileCmd->SetCandidates("delta exponential");
226   fWLS2TimeProfileCmd->AvailableForStates(G4St    226   fWLS2TimeProfileCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
227                                                   227 
228   fWLS2VerboseLevelCmd =                          228   fWLS2VerboseLevelCmd =
229     new G4UIcmdWithAnInteger("/process/optical    229     new G4UIcmdWithAnInteger("/process/optical/wls2/verbose", this);
230   fWLS2VerboseLevelCmd->SetGuidance("Verbose l    230   fWLS2VerboseLevelCmd->SetGuidance("Verbose level for WLS2 process.");
231   fWLS2VerboseLevelCmd->SetParameterName("verb    231   fWLS2VerboseLevelCmd->SetParameterName("verbose", true);
232   fWLS2VerboseLevelCmd->SetRange("verbose >= 0    232   fWLS2VerboseLevelCmd->SetRange("verbose >= 0 && verbose <= 2");
233   fWLS2VerboseLevelCmd->SetDefaultValue(1);       233   fWLS2VerboseLevelCmd->SetDefaultValue(1);
234   fWLS2VerboseLevelCmd->AvailableForStates(G4S    234   fWLS2VerboseLevelCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
235                                                   235 
236   // boundary ////////////////////////////////    236   // boundary //////////////////////////////////////
237   fBoundaryInvokeSDCmd =                          237   fBoundaryInvokeSDCmd =
238     new G4UIcmdWithABool("/process/optical/bou    238     new G4UIcmdWithABool("/process/optical/boundary/setInvokeSD", this);
239   fBoundaryInvokeSDCmd->SetGuidance(              239   fBoundaryInvokeSDCmd->SetGuidance(
240     "Set option for calling InvokeSD in G4OpBo    240     "Set option for calling InvokeSD in G4OpBoundaryProcess");
241   fBoundaryInvokeSDCmd->SetParameterName("Invo    241   fBoundaryInvokeSDCmd->SetParameterName("InvokeSD", false);
242   fBoundaryInvokeSDCmd->AvailableForStates(G4S    242   fBoundaryInvokeSDCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
243                                                   243 
244   fBoundaryVerboseLevelCmd =                      244   fBoundaryVerboseLevelCmd =
245     new G4UIcmdWithAnInteger("/process/optical    245     new G4UIcmdWithAnInteger("/process/optical/boundary/verbose", this);
246   fBoundaryVerboseLevelCmd->SetGuidance("Verbo    246   fBoundaryVerboseLevelCmd->SetGuidance("Verbose level for boundary process.");
247   fBoundaryVerboseLevelCmd->SetParameterName("    247   fBoundaryVerboseLevelCmd->SetParameterName("verbose", true);
248   fBoundaryVerboseLevelCmd->SetRange("verbose     248   fBoundaryVerboseLevelCmd->SetRange("verbose >= 0 && verbose <= 2");
249   fBoundaryVerboseLevelCmd->SetDefaultValue(1)    249   fBoundaryVerboseLevelCmd->SetDefaultValue(1);
250   fBoundaryVerboseLevelCmd->AvailableForStates    250   fBoundaryVerboseLevelCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
251                                                   251 
252   // absorption //////////////////////////////    252   // absorption //////////////////////////////////////
253   fAbsorptionVerboseLevelCmd =                    253   fAbsorptionVerboseLevelCmd =
254     new G4UIcmdWithAnInteger("/process/optical    254     new G4UIcmdWithAnInteger("/process/optical/absorption/verbose", this);
255   fAbsorptionVerboseLevelCmd->SetGuidance(        255   fAbsorptionVerboseLevelCmd->SetGuidance(
256     "Verbose level for absorption process.");     256     "Verbose level for absorption process.");
257   fAbsorptionVerboseLevelCmd->SetParameterName    257   fAbsorptionVerboseLevelCmd->SetParameterName("verbose", true);
258   fAbsorptionVerboseLevelCmd->SetRange("verbos    258   fAbsorptionVerboseLevelCmd->SetRange("verbose >= 0 && verbose <= 2");
259   fAbsorptionVerboseLevelCmd->SetDefaultValue(    259   fAbsorptionVerboseLevelCmd->SetDefaultValue(1);
260   fAbsorptionVerboseLevelCmd->AvailableForStat    260   fAbsorptionVerboseLevelCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
261                                                   261 
262   // rayleigh ////////////////////////////////    262   // rayleigh //////////////////////////////////////
263   fRayleighVerboseLevelCmd =                      263   fRayleighVerboseLevelCmd =
264     new G4UIcmdWithAnInteger("/process/optical    264     new G4UIcmdWithAnInteger("/process/optical/rayleigh/verbose", this);
265   fRayleighVerboseLevelCmd->SetGuidance("Verbo    265   fRayleighVerboseLevelCmd->SetGuidance("Verbose level for Rayleigh process.");
266   fRayleighVerboseLevelCmd->SetParameterName("    266   fRayleighVerboseLevelCmd->SetParameterName("verbose", true);
267   fRayleighVerboseLevelCmd->SetRange("verbose     267   fRayleighVerboseLevelCmd->SetRange("verbose >= 0 && verbose <= 2");
268   fRayleighVerboseLevelCmd->SetDefaultValue(1)    268   fRayleighVerboseLevelCmd->SetDefaultValue(1);
269   fRayleighVerboseLevelCmd->AvailableForStates    269   fRayleighVerboseLevelCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
270                                                   270 
271   // mie /////////////////////////////////////    271   // mie //////////////////////////////////////
272   fMieVerboseLevelCmd =                           272   fMieVerboseLevelCmd =
273     new G4UIcmdWithAnInteger("/process/optical    273     new G4UIcmdWithAnInteger("/process/optical/mie/verbose", this);
274   fMieVerboseLevelCmd->SetGuidance("Verbose le    274   fMieVerboseLevelCmd->SetGuidance("Verbose level for Mie process.");
275   fMieVerboseLevelCmd->SetParameterName("verbo    275   fMieVerboseLevelCmd->SetParameterName("verbose", true);
276   fMieVerboseLevelCmd->SetRange("verbose >= 0     276   fMieVerboseLevelCmd->SetRange("verbose >= 0 && verbose <= 2");
277   fMieVerboseLevelCmd->SetDefaultValue(1);        277   fMieVerboseLevelCmd->SetDefaultValue(1);
278   fMieVerboseLevelCmd->AvailableForStates(G4St    278   fMieVerboseLevelCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
279 }                                                 279 }
280                                                   280 
281 G4OpticalParametersMessenger::~G4OpticalParame    281 G4OpticalParametersMessenger::~G4OpticalParametersMessenger()
282 {                                                 282 {
283   delete fDir;                                    283   delete fDir;
284   delete fCerenkovDir;                            284   delete fCerenkovDir;
285   delete fScintDir;                               285   delete fScintDir;
286   delete fWlsDir;                                 286   delete fWlsDir;
287   delete fBoundaryDir;                            287   delete fBoundaryDir;
288   delete fMieDir;                                 288   delete fMieDir;
289   delete fAbsDir;                                 289   delete fAbsDir;
290   delete fRaylDir;                                290   delete fRaylDir;
291   delete fActivateProcessCmd;                     291   delete fActivateProcessCmd;
292   delete fVerboseCmd;                             292   delete fVerboseCmd;
293   delete fDumpCmd;                                293   delete fDumpCmd;
294   delete fCerenkovMaxPhotonsCmd;                  294   delete fCerenkovMaxPhotonsCmd;
295   delete fCerenkovMaxBetaChangeCmd;               295   delete fCerenkovMaxBetaChangeCmd;
296   delete fCerenkovStackPhotonsCmd;                296   delete fCerenkovStackPhotonsCmd;
297   delete fCerenkovTrackSecondariesFirstCmd;       297   delete fCerenkovTrackSecondariesFirstCmd;
298   delete fCerenkovVerboseLevelCmd;                298   delete fCerenkovVerboseLevelCmd;
299   delete fScintByParticleTypeCmd;                 299   delete fScintByParticleTypeCmd;
300   delete fScintTrackInfoCmd;                      300   delete fScintTrackInfoCmd;
301   delete fScintStackPhotonsCmd;                   301   delete fScintStackPhotonsCmd;
302   delete fScintVerboseLevelCmd;                   302   delete fScintVerboseLevelCmd;
303   delete fScintFiniteRiseTimeCmd;                 303   delete fScintFiniteRiseTimeCmd;
304   delete fScintTrackSecondariesFirstCmd;          304   delete fScintTrackSecondariesFirstCmd;
305   delete fWLSTimeProfileCmd;                      305   delete fWLSTimeProfileCmd;
306   delete fWLSVerboseLevelCmd;                     306   delete fWLSVerboseLevelCmd;
307   delete fWLS2TimeProfileCmd;                     307   delete fWLS2TimeProfileCmd;
308   delete fWLS2VerboseLevelCmd;                    308   delete fWLS2VerboseLevelCmd;
309   delete fAbsorptionVerboseLevelCmd;              309   delete fAbsorptionVerboseLevelCmd;
310   delete fRayleighVerboseLevelCmd;                310   delete fRayleighVerboseLevelCmd;
311   delete fMieVerboseLevelCmd;                     311   delete fMieVerboseLevelCmd;
312   delete fBoundaryVerboseLevelCmd;                312   delete fBoundaryVerboseLevelCmd;
313   delete fBoundaryInvokeSDCmd;                    313   delete fBoundaryInvokeSDCmd;
314 }                                                 314 }
315                                                   315 
316 void G4OpticalParametersMessenger::SetNewValue    316 void G4OpticalParametersMessenger::SetNewValue(G4UIcommand* command,
317                                                   317                                                G4String newValue)
318 {                                                 318 {
319   // physics needs to be rebuilt for all comma    319   // physics needs to be rebuilt for all commands
320   G4bool physicsModified = true;                  320   G4bool physicsModified = true;
321                                                   321 
322   /// Apply command to the associated object.     322   /// Apply command to the associated object.
323   if(command == fActivateProcessCmd)              323   if(command == fActivateProcessCmd)
324   {                                               324   {
325     std::istringstream is(newValue.data());       325     std::istringstream is(newValue.data());
326     G4String pn;                                  326     G4String pn;
327     G4String flag;                                327     G4String flag;
328     is >> pn >> flag;                             328     is >> pn >> flag;
329     G4bool value = G4UIcommand::ConvertToBool(    329     G4bool value = G4UIcommand::ConvertToBool(flag);
330     params->SetProcessActivation(pn, value);      330     params->SetProcessActivation(pn, value);
331   }                                               331   }
332   else if(command == fVerboseCmd)                 332   else if(command == fVerboseCmd)
333   {                                               333   {
334     params->SetVerboseLevel(fVerboseCmd->GetNe    334     params->SetVerboseLevel(fVerboseCmd->GetNewIntValue(newValue));
335   }                                               335   }
336   else if(command == fDumpCmd)                    336   else if(command == fDumpCmd)
337   {                                               337   {
338     params->Dump();                               338     params->Dump();
339   }                                               339   }
340   else if(command == fCerenkovMaxPhotonsCmd)      340   else if(command == fCerenkovMaxPhotonsCmd)
341   {                                               341   {
342     params->SetCerenkovMaxPhotonsPerStep(         342     params->SetCerenkovMaxPhotonsPerStep(
343       fCerenkovMaxPhotonsCmd->GetNewIntValue(n    343       fCerenkovMaxPhotonsCmd->GetNewIntValue(newValue));
344     G4cout << "Cerenkov max photons: " << para    344     G4cout << "Cerenkov max photons: " << params->GetCerenkovMaxPhotonsPerStep()
345            << G4endl;                             345            << G4endl;
346   }                                               346   }
347   else if(command == fCerenkovMaxBetaChangeCmd    347   else if(command == fCerenkovMaxBetaChangeCmd)
348   {                                               348   {
349     params->SetCerenkovMaxBetaChange(             349     params->SetCerenkovMaxBetaChange(
350       fCerenkovMaxBetaChangeCmd->GetNewDoubleV    350       fCerenkovMaxBetaChangeCmd->GetNewDoubleValue(newValue));
351   }                                               351   }
352   else if(command == fCerenkovStackPhotonsCmd)    352   else if(command == fCerenkovStackPhotonsCmd)
353   {                                               353   {
354     params->SetCerenkovStackPhotons(              354     params->SetCerenkovStackPhotons(
355       fCerenkovStackPhotonsCmd->GetNewBoolValu    355       fCerenkovStackPhotonsCmd->GetNewBoolValue(newValue));
356   }                                               356   }
357   else if(command == fCerenkovTrackSecondaries    357   else if(command == fCerenkovTrackSecondariesFirstCmd)
358   {                                               358   {
359     params->SetCerenkovTrackSecondariesFirst(     359     params->SetCerenkovTrackSecondariesFirst(
360       fCerenkovTrackSecondariesFirstCmd->GetNe    360       fCerenkovTrackSecondariesFirstCmd->GetNewBoolValue(newValue));
361   }                                               361   }
362   else if(command == fCerenkovVerboseLevelCmd)    362   else if(command == fCerenkovVerboseLevelCmd)
363   {                                               363   {
364     params->SetCerenkovVerboseLevel(              364     params->SetCerenkovVerboseLevel(
365       fCerenkovVerboseLevelCmd->GetNewIntValue    365       fCerenkovVerboseLevelCmd->GetNewIntValue(newValue));
366   }                                               366   }
367   else if(command == fScintByParticleTypeCmd)     367   else if(command == fScintByParticleTypeCmd)
368   {                                               368   {
369     params->SetScintByParticleType(               369     params->SetScintByParticleType(
370       fScintByParticleTypeCmd->GetNewBoolValue    370       fScintByParticleTypeCmd->GetNewBoolValue(newValue));
371   }                                               371   }
372   else if(command == fScintTrackInfoCmd)          372   else if(command == fScintTrackInfoCmd)
373   {                                               373   {
374     params->SetScintTrackInfo(fScintTrackInfoC    374     params->SetScintTrackInfo(fScintTrackInfoCmd->GetNewBoolValue(newValue));
375   }                                               375   }
376   else if(command == fScintFiniteRiseTimeCmd)     376   else if(command == fScintFiniteRiseTimeCmd)
377   {                                               377   {
378     params->SetScintFiniteRiseTime(               378     params->SetScintFiniteRiseTime(
379       fScintFiniteRiseTimeCmd->GetNewBoolValue    379       fScintFiniteRiseTimeCmd->GetNewBoolValue(newValue));
380   }                                               380   }
381   else if(command == fScintStackPhotonsCmd)       381   else if(command == fScintStackPhotonsCmd)
382   {                                               382   {
383     params->SetScintStackPhotons(                 383     params->SetScintStackPhotons(
384       fScintStackPhotonsCmd->GetNewBoolValue(n    384       fScintStackPhotonsCmd->GetNewBoolValue(newValue));
385   }                                               385   }
386   else if(command == fScintTrackSecondariesFir    386   else if(command == fScintTrackSecondariesFirstCmd)
387   {                                               387   {
388     params->SetScintTrackSecondariesFirst(        388     params->SetScintTrackSecondariesFirst(
389       fScintTrackSecondariesFirstCmd->GetNewBo    389       fScintTrackSecondariesFirstCmd->GetNewBoolValue(newValue));
390   }                                               390   }
391   else if(command == fScintVerboseLevelCmd)       391   else if(command == fScintVerboseLevelCmd)
392   {                                               392   {
393     params->SetScintVerboseLevel(                 393     params->SetScintVerboseLevel(
394       fScintVerboseLevelCmd->GetNewIntValue(ne    394       fScintVerboseLevelCmd->GetNewIntValue(newValue));
395   }                                               395   }
396   else if(command == fWLSTimeProfileCmd)          396   else if(command == fWLSTimeProfileCmd)
397   {                                               397   {
398     params->SetWLSTimeProfile(newValue);          398     params->SetWLSTimeProfile(newValue);
399   }                                               399   }
400   else if(command == fWLSVerboseLevelCmd)         400   else if(command == fWLSVerboseLevelCmd)
401   {                                               401   {
402     params->SetWLSVerboseLevel(fWLSVerboseLeve    402     params->SetWLSVerboseLevel(fWLSVerboseLevelCmd->GetNewIntValue(newValue));
403   }                                               403   }
404   else if(command == fWLS2TimeProfileCmd)         404   else if(command == fWLS2TimeProfileCmd)
405   {                                               405   {
406     params->SetWLS2TimeProfile(newValue);         406     params->SetWLS2TimeProfile(newValue);
407   }                                               407   }
408   else if(command == fWLS2VerboseLevelCmd)        408   else if(command == fWLS2VerboseLevelCmd)
409   {                                               409   {
410     params->SetWLS2VerboseLevel(fWLS2VerboseLe    410     params->SetWLS2VerboseLevel(fWLS2VerboseLevelCmd->GetNewIntValue(newValue));
411   }                                               411   }
412   else if(command == fAbsorptionVerboseLevelCm    412   else if(command == fAbsorptionVerboseLevelCmd)
413   {                                               413   {
414     params->SetAbsorptionVerboseLevel(            414     params->SetAbsorptionVerboseLevel(
415       fAbsorptionVerboseLevelCmd->GetNewIntVal    415       fAbsorptionVerboseLevelCmd->GetNewIntValue(newValue));
416   }                                               416   }
417   else if(command == fRayleighVerboseLevelCmd)    417   else if(command == fRayleighVerboseLevelCmd)
418   {                                               418   {
419     params->SetRayleighVerboseLevel(              419     params->SetRayleighVerboseLevel(
420       fRayleighVerboseLevelCmd->GetNewIntValue    420       fRayleighVerboseLevelCmd->GetNewIntValue(newValue));
421   }                                               421   }
422   else if(command == fMieVerboseLevelCmd)         422   else if(command == fMieVerboseLevelCmd)
423   {                                               423   {
424     params->SetMieVerboseLevel(fMieVerboseLeve    424     params->SetMieVerboseLevel(fMieVerboseLevelCmd->GetNewIntValue(newValue));
425   }                                               425   }
426   else if(command == fBoundaryVerboseLevelCmd)    426   else if(command == fBoundaryVerboseLevelCmd)
427   {                                               427   {
428     params->SetBoundaryVerboseLevel(              428     params->SetBoundaryVerboseLevel(
429       fBoundaryVerboseLevelCmd->GetNewIntValue    429       fBoundaryVerboseLevelCmd->GetNewIntValue(newValue));
430   }                                               430   }
431   else if(command == fBoundaryInvokeSDCmd)        431   else if(command == fBoundaryInvokeSDCmd)
432   {                                               432   {
433     params->SetBoundaryInvokeSD(                  433     params->SetBoundaryInvokeSD(
434       fBoundaryInvokeSDCmd->GetNewBoolValue(ne    434       fBoundaryInvokeSDCmd->GetNewBoolValue(newValue));
435   }                                               435   }
436   if(physicsModified)                             436   if(physicsModified)
437   {                                               437   {
438     G4UImanager::GetUIpointer()->ApplyCommand(    438     G4UImanager::GetUIpointer()->ApplyCommand("/run/physicsModified");
439   }                                               439   }
440 }                                                 440 }
441                                                   441