Geant4 Cross Reference

Cross-Referencing   Geant4
Geant4/geometry/navigation/src/G4GeometryMessenger.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 /geometry/navigation/src/G4GeometryMessenger.cc (Version 11.3.0) and /geometry/navigation/src/G4GeometryMessenger.cc (Version 10.0.p2)


  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 // class G4GeometryMessenger implementation    << 
 27 //                                                 26 //
 28 // Author: G.Cosmo, CERN                       <<  27 // $Id: G4GeometryMessenger.cc 73253 2013-08-22 13:24:02Z gcosmo $
                                                   >>  28 //
                                                   >>  29 // --------------------------------------------------------------------
                                                   >>  30 // GEANT 4 class source file
                                                   >>  31 //
                                                   >>  32 // G4GeometryMessenger
                                                   >>  33 //
                                                   >>  34 // Author: G.Cosmo, CERN.
                                                   >>  35 //
 29 // -------------------------------------------     36 // --------------------------------------------------------------------
 30                                                    37 
 31 #include <iomanip>                                 38 #include <iomanip>
 32                                                    39 
 33 #include "G4GeometryMessenger.hh"                  40 #include "G4GeometryMessenger.hh"
 34                                                    41 
 35 #include "G4TransportationManager.hh"              42 #include "G4TransportationManager.hh"
 36 #include "G4GeometryManager.hh"                    43 #include "G4GeometryManager.hh"
 37 #include "G4VPhysicalVolume.hh"                    44 #include "G4VPhysicalVolume.hh"
 38 #include "G4Navigator.hh"                          45 #include "G4Navigator.hh"
 39 #include "G4PropagatorInField.hh"              << 
 40                                                    46 
 41 #include "G4UIdirectory.hh"                        47 #include "G4UIdirectory.hh"
 42 #include "G4UIcommand.hh"                          48 #include "G4UIcommand.hh"
 43 #include "G4UIcmdWithoutParameter.hh"              49 #include "G4UIcmdWithoutParameter.hh"
 44 #include "G4UIcmdWithABool.hh"                     50 #include "G4UIcmdWithABool.hh"
 45 #include "G4UIcmdWithAnInteger.hh"                 51 #include "G4UIcmdWithAnInteger.hh"
 46 #include "G4UIcmdWithADoubleAndUnit.hh"            52 #include "G4UIcmdWithADoubleAndUnit.hh"
 47                                                    53 
 48 #include "G4GeomTestVolume.hh"                     54 #include "G4GeomTestVolume.hh"
 49                                                    55 
 50 //                                                 56 //
 51 // Constructor                                     57 // Constructor
 52 //                                                 58 //
 53 G4GeometryMessenger::G4GeometryMessenger(G4Tra     59 G4GeometryMessenger::G4GeometryMessenger(G4TransportationManager* tman)
 54   : tmanager(tman)                             <<  60   : tol(0.0), recLevel(0), recDepth(-1), tmanager(tman), tvolume(0)
 55 {                                                  61 {
 56   geodir = new G4UIdirectory( "/geometry/" );      62   geodir = new G4UIdirectory( "/geometry/" );
 57   geodir->SetGuidance( "Geometry control comma     63   geodir->SetGuidance( "Geometry control commands." );
 58                                                    64 
 59   //                                               65   //
 60   // Geometry navigator commands                   66   // Geometry navigator commands
 61   //                                               67   //
 62   navdir = new G4UIdirectory( "/geometry/navig     68   navdir = new G4UIdirectory( "/geometry/navigator/" );
 63   navdir->SetGuidance( "Geometry navigator con     69   navdir->SetGuidance( "Geometry navigator control setup." );
 64                                                    70 
 65   resCmd = new G4UIcmdWithoutParameter( "/geom     71   resCmd = new G4UIcmdWithoutParameter( "/geometry/navigator/reset", this );
 66   resCmd->SetGuidance( "Reset navigator and na     72   resCmd->SetGuidance( "Reset navigator and navigation history." );
 67   resCmd->SetGuidance( "NOTE: must be called o     73   resCmd->SetGuidance( "NOTE: must be called only after kernel has been" );
 68   resCmd->SetGuidance( "      initialized once     74   resCmd->SetGuidance( "      initialized once through the run manager!" );
 69   resCmd->AvailableForStates(G4State_Idle);        75   resCmd->AvailableForStates(G4State_Idle);
 70                                                    76 
 71   verbCmd = new G4UIcmdWithAnInteger( "/geomet     77   verbCmd = new G4UIcmdWithAnInteger( "/geometry/navigator/verbose", this );
 72   verbCmd->SetGuidance( "Set run-time verbosit     78   verbCmd->SetGuidance( "Set run-time verbosity for the navigator." );
 73   verbCmd->SetGuidance(" 0 : Silent (default)"     79   verbCmd->SetGuidance(" 0 : Silent (default)");
 74   verbCmd->SetGuidance(" 1 : Display volume po     80   verbCmd->SetGuidance(" 1 : Display volume positioning and step lengths");
 75   verbCmd->SetGuidance(" 2 : Display step/safe     81   verbCmd->SetGuidance(" 2 : Display step/safety info on point location");
 76   verbCmd->SetGuidance(" 3 : Display minimal s     82   verbCmd->SetGuidance(" 3 : Display minimal state at -every- step");
 77   verbCmd->SetGuidance(" 4 : Maximum verbosity     83   verbCmd->SetGuidance(" 4 : Maximum verbosity (very detailed!)");
 78   verbCmd->SetGuidance( "NOTE: this command ha     84   verbCmd->SetGuidance( "NOTE: this command has effect -only- if Geant4 has" );
 79   verbCmd->SetGuidance( "      been installed      85   verbCmd->SetGuidance( "      been installed with the G4VERBOSE flag set!" );
 80   verbCmd->SetParameterName("level",true);         86   verbCmd->SetParameterName("level",true);
 81   verbCmd->SetDefaultValue(0);                     87   verbCmd->SetDefaultValue(0);
 82   verbCmd->SetRange("level >=0 && level <=4");     88   verbCmd->SetRange("level >=0 && level <=4");
 83                                                    89 
 84   chkCmd = new G4UIcmdWithABool( "/geometry/na     90   chkCmd = new G4UIcmdWithABool( "/geometry/navigator/check_mode", this );
 85   chkCmd->SetGuidance( "Set navigator in -chec     91   chkCmd->SetGuidance( "Set navigator in -check_mode- state." );
 86   chkCmd->SetGuidance( "This will cause extra      92   chkCmd->SetGuidance( "This will cause extra checks to be applied during" );
 87   chkCmd->SetGuidance( "navigation. More stric     93   chkCmd->SetGuidance( "navigation. More strict and less tolerant conditions" );
 88   chkCmd->SetGuidance( "are applied. A run-tim     94   chkCmd->SetGuidance( "are applied. A run-time performance penalty may be" );
 89   chkCmd->SetGuidance( "observed when the -che     95   chkCmd->SetGuidance( "observed when the -check_mode- state is activated." );
 90   chkCmd->SetGuidance( "NOTE: this command has     96   chkCmd->SetGuidance( "NOTE: this command has effect -only- if Geant4 has" );
 91   chkCmd->SetGuidance( "      been installed w     97   chkCmd->SetGuidance( "      been installed with the G4VERBOSE flag set!" );
 92   chkCmd->SetParameterName("checkFlag",true);      98   chkCmd->SetParameterName("checkFlag",true);
 93   chkCmd->SetDefaultValue(false);                  99   chkCmd->SetDefaultValue(false);
 94   chkCmd->AvailableForStates(G4State_Idle);       100   chkCmd->AvailableForStates(G4State_Idle);
 95                                                   101 
 96   pchkCmd = new G4UIcmdWithABool( "/geometry/n    102   pchkCmd = new G4UIcmdWithABool( "/geometry/navigator/push_notify", this );
 97   pchkCmd->SetGuidance( "Set navigator verbosi    103   pchkCmd->SetGuidance( "Set navigator verbosity push notifications." );
 98   pchkCmd->SetGuidance( "This allows one to di << 104   pchkCmd->SetGuidance( "This allows to disable/re-enable verbosity in" );
 99   pchkCmd->SetGuidance( "navigation, when trac    105   pchkCmd->SetGuidance( "navigation, when tracks may get stuck and require" );
100   pchkCmd->SetGuidance( "one artificial push a    106   pchkCmd->SetGuidance( "one artificial push along the direction by the" );
101   pchkCmd->SetGuidance( "navigator. Notificati    107   pchkCmd->SetGuidance( "navigator. Notification is active by default." );
102   pchkCmd->SetGuidance( "NOTE: this command ha    108   pchkCmd->SetGuidance( "NOTE: this command has effect -only- if Geant4 has" );
103   pchkCmd->SetGuidance( "      been installed     109   pchkCmd->SetGuidance( "      been installed with the G4VERBOSE flag set!" );
104   pchkCmd->SetParameterName("pushFlag",true);     110   pchkCmd->SetParameterName("pushFlag",true);
105   pchkCmd->SetDefaultValue(true);                 111   pchkCmd->SetDefaultValue(true);
106   pchkCmd->AvailableForStates(G4State_Idle);      112   pchkCmd->AvailableForStates(G4State_Idle);
107                                                   113 
108   //                                              114   //
109   // Geometry verification test commands          115   // Geometry verification test commands
110   //                                              116   //
111   testdir = new G4UIdirectory( "/geometry/test    117   testdir = new G4UIdirectory( "/geometry/test/" );
112   testdir->SetGuidance( "Geometry verification    118   testdir->SetGuidance( "Geometry verification control setup." );
113   testdir->SetGuidance( "Helps in detecting po    119   testdir->SetGuidance( "Helps in detecting possible overlapping regions." );
114                                                   120 
115   tolCmd = new G4UIcmdWithADoubleAndUnit( "/ge    121   tolCmd = new G4UIcmdWithADoubleAndUnit( "/geometry/test/tolerance",this );
116   tolCmd->SetGuidance( "Define tolerance (in m    122   tolCmd->SetGuidance( "Define tolerance (in mm) by which overlaps reports" );
117   tolCmd->SetGuidance( "should be reported. By    123   tolCmd->SetGuidance( "should be reported. By default, all overlaps are" );
118   tolCmd->SetGuidance( "reported, i.e. toleran    124   tolCmd->SetGuidance( "reported, i.e. tolerance is set to: 0*mm." );
119   tolCmd->SetParameterName( "Tolerance", true,    125   tolCmd->SetParameterName( "Tolerance", true, true );
120   tolCmd->SetDefaultValue( 0 );                   126   tolCmd->SetDefaultValue( 0 );
121   tolCmd->SetDefaultUnit( "mm" );                 127   tolCmd->SetDefaultUnit( "mm" );
122   tolCmd->SetUnitCategory( "Length" );            128   tolCmd->SetUnitCategory( "Length" );
123                                                   129 
124   verCmd = new G4UIcmdWithABool( "/geometry/te    130   verCmd = new G4UIcmdWithABool( "/geometry/test/verbosity", this );
125   verCmd->SetGuidance( "Specify if running in     131   verCmd->SetGuidance( "Specify if running in verbosity mode or not." );
126   verCmd->SetGuidance( "By default verbosity i    132   verCmd->SetGuidance( "By default verbosity is set to ON (TRUE)." );
127   verCmd->SetParameterName("verbosity",true);     133   verCmd->SetParameterName("verbosity",true);
128   verCmd->SetDefaultValue(true);                  134   verCmd->SetDefaultValue(true);
129   verCmd->AvailableForStates(G4State_Idle);       135   verCmd->AvailableForStates(G4State_Idle);
130                                                   136 
131   rslCmd = new G4UIcmdWithAnInteger( "/geometr    137   rslCmd = new G4UIcmdWithAnInteger( "/geometry/test/resolution", this );
132   rslCmd->SetGuidance( "Set the number of poin    138   rslCmd->SetGuidance( "Set the number of points on surface to be generated for" );
133   rslCmd->SetGuidance( "checking overlaps." );    139   rslCmd->SetGuidance( "checking overlaps." );
134   rslCmd->SetParameterName("resolution",true);    140   rslCmd->SetParameterName("resolution",true);
135   rslCmd->SetDefaultValue(10000);                 141   rslCmd->SetDefaultValue(10000);
136                                                   142 
137   rcsCmd = new G4UIcmdWithAnInteger( "/geometr    143   rcsCmd = new G4UIcmdWithAnInteger( "/geometry/test/recursion_start", this );
138   rcsCmd->SetGuidance( "Set the initial level     144   rcsCmd->SetGuidance( "Set the initial level in the geometry tree for recursion." );
139   rcsCmd->SetGuidance( "recursive_test will th    145   rcsCmd->SetGuidance( "recursive_test will then start from the specified level." );
140   rcsCmd->SetParameterName("initial_level",tru    146   rcsCmd->SetParameterName("initial_level",true);
141   rcsCmd->SetDefaultValue(0);                     147   rcsCmd->SetDefaultValue(0);
142                                                   148 
143   rcdCmd = new G4UIcmdWithAnInteger( "/geometr    149   rcdCmd = new G4UIcmdWithAnInteger( "/geometry/test/recursion_depth", this );
144   rcdCmd->SetGuidance( "Set the depth in the g    150   rcdCmd->SetGuidance( "Set the depth in the geometry tree for recursion." );
145   rcdCmd->SetGuidance( "recursive_test will th    151   rcdCmd->SetGuidance( "recursive_test will then stop after reached the specified depth." );
146   rcdCmd->SetGuidance( "By default, recursion     152   rcdCmd->SetGuidance( "By default, recursion will proceed for the whole depth." );
147   rcdCmd->SetParameterName("recursion_depth",t    153   rcdCmd->SetParameterName("recursion_depth",true);
148   rcdCmd->SetDefaultValue(-1);                    154   rcdCmd->SetDefaultValue(-1);
149                                                   155 
150   errCmd = new G4UIcmdWithAnInteger( "/geometr    156   errCmd = new G4UIcmdWithAnInteger( "/geometry/test/maximum_errors", this );
151   errCmd->SetGuidance( "Set the maximum number    157   errCmd->SetGuidance( "Set the maximum number of overlap errors to report" );
152   errCmd->SetGuidance( "for each single volume    158   errCmd->SetGuidance( "for each single volume being checked." );
153   errCmd->SetGuidance( "Once reached the maxim    159   errCmd->SetGuidance( "Once reached the maximum number specified, overlaps" );
154   errCmd->SetGuidance( "affecting that volume     160   errCmd->SetGuidance( "affecting that volume further than that are simply ignored." );
155   errCmd->SetParameterName("maximum_errors",tr    161   errCmd->SetParameterName("maximum_errors",true);
156   errCmd->SetDefaultValue(1);                     162   errCmd->SetDefaultValue(1);
157                                                   163 
158   parCmd = new G4UIcmdWithABool( "/geometry/te << 
159   parCmd->SetGuidance( "Check for overlaps in  << 
160   parCmd->SetGuidance( "By default, overlaps a << 
161   parCmd->SetParameterName("check_parallel",tr << 
162   parCmd->SetDefaultValue(true);               << 
163                                                << 
164   recCmd = new G4UIcmdWithoutParameter( "/geom    164   recCmd = new G4UIcmdWithoutParameter( "/geometry/test/run", this );
165   recCmd->SetGuidance( "Start running the recu    165   recCmd->SetGuidance( "Start running the recursive overlap check." );
166   recCmd->SetGuidance( "Volumes are recursivel    166   recCmd->SetGuidance( "Volumes are recursively asked to verify for overlaps" );
167   recCmd->SetGuidance( "for points generated o    167   recCmd->SetGuidance( "for points generated on the surface against their" );
168   recCmd->SetGuidance( "respective mother volu    168   recCmd->SetGuidance( "respective mother volume and sisters at the same" );
169   recCmd->SetGuidance( "level, performing for     169   recCmd->SetGuidance( "level, performing for all daughters and daughters of" );
170   recCmd->SetGuidance( "daughters, etc." );       170   recCmd->SetGuidance( "daughters, etc." );
171   recCmd->SetGuidance( "NOTE: it may take a ve    171   recCmd->SetGuidance( "NOTE: it may take a very long time," );
172   recCmd->SetGuidance( "      depending on the    172   recCmd->SetGuidance( "      depending on the geometry complexity !");
173   recCmd->AvailableForStates(G4State_Idle);       173   recCmd->AvailableForStates(G4State_Idle);
174 }                                                 174 }
175                                                   175 
176 //                                                176 //
177 // Destructor                                     177 // Destructor
178 //                                                178 //
179 G4GeometryMessenger::~G4GeometryMessenger()       179 G4GeometryMessenger::~G4GeometryMessenger()
180 {                                                 180 {
181   delete verCmd; delete recCmd; delete rslCmd;    181   delete verCmd; delete recCmd; delete rslCmd;
182   delete resCmd; delete rcsCmd; delete rcdCmd; << 182   delete resCmd; delete rcsCmd; delete rcdCmd; delete errCmd;
183   delete errCmd; delete parCmd; delete tolCmd; << 183   delete tolCmd;
184   delete verbCmd; delete pchkCmd; delete chkCm    184   delete verbCmd; delete pchkCmd; delete chkCmd;
185   delete geodir; delete navdir; delete testdir    185   delete geodir; delete navdir; delete testdir;
186   for(auto* tvolume: tvolumes) {               << 186   delete tvolume;
187       delete tvolume;                          << 
188   }                                            << 
189 }                                                 187 }
190                                                   188 
191 //                                                189 //
192 // Init                                           190 // Init
193 //                                                191 //
194 void                                              192 void
195 G4GeometryMessenger::Init()                       193 G4GeometryMessenger::Init()
196 {                                                 194 {
197   // Create checker...                            195   // Create checker...
198   //                                              196   //
199   if (tvolumes.empty())                        << 197   if (!tvolume)
200   {                                               198   {
201     // Get all world volumes                   << 199     // Get the world volume
                                                   >> 200     //
                                                   >> 201     G4VPhysicalVolume* world =
                                                   >> 202       tmanager->GetNavigatorForTracking()->GetWorldVolume();
                                                   >> 203 
                                                   >> 204     // Test the actual detector...
202     //                                            205     //
203     const auto noWorlds = tmanager->GetNoWorld << 206     tvolume = new G4GeomTestVolume(world);
204     const auto fWorld = tmanager->GetWorldsIte << 
205     for(size_t i=0;i<noWorlds;++i)             << 
206     {                                          << 
207         // Test the actual detector...         << 
208         //                                     << 
209         tvolumes.push_back(new G4GeomTestVolum << 
210     }                                          << 
211   }                                               207   }
212 }                                                 208 }
213                                                   209 
214 //                                                210 //
215 // SetNewValue                                    211 // SetNewValue
216 //                                                212 //
217 void                                              213 void
218 G4GeometryMessenger::SetNewValue( G4UIcommand*    214 G4GeometryMessenger::SetNewValue( G4UIcommand* command, G4String newValues )
219 {                                                 215 {
220   if (command == resCmd) {                        216   if (command == resCmd) {
221     ResetNavigator();                             217     ResetNavigator();
222   }                                               218   }
223   else if (command == verbCmd) {                  219   else if (command == verbCmd) {
224     SetVerbosity( newValues );                    220     SetVerbosity( newValues );
225   }                                               221   }
226   else if (command == chkCmd) {                   222   else if (command == chkCmd) {
227     SetCheckMode( newValues );                    223     SetCheckMode( newValues );
228   }                                               224   }
229   else if (command == pchkCmd) {               << 
230     SetPushFlag( newValues );                  << 
231   }                                            << 
232   else if (command == tolCmd) {                   225   else if (command == tolCmd) {
233     Init();                                       226     Init();
234     tol = tolCmd->GetNewDoubleValue( newValues    227     tol = tolCmd->GetNewDoubleValue( newValues )
235         * tolCmd->GetNewUnitValue( newValues )    228         * tolCmd->GetNewUnitValue( newValues );
236     for(auto* tvolume: tvolumes)               << 229     tvolume->SetTolerance(tol);
237     {                                          << 
238       tvolume->SetTolerance(tol);              << 
239     }                                          << 
240   }                                               230   }
241   else if (command == verCmd) {                   231   else if (command == verCmd) {
242     Init();                                       232     Init();
243     for(auto* tvolume: tvolumes)               << 233     tvolume->SetVerbosity(verCmd->GetNewBoolValue( newValues ));
244     {                                          << 
245       tvolume->SetVerbosity(verCmd->GetNewBool << 
246     }                                          << 
247   }                                               234   }
248   else if (command == rslCmd) {                   235   else if (command == rslCmd) {
249     Init();                                       236     Init();
250     for(auto* tvolume: tvolumes)               << 237     tvolume->SetResolution(rslCmd->GetNewIntValue( newValues ));
251     {                                          << 
252       tvolume->SetResolution(rslCmd->GetNewInt << 
253     }                                          << 
254   }                                               238   }
255   else if (command == rcsCmd) {                   239   else if (command == rcsCmd) {
256     recLevel = rcsCmd->GetNewIntValue( newValu    240     recLevel = rcsCmd->GetNewIntValue( newValues );
257   }                                               241   }
258   else if (command == rcdCmd) {                   242   else if (command == rcdCmd) {
259     recDepth = rcdCmd->GetNewIntValue( newValu    243     recDepth = rcdCmd->GetNewIntValue( newValues );
260   }                                               244   }
261   else if (command == parCmd) {                << 
262     checkParallelWorlds = parCmd->GetNewBoolVa << 
263   }                                            << 
264   else if (command == errCmd) {                   245   else if (command == errCmd) {
265     Init();                                       246     Init();
266     for(auto* tvolume: tvolumes)               << 247     tvolume->SetErrorsThreshold(errCmd->GetNewIntValue( newValues ));
267     {                                          << 
268       tvolume->SetErrorsThreshold(errCmd->GetN << 
269     }                                          << 
270   }                                               248   }
271   else if (command == recCmd) {                   249   else if (command == recCmd) {
272     Init();                                       250     Init();
273     G4cout << "Running geometry overlaps check    251     G4cout << "Running geometry overlaps check..." << G4endl;
274     RecursiveOverlapTest();                       252     RecursiveOverlapTest();
275     G4cout << "Geometry overlaps check complet    253     G4cout << "Geometry overlaps check completed !" << G4endl;
276   }                                               254   }
277 }                                                 255 }
278                                                   256 
279 //                                                257 //
280 // GetCurrentValue                                258 // GetCurrentValue
281 //                                                259 //
282 G4String                                          260 G4String
283 G4GeometryMessenger::GetCurrentValue( G4UIcomm << 261 G4GeometryMessenger::GetCurrentValue(G4UIcommand* command )
284 {                                                 262 {
285   G4String cv = "";                               263   G4String cv = "";
286   if (command == tolCmd)                       << 264   if (command == tolCmd) {
287   {                                            << 
288     cv = tolCmd->ConvertToString( tol, "mm" );    265     cv = tolCmd->ConvertToString( tol, "mm" );
289   }                                               266   }
290   return cv;                                      267   return cv;
291 }                                                 268 }
292                                                   269 
293 //                                                270 //
294 // CheckGeometry                                  271 // CheckGeometry
295 //                                                272 //
296 void                                              273 void
297 G4GeometryMessenger::CheckGeometry()              274 G4GeometryMessenger::CheckGeometry()
298 {                                                 275 {
299   // Verify that the geometry is closed           276   // Verify that the geometry is closed
300   //                                              277   //
301   G4GeometryManager* geomManager = G4GeometryM    278   G4GeometryManager* geomManager = G4GeometryManager::GetInstance();
302   if (!geomManager->IsGeometryClosed())        << 279   if (!geomManager->IsGeometryClosed()) {
303   {                                            << 
304     geomManager->OpenGeometry();                  280     geomManager->OpenGeometry();
305     geomManager->CloseGeometry(true);             281     geomManager->CloseGeometry(true);
306   }                                               282   } 
307 }                                                 283 }
308                                                   284 
309 //                                                285 //
310 // ResetNavigator                                 286 // ResetNavigator
311 //                                                287 //
312 void                                              288 void
313 G4GeometryMessenger::ResetNavigator()             289 G4GeometryMessenger::ResetNavigator()
314 {                                                 290 {
315   // Close geometry and reset optimisation if     291   // Close geometry and reset optimisation if necessary
316   //                                              292   //
317   CheckGeometry();                                293   CheckGeometry();
318                                                   294 
319   // Reset navigator's state                      295   // Reset navigator's state
320   //                                              296   //
321   G4ThreeVector pt(0,0,0);                        297   G4ThreeVector pt(0,0,0);
322   G4Navigator* navigator = tmanager->GetNaviga    298   G4Navigator* navigator = tmanager->GetNavigatorForTracking();
323   navigator->LocateGlobalPointAndSetup(pt,null << 299   navigator->LocateGlobalPointAndSetup(pt,0,false);
324 }                                                 300 }
325                                                   301 
326 //                                                302 //
327 // Set navigator verbosity                        303 // Set navigator verbosity
328 //                                                304 //
329 void                                              305 void
330 G4GeometryMessenger::SetVerbosity(const G4Stri << 306 G4GeometryMessenger::SetVerbosity(G4String input)
331 {                                                 307 {
332   G4int level = verbCmd->GetNewIntValue(input)    308   G4int level = verbCmd->GetNewIntValue(input);
333   G4Navigator* navigator = tmanager->GetNaviga    309   G4Navigator* navigator = tmanager->GetNavigatorForTracking();
334   navigator->SetVerboseLevel(level);              310   navigator->SetVerboseLevel(level);
335 }                                                 311 }
336                                                   312 
337 //                                                313 //
338 // Set navigator mode                             314 // Set navigator mode
339 //                                                315 //
340 void                                              316 void
341 G4GeometryMessenger::SetCheckMode(const G4Stri << 317 G4GeometryMessenger::SetCheckMode(G4String input)
342 {                                                 318 {
343   G4bool mode = chkCmd->GetNewBoolValue(input)    319   G4bool mode = chkCmd->GetNewBoolValue(input);
344   G4Navigator* navigator = tmanager->GetNaviga    320   G4Navigator* navigator = tmanager->GetNavigatorForTracking();
345   navigator->CheckMode(mode);                     321   navigator->CheckMode(mode);
346   G4PropagatorInField* pField = tmanager->GetP << 
347   if (pField != nullptr)  { pField->CheckMode( << 
348 }                                                 322 }
349                                                   323 
350 //                                                324 //
351 // Set navigator verbosity for push notificati    325 // Set navigator verbosity for push notifications
352 //                                                326 //
353 void                                              327 void
354 G4GeometryMessenger::SetPushFlag(const G4Strin << 328 G4GeometryMessenger::SetPushFlag(G4String input)
355 {                                                 329 {
356   G4bool mode = pchkCmd->GetNewBoolValue(input    330   G4bool mode = pchkCmd->GetNewBoolValue(input);
357   G4Navigator* navigator = tmanager->GetNaviga    331   G4Navigator* navigator = tmanager->GetNavigatorForTracking();
358   navigator->SetPushVerbosity(mode);              332   navigator->SetPushVerbosity(mode);
359 }                                                 333 }
360                                                   334 
361 //                                                335 //
362 // Recursive Overlap Test                         336 // Recursive Overlap Test
363 //                                                337 //
364 void                                              338 void
365 G4GeometryMessenger::RecursiveOverlapTest()       339 G4GeometryMessenger::RecursiveOverlapTest()
366 {                                                 340 {
367   // Close geometry if necessary                  341   // Close geometry if necessary
368   //                                              342   //
369   CheckGeometry();                                343   CheckGeometry();
370                                                   344 
371   // Make test on single line supplied by user    345   // Make test on single line supplied by user recursively
372   //                                              346   //
373   if (checkParallelWorlds)                     << 347   tvolume->TestRecursiveOverlap( recLevel, recDepth );
374   {                                            << 
375     for(auto* tvolume: tvolumes)               << 
376     {                                          << 
377       tvolume->TestRecursiveOverlap( recLevel, << 
378     }                                          << 
379   }                                            << 
380   else                                         << 
381   {                                            << 
382     tvolumes.front()->TestRecursiveOverlap( re << 
383   }                                            << 
384 }                                                 348 }
385                                                   349