Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Functions
G4NavigationHistory.cc File Reference
#include "G4NavigationHistory.hh"
#include "G4ios.hh"

Go to the source code of this file.

Functions

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

Function Documentation

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

Definition at line 64 of file G4NavigationHistory.cc.

References G4cout, G4endl, G4NavigationHistory::GetDepth(), G4VPhysicalVolume::GetName(), G4NavigationHistory::GetReplicaNo(), G4NavigationHistory::GetVolume(), G4NavigationHistory::GetVolumeType(), kNormal, kParameterised, and kReplica.

65 {
66  G4cout << "History depth=" << nav.GetDepth() << G4endl;
67  for ( G4int i=0; i<=nav.GetDepth(); i++ )
68  {
69  os << "Level=["<<i<<"]: ";
70  if( nav.GetVolume(i) != 0 )
71  {
72  os << "Phys Name=["<< nav.GetVolume(i)->GetName()
73  << "] Type=[";
74  switch(nav.GetVolumeType(i))
75  {
76  case kNormal:
77  os << "N";
78  break;
79  case kReplica:
80  os << "R" << nav.GetReplicaNo(i);
81  break;
82  case kParameterised:
83  os << "P" << nav.GetReplicaNo(i);
84  break;
85  }
86  os << "]";
87  }
88  else
89  {
90  os << "Phys = <Null>";
91  }
92  os << G4endl;
93  }
94  return os;
95 }
G4int GetDepth() const
EVolume GetVolumeType(G4int n) const
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
const G4String & GetName() const
G4int GetReplicaNo(G4int n) const
#define G4endl
Definition: G4ios.hh:61
G4VPhysicalVolume * GetVolume(G4int n) const