Geant4-11
Functions
G4NavigationHistory.cc File Reference
#include "G4ios.hh"
#include "G4NavigationHistory.hh"

Go to the source code of this file.

Functions

G4Allocator< G4NavigationHistory > *& aNavigHistoryAllocator ()
 
std::ostream & operator<< (std::ostream &os, const G4NavigationHistory &nav)
 

Function Documentation

◆ aNavigHistoryAllocator()

G4Allocator< G4NavigationHistory > *& aNavigHistoryAllocator ( )

Definition at line 35 of file G4NavigationHistory.cc.

36{
38 return _instance;
39}
#define G4ThreadLocalStatic
Definition: tls.hh:76

References G4ThreadLocalStatic.

◆ operator<<()

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

Definition at line 68 of file G4NavigationHistory.cc.

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