Geant4 11.4.0
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"
#include "G4SafetyCalculator.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 2013 of file G4Navigator.cc.

2014{
2015 // Old version did only the following:
2016 // os << "Current History: " << G4endl << n.fHistory;
2017 // Old behaviour is recovered for fVerbose = 0
2018
2019 // Adapted from G4Navigator::PrintState() const
2020
2021 G4long oldcoutPrec = os.precision(4);
2022 if( n.fVerbose >= 4 )
2023 {
2024 os << "The current state of G4Navigator is: " << G4endl;
2025 os << " ValidExitNormal= " << n.fValidExitNormal << G4endl
2026 << " ExitNormal = " << n.fExitNormal << G4endl
2027 << " Exiting = " << n.fExiting << G4endl
2028 << " Entering = " << n.fEntering << G4endl
2029 << " BlockedPhysicalVolume= " ;
2030 if (n.fBlockedPhysicalVolume==nullptr)
2031 {
2032 os << "None";
2033 }
2034 else
2035 {
2036 os << n.fBlockedPhysicalVolume->GetName();
2037 }
2038 os << G4endl
2039 << " BlockedReplicaNo = " << n.fBlockedReplicaNo << G4endl
2040 << " LastStepWasZero = " << n.fLastStepWasZero << G4endl
2041 << G4endl;
2042 }
2043 if( ( 1 < n.fVerbose) && (n.fVerbose < 4) )
2044 {
2045 os << G4endl; // Make sure to line up
2046 os << std::setw(30) << " ExitNormal " << " "
2047 << std::setw( 5) << " Valid " << " "
2048 << std::setw( 9) << " Exiting " << " "
2049 << std::setw( 9) << " Entering" << " "
2050 << std::setw(15) << " Blocked:Volume " << " "
2051 << std::setw( 9) << " ReplicaNo" << " "
2052 << std::setw( 8) << " LastStepZero " << " "
2053 << G4endl;
2054 os << "( " << std::setw(7) << n.fExitNormal.x()
2055 << ", " << std::setw(7) << n.fExitNormal.y()
2056 << ", " << std::setw(7) << n.fExitNormal.z() << " ) "
2057 << std::setw( 5) << n.fValidExitNormal << " "
2058 << std::setw( 9) << n.fExiting << " "
2059 << std::setw( 9) << n.fEntering << " ";
2060 if ( n.fBlockedPhysicalVolume==nullptr )
2061 { os << std::setw(15) << "None"; }
2062 else
2063 { os << std::setw(15)<< n.fBlockedPhysicalVolume->GetName(); }
2064 os << std::setw( 9) << n.fBlockedReplicaNo << " "
2065 << std::setw( 8) << n.fLastStepWasZero << " "
2066 << G4endl;
2067 }
2068 if( n.fVerbose > 2 )
2069 {
2070 os.precision(8);
2071 os << " Current Localpoint = " << n.fLastLocatedPointLocal << G4endl;
2072 os << " PreviousSftOrigin = " << n.fPreviousSftOrigin << G4endl;
2073 os << " PreviousSafety = " << n.fPreviousSafety << G4endl;
2074 }
2075 if( n.fVerbose > 3 || n.fVerbose == 0 )
2076 {
2077 os << "Current History: " << G4endl << n.fHistory;
2078 }
2079
2080 os.precision(oldcoutPrec);
2081 return os;
2082}
long G4long
Definition G4Types.hh:87
#define G4endl
Definition G4ios.hh:67