Geant4 Cross Reference

Cross-Referencing   Geant4
Geant4/geometry/navigation/include/G4Navigator.icc

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/include/G4Navigator.icc (Version 11.3.0) and /geometry/navigation/include/G4Navigator.icc (Version 8.1.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 // G4Navigator class Inline implementation     << 
 27 //                                                 26 //
 28 // ------------------------------------------- <<  27 // $Id: G4Navigator.icc,v 1.10 2006/06/29 18:36:03 gunter Exp $
                                                   >>  28 // GEANT4 tag $Name: geant4-08-01-patch-01 $
                                                   >>  29 //
                                                   >>  30 // 
                                                   >>  31 // class G4Navigator Inline implementation
                                                   >>  32 //
                                                   >>  33 // ********************************************************************
 29                                                    34 
 30 // *******************************************     35 // ********************************************************************
 31 // GetCurrentLocalCoordinate                       36 // GetCurrentLocalCoordinate
 32 //                                                 37 //
 33 // Returns the local coordinate of the current     38 // Returns the local coordinate of the current track
 34 // *******************************************     39 // ********************************************************************
 35 //                                                 40 //
 36 inline                                             41 inline
 37 G4ThreeVector G4Navigator::GetCurrentLocalCoor     42 G4ThreeVector G4Navigator::GetCurrentLocalCoordinate() const
 38 {                                                  43 {
 39   return fLastLocatedPointLocal;                   44   return fLastLocatedPointLocal;
 40 }                                                  45 }
 41                                                    46 
 42 // *******************************************     47 // ********************************************************************
 43 // ComputeLocalAxis                                48 // ComputeLocalAxis
 44 //                                                 49 //
 45 // Returns local direction of vector direction     50 // Returns local direction of vector direction in world coord system
 46 // *******************************************     51 // ********************************************************************
 47 //                                                 52 //
 48 inline                                             53 inline
 49 G4ThreeVector G4Navigator::ComputeLocalAxis(co     54 G4ThreeVector G4Navigator::ComputeLocalAxis(const G4ThreeVector& pVec) const
 50 {                                                  55 {
 51   return fHistory.GetTopTransform().TransformA <<  56   return (fHistory.GetTopTransform().IsRotated())
                                                   >>  57          ? fHistory.GetTopTransform().TransformAxis(pVec) : pVec ;
 52 }                                                  58 }
 53                                                    59 
 54 // *******************************************     60 // ********************************************************************
 55 // ComputeLocalPoint                               61 // ComputeLocalPoint
 56 //                                                 62 //
 57 // Returns local coordinates of a point in the     63 // Returns local coordinates of a point in the world coord system
 58 // *******************************************     64 // ********************************************************************
 59 //                                                 65 //
 60 inline                                             66 inline
 61 G4ThreeVector                                      67 G4ThreeVector
 62 G4Navigator::ComputeLocalPoint(const G4ThreeVe     68 G4Navigator::ComputeLocalPoint(const G4ThreeVector& pGlobalPoint) const
 63 {                                                  69 {
 64   return fHistory.GetTopTransform().TransformP <<  70   return ( fHistory.GetTopTransform().TransformPoint(pGlobalPoint) ) ;
 65 }                                                  71 }
 66                                                    72 
 67 // *******************************************     73 // ********************************************************************
 68 // GetWorldVolume                                  74 // GetWorldVolume
 69 //                                                 75 //
 70 // Returns the current  world (`topmost') volu     76 // Returns the current  world (`topmost') volume
 71 // *******************************************     77 // ********************************************************************
 72 //                                                 78 //
 73 inline                                             79 inline
 74 G4VPhysicalVolume* G4Navigator::GetWorldVolume     80 G4VPhysicalVolume* G4Navigator::GetWorldVolume() const
 75 {                                                  81 {
 76   return fTopPhysical;                             82   return fTopPhysical;
 77 }                                                  83 }
 78                                                    84 
 79 // *******************************************     85 // ********************************************************************
 80 // SetWorldVolume                                  86 // SetWorldVolume
 81 //                                                 87 //
 82 // Sets the world (`topmost') volume               88 // Sets the world (`topmost') volume
 83 // *******************************************     89 // ********************************************************************
 84 //                                                 90 //
 85 inline                                             91 inline
 86 void G4Navigator::SetWorldVolume(G4VPhysicalVo     92 void G4Navigator::SetWorldVolume(G4VPhysicalVolume* pWorld)
 87 {                                                  93 {
 88   if ( !(pWorld->GetTranslation() == G4ThreeVe <<  94   if ( !(pWorld->GetTranslation()==G4ThreeVector(0,0,0)) )
 89   {                                                95   {
 90     G4Exception ("G4Navigator::SetWorldVolume( <<  96     G4Exception ("G4Navigator::SetWorldVolume()", "InvalidSetup",
 91                  FatalException, "Volume must      97                  FatalException, "Volume must be centered on the origin.");
 92   }                                                98   }
 93   const G4RotationMatrix* rm = pWorld->GetRota     99   const G4RotationMatrix* rm = pWorld->GetRotation();
 94   if ( (rm != nullptr) && (!rm->isIdentity())  << 100   if ( rm && (!rm->isIdentity()) )
 95   {                                               101   {
 96     G4Exception ("G4Navigator::SetWorldVolume( << 102     G4Exception ("G4Navigator::SetWorldVolume()", "InvalidSetup",
 97                  FatalException, "Volume must     103                  FatalException, "Volume must not be rotated.");
 98   }                                               104   }
 99   fTopPhysical = pWorld;                          105   fTopPhysical = pWorld;
100   fHistory.SetFirstEntry(pWorld);                 106   fHistory.SetFirstEntry(pWorld);
101 }                                                 107 }
102                                                   108 
103 // *******************************************    109 // ********************************************************************
104 // SetGeometrycallyLimitedStep                    110 // SetGeometrycallyLimitedStep
105 //                                                111 //
106 // Informs the navigator that the previous Ste    112 // Informs the navigator that the previous Step calculated
107 // by the geometry was taken in its entirety      113 // by the geometry was taken in its entirety
108 // *******************************************    114 // ********************************************************************
109 //                                                115 //
110 inline                                            116 inline
111 void G4Navigator::SetGeometricallyLimitedStep(    117 void G4Navigator::SetGeometricallyLimitedStep()
112 {                                                 118 {
113   fWasLimitedByGeometry = true;                << 119   fWasLimitedByGeometry=true;
114 }                                                 120 }
115                                                   121 
116 // *******************************************    122 // ********************************************************************
117 // ResetStackAndState                             123 // ResetStackAndState
118 //                                                124 //
119 // Resets stack and minimum of navigator state    125 // Resets stack and minimum of navigator state `machine'
120 // *******************************************    126 // ********************************************************************
121 //                                                127 //
122 inline                                            128 inline
123 void G4Navigator::ResetStackAndState()            129 void G4Navigator::ResetStackAndState()
124 {                                                 130 {
125   fHistory.Reset();                               131   fHistory.Reset();
126   ResetState();                                   132   ResetState();
127 }                                                 133 }
128                                                   134 
129 // *******************************************    135 // ********************************************************************
130 // VolumeType                                     136 // VolumeType
131 // *******************************************    137 // ********************************************************************
132 //                                                138 //
133 inline                                            139 inline
134 EVolume G4Navigator::VolumeType(const G4VPhysi    140 EVolume G4Navigator::VolumeType(const G4VPhysicalVolume *pVol) const
135 {                                                 141 {
136   return pVol->VolumeType();                   << 142   EVolume type;
                                                   >> 143   EAxis axis;
                                                   >> 144   G4int nReplicas;
                                                   >> 145   G4double width,offset;
                                                   >> 146   G4bool consuming;
                                                   >> 147   if ( pVol->IsReplicated() )
                                                   >> 148   {
                                                   >> 149     pVol->GetReplicationData(axis,nReplicas,width,offset,consuming);
                                                   >> 150     type = (consuming) ? kReplica : kParameterised;
                                                   >> 151   }
                                                   >> 152   else
                                                   >> 153   {
                                                   >> 154     type = kNormal;
                                                   >> 155   }
                                                   >> 156   return type;
137 }                                                 157 }
138                                                   158 
139 // *******************************************    159 // ********************************************************************
140 // CharacteriseDaughters                       << 160 // CharacteriseDahghters
141 // *******************************************    161 // ********************************************************************
142 //                                                162 //
143 inline                                            163 inline
144 EVolume G4Navigator::CharacteriseDaughters(con    164 EVolume G4Navigator::CharacteriseDaughters(const G4LogicalVolume *pLog) const
145 {                                                 165 {
146   return pLog->CharacteriseDaughters();        << 166   EVolume type;
147 }                                              << 167   EAxis axis;
148                                                << 168   G4int nReplicas;
149 // ******************************************* << 169   G4double width,offset;
150 // GetDaughtersRegularStructureId              << 170   G4bool consuming;
151 // ******************************************* << 
152 //                                             << 
153 inline                                         << 
154 G4int G4Navigator::                            << 
155 GetDaughtersRegularStructureId(const G4Logical << 
156 {                                              << 
157   G4int regId = 0;                             << 
158   G4VPhysicalVolume *pVol;                        171   G4VPhysicalVolume *pVol;
159                                                   172 
160   if ( pLog->GetNoDaughters() == 1 )           << 173   if ( pLog->GetNoDaughters()==1 )
161   {                                               174   {
162     pVol = pLog->GetDaughter(0);                  175     pVol = pLog->GetDaughter(0);
163     regId = pVol->GetRegularStructureId();     << 176     if (pVol->IsReplicated())
                                                   >> 177     {
                                                   >> 178       pVol->GetReplicationData(axis,nReplicas,width,offset,consuming);
                                                   >> 179       type = (consuming) ? kReplica : kParameterised;
                                                   >> 180     }
                                                   >> 181     else
                                                   >> 182     {
                                                   >> 183       type = kNormal;
                                                   >> 184     }
                                                   >> 185   }
                                                   >> 186   else
                                                   >> 187   {
                                                   >> 188     type = kNormal;
164   }                                               189   }
165   return regId;                                << 190   return type;
166 }                                                 191 }
167                                                   192 
168 // *******************************************    193 // ********************************************************************
169 // GetGlobalToLocalTransform                      194 // GetGlobalToLocalTransform
170 //                                                195 //
171 // Returns local to global transformation.        196 // Returns local to global transformation.
172 // I.e. transformation that will take point or    197 // I.e. transformation that will take point or axis in world coord system
173 // and return one in the local coord system       198 // and return one in the local coord system
174 // *******************************************    199 // ********************************************************************
175 //                                                200 //
176 inline                                            201 inline
177 const G4AffineTransform& G4Navigator::GetGloba    202 const G4AffineTransform& G4Navigator::GetGlobalToLocalTransform() const
178 {                                                 203 {
179   return fHistory.GetTopTransform();              204   return fHistory.GetTopTransform();
180 }                                                 205 }
181                                                   206 
182 // *******************************************    207 // ********************************************************************
183 // GetLocalToGlobalTransform                      208 // GetLocalToGlobalTransform
184 //                                                209 //
185 // Returns global to local transformation         210 // Returns global to local transformation 
186 // *******************************************    211 // ********************************************************************
187 //                                                212 //
188 inline                                            213 inline
189 const G4AffineTransform G4Navigator::GetLocalT    214 const G4AffineTransform G4Navigator::GetLocalToGlobalTransform() const
190 {                                                 215 {
191   return fHistory.GetTopTransform().Inverse(); << 216   G4AffineTransform  tempTransform;
                                                   >> 217   tempTransform = fHistory.GetTopTransform().Inverse(); 
                                                   >> 218   return tempTransform;
192 }                                                 219 }
193                                                   220 
194 // *******************************************    221 // ********************************************************************
195 // NetTranslation                                 222 // NetTranslation
196 //                                                223 //
197 // Computes+returns the local->global translat    224 // Computes+returns the local->global translation of current volume
198 // *******************************************    225 // ********************************************************************
199 //                                                226 //
200 inline                                            227 inline
201 G4ThreeVector G4Navigator::NetTranslation() co    228 G4ThreeVector G4Navigator::NetTranslation() const
202 {                                                 229 {
203   return fHistory.GetTopTransform().InverseNet << 230   G4AffineTransform tf(fHistory.GetTopTransform().Inverse());
                                                   >> 231   return tf.NetTranslation();
204 }                                                 232 }
205                                                   233 
206 // *******************************************    234 // ********************************************************************
207 // NetRotation                                    235 // NetRotation
208 //                                                236 //
209 // Computes+returns the local->global rotation    237 // Computes+returns the local->global rotation of current volume
210 // *******************************************    238 // ********************************************************************
211 //                                                239 //
212 inline                                            240 inline
213 G4RotationMatrix G4Navigator::NetRotation() co    241 G4RotationMatrix G4Navigator::NetRotation() const
214 {                                                 242 {
215   return fHistory.GetTopTransform().InverseNet << 243   G4AffineTransform tf(fHistory.GetTopTransform().Inverse());
                                                   >> 244   return tf.NetRotation();
216 }                                                 245 }
217                                                   246 
218 // *******************************************    247 // ********************************************************************
219 // CreateTouchableHistory                      << 248 // CreateGRSVolume
220 //                                                249 //
221 // `Touchable' creation method: caller has del    250 // `Touchable' creation method: caller has deletion responsibility
222 // *******************************************    251 // ********************************************************************
223 //                                                252 //
224 inline                                            253 inline
225 G4TouchableHistory* G4Navigator::CreateTouchab << 254 G4GRSVolume* G4Navigator::CreateGRSVolume() const
226 {                                                 255 {
227   return new G4TouchableHistory(fHistory);     << 256   G4AffineTransform tf(fHistory.GetTopTransform().Inverse());
                                                   >> 257   return new G4GRSVolume(fHistory.GetTopVolume(),
                                                   >> 258                          tf.NetRotation(),
                                                   >> 259                          tf.NetTranslation());
228 }                                                 260 }
229                                                   261 
230 // *******************************************    262 // ********************************************************************
231 // CreateTouchableHistory(history)             << 263 // CreateGRSSolid
232 //                                                264 //
233 // `Touchable' creation method: caller has del    265 // `Touchable' creation method: caller has deletion responsibility
234 // *******************************************    266 // ********************************************************************
235 //                                                267 //
236 inline                                            268 inline
237 G4TouchableHistory*                            << 269 G4GRSSolid* G4Navigator::CreateGRSSolid() const
238 G4Navigator::CreateTouchableHistory(const G4Na << 
239 {                                                 270 {
240   return new G4TouchableHistory(*history);     << 271   G4AffineTransform tf(fHistory.GetTopTransform().Inverse());
                                                   >> 272   return new G4GRSSolid(fHistory.GetTopVolume()->GetLogicalVolume()->GetSolid(),
                                                   >> 273                         tf.NetRotation(),
                                                   >> 274                         tf.NetTranslation());
241 }                                                 275 }
242                                                   276 
243 // *******************************************    277 // ********************************************************************
244 // LocateGlobalPointAndUpdateTouchableHandle   << 278 // CreateTouchableHistory
                                                   >> 279 //
                                                   >> 280 // `Touchable' creation method: caller has deletion responsibility
245 // *******************************************    281 // ********************************************************************
246 //                                                282 //
247 inline                                            283 inline
248 void G4Navigator::LocateGlobalPointAndUpdateTo << 284 G4TouchableHistory* G4Navigator::CreateTouchableHistory() const
249                                const G4ThreeVe << 
250                                const G4ThreeVe << 
251                                      G4Touchab << 
252                                const G4bool    << 
253 {                                                 285 {
254   G4VPhysicalVolume* pPhysVol;                 << 286   return new G4TouchableHistory(fHistory);
255   pPhysVol = LocateGlobalPointAndSetup( positi << 287 }
256   if( fEnteredDaughter || fExitedMother )      << 288 
257   {                                            << 289 // ********************************************************************
258      oldTouchableToUpdate = CreateTouchableHis << 290 // EnteredDaughterVolume
259      if( pPhysVol == nullptr )                 << 291 //
260      {                                         << 292 // To inform the caller if the track is entering a daughter volume
261        // We want to ensure that the touchable << 293 // ********************************************************************
262        // The method below should do this and  << 294 //
263        //                                      << 295 inline
264        oldTouchableToUpdate->UpdateYourself( p << 296 G4bool  G4Navigator::EnteredDaughterVolume()
265      }                                         << 297 {
266   }                                            << 298   return fEnteredDaughter;
267   return;                                      << 
268 }                                                 299 }
269                                                   300 
270 // *******************************************    301 // ********************************************************************
271 // LocateGlobalPointAndUpdateTouchable            302 // LocateGlobalPointAndUpdateTouchable
272 //                                                303 //
273 // Use direction                                  304 // Use direction
274 // *******************************************    305 // ********************************************************************
275 //                                                306 //
276 inline                                            307 inline
277 void G4Navigator::LocateGlobalPointAndUpdateTo    308 void G4Navigator::LocateGlobalPointAndUpdateTouchable(
278                            const G4ThreeVector    309                            const G4ThreeVector&       position,
279                            const G4ThreeVector    310                            const G4ThreeVector&       direction,
280                                  G4VTouchable*    311                                  G4VTouchable*        touchableToUpdate,
281                            const G4bool           312                            const G4bool               RelativeSearch  )
282 {                                                 313 {
283   G4VPhysicalVolume* pPhysVol;                    314   G4VPhysicalVolume* pPhysVol;
284   pPhysVol = LocateGlobalPointAndSetup( positi    315   pPhysVol = LocateGlobalPointAndSetup( position, &direction, RelativeSearch);  
285   touchableToUpdate->UpdateYourself( pPhysVol,    316   touchableToUpdate->UpdateYourself( pPhysVol, &fHistory );
286 }                                                 317 }
287                                                   318 
288 // *******************************************    319 // ********************************************************************
289 // LocateGlobalPointAndUpdateTouchable            320 // LocateGlobalPointAndUpdateTouchable
290 // *******************************************    321 // ********************************************************************
291 //                                                322 //
292 inline                                            323 inline
293 void G4Navigator::LocateGlobalPointAndUpdateTo    324 void G4Navigator::LocateGlobalPointAndUpdateTouchable(
294                            const G4ThreeVector    325                            const G4ThreeVector&       position,
295                                  G4VTouchable*    326                                  G4VTouchable*        touchableToUpdate,
296                            const G4bool           327                            const G4bool               RelativeSearch )
297 {                                                 328 {
298   G4VPhysicalVolume* pPhysVol;                    329   G4VPhysicalVolume* pPhysVol;
299   pPhysVol = LocateGlobalPointAndSetup( positi << 330   pPhysVol = LocateGlobalPointAndSetup( position, 0, RelativeSearch);  
300   touchableToUpdate->UpdateYourself( pPhysVol,    331   touchableToUpdate->UpdateYourself( pPhysVol, &fHistory );
301 }                                                 332 }
302                                                   333 
303 // *******************************************    334 // ********************************************************************
304 // GetVerboseLevel                                335 // GetVerboseLevel
305 // *******************************************    336 // ********************************************************************
306 //                                                337 //
307 inline                                            338 inline
308 G4int G4Navigator::GetVerboseLevel() const        339 G4int G4Navigator::GetVerboseLevel() const
309 {                                                 340 {
310   return fVerbose;                                341   return fVerbose;
311 }                                                 342 }
312                                                   343 
313 // *******************************************    344 // ********************************************************************
314 // SetVerboseLevel                                345 // SetVerboseLevel
315 // *******************************************    346 // ********************************************************************
316 //                                                347 //
317 inline                                            348 inline
318 void G4Navigator::SetVerboseLevel(G4int level) << 349 void  G4Navigator::SetVerboseLevel(G4int level)
319 {                                                 350 {
320   fVerbose = level;                               351   fVerbose = level;
321   fnormalNav.SetVerboseLevel(level);              352   fnormalNav.SetVerboseLevel(level);
322   GetVoxelNavigator().SetVerboseLevel(level);  << 353   fvoxelNav.SetVerboseLevel(level);
323   fparamNav.SetVerboseLevel(level);               354   fparamNav.SetVerboseLevel(level);
324   freplicaNav.SetVerboseLevel(level);             355   freplicaNav.SetVerboseLevel(level);
325   fregularNav.SetVerboseLevel(level);          << 
326   if (fpExternalNav != nullptr) { fpExternalNa << 
327 }                                                 356 }
328                                                   357 
329 // *******************************************    358 // ********************************************************************
330 // IsActive                                       359 // IsActive
331 // *******************************************    360 // ********************************************************************
332 //                                                361 //
333 inline                                            362 inline
334 G4bool G4Navigator::IsActive() const              363 G4bool G4Navigator::IsActive() const
335 {                                                 364 {
336   return fActive;                                 365   return fActive;
337 }                                                 366 }
338                                                   367 
339 // *******************************************    368 // ********************************************************************
340 // Activate                                       369 // Activate
341 // *******************************************    370 // ********************************************************************
342 //                                                371 //
343 inline                                            372 inline
344 void G4Navigator::Activate(G4bool flag)        << 373 void  G4Navigator::Activate(G4bool flag)
345 {                                                 374 {
346   fActive = flag;                                 375   fActive = flag;
347 }                                                 376 }
348                                                   377 
349 // *******************************************    378 // ********************************************************************
350 // EnteredDaughterVolume                       << 
351 //                                             << 
352 // To inform the caller if the track is enteri << 
353 // ******************************************* << 
354 //                                             << 
355 inline                                         << 
356 G4bool G4Navigator::EnteredDaughterVolume() co << 
357 {                                              << 
358   return fEnteredDaughter;                     << 
359 }                                              << 
360                                                << 
361 // ******************************************* << 
362 // ExitedMotherVolume                          << 
363 // ******************************************* << 
364 //                                             << 
365 inline                                         << 
366 G4bool G4Navigator::ExitedMotherVolume() const << 
367 {                                              << 
368   return fExitedMother;                        << 
369 }                                              << 
370                                                << 
371 // ******************************************* << 
372 // CheckMode                                      379 // CheckMode
373 // *******************************************    380 // ********************************************************************
374 //                                                381 //
375 inline                                            382 inline
376 void  G4Navigator::CheckMode(G4bool mode)         383 void  G4Navigator::CheckMode(G4bool mode)
377 {                                                 384 {
378   fCheck = mode;                                  385   fCheck = mode;
379   fnormalNav.CheckMode(mode);                     386   fnormalNav.CheckMode(mode);
380   GetVoxelNavigator().CheckMode(mode);         << 387   fvoxelNav.CheckMode(mode);
381   fparamNav.CheckMode(mode);                      388   fparamNav.CheckMode(mode);
382   freplicaNav.CheckMode(mode);                    389   freplicaNav.CheckMode(mode);
383   fregularNav.CheckMode(mode);                 << 
384   if (fpExternalNav != nullptr) { fpExternalNa << 
385 }                                              << 
386                                                << 
387 // ******************************************* << 
388 // IsCheckModeActive                           << 
389 // ******************************************* << 
390 //                                             << 
391 inline                                         << 
392 G4bool G4Navigator::IsCheckModeActive() const  << 
393 {                                              << 
394   return fCheck;                               << 
395 }                                              << 
396                                                << 
397 // ******************************************* << 
398 // SetPushVerbosity                            << 
399 // ******************************************* << 
400 //                                             << 
401 inline                                         << 
402 void G4Navigator::SetPushVerbosity(G4bool mode << 
403 {                                              << 
404   fWarnPush = mode;                            << 
405 }                                                 390 }
406                                                   391 
407 // *******************************************    392 // ********************************************************************
408 // SeverityOfZeroStepping                         393 // SeverityOfZeroStepping
409 //                                                394 //
410 // Reports on severity of error in case Naviga    395 // Reports on severity of error in case Navigator is stuck
411 // and is returning zero steps                    396 // and is returning zero steps
412 // *******************************************    397 // ********************************************************************
413 //                                                398 //
414 inline                                            399 inline 
415 G4int G4Navigator::SeverityOfZeroStepping( G4i    400 G4int G4Navigator::SeverityOfZeroStepping( G4int* noZeroSteps ) const 
416 {                                                 401 {
417   G4int severity = 0, noZeros = fNumberZeroSte << 402   G4int severity=0, noZeros= fNumberZeroSteps;
418   if( noZeroSteps != nullptr )                 << 403   if( noZeroSteps) *noZeroSteps = fNumberZeroSteps;
419   {                                            << 404 
420     *noZeroSteps = fNumberZeroSteps;           << 
421   }                                            << 
422   if( noZeros >= fAbandonThreshold_NoZeroSteps    405   if( noZeros >= fAbandonThreshold_NoZeroSteps )
423   {                                               406   {
424     severity = 10;                                407     severity = 10;
425   }                                               408   }
426   if( noZeros > 0 && noZeros < fActionThreshol    409   if( noZeros > 0 && noZeros < fActionThreshold_NoZeroSteps )
427   {                                               410   {
428     severity =  5 * noZeros / fActionThreshold    411     severity =  5 * noZeros / fActionThreshold_NoZeroSteps;
429   }                                               412   }
430   else if( noZeros == fActionThreshold_NoZeroS    413   else if( noZeros == fActionThreshold_NoZeroSteps )
431   {                                               414   {
432     severity =  5;                                415     severity =  5; 
433   }                                               416   }
434   else if( noZeros >= fAbandonThreshold_NoZero    417   else if( noZeros >= fAbandonThreshold_NoZeroSteps - 2 )
435   {                                               418   {
436     severity =  9;                                419     severity =  9; 
437   }                                               420   }
438   else if( noZeros < fAbandonThreshold_NoZeroS    421   else if( noZeros < fAbandonThreshold_NoZeroSteps - 2 )
439   {                                               422   {
440     severity =  5 + 4 * (noZeros-fAbandonThres    423     severity =  5 + 4 * (noZeros-fAbandonThreshold_NoZeroSteps)
441                       / fActionThreshold_NoZer    424                       / fActionThreshold_NoZeroSteps;
442   }                                               425   }
443   return severity;                                426   return severity;
444 }                                              << 
445                                                << 
446 // ******************************************* << 
447 // GetVoxelNavigator                           << 
448 // ******************************************* << 
449 //                                             << 
450 inline                                         << 
451 G4VoxelNavigation& G4Navigator::GetVoxelNaviga << 
452 {                                              << 
453   return *fpvoxelNav;                          << 
454 }                                              << 
455                                                << 
456 // ******************************************* << 
457 // EnableBestSafety                            << 
458 // ******************************************* << 
459 //                                             << 
460 inline void G4Navigator::EnableBestSafety( G4b << 
461 {                                              << 
462   GetVoxelNavigator().EnableBestSafety( value  << 
463 }                                              << 
464                                                << 
465 // ******************************************* << 
466 // SetExternalNavigation                       << 
467 // ******************************************* << 
468 //                                             << 
469 inline                                         << 
470 G4VExternalNavigation* G4Navigator::GetExterna << 
471 {                                              << 
472   return fpExternalNav;                        << 
473 }                                              << 
474                                                << 
475 // ******************************************* << 
476 // Clone                                       << 
477 // ******************************************* << 
478 //                                             << 
479 inline                                         << 
480 G4Navigator* G4Navigator::Clone() const        << 
481 {                                              << 
482   auto  clone_nav = new G4Navigator();         << 
483   clone_nav->SetWorldVolume(fTopPhysical);     << 
484   if( fpExternalNav != nullptr )               << 
485   {                                            << 
486     clone_nav->SetExternalNavigation(fpExterna << 
487   }                                            << 
488   return clone_nav;                            << 
489 }                                                 427 }
490                                                   428