42 : fId(id), fVerbose(0)
56 G4String fType = fId +
"::ComputeStep()";
59 G4cout <<
"*************** " << fType <<
" *****************" <<
G4endl
61 << std::setw(15) <<
"Safety/mm" <<
" "
62 << std::setw(15) <<
"Distance/mm" <<
" "
63 << std::setw(52) <<
"Position (local coordinates)"
66 << std::setw(15) << motherSafety <<
" "
67 << std::setw(15) <<
"N/C" <<
" " << localPoint <<
" - "
71 if ( motherSafety < 0.0 )
73 std::ostringstream message;
74 message <<
"Negative Safety In Voxel Navigation !" <<
G4endl
75 <<
" Current solid " << motherSolid->
GetName()
76 <<
" gave negative safety: " << motherSafety <<
G4endl
77 <<
" for the current (local) point " << localPoint;
83 std::ostringstream message;
84 message <<
"Point is outside Current Volume - " <<
G4endl
85 <<
" Point " << localPoint
86 <<
" is outside current volume " << motherPhysical->
GetName()
89 message <<
" Estimated isotropic distance to solid (distToIn)= "
91 if( estDistToSolid > 100.0 * motherSolid->
GetTolerance() )
95 "Point is far outside Current Volume !" );
99 "Point is a little outside Current Volume.");
106 static G4int precVerf= 20;
108 G4cout <<
" - Information on mother / key daughters ..." <<
G4endl;
109 G4cout <<
" Type " << std::setw(12) <<
"Solid-Name" <<
" "
110 << std::setw(3*(6+precVerf)) <<
" local point" <<
" "
111 << std::setw(4+precVerf) <<
"solid-Safety" <<
" "
112 << std::setw(4+precVerf) <<
"solid-Step" <<
" "
113 << std::setw(17) <<
"distance Method "
114 << std::setw(3*(6+precVerf)) <<
" local direction" <<
" "
116 G4cout <<
" Mother " << std::setw(12) << motherSolid->
GetName() <<
" "
117 << std::setw(4+precVerf) << localPoint <<
" "
118 << std::setw(4+precVerf) << motherSafety <<
" "
120 G4cout.precision(oldprec);
135 if ( sampleStep < kInfinity )
138 intersectionPoint= samplePoint + sampleStep * sampleDirection;
140 G4String fType = fId +
"::ComputeStep()";
142 G4String solidResponse =
"-kInside-";
144 { solidResponse =
"-kOutside-"; }
146 { solidResponse =
"-kSurface-"; }
150 G4cout <<
" Invoked Inside() for solid: "
152 <<
". Solid replied: " << solidResponse <<
G4endl
153 <<
" For point p: " << intersectionPoint
154 <<
", considered as 'intersection' point." <<
G4endl;
157 G4double safetyIn= -1, safetyOut= -1;
158 G4double newDistIn= -1, newDistOut= -1;
174 std::ostringstream message;
175 message <<
"Conflicting response from Solid." <<
G4endl
176 <<
" Inaccurate solid DistanceToIn"
178 <<
" Solid gave DistanceToIn = "
179 << sampleStep <<
" yet returns " << solidResponse
180 <<
" for this point !" <<
G4endl
181 <<
" Point = " << intersectionPoint <<
G4endl
182 <<
" Safety values: " <<
G4endl;
185 message <<
" DistanceToIn(p) = " << safetyIn;
189 message <<
" DistanceToOut(p) = " << safetyOut;
192 G4cout.precision(oldcoutPrec);
199 if( std::max( newDistIn, newDistOut ) <=
202 std::ostringstream message;
203 message <<
"Zero from both Solid DistanceIn and Out(p,v)." <<
G4endl
204 <<
" Identified point for which the solid "
206 <<
" has MAJOR problem: " <<
G4endl
207 <<
" --> Both DistanceToIn(p,v) and DistanceToOut(p,v) "
208 <<
"return Zero, an equivalent value or negative value."
210 <<
" Solid: " << sampleSolid <<
G4endl
211 <<
" Point p= " << intersectionPoint <<
G4endl
212 <<
" Direction v= " << sampleDirection <<
G4endl
213 <<
" DistanceToIn(p,v) = " << newDistIn <<
G4endl
214 <<
" DistanceToOut(p,v,..) = " << newDistOut <<
G4endl
215 <<
" Safety values: " <<
G4endl
216 <<
" DistanceToIn(p) = " << safetyIn <<
G4endl
217 <<
" DistanceToOut(p) = " << safetyOut;
226 static G4int precVerf= 20;
229 << std::setw(12) << sampleSolid->
GetName() <<
" "
230 << std::setw(4+precVerf) << samplePoint <<
" "
231 << std::setw(4+precVerf) << sampleSafety <<
" "
232 << std::setw(4+precVerf) << sampleStep <<
" "
233 << std::setw(16) <<
"distanceToIn" <<
" "
234 << std::setw(4+precVerf) << localDirection <<
" "
236 G4cout.precision(oldprec);
251 << std::setw(15) << motherSafety <<
" "
252 << std::setw(15) << motherStep <<
" " << localPoint <<
" - "
256 if( ( motherStep < 0.0 ) || ( motherStep >= kInfinity) )
258 G4String fType = fId +
"::ComputeStep()";
261 std::ostringstream message;
262 message <<
"Current point is outside the current solid !" <<
G4endl
263 <<
" Problem in Navigation" <<
G4endl
264 <<
" Point (local coordinates): "
266 <<
" Local Direction: " << localDirection <<
G4endl
267 <<
" Solid: " << motherSolid->
GetName();
270 G4cout.precision(oldPrOut);
271 G4cerr.precision(oldPrErr);
275 static G4int precVerf= 20;
277 G4cout <<
" Mother " << std::setw(12) << motherSolid->
GetName() <<
" "
278 << std::setw(4+precVerf) << localPoint <<
" "
279 << std::setw(4+precVerf) << motherSafety <<
" "
280 << std::setw(4+precVerf) << motherStep <<
" "
281 << std::setw(16) <<
"distanceToOut" <<
" "
282 << std::setw(4+precVerf) << localDirection <<
" "
284 G4cout.precision(oldprec);
297 G4cout <<
"************** " << fId <<
"::ComputeSafety() ****************" <<
G4endl;
299 << std::setw(15) <<
"Safety/mm" <<
" "
300 << std::setw(52) <<
"Position (local coordinates)"
302 volumeType =
" Mother ";
305 << std::setw(15) << safety <<
" " << point <<
" - "
318 << std::setw(15) << sampleSafety <<
" ";
321 G4cout << std::setw(15) << sampleStep <<
" ";
325 G4cout << std::setw(15) <<
"N/C" <<
" ";
327 G4cout << samplePoint <<
" - "
G4DLLIMPORT std::ostream G4cerr
G4DLLIMPORT std::ostream G4cout
static G4GeometryTolerance * GetInstance()
G4VSolid * GetSolid() const
void PreComputeStepLog(const G4VPhysicalVolume *motherPhysical, G4double motherSafety, const G4ThreeVector &localPoint) const
G4NavigationLogger(const G4String &id)
void PostComputeStepLog(const G4VSolid *motherSolid, const G4ThreeVector &localPoint, const G4ThreeVector &localDirection, G4double motherStep, G4double motherSafety) const
void PrintDaughterLog(const G4VSolid *sampleSolid, const G4ThreeVector &samplePoint, G4double sampleSafety, G4double sampleStep) const
void ComputeSafetyLog(const G4VSolid *solid, const G4ThreeVector &point, G4double safety, G4bool banner) const
void AlongComputeStepLog(const G4VSolid *sampleSolid, const G4ThreeVector &samplePoint, const G4ThreeVector &sampleDirection, const G4ThreeVector &localDirection, G4double sampleSafety, G4double sampleStep) const
G4LogicalVolume * GetLogicalVolume() const
const G4String & GetName() const
G4double GetTolerance() const
virtual EInside Inside(const G4ThreeVector &p) const =0
virtual G4double DistanceToOut(const G4ThreeVector &p, const G4ThreeVector &v, const G4bool calcNorm=false, G4bool *validNorm=0, G4ThreeVector *n=0) const =0
virtual G4double DistanceToIn(const G4ThreeVector &p, const G4ThreeVector &v) const =0
virtual G4GeometryType GetEntityType() const =0
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)