Geant4 Cross Reference

Cross-Referencing   Geant4
Geant4/examples/advanced/gorad/src/GRPhysicsListMessenger.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 /examples/advanced/gorad/src/GRPhysicsListMessenger.cc (Version 11.3.0) and /examples/advanced/gorad/src/GRPhysicsListMessenger.cc (Version 10.7.p1)


  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 //  Gorad (Geant4 Open-source Radiation Analys     26 //  Gorad (Geant4 Open-source Radiation Analysis and Design)
 27 //                                                 27 //
 28 //  Author : Makoto Asai (SLAC National Accele     28 //  Author : Makoto Asai (SLAC National Accelerator Laboratory)
 29 //                                                 29 //
 30 //  Development of Gorad is funded by NASA Joh     30 //  Development of Gorad is funded by NASA Johnson Space Center (JSC)
 31 //  under the contract NNJ15HK11B.                 31 //  under the contract NNJ15HK11B.
 32 //                                                 32 //
 33 // *******************************************     33 // ********************************************************************
 34 //                                                 34 //
 35 // GRPhysicsListMessenger.cc                       35 // GRPhysicsListMessenger.cc
 36 //   A messenger class that handles Gorad phys     36 //   A messenger class that handles Gorad physics list options.
 37 //                                                 37 //
 38 // History                                         38 // History
 39 //   September 8th, 2020 : first implementatio     39 //   September 8th, 2020 : first implementation
 40 //                                                 40 //
 41 // *******************************************     41 // ********************************************************************
 42                                                    42 
 43 #include "GRPhysicsListMessenger.hh"               43 #include "GRPhysicsListMessenger.hh"
 44                                                    44 
 45 #include "GRPhysicsList.hh"                        45 #include "GRPhysicsList.hh"
 46 #include "G4UIcommand.hh"                          46 #include "G4UIcommand.hh"
 47 #include "G4UIparameter.hh"                        47 #include "G4UIparameter.hh"
 48 #include "G4UIdirectory.hh"                        48 #include "G4UIdirectory.hh"
 49 #include "G4UIcmdWithAString.hh"                   49 #include "G4UIcmdWithAString.hh"
 50 #include "G4UIcmdWithADoubleAndUnit.hh"            50 #include "G4UIcmdWithADoubleAndUnit.hh"
 51 #include "G4UIcmdWithoutParameter.hh"              51 #include "G4UIcmdWithoutParameter.hh"
 52                                                    52 
 53 GRPhysicsListMessenger::GRPhysicsListMessenger     53 GRPhysicsListMessenger::GRPhysicsListMessenger(GRPhysicsList* pl)
 54 : pPL(pl)                                          54 : pPL(pl)
 55 {                                                  55 {
 56   G4UIparameter* param = nullptr;                  56   G4UIparameter* param = nullptr;
 57                                                    57 
 58   physDir = new G4UIdirectory("/gorad/physics/     58   physDir = new G4UIdirectory("/gorad/physics/");
 59   physDir->SetGuidance("GORAD physics selectio     59   physDir->SetGuidance("GORAD physics selection");
 60                                                    60 
 61   selectEMCmd = new G4UIcmdWithAString("/gorad     61   selectEMCmd = new G4UIcmdWithAString("/gorad/physics/EM",this);
 62   selectEMCmd->AvailableForStates(G4State_PreI     62   selectEMCmd->AvailableForStates(G4State_PreInit);
 63   selectEMCmd->SetToBeBroadcasted(false);          63   selectEMCmd->SetToBeBroadcasted(false);
 64   selectEMCmd->SetParameterName("EM_option",tr     64   selectEMCmd->SetParameterName("EM_option",true);
 65   selectEMCmd->SetCandidates("Op_0 Op_1 Op_3 O     65   selectEMCmd->SetCandidates("Op_0 Op_1 Op_3 Op_4 LIV LIV_Pol");
 66   selectEMCmd->SetDefaultValue("Op_0");            66   selectEMCmd->SetDefaultValue("Op_0");
 67   selectEMCmd->SetGuidance("Select EM Physics      67   selectEMCmd->SetGuidance("Select EM Physics option");
 68   selectEMCmd->SetGuidance(" Op_0 (default) :      68   selectEMCmd->SetGuidance(" Op_0 (default) : Suitable to medium and high energy applications");
 69   selectEMCmd->SetGuidance(" Op_1 : Faster tha     69   selectEMCmd->SetGuidance(" Op_1 : Faster than Op_0 because of less accurate MSC step limitation");
 70   selectEMCmd->SetGuidance(" Op_3 : Suitable f     70   selectEMCmd->SetGuidance(" Op_3 : Suitable for medical applications - more accurate MSC for all particles");
 71   selectEMCmd->SetGuidance(" Op_4 : Most accur     71   selectEMCmd->SetGuidance(" Op_4 : Most accurate (GS MSC model with Mott correction and error-free stepping for e+/-");
 72   selectEMCmd->SetGuidance(" LIV  : Livermore      72   selectEMCmd->SetGuidance(" LIV  : Livermore models for e-/gamma below 1 GeV, otherwise Op_0");
 73   selectEMCmd->SetGuidance(" LIV_Pol : Polariz     73   selectEMCmd->SetGuidance(" LIV_Pol : Polarized extension of Livermore models (t.b.a.)");
 74                                                    74 
 75   selectHadCmd = new G4UIcmdWithAString("/gora     75   selectHadCmd = new G4UIcmdWithAString("/gorad/physics/Hadronic",this);
 76   selectHadCmd->AvailableForStates(G4State_Pre     76   selectHadCmd->AvailableForStates(G4State_PreInit);
 77   selectHadCmd->SetToBeBroadcasted(false);         77   selectHadCmd->SetToBeBroadcasted(false);
 78   selectHadCmd->SetParameterName("Had_option",     78   selectHadCmd->SetParameterName("Had_option",true);
 79   selectHadCmd->SetCandidates("FTFP_BERT QGSP_     79   selectHadCmd->SetCandidates("FTFP_BERT QGSP_BIC Shielding");
 80   selectHadCmd->SetDefaultValue("FTFP_BERT");      80   selectHadCmd->SetDefaultValue("FTFP_BERT");
 81   selectHadCmd->SetGuidance("Select Hadronic P     81   selectHadCmd->SetGuidance("Select Hadronic Physics option");
 82   selectHadCmd->SetGuidance(" FTFP_BERT (defau     82   selectHadCmd->SetGuidance(" FTFP_BERT (default) : Fritiof string + Bertini cascade + Precompound de-excitation");
 83   selectHadCmd->SetGuidance("                      83   selectHadCmd->SetGuidance("                       suitable to most of midium and high energy applications");
 84   selectHadCmd->SetGuidance(" QGSP_BIC : Quark     84   selectHadCmd->SetGuidance(" QGSP_BIC : Quark-Gluon-String + Fritiof string + Binary cascade + Precompound de-excitation");
 85   selectHadCmd->SetGuidance("            suita     85   selectHadCmd->SetGuidance("            suitable for lower energy applications such as medical");
 86   selectHadCmd->SetGuidance(" Shielding : Simi     86   selectHadCmd->SetGuidance(" Shielding : Similar to FTFP+BERT with better ion-ion interactions.");
 87   selectHadCmd->SetGuidance("             High     87   selectHadCmd->SetGuidance("             High-Precision neutron and Radioactive Decay models are included by default.");
 88                                                    88 
 89   addHPCmd = new G4UIcmdWithoutParameter("/gor     89   addHPCmd = new G4UIcmdWithoutParameter("/gorad/physics/addHP",this);
 90   addHPCmd->AvailableForStates(G4State_PreInit     90   addHPCmd->AvailableForStates(G4State_PreInit);
 91   addHPCmd->SetToBeBroadcasted(false);             91   addHPCmd->SetToBeBroadcasted(false);
 92   addHPCmd->SetGuidance("Add High-Precision ne     92   addHPCmd->SetGuidance("Add High-Precision neutron model.");
 93   addHPCmd->SetGuidance(" Note: Shielding opti     93   addHPCmd->SetGuidance(" Note: Shielding option has already had HP. This command does not make effect to Shielding option.");
 94                                                    94 
 95   addRDMCmd = new G4UIcmdWithoutParameter("/go     95   addRDMCmd = new G4UIcmdWithoutParameter("/gorad/physics/addRDM",this);
 96   addRDMCmd->AvailableForStates(G4State_PreIni     96   addRDMCmd->AvailableForStates(G4State_PreInit);
 97   addRDMCmd->SetToBeBroadcasted(false);            97   addRDMCmd->SetToBeBroadcasted(false);
 98   addRDMCmd->SetGuidance("Add Radioactive Deca     98   addRDMCmd->SetGuidance("Add Radioactive Decay model.");
 99   addRDMCmd->SetGuidance(" Note: Shielding opt     99   addRDMCmd->SetGuidance(" Note: Shielding option has already had RDM. This command does not make effect to Shielding option.");
100                                                   100 
101   addRMCCmd = new G4UIcmdWithoutParameter("/go    101   addRMCCmd = new G4UIcmdWithoutParameter("/gorad/physics/addRMC",this);
102   addRMCCmd->AvailableForStates(G4State_PreIni    102   addRMCCmd->AvailableForStates(G4State_PreInit);
103   addRMCCmd->SetToBeBroadcasted(false);           103   addRMCCmd->SetToBeBroadcasted(false);
104   addRMCCmd->SetGuidance("Add Reverse Monte Ca    104   addRMCCmd->SetGuidance("Add Reverse Monte Carlo.");
105                                                   105 
106   addOpticalCmd = new G4UIcmdWithoutParameter(    106   addOpticalCmd = new G4UIcmdWithoutParameter("/gorad/physics/addOptical",this);
107   addOpticalCmd->AvailableForStates(G4State_Pr    107   addOpticalCmd->AvailableForStates(G4State_PreInit);
108   addOpticalCmd->SetToBeBroadcasted(false);       108   addOpticalCmd->SetToBeBroadcasted(false);
109   addOpticalCmd->SetGuidance("Add Optical phys    109   addOpticalCmd->SetGuidance("Add Optical physics");
110                                                   110 
111   addStepLimitCmd = new G4UIcmdWithAString("/g    111   addStepLimitCmd = new G4UIcmdWithAString("/gorad/physics/addStepLimit",this);
112   addStepLimitCmd->AvailableForStates(G4State_    112   addStepLimitCmd->AvailableForStates(G4State_PreInit);
113   addStepLimitCmd->SetToBeBroadcasted(false);     113   addStepLimitCmd->SetToBeBroadcasted(false);
114   addStepLimitCmd->SetGuidance("Add step-limit    114   addStepLimitCmd->SetGuidance("Add step-limiter process to artificially limit step length.");
115   addStepLimitCmd->SetGuidance("Specify partic    115   addStepLimitCmd->SetGuidance("Specify particle types to be applied.");
116   addStepLimitCmd->SetGuidance("  charged (def    116   addStepLimitCmd->SetGuidance("  charged (default) : applied only to the charged particles");
117   addStepLimitCmd->SetGuidance("  neutral : ap    117   addStepLimitCmd->SetGuidance("  neutral : applied only to the neutral particles");
118   addStepLimitCmd->SetGuidance("  all : applie    118   addStepLimitCmd->SetGuidance("  all : applied to all particle types");
119   addStepLimitCmd->SetGuidance("  e+/- : appli    119   addStepLimitCmd->SetGuidance("  e+/- : applied only to e+/e-");
120   addStepLimitCmd->SetGuidance(" Note: In addi    120   addStepLimitCmd->SetGuidance(" Note: In addition to this command, you need to specify the limitation value by");
121   addStepLimitCmd->SetGuidance("       /gorad/    121   addStepLimitCmd->SetGuidance("       /gorad/physics/limit/stepLimit or /gorad/physics/limit/localStepLimt command.");
122   addStepLimitCmd->SetParameterName("particle"    122   addStepLimitCmd->SetParameterName("particle",true);
123   addStepLimitCmd->SetDefaultValue("charged");    123   addStepLimitCmd->SetDefaultValue("charged");
124   addStepLimitCmd->SetCandidates("charged neut    124   addStepLimitCmd->SetCandidates("charged neutral all e+/-");
125                                                   125 
126   physLimitDir = new G4UIdirectory("/gorad/phy    126   physLimitDir = new G4UIdirectory("/gorad/physics/limit/");
127   physLimitDir->SetGuidance("Specify step limi    127   physLimitDir->SetGuidance("Specify step limitation");
128                                                   128 
129   setStepLimitCmd = new G4UIcmdWithADoubleAndU    129   setStepLimitCmd = new G4UIcmdWithADoubleAndUnit("/gorad/physics/limit/stepLimit",this);
130   setStepLimitCmd->AvailableForStates(G4State_    130   setStepLimitCmd->AvailableForStates(G4State_Idle);
131   setStepLimitCmd->SetToBeBroadcasted(false);     131   setStepLimitCmd->SetToBeBroadcasted(false);
132   setStepLimitCmd->SetParameterName("length",f    132   setStepLimitCmd->SetParameterName("length",false);
133   setStepLimitCmd->SetDefaultUnit("mm");          133   setStepLimitCmd->SetDefaultUnit("mm");
134   setStepLimitCmd->SetGuidance("Define the lim    134   setStepLimitCmd->SetGuidance("Define the limitation of the step length");
135   setStepLimitCmd->SetGuidance("This limitatio    135   setStepLimitCmd->SetGuidance("This limitation is applied to the entire geometry except regions that has its dedicated limit.");
136                                                   136 
137   setRegionStepLimitCmd = new G4UIcommand("/go    137   setRegionStepLimitCmd = new G4UIcommand("/gorad/physics/limit/regionStepLimit",this);
138   setRegionStepLimitCmd->AvailableForStates(G4    138   setRegionStepLimitCmd->AvailableForStates(G4State_Idle);
139   setRegionStepLimitCmd->SetToBeBroadcasted(fa    139   setRegionStepLimitCmd->SetToBeBroadcasted(false);
140   setRegionStepLimitCmd->SetGuidance("Define t    140   setRegionStepLimitCmd->SetGuidance("Define the limitation of the step length for the specified region");
141   setRegionStepLimitCmd->SetGuidance("   [usag    141   setRegionStepLimitCmd->SetGuidance("   [usage] /gorad/physics/limit/regionStepLimit region length [unit]");
142   setRegionStepLimitCmd->SetGuidance("      re    142   setRegionStepLimitCmd->SetGuidance("      region (string) : region name");
143   setRegionStepLimitCmd->SetGuidance(" Note: R    143   setRegionStepLimitCmd->SetGuidance(" Note: Region has to be defined in advance to this command.");
144   setRegionStepLimitCmd->SetGuidance("       I    144   setRegionStepLimitCmd->SetGuidance("       If new region is necessary, use /gorad/geometry/createRegion to create it.");
145   param = new G4UIparameter("region",'s',false    145   param = new G4UIparameter("region",'s',false);
146   setRegionStepLimitCmd->SetParameter(param);     146   setRegionStepLimitCmd->SetParameter(param);
147   param = new G4UIparameter("length",'d',false    147   param = new G4UIparameter("length",'d',false);
148   setRegionStepLimitCmd->SetParameter(param);     148   setRegionStepLimitCmd->SetParameter(param);
149   param = new G4UIparameter("unit",'s',true);     149   param = new G4UIparameter("unit",'s',true);
150   param->SetDefaultUnit("mm");                    150   param->SetDefaultUnit("mm");
151   setRegionStepLimitCmd->SetParameter(param);     151   setRegionStepLimitCmd->SetParameter(param);
152                                                   152 
153   physCutDir = new G4UIdirectory("/gorad/physi    153   physCutDir = new G4UIdirectory("/gorad/physics/cuts/");
154   physCutDir->SetGuidance("Specify production     154   physCutDir->SetGuidance("Specify production thresholds (a.k.a. cuts)");
155                                                   155 
156   setCutCmd = new G4UIcmdWithADoubleAndUnit("/    156   setCutCmd = new G4UIcmdWithADoubleAndUnit("/gorad/physics/cuts/setCuts",this);
157   setCutCmd->AvailableForStates(G4State_PreIni    157   setCutCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
158   setCutCmd->SetToBeBroadcasted(false);           158   setCutCmd->SetToBeBroadcasted(false);
159   setCutCmd->SetParameterName("length",false);    159   setCutCmd->SetParameterName("length",false);
160   setCutCmd->SetDefaultUnit("mm");                160   setCutCmd->SetDefaultUnit("mm");
161   setCutCmd->SetGuidance("Specify production t    161   setCutCmd->SetGuidance("Specify production thresholds (a.k.a. cuts) that is applied to the entire geometry");
162   setCutCmd->SetGuidance("This threshold is ap    162   setCutCmd->SetGuidance("This threshold is applied to all of e-, e+, gamma and proton.");
163   setCutCmd->SetGuidance("Threshold of each pa    163   setCutCmd->SetGuidance("Threshold of each particle can be overwitted by /gorad/physics/cuts/setParticleCut command");
164                                                   164 
165   setCutParticleCmd = new G4UIcommand("/gorad/    165   setCutParticleCmd = new G4UIcommand("/gorad/physics/cuts/setParticleCut",this);
166   setCutParticleCmd->AvailableForStates(G4Stat    166   setCutParticleCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
167   setCutParticleCmd->SetToBeBroadcasted(false)    167   setCutParticleCmd->SetToBeBroadcasted(false);
168   setCutParticleCmd->SetGuidance("Specify prod    168   setCutParticleCmd->SetGuidance("Specify production threshold (a.k.a. cut) for the specified particle that is applied to the entire geometry");
169   setCutParticleCmd->SetGuidance("  [usage] /g    169   setCutParticleCmd->SetGuidance("  [usage] /gorad/physics/setParticleCut particle cut unit");
170   param = new G4UIparameter("particle",'s',fal    170   param = new G4UIparameter("particle",'s',false);
171   param->SetParameterCandidates("e- e+ gamma p    171   param->SetParameterCandidates("e- e+ gamma proton");
172   setCutParticleCmd->SetParameter(param);         172   setCutParticleCmd->SetParameter(param);
173   param = new G4UIparameter("cut",'d',false);     173   param = new G4UIparameter("cut",'d',false);
174   setCutParticleCmd->SetParameter(param);         174   setCutParticleCmd->SetParameter(param);
175   param = new G4UIparameter("unit",'s',true);     175   param = new G4UIparameter("unit",'s',true);
176   param->SetDefaultUnit("mm");                    176   param->SetDefaultUnit("mm");
177   setCutParticleCmd->SetParameter(param);         177   setCutParticleCmd->SetParameter(param);
178                                                   178 
179   setCutRegionCmd = new G4UIcommand("/gorad/ph    179   setCutRegionCmd = new G4UIcommand("/gorad/physics/cuts/setRegionCut",this);
180   setCutRegionCmd->AvailableForStates(G4State_    180   setCutRegionCmd->AvailableForStates(G4State_Idle);
181   setCutRegionCmd->SetToBeBroadcasted(false);     181   setCutRegionCmd->SetToBeBroadcasted(false);
182   setCutRegionCmd->SetGuidance("Specify produc    182   setCutRegionCmd->SetGuidance("Specify production threshold (a.k.a. cut) that is applied to the specified region");
183   setCutRegionCmd->SetGuidance("  [usage] /gor    183   setCutRegionCmd->SetGuidance("  [usage] /gorad/physics/setRegionCut region cut unit");
184   setCutRegionCmd->SetGuidance("This threshold    184   setCutRegionCmd->SetGuidance("This threshold is applied to all of e-, e+, gamma and proton.");
185   setCutRegionCmd->SetGuidance("Threshold of e    185   setCutRegionCmd->SetGuidance("Threshold of each particle can be overwitted by /gorad/physics/cuts/setRegionParticleCut command");
186   setCutRegionCmd->SetGuidance(" Note: Region     186   setCutRegionCmd->SetGuidance(" Note: Region has to be defined in advance to this command.");
187   setCutRegionCmd->SetGuidance("       If new     187   setCutRegionCmd->SetGuidance("       If new region is necessary, use /gorad/geometry/createRegion to create it.");
188   param = new G4UIparameter("region",'s',false    188   param = new G4UIparameter("region",'s',false);
189   setCutRegionCmd->SetParameter(param);           189   setCutRegionCmd->SetParameter(param);
190   param = new G4UIparameter("cut",'d',false);     190   param = new G4UIparameter("cut",'d',false);
191   setCutRegionCmd->SetParameter(param);           191   setCutRegionCmd->SetParameter(param);
192   param = new G4UIparameter("unit",'s',true);     192   param = new G4UIparameter("unit",'s',true);
193   param->SetDefaultUnit("mm");                    193   param->SetDefaultUnit("mm");
194   setCutRegionCmd->SetParameter(param);           194   setCutRegionCmd->SetParameter(param);
195                                                   195 
196   setCutRegionParticleCmd = new G4UIcommand("/    196   setCutRegionParticleCmd = new G4UIcommand("/gorad/physics/cuts/setRegionParticleCut",this);
197   setCutRegionParticleCmd->AvailableForStates(    197   setCutRegionParticleCmd->AvailableForStates(G4State_Idle);
198   setCutRegionParticleCmd->SetToBeBroadcasted(    198   setCutRegionParticleCmd->SetToBeBroadcasted(false);
199   setCutRegionParticleCmd->SetGuidance("Specif    199   setCutRegionParticleCmd->SetGuidance("Specify production threshold (a.k.a. cut) that is applied to the specified region");
200   setCutRegionParticleCmd->SetGuidance("  [usa    200   setCutRegionParticleCmd->SetGuidance("  [usage] /gorad/physics/setRegionParticleCut region particle cut unit");
201   setCutRegionParticleCmd->SetGuidance(" Note:    201   setCutRegionParticleCmd->SetGuidance(" Note: Region has to be defined in advance to this command.");
202   setCutRegionParticleCmd->SetGuidance("          202   setCutRegionParticleCmd->SetGuidance("       If new region is necessary, use /gorad/geometry/createRegion to create it.");
203   param = new G4UIparameter("region",'s',false    203   param = new G4UIparameter("region",'s',false);
204   setCutRegionParticleCmd->SetParameter(param)    204   setCutRegionParticleCmd->SetParameter(param);
205   param = new G4UIparameter("particle",'s',fal    205   param = new G4UIparameter("particle",'s',false);
206   param->SetParameterCandidates("e- e+ gamma p    206   param->SetParameterCandidates("e- e+ gamma proton");
207   setCutRegionParticleCmd->SetParameter(param)    207   setCutRegionParticleCmd->SetParameter(param);
208   param = new G4UIparameter("cut",'d',false);     208   param = new G4UIparameter("cut",'d',false);
209   setCutRegionParticleCmd->SetParameter(param)    209   setCutRegionParticleCmd->SetParameter(param);
210   param = new G4UIparameter("unit",'s',true);     210   param = new G4UIparameter("unit",'s',true);
211   param->SetDefaultUnit("mm");                    211   param->SetDefaultUnit("mm");
212   setCutRegionParticleCmd->SetParameter(param)    212   setCutRegionParticleCmd->SetParameter(param);
213                                                   213 
214 }                                                 214 }
215                                                   215 
216 GRPhysicsListMessenger::~GRPhysicsListMessenge    216 GRPhysicsListMessenger::~GRPhysicsListMessenger()
217 {                                                 217 {
218   delete selectEMCmd;                             218   delete selectEMCmd;
219   delete selectHadCmd;                            219   delete selectHadCmd;
220   delete addHPCmd;                                220   delete addHPCmd;
221   delete addRDMCmd;                               221   delete addRDMCmd;
222   delete addRMCCmd;                               222   delete addRMCCmd;
223   delete addOpticalCmd;                           223   delete addOpticalCmd;
224   delete addStepLimitCmd;                         224   delete addStepLimitCmd;
225   delete setStepLimitCmd;                         225   delete setStepLimitCmd;
226   delete setRegionStepLimitCmd;                   226   delete setRegionStepLimitCmd;
227   delete setCutCmd;                               227   delete setCutCmd;
228   delete setCutParticleCmd;                       228   delete setCutParticleCmd;
229   delete setCutRegionCmd;                         229   delete setCutRegionCmd;
230   delete setCutRegionParticleCmd;                 230   delete setCutRegionParticleCmd;
231                                                   231 
232   delete physLimitDir;                            232   delete physLimitDir;
233   delete physCutDir;                              233   delete physCutDir;
234   delete physDir;                                 234   delete physDir;
235 }                                                 235 }
236                                                   236 
237 #include "G4Tokenizer.hh"                         237 #include "G4Tokenizer.hh"
238                                                   238 
239 void GRPhysicsListMessenger::SetNewValue(G4UIc    239 void GRPhysicsListMessenger::SetNewValue(G4UIcommand* cmd, G4String val)
240 {                                                 240 {
241   if(cmd==selectEMCmd)                            241   if(cmd==selectEMCmd)
242   { pPL->SetEM(val); }                            242   { pPL->SetEM(val); }
243   else if(cmd==selectHadCmd)                      243   else if(cmd==selectHadCmd)
244   { pPL->SetHad(val); }                           244   { pPL->SetHad(val); }
245   else if(cmd==addHPCmd)                          245   else if(cmd==addHPCmd)
246   { pPL->AddHP(); }                               246   { pPL->AddHP(); }
247   else if(cmd==addRDMCmd)                         247   else if(cmd==addRDMCmd)
248   { pPL->AddRDM(); }                              248   { pPL->AddRDM(); }
249   else if(cmd==addRMCCmd)                         249   else if(cmd==addRMCCmd)
250   { pPL->AddRMC(); }                              250   { pPL->AddRMC(); }
251   else if(cmd==addOpticalCmd)                     251   else if(cmd==addOpticalCmd)
252   { G4cout<<"Not yet implemented."<<G4endl; }     252   { G4cout<<"Not yet implemented."<<G4endl; }
253   else if(cmd==addStepLimitCmd)                   253   else if(cmd==addStepLimitCmd)
254   {                                               254   {
255     G4int opt = 0;                                255     G4int opt = 0;
256     if(val=="neutral") opt = 1;                   256     if(val=="neutral") opt = 1; 
257     else if(val=="all") opt = 2;                  257     else if(val=="all") opt = 2; 
258     else if(val=="e+/-") opt = 3;                 258     else if(val=="e+/-") opt = 3; 
259     pPL->AddStepLimit(opt);                       259     pPL->AddStepLimit(opt);
260   }                                               260   }
261   else if(cmd==setStepLimitCmd)                   261   else if(cmd==setStepLimitCmd)
262   { pPL->SetGlobalStepLimit(setStepLimitCmd->G    262   { pPL->SetGlobalStepLimit(setStepLimitCmd->GetNewDoubleValue(val)); }
263   else if(cmd==setRegionStepLimitCmd)             263   else if(cmd==setRegionStepLimitCmd)
264   {                                               264   {
265     G4Tokenizer next(val);                        265     G4Tokenizer next(val);
266     G4String reg = next();                        266     G4String reg = next();
267     G4String newVal = next();                     267     G4String newVal = next();
268     newVal += " ";                                268     newVal += " ";
269     newVal += next();                             269     newVal += next();
270     auto regPtr = pPL->SetLocalStepLimit(reg,s    270     auto regPtr = pPL->SetLocalStepLimit(reg,setRegionStepLimitCmd->ConvertToDimensionedDouble(newVal));
271     if(!regPtr)                                   271     if(!regPtr)
272     {                                             272     {
273       G4ExceptionDescription ed;                  273       G4ExceptionDescription ed;
274       ed << "Region <" << reg << "> is not def    274       ed << "Region <" << reg << "> is not defined. Region has to be defined in advance to this command."
275          << "\nIf new region is necessary, use    275          << "\nIf new region is necessary, use /gorad/geometry/createRegion to create it.";
276       setRegionStepLimitCmd->CommandFailed(ed)    276       setRegionStepLimitCmd->CommandFailed(ed);
277     }                                             277     }
278   }                                               278   }
279   else if(cmd==setCutCmd)                         279   else if(cmd==setCutCmd)
280   { pPL->SetGlobalCuts(setCutCmd->GetNewDouble    280   { pPL->SetGlobalCuts(setCutCmd->GetNewDoubleValue(val)); }
281   else if(cmd==setCutParticleCmd)                 281   else if(cmd==setCutParticleCmd)
282   {                                               282   {
283     G4Tokenizer next(val);                        283     G4Tokenizer next(val);
284     G4String pat = next();                        284     G4String pat = next();
285     G4String newVal = next();                     285     G4String newVal = next();
286     newVal += " ";                                286     newVal += " ";
287     newVal += next();                             287     newVal += next();
288     G4int i = 0;                                  288     G4int i = 0;
289     if(pat=="e-") i = 0;                          289     if(pat=="e-") i = 0; 
290     else if(pat=="e+") i = 1;                     290     else if(pat=="e+") i = 1; 
291     else if(pat=="gamma") i = 2;                  291     else if(pat=="gamma") i = 2; 
292     else if(pat=="proton") i = 3;                 292     else if(pat=="proton") i = 3; 
293     pPL->SetGlobalCut(i,setCutParticleCmd->Con    293     pPL->SetGlobalCut(i,setCutParticleCmd->ConvertToDimensionedDouble(newVal));
294   }                                               294   }
295   else if(cmd==setCutRegionCmd)                   295   else if(cmd==setCutRegionCmd)
296   {                                               296   {
297     G4Tokenizer next(val);                        297     G4Tokenizer next(val);
298     G4String reg = next();                        298     G4String reg = next();
299     G4String newVal = next();                     299     G4String newVal = next();
300     newVal += " ";                                300     newVal += " ";
301     newVal += next();                             301     newVal += next();
302     auto regPtr = pPL->SetLocalCuts(reg,setCut    302     auto regPtr = pPL->SetLocalCuts(reg,setCutRegionCmd->ConvertToDimensionedDouble(newVal));
303     if(!regPtr)                                   303     if(!regPtr)
304     {                                             304     {
305       G4ExceptionDescription ed;                  305       G4ExceptionDescription ed;
306       ed << "Region <" << reg << "> is not def    306       ed << "Region <" << reg << "> is not defined. Region has to be defined in advance to this command."
307          << "\nIf new region is necessary, use    307          << "\nIf new region is necessary, use /gorad/geometry/createRegion to create it.";
308       setRegionStepLimitCmd->CommandFailed(ed)    308       setRegionStepLimitCmd->CommandFailed(ed);
309     }                                             309     }
310   }                                               310   }
311   else if(cmd==setCutRegionParticleCmd)           311   else if(cmd==setCutRegionParticleCmd)
312   {                                               312   {
313     G4Tokenizer next(val);                        313     G4Tokenizer next(val);
314     G4String reg = next();                        314     G4String reg = next();
315     G4String pat = next();                        315     G4String pat = next();
316     G4int i = 0;                                  316     G4int i = 0;
317     if(pat=="e-") i = 0;                          317     if(pat=="e-") i = 0; 
318     else if(pat=="e+") i = 1;                     318     else if(pat=="e+") i = 1; 
319     else if(pat=="gamma") i = 2;                  319     else if(pat=="gamma") i = 2; 
320     else if(pat=="proton") i = 3;                 320     else if(pat=="proton") i = 3; 
321     G4String newVal = next();                     321     G4String newVal = next();
322     newVal += " ";                                322     newVal += " ";
323     newVal += next();                             323     newVal += next();
324     auto regPtr = pPL->SetLocalCut(reg,i,setCu    324     auto regPtr = pPL->SetLocalCut(reg,i,setCutRegionParticleCmd->ConvertToDimensionedDouble(newVal));
325     if(!regPtr)                                   325     if(!regPtr)
326     {                                             326     {
327       G4ExceptionDescription ed;                  327       G4ExceptionDescription ed;
328       ed << "Region <" << reg << "> is not def    328       ed << "Region <" << reg << "> is not defined. Region has to be defined in advance to this command."
329          << "\nIf new region is necessary, use    329          << "\nIf new region is necessary, use /gorad/geometry/createRegion to create it.";
330       setRegionStepLimitCmd->CommandFailed(ed)    330       setRegionStepLimitCmd->CommandFailed(ed);
331     }                                             331     }
332   }                                               332   }
333                                                   333   
334 }                                                 334 }
335                                                   335 
336 G4String GRPhysicsListMessenger::GetCurrentVal    336 G4String GRPhysicsListMessenger::GetCurrentValue(G4UIcommand* cmd)
337 {                                                 337 {
338   G4String val("");                               338   G4String val("");
339                                                   339 
340   if(cmd==selectEMCmd)                            340   if(cmd==selectEMCmd)
341   { val = pPL->GetEM(); }                         341   { val = pPL->GetEM(); }
342   else if(cmd==selectHadCmd)                      342   else if(cmd==selectHadCmd)
343   { val = pPL->GetHad(); }                        343   { val = pPL->GetHad(); }
344   else if(cmd==addHPCmd)                          344   else if(cmd==addHPCmd)
345   { val = cmd->ConvertToString(pPL->IfHP()); }    345   { val = cmd->ConvertToString(pPL->IfHP()); }
346   else if(cmd==addRDMCmd)                         346   else if(cmd==addRDMCmd)
347   { val = cmd->ConvertToString(pPL->IfRDM());     347   { val = cmd->ConvertToString(pPL->IfRDM()); }
348   else if(cmd==addRMCCmd)                         348   else if(cmd==addRMCCmd)
349   { val = cmd->ConvertToString(pPL->IfRMC());     349   { val = cmd->ConvertToString(pPL->IfRMC()); }
350   else if(cmd==addOpticalCmd)                     350   else if(cmd==addOpticalCmd)
351   { G4cout<<"Not yet implemented."<<G4endl; }     351   { G4cout<<"Not yet implemented."<<G4endl; }
352   else if(cmd==addStepLimitCmd)                   352   else if(cmd==addStepLimitCmd)
353   {                                               353   {
354     auto opt = pPL->IfStepLimit();                354     auto opt = pPL->IfStepLimit();
355     switch(opt)                                   355     switch(opt)
356     {                                             356     {
357       case 0: val =  "charged"; break;            357       case 0: val =  "charged"; break;
358       case 1: val =  "neutral"; break;            358       case 1: val =  "neutral"; break;
359       case 2: val =  "all"; break;                359       case 2: val =  "all"; break;
360       case 3: val =  "e+/-"; break;               360       case 3: val =  "e+/-"; break;
361       default : val = "undefined"; break;         361       default : val = "undefined"; break;
362     }                                             362     }
363   }                                               363   }
364   return val;                                     364   return val;
365 }                                                 365 }
366                                                   366 
367                                                   367 
368                                                   368