Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4NavigationHistory Class Reference

G4NavigationHistory is a class responsible for the maintenance of the history of the path taken through the geometrical hierarchy. More...

#include <G4NavigationHistory.hh>

Public Member Functions

 G4NavigationHistory ()
 ~G4NavigationHistory ()
 G4NavigationHistory (const G4NavigationHistory &h)
G4NavigationHistoryoperator= (const G4NavigationHistory &h)
void Reset ()
void Clear ()
void SetFirstEntry (G4VPhysicalVolume *pVol)
const G4AffineTransformGetTopTransform () const
const G4AffineTransformGetPtrTopTransform () const
G4int GetTopReplicaNo () const
EVolume GetTopVolumeType () const
G4VPhysicalVolumeGetTopVolume () const
std::size_t GetDepth () const
std::size_t GetMaxDepth () const
const G4AffineTransformGetTransform (G4int n) const
G4int GetReplicaNo (G4int n) const
EVolume GetVolumeType (G4int n) const
G4VPhysicalVolumeGetVolume (G4int n) const
void NewLevel (G4VPhysicalVolume *pNewMother, EVolume vType=kNormal, G4int nReplica=-1)
void BackLevel ()
void BackLevel (G4int n)
void * operator new (std::size_t)
void operator delete (void *aHistory)

Friends

std::ostream & operator<< (std::ostream &os, const G4NavigationHistory &h)

Detailed Description

G4NavigationHistory is a class responsible for the maintenance of the history of the path taken through the geometrical hierarchy.

Definition at line 57 of file G4NavigationHistory.hh.

Constructor & Destructor Documentation

◆ G4NavigationHistory() [1/2]

G4NavigationHistory::G4NavigationHistory ( )

Constructor. Sizes history lists & resets histories.

Definition at line 40 of file G4NavigationHistory.cc.

41{
43 Clear();
44}
static G4NavigationHistoryPool * GetInstance()
std::vector< G4NavigationLevel > * GetLevels()

Referenced by G4NavigationHistory(), operator<<, and operator=().

◆ ~G4NavigationHistory()

G4NavigationHistory::~G4NavigationHistory ( )

Default Destructor.

Definition at line 61 of file G4NavigationHistory.cc.

62{
64}
void DeRegister(std::vector< G4NavigationLevel > *pLevels)

◆ G4NavigationHistory() [2/2]

G4NavigationHistory::G4NavigationHistory ( const G4NavigationHistory & h)

Copy contructor and assigment operator.

Definition at line 46 of file G4NavigationHistory.cc.

47{
49 if( GetMaxDepth() != h.GetMaxDepth() )
50 {
51 fNavHistory->resize( h.GetMaxDepth() );
52 }
53
54 for ( auto ilev=G4long(h.fStackDepth); ilev>=0; --ilev )
55 {
56 (*fNavHistory)[ilev] = (*h.fNavHistory)[ilev];
57 }
58 fStackDepth = h.fStackDepth;
59}
long G4long
Definition G4Types.hh:87
std::size_t GetMaxDepth() const

Member Function Documentation

◆ BackLevel() [1/2]

void G4NavigationHistory::BackLevel ( )
inline

Backs up one level in history: from mother to grandmother. It does not erase the history record of the current mother.

Referenced by G4ReplicaNavigation::BackLocate(), and G4ParameterisedNavigation::LevelLocate().

◆ BackLevel() [2/2]

void G4NavigationHistory::BackLevel ( G4int n)
inline

Backs up the specified number of levels in history.

Parameters
[in]nThe history level.

◆ Clear()

void G4NavigationHistory::Clear ( )
inline

Clears entries, zeroing transforms, matrices & negating replica history.

Referenced by G4NavigationHistory().

◆ GetDepth()

std::size_t G4NavigationHistory::GetDepth ( ) const
inline

◆ GetMaxDepth()

std::size_t G4NavigationHistory::GetMaxDepth ( ) const
inline

Returns the current maximum size of the history. The maximum depth is set to 16, meaning history entries [0..15] inclusive.

Referenced by G4NavigationHistory().

◆ GetPtrTopTransform()

const G4AffineTransform * G4NavigationHistory::GetPtrTopTransform ( ) const
inline

Returns a pointer to the topmost transformation.

◆ GetReplicaNo()

G4int G4NavigationHistory::GetReplicaNo ( G4int n) const
inline

