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