71 const G4double currentProposedStepLength,
79 G4int &blockedReplicaNo)
85 G4double ourStep=currentProposedStepLength, ourSafety;
87 G4int localNoDaughters, sampleNo;
88 G4bool motherValidExitNormal=
false;
93 motherSolid = motherLogical->
GetSolid();
98 ourSafety = motherSafety;
103 if ( fCheck && ( (localNoDaughters>0) || (ourStep < motherSafety) ) )
113 if ( exiting&&validExitNormal )
119 blockedExitedVol = (*pBlockedPhysical);
137 &motherValidExitNormal,
140 if( (motherStep >=
kInfinity) || (motherStep < 0.0) )
145 ourStep = motherStep = 0.0;
151 validExitNormal= motherValidExitNormal;
152 exitNormal= motherExitNormal;
154 *pBlockedPhysical= 0;
163 for ( sampleNo=localNoDaughters-1; sampleNo>=0; sampleNo--)
165 samplePhysical = motherLogical->
GetDaughter(sampleNo);
166 if ( samplePhysical!=blockedExitedVol )
171 const G4ThreeVector samplePoint = sampleTf.TransformPoint(localPoint);
177 if ( sampleSafety<ourSafety )
179 ourSafety=sampleSafety;
182 if ( sampleSafety<=ourStep )
184 sampleDirection = sampleTf.TransformAxis(localDirection);
192 sampleDirection, sampleStep);
195 if ( sampleStep<=ourStep )
197 ourStep = sampleStep;
200 *pBlockedPhysical = samplePhysical;
201 blockedReplicaNo = -1;
206 sampleDirection, localDirection, sampleSafety, sampleStep);
212 if( fCheck && (sampleStep <
kInfinity) && (sampleStep >= motherStep) )
217 samplePoint, sampleDirection,
219 localPoint, localDirection,
220 motherStep, sampleStep);
234 if ( currentProposedStepLength<ourSafety )
240 *pBlockedPhysical = 0;
247 if ( motherSafety<=ourStep )
254 &motherValidExitNormal,
261 motherStep, motherSafety);
262 if( motherValidExitNormal )
269 "From motherSolid::DistanceToOut" );
274 if( (motherStep >=
kInfinity) || (motherStep < 0.0) )
283 ourStep = motherStep = 0.0;
290 validExitNormal =
false;
291 *pBlockedPhysical= 0;
297 if ( motherStep<=ourStep )
299 ourStep = motherStep;
302 validExitNormal= motherValidExitNormal;
303 exitNormal= motherExitNormal;
305 if ( motherValidExitNormal )
316 "From RotationMatrix" );
323 validExitNormal =
false;
327 newSafety = ourSafety;
343 G4int localNoDaughters, sampleNo;
347 motherSolid = motherLogical->
GetSolid();
352 ourSafety = motherSafety;
364 for ( sampleNo=localNoDaughters-1; sampleNo>=0; sampleNo-- )
366 samplePhysical = motherLogical->
GetDaughter(sampleNo);
371 sampleTf.TransformPoint(localPoint);
376 if ( sampleSafety<ourSafety )
378 ourSafety = sampleSafety;
384 sampleSafety,
false,
false);
void SetVerboseLevel(G4int level)
void AlongComputeStepLog(const G4VSolid *sampleSolid, const G4ThreeVector &samplePoint, const G4ThreeVector &sampleDirection, const G4ThreeVector &localDirection, G4double sampleSafety, G4double sampleStep) const
G4VPhysicalVolume * GetTopVolume() const
void PrintDaughterLog(const G4VSolid *sampleSolid, const G4ThreeVector &samplePoint, G4double sampleSafety, G4bool onlySafety, const G4ThreeVector &sampleDirection, G4double sampleStep) const
static const G4double kInfinity
CLHEP::Hep3Vector G4ThreeVector
double dot(const Hep3Vector &) const
G4VSolid * GetSolid() const
G4VPhysicalVolume * GetDaughter(const G4int i) const
const G4RotationMatrix * GetRotation() const
HepRotation inverse() const
G4double ComputeSafety(const G4ThreeVector &globalpoint, const G4NavigationHistory &history, const G4double pMaxLength=DBL_MAX)
void ReportOutsideMother(const G4ThreeVector &localPoint, const G4ThreeVector &localDirection, const G4VPhysicalVolume *motherPV, G4double tDist=30.0 *CLHEP::cm) const
G4bool CheckAndReportBadNormal(const G4ThreeVector &unitNormal, const G4ThreeVector &localPoint, const G4ThreeVector &localDirection, G4double step, const G4VSolid *solid, const char *msg) const
virtual G4double DistanceToIn(const G4ThreeVector &p, const G4ThreeVector &v) const =0
static const double kMinExitingNormalCosine
G4int GetNoDaughters() const
const G4ThreeVector & GetTranslation() const
G4double ComputeStep(const G4ThreeVector &localPoint, const G4ThreeVector &localDirection, const G4double currentProposedStepLength, G4double &newSafety, G4NavigationHistory &history, G4bool &validExitNormal, G4ThreeVector &exitNormal, G4bool &exiting, G4bool &entering, G4VPhysicalVolume *(*pBlockedPhysical), G4int &blockedReplicaNo)
G4LogicalVolume * GetLogicalVolume() const
void ComputeSafetyLog(const G4VSolid *solid, const G4ThreeVector &point, G4double safety, G4bool isMotherVolume, G4int banner=-1) const
void PreComputeStepLog(const G4VPhysicalVolume *motherPhysical, G4double motherSafety, const G4ThreeVector &localPoint) const
G4int GetVerboseLevel() const
void PostComputeStepLog(const G4VSolid *motherSolid, const G4ThreeVector &localPoint, const G4ThreeVector &localDirection, G4double motherStep, G4double motherSafety) const
void CheckDaughterEntryPoint(const G4VSolid *sampleSolid, const G4ThreeVector &samplePoint, const G4ThreeVector &sampleDirection, const G4VSolid *motherSolid, const G4ThreeVector &localPoint, const G4ThreeVector &localDirection, G4double motherStep, G4double sampleStep) const
G4int GetVerboseLevel() const
virtual G4double DistanceToOut(const G4ThreeVector &p, const G4ThreeVector &v, const G4bool calcNorm=false, G4bool *validNorm=0, G4ThreeVector *n=0) const =0
void SetVerboseLevel(G4int level)