74{
79 G4double ourStep=currentProposedStepLength, motherSafety, ourSafety;
80 G4int localNoDaughters, sampleNo;
81
84 motherSolid = motherLogical->
GetSolid();
85
86
87
89 ourSafety = motherSafety;
90
91#ifdef G4VERBOSE
92 if ( fCheck )
93 {
95 }
96#endif
97
98
99
100
101
102
103
104 if ( exiting&&validExitNormal )
105 {
106 if ( localDirection.
dot(exitNormal)>=kMinExitingNormalCosine )
107 {
108
109
110 blockedExitedVol =* pBlockedPhysical;
111 ourSafety = 0;
112 }
113 }
114 exiting = false;
115 entering = false;
116
118 for ( sampleNo=localNoDaughters-1; sampleNo>=0; sampleNo--)
119 {
120 samplePhysical = motherLogical->
GetDaughter(sampleNo);
121 if ( samplePhysical!=blockedExitedVol )
122 {
125 sampleTf.Invert();
127 sampleTf.TransformPoint(localPoint);
132#ifdef G4VERBOSE
133 if( fCheck )
134 {
136 }
137#endif
138 if ( sampleSafety<ourSafety )
139 {
140 ourSafety=sampleSafety;
141 }
142 if ( sampleSafety<=ourStep )
143 {
144 sampleDirection = sampleTf.TransformAxis(localDirection);
147
148#ifdef G4VERBOSE
149 if( fCheck )
150 {
152 sampleSafety, sampleStep);
153 }
154#endif
155 if ( sampleStep<=ourStep )
156 {
157 ourStep = sampleStep;
158 entering = true;
159 exiting = false;
160 *pBlockedPhysical = samplePhysical;
161 blockedReplicaNo = -1;
162#ifdef G4VERBOSE
163 if( fCheck )
164 {
166 sampleDirection, localDirection, sampleSafety, sampleStep);
167 }
168#endif
169 }
170 }
171 }
172 }
173 if ( currentProposedStepLength<ourSafety )
174 {
175
176
177 entering = false;
178 exiting = false;
179 *pBlockedPhysical = 0;
180 ourStep = kInfinity;
181 }
182 else
183 {
184
185
186 if ( motherSafety<=ourStep )
187 {
189 localDirection,
190 true,
191 &validExitNormal,
192 &exitNormal);
193#ifdef G4VERBOSE
194 if ( fCheck )
195 {
197 motherStep, motherSafety);
198 }
199#endif
200
201 if ( motherStep<=ourStep )
202 {
203 ourStep = motherStep;
204 exiting = true;
205 entering = false;
206 if ( validExitNormal )
207 {
209 if (rot)
210 {
212 }
213 }
214 }
215 else
216 {
217 validExitNormal = false;
218 }
219 }
220 }
221 newSafety = ourSafety;
222 return ourStep;
223}
double dot(const Hep3Vector &) const
HepRotation inverse() const
void PreComputeStepLog(const G4VPhysicalVolume *motherPhysical, G4double motherSafety, const G4ThreeVector &localPoint) const
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 AlongComputeStepLog(const G4VSolid *sampleSolid, const G4ThreeVector &samplePoint, const G4ThreeVector &sampleDirection, const G4ThreeVector &localDirection, G4double sampleSafety, G4double sampleStep) const