Returns the specified replica number record.

Parameters
[in]nThe history level.

Referenced by G4ReplicaNavigation::BackLocate(), G4ReplicaNavigation::ComputeSafety(), G4ReplicaNavigation::ComputeStep(), and operator<<.

◆ GetTopReplicaNo()

G4int G4NavigationHistory::GetTopReplicaNo ( ) const
inline

Returns the topmost replica number record.

Referenced by G4ReplicaNavigation::ComputeSafety(), and G4ReplicaNavigation::ComputeStep().

◆ GetTopTransform()

◆ GetTopVolume()

◆ GetTopVolumeType()

EVolume G4NavigationHistory::GetTopVolumeType ( ) const
inline

Returns the topmost volume type.

◆ GetTransform()

const G4AffineTransform & G4NavigationHistory::GetTransform ( G4int n) const
inline

◆ GetVolume()

G4VPhysicalVolume * G4NavigationHistory::GetVolume ( G4int n) const
inline

Returns the specified physical volume pointer.

Parameters
[in]nThe history level.

Referenced by G4ReplicaNavigation::BackLocate(), G4ReplicaNavigation::ComputeSafety(), G4ReplicaNavigation::ComputeStep(), and operator<<.

◆ GetVolumeType()

EVolume G4NavigationHistory::GetVolumeType ( G4int n) const
inline

Returns the specified volume type.

Parameters
[in]nThe history level.

Referenced by G4ReplicaNavigation::BackLocate(), G4ReplicaNavigation::ComputeSafety(), G4ReplicaNavigation::ComputeStep(), and operator<<.

◆ NewLevel()

void G4NavigationHistory::NewLevel ( G4VPhysicalVolume * pNewMother,
EVolume vType = kNormal,
G4int nReplica = -1 )
inline

Changes the navigation level to that of the new mother.

Parameters
[in]pNewMotherPointer to the mother physical volume
[in]vTypeThe volume type.
[in]nReplicaThe replica number.

Referenced by G4ParameterisedNavigation::LevelLocate(), and G4RegularNavigation::LevelLocate().

◆ operator delete()

void G4NavigationHistory::operator delete ( void * aHistory)
inline

◆ operator new()

void * G4NavigationHistory::operator new ( std::size_t )
inline

New/delete override for "G4Allocator".

◆ operator=()

G4NavigationHistory & G4NavigationHistory::operator= ( const G4NavigationHistory & h)
inline

◆ Reset()

void G4NavigationHistory::Reset ( )
inline

Resets history. It does clear most entries. Level 0 is preserved.

◆ SetFirstEntry()

void G4NavigationHistory::SetFirstEntry ( G4VPhysicalVolume * pVol)
inline

Setups the initial entry in stack: copies through volume transform and rotarion matrix. The volume 'pVol' is assumed to be unrotated.

◆ operator<<

std::ostream & operator<< ( std::ostream & os,
const G4NavigationHistory & h )
friend

Streaming operator.

Definition at line 66 of file G4NavigationHistory.cc.

68{
69 os << "History depth=" << nav.GetDepth() << G4endl;
70 for ( G4int i=0; i<=(G4int)nav.GetDepth(); ++i )
71 {
72 os << "Level=["<<i<<"]: ";
73 if( nav.GetVolume(i) != nullptr )
74 {
75 os << "Phys Name=["<< nav.GetVolume(i)->GetName()
76 << "] Type=[";
77 switch(nav.GetVolumeType(i))
78 {
79 case kNormal:
80 os << "N";
81 break;
82 case kReplica:
83 os << "R" << nav.GetReplicaNo(i);
84 break;
85 case kParameterised:
86 os << "P" << nav.GetReplicaNo(i);
87 break;
88 case kExternal:
89 os << "E" << nav.GetReplicaNo(i);
90 break;
91 }
92 os << "]";
93 }
94 else
95 {
96 os << "Phys = <Null>";
97 }
98 os << G4endl;
99 }
100 return os;
101}
int G4int
Definition G4Types.hh:85
#define G4endl
Definition G4ios.hh:67
@ kNormal
Definition geomdefs.hh:84
@ kParameterised
Definition geomdefs.hh:86
@ kExternal
Definition geomdefs.hh:87
@ kReplica
Definition geomdefs.hh:85

The documentation for this class was generated from the following files: