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 10.7.p4)


  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 
                                                   >>  53 // Commands with '/defaults/' are duplicates and will be removed in
                                                   >>  54 // the next major release of Geant4. Use commands with no /defaults/ instead
                                                   >>  55 
                                                   >>  56 
 52 //....oooOO0OOooo........oooOO0OOooo........oo     57 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 53                                                    58 
 54 G4OpticalParametersMessenger::G4OpticalParamet     59 G4OpticalParametersMessenger::G4OpticalParametersMessenger(
 55   G4OpticalParameters* opticalParameters)      <<  60                   G4OpticalParameters* opticalParameters)
 56   : params(opticalParameters)                      61   : params(opticalParameters)
 57                                                    62 
 58 {                                                  63 {
 59   G4bool toBeBroadcasted = false;              <<  64     G4bool toBeBroadcasted = false;
 60   fDir = new G4UIdirectory("/process/optical/" <<  65     fDir = new G4UIdirectory("/process/optical/defaults/",toBeBroadcasted);
 61   fDir->SetGuidance(                           <<  66     fDir->SetGuidance("DEPRECATED Commands related to the optical physics simulation engine.");
 62     "Commands related to the optical physics s <<  67     fDir2 = new G4UIdirectory("/process/optical/",toBeBroadcasted);
 63                                                <<  68     fDir2->SetGuidance("Commands related to the optical physics simulation engine.");
 64   fCerenkovDir =                               <<  69 
 65     new G4UIdirectory("/process/optical/cerenk <<  70     CreateDirectory("/process/optical/defaults/cerenkov/", "DEPRECATED Cerenkov process commands");
 66   fCerenkovDir->SetGuidance("Cerenkov process  <<  71     CreateDirectory("/process/optical/defaults/scintillation/", "DEPRECATED Scintillation process commands");
 67   fScintDir =                                  <<  72     CreateDirectory("/process/optical/defaults/wls/", "DEPRECATED Wave length shifting process commands");
 68     new G4UIdirectory("/process/optical/scinti <<  73     CreateDirectory("/process/optical/defaults/boundary/", "DEPRECATED Boundary scattering commands");
 69   fScintDir->SetGuidance("Scintillation proces <<  74 
 70   fWlsDir = new G4UIdirectory("/process/optica <<  75     CreateDirectory("/process/optical/cerenkov/", "Cerenkov process commands");
 71   fWlsDir->SetGuidance("Wave length shifting p <<  76     CreateDirectory("/process/optical/scintillation/", "Scintillation process commands");
 72   fWls2Dir = new G4UIdirectory("/process/optic <<  77     CreateDirectory("/process/optical/wls/", "Wave length shifting process commands");
 73   fWls2Dir->SetGuidance("Second Wave length sh <<  78     CreateDirectory("/process/optical/wls2/", "Second Wave length shifting process commands");
 74   fBoundaryDir =                               <<  79     CreateDirectory("/process/optical/boundary/", "Boundary scattering commands");
 75     new G4UIdirectory("/process/optical/bounda <<  80     CreateDirectory("/process/optical/mie/", "Mie scattering process commands");
 76   fBoundaryDir->SetGuidance("Boundary scatteri <<  81     CreateDirectory("/process/optical/absorption/", "absorption process commands");
 77   fMieDir = new G4UIdirectory("/process/optica <<  82     CreateDirectory("/process/optical/rayleigh/", "Rayleigh scattering commands");
 78   fMieDir->SetGuidance("Mie scattering process <<  83 
 79   fAbsDir = new G4UIdirectory("/process/optica <<  84     // general commands
 80   fAbsDir->SetGuidance("absorption process com <<  85     fActivateProcessCmd= new G4UIcommand("/process/optical/processActivation", this);
 81   fRaylDir = new G4UIdirectory("/process/optic <<  86     fActivateProcessCmd->SetGuidance("Activate/deactivate the specified optical process");
 82   fRaylDir->SetGuidance("Rayleigh scattering c <<  87     G4UIparameter* par = new G4UIparameter("proc_name",'s',false);
 83                                                <<  88     G4String candidates;
 84   // general commands                          <<  89     for ( G4int i=0; i<kNoProcess; i++ ) {
 85   fActivateProcessCmd =                        <<  90         candidates += G4OpticalProcessName(i);
 86     new G4UIcommand("/process/optical/processA <<  91         candidates += G4String(" ");
 87   fActivateProcessCmd->SetGuidance(            <<  92     }
 88     "Activate/deactivate the specified optical <<  93     par->SetParameterCandidates(candidates);
 89   auto par = new G4UIparameter("proc_name", 's <<  94     par->SetGuidance("the process name");
 90   G4String candidates;                         <<  95     fActivateProcessCmd->SetParameter(par);
 91   for(G4int i = 0; i < kNoProcess; ++i)        <<  96     par = new G4UIparameter("flag",'b',true);
 92   {                                            <<  97     par->SetDefaultValue(true);
 93     candidates += G4OpticalProcessName(i);     <<  98     par->SetGuidance("activation flag");
 94     candidates += G4String(" ");               <<  99     fActivateProcessCmd->SetParameter(par);
 95   }                                            << 100     fActivateProcessCmd->AvailableForStates(G4State_PreInit);
 96   par->SetParameterCandidates(candidates);     << 101 
 97   par->SetGuidance("the process name");        << 102     // DEPRECATED
 98   fActivateProcessCmd->SetParameter(par);      << 103     fTrackSecondariesFirstCmd = new G4UIcommand("/process/optical/setTrackSecondariesFirst", this);
 99   par = new G4UIparameter("flag", 'b', true);  << 104     fTrackSecondariesFirstCmd->SetGuidance("Activate/deactivate tracking of secondaries before finishing their parent track");
100   par->SetDefaultValue(true);                  << 105     fTrackSecondariesFirstCmd->SetGuidance("DEPRECATED: Use /process/optical/cerenkov/setTrackSecondariesFirst and");
101   par->SetGuidance("activation flag");         << 106     fTrackSecondariesFirstCmd->SetGuidance("/process/optical/scintillation/setTrackSecondariesFirst and instead.");
102   fActivateProcessCmd->SetParameter(par);      << 107     par = new G4UIparameter("proc_name",'s',false);
103   fActivateProcessCmd->AvailableForStates(G4St << 108     par->SetParameterCandidates("Cerenkov Scintillation");
104                                                << 109     fTrackSecondariesFirstCmd->SetParameter(par);
105   fVerboseCmd = new G4UIcmdWithAnInteger("/pro << 110     par = new G4UIparameter("flag",'b',false);
106   fVerboseCmd->SetGuidance("Set default verbos << 111     par->SetDefaultValue(true);
107   fVerboseCmd->SetParameterName("ver", true);  << 112     fTrackSecondariesFirstCmd->SetParameter(par);
108   fVerboseCmd->SetDefaultValue(1);             << 113     fTrackSecondariesFirstCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
109   fVerboseCmd->SetRange("ver>=0");             << 114 
110   fVerboseCmd->AvailableForStates(G4State_PreI << 115     fVerboseCmd = new G4UIcmdWithAnInteger("/process/optical/verbose", this);
111                                                << 116     fVerboseCmd->SetGuidance("Set default verbose level for optical processes");
112   fDumpCmd = new G4UIcommand("/process/optical << 117     fVerboseCmd->SetParameterName("ver", true);
113   fDumpCmd->SetGuidance("Print all optical par << 118     fVerboseCmd->SetDefaultValue(1);
114                                                << 119     fVerboseCmd->SetRange("ver>=0");
115   // Cerenkov ////////////////////             << 120     fVerboseCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
116   fCerenkovMaxPhotonsCmd =                     << 121 
117     new G4UIcmdWithAnInteger("/process/optical << 122     fDumpCmd = new G4UIcommand("/process/optical/printParameters", this);
118   fCerenkovMaxPhotonsCmd->SetGuidance("Set max << 123     fDumpCmd->SetGuidance("Print all optical parameters.");
119   fCerenkovMaxPhotonsCmd->SetParameterName("Ce << 124 
120   fCerenkovMaxPhotonsCmd->SetRange("CerenkovMa << 125     // Cerenkov ////////////////////
121   fCerenkovMaxPhotonsCmd->AvailableForStates(G << 126     fCerenkovMaxPhotons1Cmd = new G4UIcmdWithAnInteger("/process/optical/defaults/cerenkov/setMaxPhotons", this);
122                                                << 127     fCerenkovMaxPhotons1Cmd->SetGuidance("Set maximum number of photons per step");
123   fCerenkovMaxBetaChangeCmd =                  << 128     fCerenkovMaxPhotons1Cmd->SetGuidance("DEPRECATED: use /process/optical/cerenkov/setMaxPhotons instead.");
124     new G4UIcmdWithADouble("/process/optical/c << 129     fCerenkovMaxPhotons1Cmd->SetParameterName("CerenkovMaxPhotons", false);
125   fCerenkovMaxBetaChangeCmd->SetGuidance(      << 130     fCerenkovMaxPhotons1Cmd->SetRange("CerenkovMaxPhotons>=0");
126     "Set maximum change of beta of parent part << 131     fCerenkovMaxPhotons1Cmd->AvailableForStates(G4State_PreInit, G4State_Idle);
127   fCerenkovMaxBetaChangeCmd->SetParameterName( << 132 
128   fCerenkovMaxBetaChangeCmd->SetRange("Cerenko << 133     fCerenkovMaxPhotonsCmd = new G4UIcmdWithAnInteger("/process/optical/cerenkov/setMaxPhotons", this);
129   fCerenkovMaxBetaChangeCmd->AvailableForState << 134     fCerenkovMaxPhotonsCmd->SetGuidance("Set maximum number of photons per step");
130                                                << 135     fCerenkovMaxPhotonsCmd->SetParameterName("CerenkovMaxPhotons", false);
131   fCerenkovStackPhotonsCmd =                   << 136     fCerenkovMaxPhotonsCmd->SetRange("CerenkovMaxPhotons>=0");
132     new G4UIcmdWithABool("/process/optical/cer << 137     fCerenkovMaxPhotonsCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
133   fCerenkovStackPhotonsCmd->SetGuidance(       << 138 
134     "Set whether or not to stack secondary Cer << 139     fCerenkovMaxBetaChange1Cmd = new G4UIcmdWithADouble("/process/optical/defaults/cerenkov/setMaxBetaChange", this);
135   fCerenkovStackPhotonsCmd->AvailableForStates << 140     fCerenkovMaxBetaChange1Cmd->SetGuidance("Set maximum change of beta of parent particle per step");
136                                                << 141     fCerenkovMaxBetaChange1Cmd->SetGuidance("DEPRECATED: use /process/optical/cerenkov/setMaxBetaChange instead.");
137   fCerenkovTrackSecondariesFirstCmd = new G4UI << 142     fCerenkovMaxBetaChange1Cmd->SetParameterName("CerenkovMaxBetaChange", false);
138     "/process/optical/cerenkov/setTrackSeconda << 143     fCerenkovMaxBetaChange1Cmd->SetRange("CerenkovMaxBetaChange>=0");
139   fCerenkovTrackSecondariesFirstCmd->SetGuidan << 144     fCerenkovMaxBetaChange1Cmd->AvailableForStates(G4State_PreInit, G4State_Idle);
140     "Whether to track secondary Cerenkov photo << 145 
141   fCerenkovTrackSecondariesFirstCmd->Available << 146     fCerenkovMaxBetaChangeCmd = new G4UIcmdWithADouble("/process/optical/cerenkov/setMaxBetaChange", this);
142                                                << 147     fCerenkovMaxBetaChangeCmd->SetGuidance("Set maximum change of beta of parent particle per step");
143                                                << 148     fCerenkovMaxBetaChangeCmd->SetParameterName("CerenkovMaxBetaChange", false);
144   fCerenkovVerboseLevelCmd =                   << 149     fCerenkovMaxBetaChangeCmd->SetRange("CerenkovMaxBetaChange>=0");
145     new G4UIcmdWithAnInteger("/process/optical << 150     fCerenkovMaxBetaChangeCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
146   fCerenkovVerboseLevelCmd->SetGuidance("Verbo << 151 
147   fCerenkovVerboseLevelCmd->SetParameterName(" << 152     fCerenkovStackPhotons1Cmd = new G4UIcmdWithABool("/process/optical/defaults/cerenkov/setStackPhotons", this);
148   fCerenkovVerboseLevelCmd->SetRange("verbose  << 153     fCerenkovStackPhotons1Cmd->SetGuidance("Set whether or not to stack secondary Cerenkov photons");
149   fCerenkovVerboseLevelCmd->SetDefaultValue(2) << 154     fCerenkovStackPhotons1Cmd->SetGuidance("DEPRECATED: use /process/optical/cerenkov/setStackPhotons instead.");
150   fCerenkovVerboseLevelCmd->AvailableForStates << 155     fCerenkovStackPhotons1Cmd->SetParameterName("CerenkovStackPhotons", true);
151                                                << 156     fCerenkovStackPhotons1Cmd->SetDefaultValue(true);
152   // Scintillation //////////////////////////  << 157     fCerenkovStackPhotons1Cmd->AvailableForStates(G4State_PreInit, G4State_Idle);
153   fScintByParticleTypeCmd = new G4UIcmdWithABo << 158 
154     "/process/optical/scintillation/setByParti << 159     fCerenkovStackPhotonsCmd = new G4UIcmdWithABool("/process/optical/cerenkov/setStackPhotons", this);
155   fScintByParticleTypeCmd->SetGuidance(        << 160     fCerenkovStackPhotonsCmd->SetGuidance("Set whether or not to stack secondary Cerenkov photons");
156     "Activate/Inactivate scintillation process << 161     fCerenkovStackPhotonsCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
157   fScintByParticleTypeCmd->SetParameterName(   << 162 
158     "ScintillationByParticleTypeActivation", f << 163     fCerenkovTrackSecondariesFirstCmd = new G4UIcmdWithABool("/process/optical/cerenkov/setTrackSecondariesFirst", this);
159   fScintByParticleTypeCmd->AvailableForStates( << 164     fCerenkovTrackSecondariesFirstCmd->SetGuidance("Whether to track secondary Cerenkov photons before the primary.");
160                                                << 165     fCerenkovTrackSecondariesFirstCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
161   fScintTrackInfoCmd =                         << 166 
162     new G4UIcmdWithABool("/process/optical/sci << 167     fCerenkovVerboseLevelCmd = new G4UIcmdWithAnInteger("/process/optical/cerenkov/verbose", this);
163   fScintTrackInfoCmd->SetGuidance(             << 168     fCerenkovVerboseLevelCmd->SetGuidance("Verbose level for Cerenkov process.");
164     "Activate/Inactivate scintillation TrackIn << 169     fCerenkovVerboseLevelCmd->SetParameterName("verbose", true);
165   fScintTrackInfoCmd->SetParameterName("Scinti << 170     fCerenkovVerboseLevelCmd->SetRange("verbose >= 0 && verbose <= 2");
166   fScintTrackInfoCmd->AvailableForStates(G4Sta << 171     fCerenkovVerboseLevelCmd->SetDefaultValue(2);
167                                                << 172     fCerenkovVerboseLevelCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
168   fScintFiniteRiseTimeCmd = new G4UIcmdWithABo << 173 
169     "/process/optical/scintillation/setFiniteR << 174     // Scintillation //////////////////////////
170   fScintFiniteRiseTimeCmd->SetGuidance(        << 175     fScintYieldFactor1Cmd = new G4UIcmdWithADouble("/process/optical/defaults/scintillation/setYieldFactor", this);
171     "Set option of a finite rise-time for G4Sc << 176     fScintYieldFactor1Cmd->SetGuidance("Set scintillation yield factor");
172   fScintFiniteRiseTimeCmd->SetGuidance(        << 177     fScintYieldFactor1Cmd->SetGuidance("DEPRECATED: use /process/optical/scintillation/setYieldFactorinstead.");
173     "If set, the G4Scintillation process expec << 178     fScintYieldFactor1Cmd->SetParameterName("ScintillationYieldFactor", false);
174   fScintFiniteRiseTimeCmd->SetGuidance(        << 179     fScintYieldFactor1Cmd->SetRange("ScintillationYieldFactor>=0");
175     "constant material property SCINTILLATIONR << 180     fScintYieldFactor1Cmd->AvailableForStates(G4State_PreInit, G4State_Idle);
176   fScintFiniteRiseTimeCmd->SetParameterName("F << 181 
177   fScintFiniteRiseTimeCmd->AvailableForStates( << 182     fScintYieldFactorCmd = new G4UIcmdWithADouble("/process/optical/scintillation/setYieldFactor", this);
178                                                << 183     fScintYieldFactorCmd->SetGuidance("Set scintillation yield factor");
179   fScintStackPhotonsCmd = new G4UIcmdWithABool << 184     fScintYieldFactorCmd->SetParameterName("ScintillationYieldFactor", false);
180     "/process/optical/scintillation/setStackPh << 185     fScintYieldFactorCmd->SetRange("ScintillationYieldFactor>=0");
181   fScintStackPhotonsCmd->SetGuidance(          << 186     fScintYieldFactorCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
182     "Set whether or not to stack secondary Sci << 187 
183   fScintStackPhotonsCmd->SetParameterName("Sci << 188     fScintExcitationRatioCmd = new G4UIcmdWithADouble("/process/optical/scintillation/setExcitationRatio", this);
184   fScintStackPhotonsCmd->SetDefaultValue(true) << 189     fScintExcitationRatioCmd->SetGuidance("Set scintillation excitation ratio");
185   fScintStackPhotonsCmd->AvailableForStates(G4 << 190     fScintExcitationRatioCmd->SetParameterName("ExcitationRatio", false);
186                                                << 191     fScintExcitationRatioCmd->SetRange("ExcitationRatio >= 0 && ExcitationRatio <=1");
187   fScintTrackSecondariesFirstCmd = new G4UIcmd << 192     fScintExcitationRatioCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
188     "/process/optical/scintillation/setTrackSe << 193 
189   fScintTrackSecondariesFirstCmd->SetGuidance( << 194     fScintByParticleType1Cmd = new G4UIcmdWithABool("/process/optical/defaults/scintillation/setByParticleType", this);
190     "Whether to track scintillation secondarie << 195     fScintByParticleType1Cmd->SetGuidance("Activate/Inactivate scintillation process by particle type");
191   fScintTrackSecondariesFirstCmd->AvailableFor << 196     fScintByParticleType1Cmd->SetGuidance("DEPRECATED: use /process/optical/scintillation/setByParticleType instead.");
192                                                << 197     fScintByParticleType1Cmd->SetParameterName("ScintillationByParticleTypeActivation", false);
193                                                << 198     fScintByParticleType1Cmd->AvailableForStates(G4State_PreInit, G4State_Idle);
194   fScintVerboseLevelCmd =                      << 199 
195     new G4UIcmdWithAnInteger("/process/optical << 200     fScintByParticleTypeCmd = new G4UIcmdWithABool("/process/optical/scintillation/setByParticleType", this);
196   fScintVerboseLevelCmd->SetGuidance(          << 201     fScintByParticleTypeCmd->SetGuidance("Activate/Inactivate scintillation process by particle type");
197     "Verbose level for scintillation process." << 202     fScintByParticleTypeCmd->SetParameterName("ScintillationByParticleTypeActivation", false);
198   fScintVerboseLevelCmd->SetParameterName("ver << 203     fScintByParticleTypeCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
199   fScintVerboseLevelCmd->SetRange("verbose >=  << 204 
200   fScintVerboseLevelCmd->AvailableForStates(G4 << 205     fScintEnhancedTimeConstantsCmd = new G4UIcmdWithABool("/process/optical/scintillation/setEnhancedTimeConstants", this);
201                                                << 206     fScintEnhancedTimeConstantsCmd->SetGuidance("Activate/Inactivate enhanced time constants for scintillation.");
202   // WLS   //////////////////////////////////  << 207     fScintEnhancedTimeConstantsCmd->SetGuidance("This will be the default in the next major release.");
203   fWLSTimeProfileCmd =                         << 208     fScintEnhancedTimeConstantsCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
204     new G4UIcmdWithAString("/process/optical/w << 209 
205   fWLSTimeProfileCmd->SetGuidance(             << 210     fScintTrackInfo1Cmd = new G4UIcmdWithABool("/process/optical/defaults/scintillation/setTrackInfo", this);
206     "Set the WLS time profile (delta or expone << 211     fScintTrackInfo1Cmd->SetGuidance("Activate/Inactivate scintillation TrackInformation");
207   fWLSTimeProfileCmd->SetParameterName("WLSTim << 212     fScintTrackInfo1Cmd->SetGuidance("DEPRECATED: use /process/optical/scintillation/setTrackInfo instead.");
208   fWLSTimeProfileCmd->SetCandidates("delta exp << 213     fScintTrackInfo1Cmd->SetParameterName("ScintillationTrackInfo", false);
209   fWLSTimeProfileCmd->AvailableForStates(G4Sta << 214     fScintTrackInfo1Cmd->AvailableForStates(G4State_PreInit, G4State_Idle);
210                                                << 215 
211   fWLSVerboseLevelCmd =                        << 216     fScintTrackInfoCmd = new G4UIcmdWithABool("/process/optical/scintillation/setTrackInfo", this);
212     new G4UIcmdWithAnInteger("/process/optical << 217     fScintTrackInfoCmd->SetGuidance("Activate/Inactivate scintillation TrackInformation");
213   fWLSVerboseLevelCmd->SetGuidance("Verbose le << 218     fScintTrackInfoCmd->SetParameterName("ScintillationTrackInfo", false);
214   fWLSVerboseLevelCmd->SetParameterName("verbo << 219     fScintTrackInfoCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
215   fWLSVerboseLevelCmd->SetRange("verbose >= 0  << 220 
216   fWLSVerboseLevelCmd->SetDefaultValue(1);     << 221     fScintFiniteRiseTime1Cmd = new G4UIcmdWithABool("/process/optical/defaults/scintillation/setFiniteRiseTime", this);
217   fWLSVerboseLevelCmd->AvailableForStates(G4St << 222     fScintFiniteRiseTime1Cmd->SetGuidance("Set option of a finite rise-time for G4Scintillation");
218                                                << 223     fScintFiniteRiseTime1Cmd->SetGuidance("If set, the G4Scintillation process expects the user to have set the");
219   // WLS2   ////////////////////////////////// << 224     fScintFiniteRiseTime1Cmd->SetGuidance("constant material property FAST/SLOWSCINTILLATIONRISETIME");
220   fWLS2TimeProfileCmd =                        << 225     fScintFiniteRiseTime1Cmd->SetGuidance("DEPRECATED: use /process/optical/scintillation/setFiniteRiseTime instead.");
221     new G4UIcmdWithAString("/process/optical/w << 226     fScintFiniteRiseTime1Cmd->SetParameterName("FiniteRiseTime", false);
222   fWLS2TimeProfileCmd->SetGuidance(            << 227     fScintFiniteRiseTime1Cmd->AvailableForStates(G4State_PreInit, G4State_Idle);
223     "Set the WLS2 time profile (delta or expon << 228 
224   fWLS2TimeProfileCmd->SetParameterName("WLS2T << 229     fScintFiniteRiseTimeCmd = new G4UIcmdWithABool("/process/optical/scintillation/setFiniteRiseTime", this);
225   fWLS2TimeProfileCmd->SetCandidates("delta ex << 230     fScintFiniteRiseTimeCmd->SetGuidance("Set option of a finite rise-time for G4Scintillation");
226   fWLS2TimeProfileCmd->AvailableForStates(G4St << 231     fScintFiniteRiseTimeCmd->SetGuidance("If set, the G4Scintillation process expects the user to have set the");
227                                                << 232     fScintFiniteRiseTimeCmd->SetGuidance("constant material property FAST/SLOWSCINTILLATIONRISETIME");
228   fWLS2VerboseLevelCmd =                       << 233     fScintFiniteRiseTimeCmd->SetParameterName("FiniteRiseTime", false);
229     new G4UIcmdWithAnInteger("/process/optical << 234     fScintFiniteRiseTimeCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
230   fWLS2VerboseLevelCmd->SetGuidance("Verbose l << 235 
231   fWLS2VerboseLevelCmd->SetParameterName("verb << 236     fScintStackPhotons1Cmd = new G4UIcmdWithABool("/process/optical/defaults/scintillation/setStackPhotons", this);
232   fWLS2VerboseLevelCmd->SetRange("verbose >= 0 << 237     fScintStackPhotons1Cmd->SetGuidance("Set whether or not to stack secondary Scintillation photons");
233   fWLS2VerboseLevelCmd->SetDefaultValue(1);    << 238     fScintStackPhotons1Cmd->SetGuidance("DEPRECATED: use /process/optical/scintillation/setStackPhotons instead.");
234   fWLS2VerboseLevelCmd->AvailableForStates(G4S << 239     fScintStackPhotons1Cmd->SetParameterName("ScintillationStackPhotons", true);
235                                                << 240     fScintStackPhotons1Cmd->SetDefaultValue(true);
236   // boundary //////////////////////////////// << 241     fScintStackPhotons1Cmd->AvailableForStates(G4State_PreInit, G4State_Idle);
237   fBoundaryInvokeSDCmd =                       << 242 
238     new G4UIcmdWithABool("/process/optical/bou << 243     fScintStackPhotonsCmd = new G4UIcmdWithABool("/process/optical/scintillation/setStackPhotons", this);
239   fBoundaryInvokeSDCmd->SetGuidance(           << 244     fScintStackPhotonsCmd->SetGuidance("Set whether or not to stack secondary Scintillation photons");
240     "Set option for calling InvokeSD in G4OpBo << 245     fScintStackPhotonsCmd->SetParameterName("ScintillationStackPhotons", true);
241   fBoundaryInvokeSDCmd->SetParameterName("Invo << 246     fScintStackPhotonsCmd->SetDefaultValue(true);
242   fBoundaryInvokeSDCmd->AvailableForStates(G4S << 247     fScintStackPhotonsCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
243                                                << 248 
244   fBoundaryVerboseLevelCmd =                   << 249     fScintTrackSecondariesFirstCmd = new G4UIcmdWithABool("/process/optical/scintillation/setTrackSecondariesFirst", this);
245     new G4UIcmdWithAnInteger("/process/optical << 250     fScintTrackSecondariesFirstCmd->SetGuidance("Whether to track scintillation secondaries before primary.");
246   fBoundaryVerboseLevelCmd->SetGuidance("Verbo << 251     fScintTrackSecondariesFirstCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
247   fBoundaryVerboseLevelCmd->SetParameterName(" << 252 
248   fBoundaryVerboseLevelCmd->SetRange("verbose  << 253     fScintVerboseLevelCmd = new G4UIcmdWithAnInteger("/process/optical/scintillation/verbose", this);
249   fBoundaryVerboseLevelCmd->SetDefaultValue(1) << 254     fScintVerboseLevelCmd->SetGuidance("Verbose level for scintillation process.");
250   fBoundaryVerboseLevelCmd->AvailableForStates << 255     fScintVerboseLevelCmd->SetParameterName("verbose", true);
251                                                << 256     fScintVerboseLevelCmd->SetRange("verbose >= 0 && verbose <= 2");
252   // absorption ////////////////////////////// << 257     fScintVerboseLevelCmd->AvailableForStates(G4State_Idle, G4State_PreInit);
253   fAbsorptionVerboseLevelCmd =                 << 258 
254     new G4UIcmdWithAnInteger("/process/optical << 259     // WLS   //////////////////////////////////
255   fAbsorptionVerboseLevelCmd->SetGuidance(     << 260     fWLSTimeProfile1Cmd = new G4UIcmdWithAString("/process/optical/defaults/wls/setTimeProfile", this);
256     "Verbose level for absorption process.");  << 261     fWLSTimeProfile1Cmd->SetGuidance("Set the WLS time profile (delta or exponential)");
257   fAbsorptionVerboseLevelCmd->SetParameterName << 262     fWLSTimeProfile1Cmd->SetGuidance("DEPRECATED: use /process/optical/wls/setTimeProfile instead.");
258   fAbsorptionVerboseLevelCmd->SetRange("verbos << 263     fWLSTimeProfile1Cmd->SetParameterName("WLSTimeProfile", false);
259   fAbsorptionVerboseLevelCmd->SetDefaultValue( << 264     fWLSTimeProfile1Cmd->SetCandidates("delta exponential");
260   fAbsorptionVerboseLevelCmd->AvailableForStat << 265     fWLSTimeProfile1Cmd->AvailableForStates(G4State_PreInit, G4State_Idle);
261                                                << 266 
262   // rayleigh //////////////////////////////// << 267     fWLSTimeProfileCmd = new G4UIcmdWithAString("/process/optical/wls/setTimeProfile", this);
263   fRayleighVerboseLevelCmd =                   << 268     fWLSTimeProfileCmd->SetGuidance("Set the WLS time profile (delta or exponential)");
264     new G4UIcmdWithAnInteger("/process/optical << 269     fWLSTimeProfileCmd->SetParameterName("WLSTimeProfile", false);
265   fRayleighVerboseLevelCmd->SetGuidance("Verbo << 270     fWLSTimeProfileCmd->SetCandidates("delta exponential");
266   fRayleighVerboseLevelCmd->SetParameterName(" << 271     fWLSTimeProfileCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
267   fRayleighVerboseLevelCmd->SetRange("verbose  << 272 
268   fRayleighVerboseLevelCmd->SetDefaultValue(1) << 273     fWLSVerboseLevelCmd = new G4UIcmdWithAnInteger("/process/optical/wls/verbose", this);
269   fRayleighVerboseLevelCmd->AvailableForStates << 274     fWLSVerboseLevelCmd->SetGuidance("Verbose level for WLS process.");
270                                                << 275     fWLSVerboseLevelCmd->SetParameterName("verbose", true);
271   // mie ///////////////////////////////////// << 276     fWLSVerboseLevelCmd->SetRange("verbose >= 0 && verbose <= 2");
272   fMieVerboseLevelCmd =                        << 277     fWLSVerboseLevelCmd->SetDefaultValue(1);
273     new G4UIcmdWithAnInteger("/process/optical << 278     fWLSVerboseLevelCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
274   fMieVerboseLevelCmd->SetGuidance("Verbose le << 279 
275   fMieVerboseLevelCmd->SetParameterName("verbo << 280     // WLS2   //////////////////////////////////
276   fMieVerboseLevelCmd->SetRange("verbose >= 0  << 281     fWLS2TimeProfileCmd = new G4UIcmdWithAString("/process/optical/wls2/setTimeProfile", this);
277   fMieVerboseLevelCmd->SetDefaultValue(1);     << 282     fWLS2TimeProfileCmd->SetGuidance("Set the WLS2 time profile (delta or exponential)");
278   fMieVerboseLevelCmd->AvailableForStates(G4St << 283     fWLS2TimeProfileCmd->SetParameterName("WLS2TimeProfile", false);
                                                   >> 284     fWLS2TimeProfileCmd->SetCandidates("delta exponential");
                                                   >> 285     fWLS2TimeProfileCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
                                                   >> 286 
                                                   >> 287     fWLS2VerboseLevelCmd = new G4UIcmdWithAnInteger("/process/optical/wls2/verbose", this);
                                                   >> 288     fWLS2VerboseLevelCmd->SetGuidance("Verbose level for WLS2 process.");
                                                   >> 289     fWLS2VerboseLevelCmd->SetParameterName("verbose", true);
                                                   >> 290     fWLS2VerboseLevelCmd->SetRange("verbose >= 0 && verbose <= 2");
                                                   >> 291     fWLS2VerboseLevelCmd->SetDefaultValue(1);
                                                   >> 292     fWLS2VerboseLevelCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
                                                   >> 293 
                                                   >> 294     // boundary //////////////////////////////////////
                                                   >> 295     fBoundaryInvokeSD1Cmd = new G4UIcmdWithABool("/process/optical/defaults/boundary/setInvokeSD", this);
                                                   >> 296     fBoundaryInvokeSD1Cmd->SetGuidance("Set option for calling InvokeSD in G4OpBoundaryProcess");
                                                   >> 297     fBoundaryInvokeSD1Cmd->SetGuidance("DEPRECATED: use /process/optical/boundary/setInvokeSD instead.");
                                                   >> 298     fBoundaryInvokeSD1Cmd->SetParameterName("InvokeSD", false);
                                                   >> 299     fBoundaryInvokeSD1Cmd->AvailableForStates(G4State_PreInit, G4State_Idle);
                                                   >> 300 
                                                   >> 301     fBoundaryInvokeSDCmd = new G4UIcmdWithABool("/process/optical/boundary/setInvokeSD", this);
                                                   >> 302     fBoundaryInvokeSDCmd->SetGuidance("Set option for calling InvokeSD in G4OpBoundaryProcess");
                                                   >> 303     fBoundaryInvokeSDCmd->SetParameterName("InvokeSD", false);
                                                   >> 304     fBoundaryInvokeSDCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
                                                   >> 305 
                                                   >> 306     fBoundaryVerboseLevelCmd = new G4UIcmdWithAnInteger("/process/optical/boundary/verbose", this);
                                                   >> 307     fBoundaryVerboseLevelCmd->SetGuidance("Verbose level for boundary process.");
                                                   >> 308     fBoundaryVerboseLevelCmd->SetParameterName("verbose", true);
                                                   >> 309     fBoundaryVerboseLevelCmd->SetRange("verbose >= 0 && verbose <= 2");
                                                   >> 310     fBoundaryVerboseLevelCmd->SetDefaultValue(1);
                                                   >> 311     fBoundaryVerboseLevelCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
                                                   >> 312 
                                                   >> 313     // absorption //////////////////////////////////////
                                                   >> 314     fBoundaryInvokeSD1Cmd = new G4UIcmdWithABool("/process/optical/defaults/boundary/setInvokeSD", this);
                                                   >> 315     fAbsorptionVerboseLevelCmd = new G4UIcmdWithAnInteger("/process/optical/absorption/verbose", this);
                                                   >> 316     fAbsorptionVerboseLevelCmd->SetGuidance("Verbose level for absorption process.");
                                                   >> 317     fAbsorptionVerboseLevelCmd->SetParameterName("verbose", true);
                                                   >> 318     fAbsorptionVerboseLevelCmd->SetRange("verbose >= 0 && verbose <= 2");
                                                   >> 319     fAbsorptionVerboseLevelCmd->SetDefaultValue(1);
                                                   >> 320     fAbsorptionVerboseLevelCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
                                                   >> 321 
                                                   >> 322     // rayleigh //////////////////////////////////////
                                                   >> 323     fBoundaryInvokeSD1Cmd = new G4UIcmdWithABool("/process/optical/defaults/boundary/setInvokeSD", this);
                                                   >> 324     fRayleighVerboseLevelCmd = new G4UIcmdWithAnInteger("/process/optical/rayleigh/verbose", this);
                                                   >> 325     fRayleighVerboseLevelCmd->SetGuidance("Verbose level for Rayleigh process.");
                                                   >> 326     fRayleighVerboseLevelCmd->SetParameterName("verbose", true);
                                                   >> 327     fRayleighVerboseLevelCmd->SetRange("verbose >= 0 && verbose <= 2");
                                                   >> 328     fRayleighVerboseLevelCmd->SetDefaultValue(1);
                                                   >> 329     fRayleighVerboseLevelCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
                                                   >> 330 
                                                   >> 331     // mie //////////////////////////////////////
                                                   >> 332     fMieVerboseLevelCmd = new G4UIcmdWithAnInteger("/process/optical/mie/verbose", this);
                                                   >> 333     fMieVerboseLevelCmd->SetGuidance("Verbose level for Mie process.");
                                                   >> 334     fMieVerboseLevelCmd->SetParameterName("verbose", true);
                                                   >> 335     fMieVerboseLevelCmd->SetRange("verbose >= 0 && verbose <= 2");
                                                   >> 336     fMieVerboseLevelCmd->SetDefaultValue(1);
                                                   >> 337     fMieVerboseLevelCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
279 }                                                 338 }
280                                                   339 
281 G4OpticalParametersMessenger::~G4OpticalParame    340 G4OpticalParametersMessenger::~G4OpticalParametersMessenger()
282 {                                                 341 {
283   delete fDir;                                    342   delete fDir;
284   delete fCerenkovDir;                         << 343   delete fDir2;
285   delete fScintDir;                            << 
286   delete fWlsDir;                              << 
287   delete fBoundaryDir;                         << 
288   delete fMieDir;                              << 
289   delete fAbsDir;                              << 
290   delete fRaylDir;                             << 
291   delete fActivateProcessCmd;                     344   delete fActivateProcessCmd;
292   delete fVerboseCmd;                             345   delete fVerboseCmd;
293   delete fDumpCmd;                                346   delete fDumpCmd;
294   delete fCerenkovMaxPhotonsCmd;                  347   delete fCerenkovMaxPhotonsCmd;
                                                   >> 348   delete fCerenkovMaxPhotons1Cmd;
295   delete fCerenkovMaxBetaChangeCmd;               349   delete fCerenkovMaxBetaChangeCmd;
                                                   >> 350   delete fCerenkovMaxBetaChange1Cmd;
296   delete fCerenkovStackPhotonsCmd;                351   delete fCerenkovStackPhotonsCmd;
                                                   >> 352   delete fCerenkovStackPhotons1Cmd;
297   delete fCerenkovTrackSecondariesFirstCmd;       353   delete fCerenkovTrackSecondariesFirstCmd;
298   delete fCerenkovVerboseLevelCmd;                354   delete fCerenkovVerboseLevelCmd;
                                                   >> 355   delete fScintYieldFactorCmd;
                                                   >> 356   delete fScintYieldFactor1Cmd;
299   delete fScintByParticleTypeCmd;                 357   delete fScintByParticleTypeCmd;
                                                   >> 358   delete fScintByParticleType1Cmd;
                                                   >> 359   delete fScintEnhancedTimeConstantsCmd;
300   delete fScintTrackInfoCmd;                      360   delete fScintTrackInfoCmd;
                                                   >> 361   delete fScintTrackInfo1Cmd;
301   delete fScintStackPhotonsCmd;                   362   delete fScintStackPhotonsCmd;
                                                   >> 363   delete fScintStackPhotons1Cmd;
                                                   >> 364   delete fScintExcitationRatioCmd;
302   delete fScintVerboseLevelCmd;                   365   delete fScintVerboseLevelCmd;
303   delete fScintFiniteRiseTimeCmd;                 366   delete fScintFiniteRiseTimeCmd;
                                                   >> 367   delete fScintFiniteRiseTime1Cmd;
304   delete fScintTrackSecondariesFirstCmd;          368   delete fScintTrackSecondariesFirstCmd;
305   delete fWLSTimeProfileCmd;                      369   delete fWLSTimeProfileCmd;
                                                   >> 370   delete fWLSTimeProfile1Cmd;
306   delete fWLSVerboseLevelCmd;                     371   delete fWLSVerboseLevelCmd;
307   delete fWLS2TimeProfileCmd;                     372   delete fWLS2TimeProfileCmd;
308   delete fWLS2VerboseLevelCmd;                    373   delete fWLS2VerboseLevelCmd;
309   delete fAbsorptionVerboseLevelCmd;              374   delete fAbsorptionVerboseLevelCmd;
310   delete fRayleighVerboseLevelCmd;                375   delete fRayleighVerboseLevelCmd;
311   delete fMieVerboseLevelCmd;                     376   delete fMieVerboseLevelCmd;
312   delete fBoundaryVerboseLevelCmd;                377   delete fBoundaryVerboseLevelCmd;
                                                   >> 378   delete fTrackSecondariesFirstCmd;
313   delete fBoundaryInvokeSDCmd;                    379   delete fBoundaryInvokeSDCmd;
                                                   >> 380   delete fBoundaryInvokeSD1Cmd;
314 }                                                 381 }
315                                                   382 
316 void G4OpticalParametersMessenger::SetNewValue    383 void G4OpticalParametersMessenger::SetNewValue(G4UIcommand* command,
317                                                << 384                                             G4String newValue)
318 {                                                 385 {
319   // physics needs to be rebuilt for all comma    386   // physics needs to be rebuilt for all commands
320   G4bool physicsModified = true;                  387   G4bool physicsModified = true;
321                                                   388 
322   /// Apply command to the associated object.     389   /// Apply command to the associated object.
323   if(command == fActivateProcessCmd)           << 390   if (command == fActivateProcessCmd) {
324   {                                            << 
325     std::istringstream is(newValue.data());       391     std::istringstream is(newValue.data());
326     G4String pn;                                  392     G4String pn;
327     G4String flag;                                393     G4String flag;
328     is >> pn >> flag;                             394     is >> pn >> flag;
329     G4bool value = G4UIcommand::ConvertToBool(    395     G4bool value = G4UIcommand::ConvertToBool(flag);
330     params->SetProcessActivation(pn, value);      396     params->SetProcessActivation(pn, value);
331   }                                               397   }
332   else if(command == fVerboseCmd)              << 398   else if (command == fTrackSecondariesFirstCmd) {
333   {                                            << 399     std::istringstream is(newValue.data());
                                                   >> 400     G4String pn;
                                                   >> 401     G4String flag;
                                                   >> 402     is >> pn >> flag;
                                                   >> 403     G4bool value = G4UIcommand::ConvertToBool(flag);
                                                   >> 404     if (pn == "Cerenkov") params->SetCerenkovTrackSecondariesFirst(value);
                                                   >> 405     else if (pn == "Scintillation") params->SetScintTrackSecondariesFirst(value);
                                                   >> 406     else {
                                                   >> 407       G4ExceptionDescription msg;
                                                   >> 408       msg << "Process name not allowed:  "<<pn<<" (UI: "<<newValue<<")";
                                                   >> 409       G4Exception("G4OpticalParametersMessenger::SetNewValue(...)","Optical001",
                                                   >> 410                   FatalException,msg);
                                                   >> 411     }
                                                   >> 412   }
                                                   >> 413   else if (command == fVerboseCmd) {
334     params->SetVerboseLevel(fVerboseCmd->GetNe    414     params->SetVerboseLevel(fVerboseCmd->GetNewIntValue(newValue));
335   }                                               415   }
336   else if(command == fDumpCmd)                 << 416   else if (command == fDumpCmd) {
337   {                                            << 
338     params->Dump();                               417     params->Dump();
339   }                                               418   }
340   else if(command == fCerenkovMaxPhotonsCmd)   << 419   else if (command == fCerenkovMaxPhotons1Cmd) {
341   {                                            << 420     params->SetCerenkovMaxPhotonsPerStep(
                                                   >> 421           fCerenkovMaxPhotons1Cmd->GetNewIntValue(newValue));
                                                   >> 422     Deprecated();
                                                   >> 423   }
                                                   >> 424   else if (command == fCerenkovMaxPhotonsCmd) {
342     params->SetCerenkovMaxPhotonsPerStep(         425     params->SetCerenkovMaxPhotonsPerStep(
343       fCerenkovMaxPhotonsCmd->GetNewIntValue(n << 426           fCerenkovMaxPhotonsCmd->GetNewIntValue(newValue));
344     G4cout << "Cerenkov max photons: " << para << 427     G4cout << "Cerenkov max photons: " << params->GetCerenkovMaxPhotonsPerStep() << G4endl;
345            << G4endl;                          << 428   }
                                                   >> 429   else if (command == fCerenkovMaxBetaChange1Cmd) {
                                                   >> 430     params->SetCerenkovMaxBetaChange(
                                                   >> 431           fCerenkovMaxBetaChange1Cmd->GetNewDoubleValue(newValue));
                                                   >> 432     Deprecated();
346   }                                               433   }
347   else if(command == fCerenkovMaxBetaChangeCmd << 434   else if (command == fCerenkovMaxBetaChangeCmd) {
348   {                                            << 
349     params->SetCerenkovMaxBetaChange(             435     params->SetCerenkovMaxBetaChange(
350       fCerenkovMaxBetaChangeCmd->GetNewDoubleV << 436           fCerenkovMaxBetaChangeCmd->GetNewDoubleValue(newValue));
                                                   >> 437   }
                                                   >> 438   else if (command == fCerenkovStackPhotons1Cmd) {
                                                   >> 439     params->SetCerenkovStackPhotons(
                                                   >> 440           fCerenkovStackPhotons1Cmd->GetNewBoolValue(newValue));
                                                   >> 441     Deprecated();
351   }                                               442   }
352   else if(command == fCerenkovStackPhotonsCmd) << 443   else if (command == fCerenkovStackPhotonsCmd) {
353   {                                            << 
354     params->SetCerenkovStackPhotons(              444     params->SetCerenkovStackPhotons(
355       fCerenkovStackPhotonsCmd->GetNewBoolValu << 445           fCerenkovStackPhotonsCmd->GetNewBoolValue(newValue));
356   }                                               446   }
357   else if(command == fCerenkovTrackSecondaries << 447   else if (command == fCerenkovTrackSecondariesFirstCmd) {
358   {                                            << 
359     params->SetCerenkovTrackSecondariesFirst(     448     params->SetCerenkovTrackSecondariesFirst(
360       fCerenkovTrackSecondariesFirstCmd->GetNe << 449           fCerenkovTrackSecondariesFirstCmd->GetNewBoolValue(newValue));
361   }                                               450   }
362   else if(command == fCerenkovVerboseLevelCmd) << 451   else if (command == fCerenkovVerboseLevelCmd) {
363   {                                            << 
364     params->SetCerenkovVerboseLevel(              452     params->SetCerenkovVerboseLevel(
365       fCerenkovVerboseLevelCmd->GetNewIntValue << 453           fCerenkovVerboseLevelCmd->GetNewIntValue(newValue));
                                                   >> 454   }
                                                   >> 455   else if (command == fScintYieldFactor1Cmd) {
                                                   >> 456     params->SetScintYieldFactor(
                                                   >> 457           fScintYieldFactor1Cmd->GetNewDoubleValue(newValue));
                                                   >> 458     Deprecated();
                                                   >> 459   }
                                                   >> 460   else if (command == fScintYieldFactorCmd) {
                                                   >> 461     params->SetScintYieldFactor(
                                                   >> 462           fScintYieldFactorCmd->GetNewDoubleValue(newValue));
366   }                                               463   }
367   else if(command == fScintByParticleTypeCmd)  << 464   else if (command == fScintByParticleType1Cmd) {
368   {                                            << 
369     params->SetScintByParticleType(               465     params->SetScintByParticleType(
370       fScintByParticleTypeCmd->GetNewBoolValue << 466          fScintByParticleType1Cmd->GetNewBoolValue(newValue));
                                                   >> 467     Deprecated();
371   }                                               468   }
372   else if(command == fScintTrackInfoCmd)       << 469   else if (command == fScintByParticleTypeCmd) {
373   {                                            << 470     params->SetScintByParticleType(
374     params->SetScintTrackInfo(fScintTrackInfoC << 471          fScintByParticleTypeCmd->GetNewBoolValue(newValue));
                                                   >> 472   }
                                                   >> 473   else if (command == fScintEnhancedTimeConstantsCmd) {
                                                   >> 474     params->SetScintEnhancedTimeConstants(
                                                   >> 475          fScintEnhancedTimeConstantsCmd->GetNewBoolValue(newValue));
                                                   >> 476   }
                                                   >> 477   else if (command == fScintTrackInfo1Cmd) {
                                                   >> 478     params->SetScintTrackInfo(
                                                   >> 479          fScintTrackInfo1Cmd->GetNewBoolValue(newValue));
                                                   >> 480     Deprecated();
                                                   >> 481   }
                                                   >> 482   else if (command == fScintTrackInfoCmd) {
                                                   >> 483     params->SetScintTrackInfo(
                                                   >> 484          fScintTrackInfoCmd->GetNewBoolValue(newValue));
                                                   >> 485   }
                                                   >> 486   else if (command == fScintFiniteRiseTime1Cmd) {
                                                   >> 487     params->SetScintFiniteRiseTime(
                                                   >> 488          fScintFiniteRiseTime1Cmd->GetNewBoolValue(newValue));
                                                   >> 489     Deprecated();
375   }                                               490   }
376   else if(command == fScintFiniteRiseTimeCmd)  << 491   else if (command == fScintFiniteRiseTimeCmd) {
377   {                                            << 
378     params->SetScintFiniteRiseTime(               492     params->SetScintFiniteRiseTime(
379       fScintFiniteRiseTimeCmd->GetNewBoolValue << 493          fScintFiniteRiseTimeCmd->GetNewBoolValue(newValue));
380   }                                               494   }
381   else if(command == fScintStackPhotonsCmd)    << 495   else if (command == fScintStackPhotons1Cmd) {
382   {                                            << 
383     params->SetScintStackPhotons(                 496     params->SetScintStackPhotons(
384       fScintStackPhotonsCmd->GetNewBoolValue(n << 497           fScintStackPhotons1Cmd->GetNewBoolValue(newValue));
                                                   >> 498     Deprecated();
385   }                                               499   }
386   else if(command == fScintTrackSecondariesFir << 500   else if (command == fScintStackPhotonsCmd) {
387   {                                            << 501     params->SetScintStackPhotons(
                                                   >> 502           fScintStackPhotonsCmd->GetNewBoolValue(newValue));
                                                   >> 503   }
                                                   >> 504   else if (command == fScintExcitationRatioCmd) {
                                                   >> 505     params->SetScintExcitationRatio(
                                                   >> 506           fScintExcitationRatioCmd->GetNewDoubleValue(newValue));
                                                   >> 507   }
                                                   >> 508   else if (command == fScintTrackSecondariesFirstCmd) {
388     params->SetScintTrackSecondariesFirst(        509     params->SetScintTrackSecondariesFirst(
389       fScintTrackSecondariesFirstCmd->GetNewBo << 510           fScintTrackSecondariesFirstCmd->GetNewBoolValue(newValue));
390   }                                               511   }
391   else if(command == fScintVerboseLevelCmd)    << 512   else if (command == fScintVerboseLevelCmd) {
392   {                                            << 
393     params->SetScintVerboseLevel(                 513     params->SetScintVerboseLevel(
394       fScintVerboseLevelCmd->GetNewIntValue(ne << 514           fScintVerboseLevelCmd->GetNewIntValue(newValue));
395   }                                               515   }
396   else if(command == fWLSTimeProfileCmd)       << 516   else if (command == fWLSTimeProfile1Cmd) {
397   {                                            << 
398     params->SetWLSTimeProfile(newValue);          517     params->SetWLSTimeProfile(newValue);
                                                   >> 518     Deprecated();
399   }                                               519   }
400   else if(command == fWLSVerboseLevelCmd)      << 520   else if (command == fWLSTimeProfileCmd) {
401   {                                            << 521     params->SetWLSTimeProfile(newValue);
                                                   >> 522   }
                                                   >> 523   else if (command == fWLSVerboseLevelCmd) {
402     params->SetWLSVerboseLevel(fWLSVerboseLeve    524     params->SetWLSVerboseLevel(fWLSVerboseLevelCmd->GetNewIntValue(newValue));
403   }                                               525   }
404   else if(command == fWLS2TimeProfileCmd)      << 526   else if (command == fWLS2TimeProfileCmd) {
405   {                                            << 
406     params->SetWLS2TimeProfile(newValue);         527     params->SetWLS2TimeProfile(newValue);
407   }                                               528   }
408   else if(command == fWLS2VerboseLevelCmd)     << 529   else if (command == fWLS2VerboseLevelCmd) {
409   {                                            << 
410     params->SetWLS2VerboseLevel(fWLS2VerboseLe    530     params->SetWLS2VerboseLevel(fWLS2VerboseLevelCmd->GetNewIntValue(newValue));
411   }                                               531   }
412   else if(command == fAbsorptionVerboseLevelCm << 532   else if (command == fAbsorptionVerboseLevelCmd) {
413   {                                            << 533     params->SetAbsorptionVerboseLevel(fAbsorptionVerboseLevelCmd->GetNewIntValue(newValue));
414     params->SetAbsorptionVerboseLevel(         << 534   }
415       fAbsorptionVerboseLevelCmd->GetNewIntVal << 535   else if (command == fRayleighVerboseLevelCmd) {
416   }                                            << 536     params->SetRayleighVerboseLevel(fRayleighVerboseLevelCmd->GetNewIntValue(newValue));
417   else if(command == fRayleighVerboseLevelCmd) << 
418   {                                            << 
419     params->SetRayleighVerboseLevel(           << 
420       fRayleighVerboseLevelCmd->GetNewIntValue << 
421   }                                               537   }
422   else if(command == fMieVerboseLevelCmd)      << 538   else if (command == fMieVerboseLevelCmd) {
423   {                                            << 
424     params->SetMieVerboseLevel(fMieVerboseLeve    539     params->SetMieVerboseLevel(fMieVerboseLevelCmd->GetNewIntValue(newValue));
425   }                                               540   }
426   else if(command == fBoundaryVerboseLevelCmd) << 541   else if (command == fBoundaryVerboseLevelCmd) {
427   {                                            << 542     params->SetBoundaryVerboseLevel(fBoundaryVerboseLevelCmd->GetNewIntValue(newValue));
428     params->SetBoundaryVerboseLevel(           << 543   }
429       fBoundaryVerboseLevelCmd->GetNewIntValue << 544   else if (command == fBoundaryInvokeSD1Cmd) {
430   }                                            << 545     params->SetBoundaryInvokeSD(fBoundaryInvokeSD1Cmd->GetNewBoolValue(newValue));
431   else if(command == fBoundaryInvokeSDCmd)     << 546     Deprecated();
432   {                                            << 547   }
433     params->SetBoundaryInvokeSD(               << 548   else if (command == fBoundaryInvokeSDCmd) {
434       fBoundaryInvokeSDCmd->GetNewBoolValue(ne << 549     params->SetBoundaryInvokeSD(fBoundaryInvokeSDCmd->GetNewBoolValue(newValue));
435   }                                               550   }
436   if(physicsModified)                          << 551   if (physicsModified) {
437   {                                            << 
438     G4UImanager::GetUIpointer()->ApplyCommand(    552     G4UImanager::GetUIpointer()->ApplyCommand("/run/physicsModified");
439   }                                               553   }
                                                   >> 554 }
                                                   >> 555 
                                                   >> 556 void G4OpticalParametersMessenger::Deprecated()
                                                   >> 557 {
                                                   >> 558     G4ExceptionDescription ed;
                                                   >> 559     ed <<" This command has been deprecated and will be removed in the next" << G4endl
                                                   >> 560        << "major release. Use the same command without /defaults/ instead.";
                                                   >> 561     G4Exception("G4OpticalParametersMessenger", "optical001", JustWarning, ed);
440 }                                                 562 }
441                                                   563