Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4ParameterisedNavigation.cc
Go to the documentation of this file.
1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
10// * *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
17// * *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
25//
26// class G4ParameterisedNavigation Implementation
27//
28// Initial Author: P.Kent, 1996
29// Revisions:
30// J. Apostolakis 24 Nov 2005, Revised/fixed treatment of nested params
31// J. Apostolakis 4 Feb 2005, Reintroducting multi-level parameterisation
32// for materials only - see note 1 below
33// G. Cosmo 11 Mar 2004, Added Check mode
34// G. Cosmo 15 May 2002, Extended to 3-d voxelisation, made subclass
35// J. Apostolakis 5 Mar 1998, Enabled parameterisation of mat & solid type
36// --------------------------------------------------------------------
37
38// Note 1: Design/implementation note for extensions - JAp, March 1st, 2005
39// We cannot make the solid, dimensions and transformation dependent on
40// parent because the voxelisation will not have access to this.
41// So the following can NOT be done:
42// sampleSolid = curParam->ComputeSolid(num, curPhysical, pParentTouch);
43// sampleSolid->ComputeDimensions(curParam, num, curPhysical, pParentTouch);
44// curParam->ComputeTransformation(num, curPhysical, pParentTouch);
45
47#include "G4TouchableHistory.hh"
49
51
52#include <cassert>
53
54// ********************************************************************
55// Constructor
56// ********************************************************************
57//
59
60// ***************************************************************************
61// Destructor
62// ***************************************************************************
63//
65
66// ***************************************************************************
67// ComputeStep
68// ***************************************************************************
69//
71 ComputeStep(const G4ThreeVector& localPoint,
72 const G4ThreeVector& localDirection,
73 const G4double currentProposedStepLength,
74 G4double& newSafety,
75 G4NavigationHistory& history,
76 G4bool& validExitNormal,
77 G4ThreeVector& exitNormal,
78 G4bool& exiting,
79 G4bool& entering,
80 G4VPhysicalVolume *(*pBlockedPhysical),
81 G4int& blockedReplicaNo)
82{
83 G4VPhysicalVolume *motherPhysical, *samplePhysical;
84 G4VPVParameterisation *sampleParam;
85 G4LogicalVolume *motherLogical;
86 G4VSolid *motherSolid, *sampleSolid;
87 G4ThreeVector sampleDirection;
88 G4double ourStep=currentProposedStepLength, ourSafety;
89 G4double motherSafety, motherStep = DBL_MAX;
90 G4bool motherValidExitNormal = false;
91 G4ThreeVector motherExitNormal;
92
93 G4int sampleNo;
94
95 G4bool initialNode, noStep;
96 G4SmartVoxelNode *curVoxelNode;
97 G4long curNoVolumes, contentNo;
98 G4double voxelSafety;
99
100 // Replication data
101 //
102 EAxis axis;
103 G4int nReplicas;
104 G4double width, offset;
105 G4bool consuming;
106
107 motherPhysical = history.GetTopVolume();
108 motherLogical = motherPhysical->GetLogicalVolume();
109 motherSolid = motherLogical->GetSolid();
110
111 //
112 // Compute mother safety
113 //
114
115 motherSafety = motherSolid->DistanceToOut(localPoint);
116 ourSafety = motherSafety; // Working isotropic safety
117
118#ifdef G4VERBOSE
119 if ( fCheck )
120 {
121 if( motherSafety < 0.0 )
122 {
123 motherSolid->DumpInfo();
124 std::ostringstream message;
125 message << "Negative Safety In Voxel Navigation !" << G4endl
126 << " Current solid " << motherSolid->GetName()
127 << " gave negative safety: " << motherSafety << G4endl
128 << " for the current (local) point " << localPoint;
129 G4Exception("G4ParameterisedNavigation::ComputeStep()",
130 "GeomNav0003", FatalException, message);
131 }
132 if( motherSolid->Inside(localPoint) == kOutside )
133 {
134 std::ostringstream message;
135 message << "Point is outside Current Volume !" << G4endl
136 << " Point " << localPoint
137 << " is outside current volume " << motherPhysical->GetName()
138 << G4endl;
139 G4double estDistToSolid = motherSolid->DistanceToIn(localPoint);
140 G4cout << " Estimated isotropic distance to solid (distToIn)= "
141 << estDistToSolid;
142 if( estDistToSolid > 100.0 * motherSolid->GetTolerance() )
143 {
144 motherSolid->DumpInfo();
145 G4Exception("G4ParameterisedNavigation::ComputeStep()",
146 "GeomNav0003", FatalException, message,
147 "Point is far outside Current Volume !");
148 }
149 else
150 {
151 G4Exception("G4ParameterisedNavigation::ComputeStep()",
152 "GeomNav1002", JustWarning, message,
153 "Point is a little outside Current Volume.");
154 }
155 }
156
157 // Compute early:
158 // a) to check whether point is (wrongly) outside
159 // (signaled if step < 0 or step == kInfinity )
160 // b) to check value against answer of daughters!
161 //
162 motherStep = motherSolid->DistanceToOut(localPoint,
163 localDirection,
164 true,
165 &motherValidExitNormal,
166 &motherExitNormal);
167
168 if( (motherStep >= kInfinity) || (motherStep < 0.0) )
169 {
170 // Error - indication of being outside solid !!
171 //
172 fLogger->ReportOutsideMother(localPoint, localDirection, motherPhysical);
173
174 ourStep = motherStep = 0.0;
175 exiting = true;
176 entering = false;
177
178 // If we are outside the solid does the normal make sense?
179 validExitNormal = motherValidExitNormal;
180 exitNormal = motherExitNormal;
181
182 *pBlockedPhysical = nullptr; // or motherPhysical ?
183 blockedReplicaNo = 0; // or motherReplicaNumber ?
184
185 newSafety = 0.0;
186 return ourStep;
187 }
188 }
189#endif
190
191 initialNode = true;
192 noStep = true;
193
194 // By definition, the parameterised volume is the first
195 // (and only) daughter of the mother volume
196 //
197 samplePhysical = motherLogical->GetDaughter(0);
198 samplePhysical->GetReplicationData(axis,nReplicas,width,offset,consuming);
199 fBList.Enlarge(nReplicas);
200 fBList.Reset();
201
202 // Exiting normal optimisation
203 //
204 if (exiting && (*pBlockedPhysical==samplePhysical) && validExitNormal)
205 {
206 if (localDirection.dot(exitNormal)>=kMinExitingNormalCosine)
207 {
208 // Block exited daughter replica; Must be on boundary => zero safety
209 //
210 fBList.BlockVolume(blockedReplicaNo);
211 ourSafety = 0;
212 }
213 }
214 exiting = false;
215 entering = false;
216
217 sampleParam = samplePhysical->GetParameterisation();
218
219 // Loop over voxels & compute daughter safeties & intersections
220
221 do
222 {
223 curVoxelNode = fVoxelNode;
224 curNoVolumes = curVoxelNode->GetNoContained();
225
226 for ( contentNo=curNoVolumes-1; contentNo>=0; contentNo-- )
227 {
228 sampleNo = curVoxelNode->GetVolume((G4int)contentNo);
229 if ( !fBList.IsBlocked(sampleNo) )
230 {
231 fBList.BlockVolume(sampleNo);
232
233 // Call virtual methods, and copy information if needed
234 //
235 sampleSolid = IdentifyAndPlaceSolid( sampleNo, samplePhysical,
236 sampleParam );
237
238 G4AffineTransform sampleTf(samplePhysical->GetRotation(),
239 samplePhysical->GetTranslation());
240 sampleTf.Invert();
241 const G4ThreeVector samplePoint = sampleTf.TransformPoint(localPoint);
242 const G4double sampleSafety = sampleSolid->DistanceToIn(samplePoint);
243 if ( sampleSafety<ourSafety )
244 {
245 ourSafety = sampleSafety;
246 }
247 if ( sampleSafety<=ourStep )
248 {
249 sampleDirection = sampleTf.TransformAxis(localDirection);
250 G4double sampleStep =
251 sampleSolid->DistanceToIn(samplePoint, sampleDirection);
252 if ( sampleStep<=ourStep )
253 {
254 ourStep = sampleStep;
255 entering = true;
256 exiting = false;
257 *pBlockedPhysical = samplePhysical;
258 blockedReplicaNo = sampleNo;
259#ifdef G4VERBOSE
260 // Check to see that the resulting point is indeed in/on volume.
261 // This check could eventually be made only for successful
262 // candidate.
263
264 if ( ( fCheck ) && ( sampleStep < kInfinity ) )
265 {
266 G4ThreeVector intersectionPoint;
267 intersectionPoint = samplePoint + sampleStep * sampleDirection;
268 EInside insideIntPt = sampleSolid->Inside(intersectionPoint);
269 if( insideIntPt != kSurface )
270 {
271 G4long oldcoutPrec = G4cout.precision(16);
272 std::ostringstream message;
273 message << "Navigator gets conflicting response from Solid."
274 << G4endl
275 << " Inaccurate solid DistanceToIn"
276 << " for solid " << sampleSolid->GetName() << G4endl
277 << " Solid gave DistanceToIn = "
278 << sampleStep << " yet returns " ;
279 if( insideIntPt == kInside )
280 {
281 message << "-kInside-";
282 }
283 else if( insideIntPt == kOutside )
284 {
285 message << "-kOutside-";
286 }
287 else
288 {
289 message << "-kSurface-";
290 }
291 message << " for this point !" << G4endl
292 << " Point = " << intersectionPoint
293 << G4endl;
294 if ( insideIntPt != kInside )
295 {
296 message << " DistanceToIn(p) = "
297 << sampleSolid->DistanceToIn(intersectionPoint);
298 }
299 if ( insideIntPt != kOutside )
300 {
301 message << " DistanceToOut(p) = "
302 << sampleSolid->DistanceToOut(intersectionPoint);
303 }
304 G4Exception("G4ParameterisedNavigation::ComputeStep()",
305 "GeomNav1002", JustWarning, message);
306 G4cout.precision(oldcoutPrec);
307 }
308 }
309#endif
310 }
311 }
312 }
313 }
314
315 if ( initialNode )
316 {
317 initialNode = false;
318 voxelSafety = ComputeVoxelSafety(localPoint,axis);
319 if ( voxelSafety<ourSafety )
320 {
321 ourSafety = voxelSafety;
322 }
323 if ( currentProposedStepLength<ourSafety )
324 {
325 // Guaranteed physics limited
326 //
327 noStep = false;
328 entering = false;
329 exiting = false;
330 *pBlockedPhysical = nullptr;
331 ourStep = kInfinity;
332 }
333 else
334 {
335 // Consider intersection with mother solid
336 //
337 if ( motherSafety<=ourStep )
338 {
339 if ( !fCheck )
340 {
341 motherStep = motherSolid->DistanceToOut(localPoint,
342 localDirection,
343 true,
344 &motherValidExitNormal,
345 &motherExitNormal);
346 }
347
348 if( ( motherStep < 0.0 ) || ( motherStep >= kInfinity) )
349 {
350#ifdef G4VERBOSE
351 fLogger->ReportOutsideMother(localPoint, localDirection,
352 motherPhysical);
353#endif
354 ourStep = motherStep = 0.0;
355 // Rely on the code below to set the remaining state, i.e.
356 // exiting, entering, exitNormal & validExitNormal,
357 // pBlockedPhysical etc.
358 }
359#ifdef G4VERBOSE
360 if( motherValidExitNormal && ( fCheck || (motherStep<=ourStep)) )
361 {
362 fLogger->CheckAndReportBadNormal(motherExitNormal,
363 localPoint, localDirection,
364 motherStep, motherSolid,
365 "From motherSolid::DistanceToOut");
366 }
367#endif
368 if ( motherStep<=ourStep )
369 {
370 ourStep = motherStep;
371 exiting = true;
372 entering = false;
373 if ( validExitNormal )
374 {
375 const G4RotationMatrix* rot = motherPhysical->GetRotation();
376 if (rot != nullptr)
377 {
378 exitNormal *= rot->inverse();
379 }
380 }
381 }
382 else
383 {
384 validExitNormal = false;
385 }
386 }
387 }
388 newSafety = ourSafety;
389 }
390 if (noStep)
391 {
392 noStep = LocateNextVoxel(localPoint, localDirection, ourStep, axis);
393 }
394 } while (noStep);
395
396 return ourStep;
397}
398
399// ***************************************************************************
400// ComputeSafety
401// ***************************************************************************
402//
405 const G4NavigationHistory& history,
406 const G4double )
407{
408 G4VPhysicalVolume *motherPhysical, *samplePhysical;
409 G4VPVParameterisation *sampleParam;
410 G4LogicalVolume *motherLogical;
411 G4VSolid *motherSolid, *sampleSolid;
412 G4double motherSafety, ourSafety;
413 G4int sampleNo, curVoxelNodeNo;
414
415 G4SmartVoxelNode *curVoxelNode;
416 G4long curNoVolumes, contentNo;
417 G4double voxelSafety;
418
419 // Replication data
420 //
421 EAxis axis;
422 G4int nReplicas;
423 G4double width, offset;
424 G4bool consuming;
425
426 motherPhysical = history.GetTopVolume();
427 motherLogical = motherPhysical->GetLogicalVolume();
428 motherSolid = motherLogical->GetSolid();
429
430 //
431 // Compute mother safety
432 //
433
434 motherSafety = motherSolid->DistanceToOut(localPoint);
435 ourSafety = motherSafety; // Working isotropic safety
436
437 //
438 // Compute daughter safeties
439 //
440
441 // By definition, parameterised volumes exist as first
442 // daughter of the mother volume
443 //
444 samplePhysical = motherLogical->GetDaughter(0);
445 samplePhysical->GetReplicationData(axis, nReplicas,
446 width, offset, consuming);
447 sampleParam = samplePhysical->GetParameterisation();
448
449 // Look inside the current Voxel only at the current point
450 //
451 if ( axis==kUndefined ) // 3D case: current voxel node is retrieved
452 { // from G4VoxelNavigation.
453 curVoxelNode = fVoxelNode;
454 }
455 else // 1D case: current voxel node is computed here.
456 {
457 curVoxelNodeNo = G4int((localPoint(fVoxelAxis)
458 -fVoxelHeader->GetMinExtent()) / fVoxelSliceWidth );
459 curVoxelNode = fVoxelHeader->GetSlice(curVoxelNodeNo)->GetNode();
460 fVoxelNodeNo = curVoxelNodeNo;
461 fVoxelNode = curVoxelNode;
462 }
463 curNoVolumes = curVoxelNode->GetNoContained();
464
465 for ( contentNo=curNoVolumes-1; contentNo>=0; contentNo-- )
466 {
467 sampleNo = curVoxelNode->GetVolume((G4int)contentNo);
468
469 // Call virtual methods, and copy information if needed
470 //
471 sampleSolid= IdentifyAndPlaceSolid( sampleNo,samplePhysical,sampleParam );
472
473 G4AffineTransform sampleTf(samplePhysical->GetRotation(),
474 samplePhysical->GetTranslation());
475 sampleTf.Invert();
476 const G4ThreeVector samplePoint = sampleTf.TransformPoint(localPoint);
477 G4double sampleSafety = sampleSolid->DistanceToIn(samplePoint);
478 if ( sampleSafety<ourSafety )
479 {
480 ourSafety = sampleSafety;
481 }
482 }
483
484 voxelSafety = ComputeVoxelSafety(localPoint,axis);
485 if ( voxelSafety<ourSafety )
486 {
487 ourSafety=voxelSafety;
488 }
489
490 return ourSafety;
491}
492
493// ********************************************************************
494// ComputeVoxelSafety
495//
496// Computes safety from specified point to collected voxel boundaries
497// using already located point.
498// ********************************************************************
499//
500G4double G4ParameterisedNavigation::
501ComputeVoxelSafety(const G4ThreeVector& localPoint,
502 const EAxis pAxis) const
503{
504 // If no best axis is specified, adopt default
505 // strategy as for placements
506 //
507 if ( pAxis==kUndefined )
508 {
509 return G4VoxelNavigation::ComputeVoxelSafety(localPoint);
510 }
511
512 G4double voxelSafety, plusVoxelSafety, minusVoxelSafety;
513 G4double curNodeOffset, minCurCommonDelta, maxCurCommonDelta;
514 G4long minCurNodeNoDelta, maxCurNodeNoDelta;
515
516 // Compute linear intersection distance to boundaries of max/min
517 // to collected nodes at current level
518 //
519 curNodeOffset = fVoxelNodeNo*fVoxelSliceWidth;
520 minCurCommonDelta = localPoint(fVoxelAxis)
521 - fVoxelHeader->GetMinExtent()-curNodeOffset;
522 maxCurNodeNoDelta = fVoxelNode->GetMaxEquivalentSliceNo()-fVoxelNodeNo;
523 minCurNodeNoDelta = fVoxelNodeNo-fVoxelNode->GetMinEquivalentSliceNo();
524 maxCurCommonDelta = fVoxelSliceWidth-minCurCommonDelta;
525 plusVoxelSafety = minCurNodeNoDelta*fVoxelSliceWidth+minCurCommonDelta;
526 minusVoxelSafety = maxCurNodeNoDelta*fVoxelSliceWidth+maxCurCommonDelta;
527 voxelSafety = std::min(plusVoxelSafety,minusVoxelSafety);
528
529 if ( voxelSafety<0 )
530 {
531 voxelSafety = 0;
532 }
533
534 return voxelSafety;
535}
536
537// ********************************************************************
538// LocateNextVoxel
539//
540// Finds the next voxel from the current voxel and point
541// in the specified direction.
542//
543// Returns false if all voxels considered
544// true otherwise
545// [current Step ends inside same voxel or leaves all voxels]
546// ********************************************************************
547//
548G4bool G4ParameterisedNavigation::
549LocateNextVoxel( const G4ThreeVector& localPoint,
550 const G4ThreeVector& localDirection,
551 const G4double currentStep,
552 const EAxis pAxis)
553{
554 // If no best axis is specified, adopt default
555 // location strategy as for placements
556 //
557 if ( pAxis==kUndefined )
558 {
559 return G4VoxelNavigation::LocateNextVoxel(localPoint,
560 localDirection,
561 currentStep);
562 }
563
564 G4bool isNewVoxel;
565 G4int newNodeNo;
566 G4double minVal, maxVal, curMinExtent, curCoord;
567
568 curMinExtent = fVoxelHeader->GetMinExtent();
569 curCoord = localPoint(fVoxelAxis)+currentStep*localDirection(fVoxelAxis);
570 minVal = curMinExtent+fVoxelNode->GetMinEquivalentSliceNo()*fVoxelSliceWidth;
571 isNewVoxel = false;
572
573 if ( minVal<=curCoord )
574 {
575 maxVal = curMinExtent
576 + (fVoxelNode->GetMaxEquivalentSliceNo()+1)*fVoxelSliceWidth;
577 if ( maxVal<curCoord )
578 {
579 newNodeNo = fVoxelNode->GetMaxEquivalentSliceNo()+1;
580 if ( newNodeNo<G4int(fVoxelHeader->GetNoSlices()) )
581 {
582 fVoxelNodeNo = newNodeNo;
583 fVoxelNode = fVoxelHeader->GetSlice(newNodeNo)->GetNode();
584 isNewVoxel = true;
585 }
586 }
587 }
588 else
589 {
590 newNodeNo = fVoxelNode->GetMinEquivalentSliceNo()-1;
591
592 // Must locate from newNodeNo no and down to setup stack and fVoxelNode
593 // Repeat or earlier code...
594 //
595 if ( newNodeNo>=0 )
596 {
597 fVoxelNodeNo = newNodeNo;
598 fVoxelNode = fVoxelHeader->GetSlice(newNodeNo)->GetNode();
599 isNewVoxel = true;
600 }
601 }
602 return isNewVoxel;
603}
604
605// ********************************************************************
606// LevelLocate
607// ********************************************************************
608//
609G4bool
611 const G4VPhysicalVolume* blockedVol,
612 const G4int blockedNum,
613 const G4ThreeVector& globalPoint,
614 const G4ThreeVector* globalDirection,
615 const G4bool pLocatedOnEdge,
616 G4ThreeVector& localPoint )
617{
618 G4SmartVoxelHeader *motherVoxelHeader;
619 G4SmartVoxelNode *motherVoxelNode;
620 G4VPhysicalVolume *motherPhysical, *pPhysical;
621 G4VPVParameterisation *pParam;
622 G4LogicalVolume *motherLogical;
623 G4VSolid *pSolid;
624 G4ThreeVector samplePoint;
625 G4int voxelNoDaughters, replicaNo;
626
627 motherPhysical = history.GetTopVolume();
628 motherLogical = motherPhysical->GetLogicalVolume();
629 motherVoxelHeader = motherLogical->GetVoxelHeader();
630
631 // Find the voxel containing the point
632 //
633 motherVoxelNode = ParamVoxelLocate(motherVoxelHeader,localPoint);
634
635 voxelNoDaughters = (G4int)motherVoxelNode->GetNoContained();
636 if ( voxelNoDaughters==0 ) { return false; }
637
638 pPhysical = motherLogical->GetDaughter(0);
639 pParam = pPhysical->GetParameterisation();
640
641 // Save parent history in touchable history
642 // ... for use as parent t-h in ComputeMaterial method of param
643 //
644 G4TouchableHistory parentTouchable( history );
645
646 // Search replicated daughter volume
647 //
648 for ( auto sampleNo=voxelNoDaughters-1; sampleNo>=0; sampleNo-- )
649 {
650 replicaNo = motherVoxelNode->GetVolume(sampleNo);
651 if ( (replicaNo!=blockedNum) || (pPhysical!=blockedVol) )
652 {
653 // Obtain solid (as it can vary) and obtain its parameters
654 //
655 pSolid = IdentifyAndPlaceSolid( replicaNo, pPhysical, pParam );
656
657 // Setup history
658 //
659 history.NewLevel(pPhysical, kParameterised, replicaNo);
660 samplePoint = history.GetTopTransform().TransformPoint(globalPoint);
661 if ( !G4AuxiliaryNavServices::CheckPointOnSurface( pSolid, samplePoint,
662 globalDirection, history.GetTopTransform(), pLocatedOnEdge) )
663 {
664 history.BackLevel();
665 }
666 else
667 {
668 // Enter this daughter
669 //
670 localPoint = samplePoint;
671
672 // Set the correct copy number in physical
673 //
674 pPhysical->SetCopyNo(replicaNo);
675
676 // Set the correct solid and material in Logical Volume
677 //
678 G4LogicalVolume *pLogical = pPhysical->GetLogicalVolume();
679 pLogical->SetSolid(pSolid);
680 pLogical->UpdateMaterial(pParam->ComputeMaterial(replicaNo,
681 pPhysical, &parentTouchable) );
682 return true;
683 }
684 }
685 }
686 return false;
687}
688
690 const G4ThreeVector& localPoint )
691{
692 auto motherLogical = motherPhysical->GetLogicalVolume();
693
694 /* this should only be called on parameterized volumes, which always satisfy the conditions below */
695 assert(motherPhysical->GetRegularStructureId() != 1);
696 assert(motherLogical->GetNoDaughters() == 1);
697
698 if ( auto pVoxelHeader = motherLogical->GetVoxelHeader() )
699 ParamVoxelLocate( pVoxelHeader, localPoint );
700}
@ JustWarning
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
double G4double
Definition G4Types.hh:83
long G4long
Definition G4Types.hh:87
bool G4bool
Definition G4Types.hh:86
int G4int
Definition G4Types.hh:85
#define G4endl
Definition G4ios.hh:67
G4GLOB_DLL std::ostream G4cout
double dot(const Hep3Vector &) const
HepRotation inverse() const
G4AffineTransform & Invert()
G4ThreeVector TransformPoint(const G4ThreeVector &vec) const
G4ThreeVector TransformAxis(const G4ThreeVector &axis) const
static G4bool CheckPointOnSurface(const G4VSolid *sampleSolid, const G4ThreeVector &localPoint, const G4ThreeVector *globalDirection, const G4AffineTransform &sampleTransform, const G4bool locatedOnEdge)
void BlockVolume(const G4int v)
void Enlarge(const G4int nv)
G4bool IsBlocked(const G4int v) const
G4VSolid * GetSolid() const
G4VPhysicalVolume * GetDaughter(const std::size_t i) const
void SetSolid(G4VSolid *pSolid)
G4SmartVoxelHeader * GetVoxelHeader() const
void UpdateMaterial(G4Material *pMaterial)
void NewLevel(G4VPhysicalVolume *pNewMother, EVolume vType=kNormal, G4int nReplica=-1)
const G4AffineTransform & GetTopTransform() const
G4VPhysicalVolume * GetTopVolume() const
G4bool CheckAndReportBadNormal(const G4ThreeVector &unitNormal, const G4ThreeVector &localPoint, const G4ThreeVector &localDirection, G4double step, const G4VSolid *solid, const char *msg) const
void ReportOutsideMother(const G4ThreeVector &localPoint, const G4ThreeVector &localDirection, const G4VPhysicalVolume *motherPV, G4double tDist=30.0 *CLHEP::cm) const
G4SmartVoxelNode * ParamVoxelLocate(G4SmartVoxelHeader *pHead, const G4ThreeVector &localPoint)
G4double ComputeStep(const G4ThreeVector &globalPoint, const G4ThreeVector &globalDirection, const G4double currentProposedStepLength, G4double &newSafety, G4NavigationHistory &history, G4bool &validExitNormal, G4ThreeVector &exitNormal, G4bool &exiting, G4bool &entering, G4VPhysicalVolume *(*pBlockedPhysical), G4int &blockedReplicaNo) override
~G4ParameterisedNavigation() override
G4double ComputeSafety(const G4ThreeVector &localPoint, const G4NavigationHistory &history, const G4double pProposedMaxLength=DBL_MAX) override
void RelocateWithinVolume(G4VPhysicalVolume *motherPhysical, const G4ThreeVector &localPoint) override
G4bool LevelLocate(G4NavigationHistory &history, const G4VPhysicalVolume *blockedVol, const G4int blockedNum, const G4ThreeVector &globalPoint, const G4ThreeVector *globalDirection, const G4bool pLocatedOnEdge, G4ThreeVector &localPoint) override
std::size_t GetNoSlices() const
G4double GetMinExtent() const
G4SmartVoxelProxy * GetSlice(std::size_t n) const
G4int GetMaxEquivalentSliceNo() const
G4int GetVolume(G4int pVolumeNo) const
std::size_t GetNoContained() const
G4int GetMinEquivalentSliceNo() const
G4SmartVoxelNode * GetNode() const
virtual G4Material * ComputeMaterial(const G4int repNo, G4VPhysicalVolume *currentVol, const G4VTouchable *parentTouch=nullptr)
const G4RotationMatrix * GetRotation() const
virtual void SetCopyNo(G4int CopyNo)=0
const G4ThreeVector GetTranslation() const
G4LogicalVolume * GetLogicalVolume() const
virtual void GetReplicationData(EAxis &axis, G4int &nReplicas, G4double &width, G4double &offset, G4bool &consuming) const =0
const G4String & GetName() const
virtual G4int GetRegularStructureId() const =0
virtual G4VPVParameterisation * GetParameterisation() const =0
G4String GetName() const
G4double GetTolerance() const
virtual EInside Inside(const G4ThreeVector &p) const =0
virtual G4double DistanceToOut(const G4ThreeVector &p, const G4ThreeVector &v, const G4bool calcNorm=false, G4bool *validNorm=nullptr, G4ThreeVector *n=nullptr) const =0
void DumpInfo() const
virtual G4double DistanceToIn(const G4ThreeVector &p, const G4ThreeVector &v) const =0
G4NavigationLogger * fLogger
G4SmartVoxelNode * fVoxelNode
G4bool LocateNextVoxel(const G4ThreeVector &localPoint, const G4ThreeVector &localDirection, const G4double currentStep)
G4double ComputeVoxelSafety(const G4ThreeVector &localPoint) const
EAxis
Definition geomdefs.hh:54
@ kUndefined
Definition geomdefs.hh:61
EInside
Definition geomdefs.hh:67
@ kInside
Definition geomdefs.hh:70
@ kOutside
Definition geomdefs.hh:68
@ kSurface
Definition geomdefs.hh:69
@ kParameterised
Definition geomdefs.hh:86
#define DBL_MAX
Definition templates.hh:62