Geant4 11.1.1
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4Navigator.cc File Reference
#include <iomanip>
#include "G4Navigator.hh"
#include "G4ios.hh"
#include "G4SystemOfUnits.hh"
#include "G4GeometryTolerance.hh"
#include "G4VPhysicalVolume.hh"
#include "G4VoxelSafety.hh"

Go to the source code of this file.

Functions

std::ostream & operator<< (std::ostream &os, const G4Navigator &n)
 

Function Documentation

◆ operator<<()

std::ostream & operator<< ( std::ostream &  os,
const G4Navigator n 
)

Definition at line 2130 of file G4Navigator.cc.

2131{
2132 // Old version did only the following:
2133 // os << "Current History: " << G4endl << n.fHistory;
2134 // Old behaviour is recovered for fVerbose = 0
2135
2136 // Adapted from G4Navigator::PrintState() const
2137
2138 G4long oldcoutPrec = os.precision(4);
2139 if( n.fVerbose >= 4 )
2140 {
2141 os << "The current state of G4Navigator is: " << G4endl;
2142 os << " ValidExitNormal= " << n.fValidExitNormal << G4endl
2143 << " ExitNormal = " << n.fExitNormal << G4endl
2144 << " Exiting = " << n.fExiting << G4endl
2145 << " Entering = " << n.fEntering << G4endl
2146 << " BlockedPhysicalVolume= " ;
2147 if (n.fBlockedPhysicalVolume==0)
2148 os << "None";
2149 else
2150 os << n.fBlockedPhysicalVolume->GetName();
2151 os << G4endl
2152 << " BlockedReplicaNo = " << n.fBlockedReplicaNo << G4endl
2153 << " LastStepWasZero = " << n.fLastStepWasZero << G4endl
2154 << G4endl;
2155 }
2156 if( ( 1 < n.fVerbose) && (n.fVerbose < 4) )
2157 {
2158 os << G4endl; // Make sure to line up
2159 os << std::setw(30) << " ExitNormal " << " "
2160 << std::setw( 5) << " Valid " << " "
2161 << std::setw( 9) << " Exiting " << " "
2162 << std::setw( 9) << " Entering" << " "
2163 << std::setw(15) << " Blocked:Volume " << " "
2164 << std::setw( 9) << " ReplicaNo" << " "
2165 << std::setw( 8) << " LastStepZero " << " "
2166 << G4endl;
2167 os << "( " << std::setw(7) << n.fExitNormal.x()
2168 << ", " << std::setw(7) << n.fExitNormal.y()
2169 << ", " << std::setw(7) << n.fExitNormal.z() << " ) "
2170 << std::setw( 5) << n.fValidExitNormal << " "
2171 << std::setw( 9) << n.fExiting << " "
2172 << std::setw( 9) << n.fEntering << " ";
2173 if ( n.fBlockedPhysicalVolume==0 )
2174 { os << std::setw(15) << "None"; }
2175 else
2176 { os << std::setw(15)<< n.fBlockedPhysicalVolume->GetName(); }
2177 os << std::setw( 9) << n.fBlockedReplicaNo << " "
2178 << std::setw( 8) << n.fLastStepWasZero << " "
2179 << G4endl;
2180 }
2181 if( n.fVerbose > 2 )
2182 {
2183 os.precision(8);
2184 os << " Current Localpoint = " << n.fLastLocatedPointLocal << G4endl;
2185 os << " PreviousSftOrigin = " << n.fPreviousSftOrigin << G4endl;
2186 os << " PreviousSafety = " << n.fPreviousSafety << G4endl;
2187 }
2188 if( n.fVerbose > 3 || n.fVerbose == 0 )
2189 {
2190 os << "Current History: " << G4endl << n.fHistory;
2191 }
2192
2193 os.precision(oldcoutPrec);
2194 return os;
2195}
long G4long
Definition: G4Types.hh:87
#define G4endl
Definition: G4ios.hh:57