12 LWSDBG(1, std::cout <<
TypeStr() <<
" DisToOut" << MSG_VECTOR(inputP) << std::endl);
14 LWSDBG(2, std::cout <<
"DistanceToOut(p):"
15 <<
" point " << MSG_VECTOR(inputP)
16 <<
" is not inside of the m_BoundingShape."
20 G4ThreeVector
p(inputP);
24 LWSDBG(2, std::cout <<
"already not inside " << MSG_VECTOR(
p) << std::endl);
28 LWSDBG(2, std::cout <<
"dto " <<
d <<
" " <<
d0 << std::endl);
34 const G4ThreeVector &inputV,
35 const G4bool calcNorm,
37 G4ThreeVector* sn)
const
39 LWSDBG(1, std::cout <<
TypeStr() <<
" DisToOut" << MSG_VECTOR(inputP)
40 << MSG_VECTOR(inputV) << std::endl);
43 if(inside_BS == kOutside){
44 LWSDBG(2, std::cout <<
"DistanceToOut(p):"
45 <<
" point " << MSG_VECTOR(inputP)
46 <<
" is outside of m_BoundingShape." << std::endl);
47 if(calcNorm) *validNorm =
false;
52 G4ThreeVector
p(inputP);
54 const G4double adtnf_p = fabs(
GetCalculator()->DistanceToTheNearestFan(
p, p_fan));
56 LWSDBG(2, std::cout <<
"DistanceToOut(p, v): point "
58 <<
" is outside of solid." << std::endl);
59 if(calcNorm) *validNorm =
false;
63 G4ThreeVector
v(inputV);
64 const G4double
phi0 =
p.phi() - inputP.phi();
68 LWSDBG(4, std::cout <<
"dto: " << MSG_VECTOR(
p) <<
" "
69 << MSG_VECTOR(
v) << std::endl);
74 inputP, inputV, calcNorm, validNorm, sn
78 LWSDBG(5, std::cout <<
"dto exit point too low " << MSG_VECTOR(
q) << std::endl);
80 q.setX(
p.x() +
v.x() *
dy);
82 q.setZ(
p.z() +
v.z() *
dy);
84 LWSDBG(5, std::cout <<
"dto exit point " << MSG_VECTOR(
q) << std::endl);
89 LWSDBG(5, std::cout <<
"q=" << MSG_VECTOR(
q)
90 <<
" outside fan cur distance="
103 LWSDBG(5, std::cout <<
"At end_dto distance=" <<
distance << std::endl);
104 if(calcNorm &&
distance < dto_bs) *validNorm =
false;
106 #ifdef DEBUG_LARWHEELSLICESOLID
108 std::cout <<
"DTO: " <<
distance <<
" ";
110 std::cout << *validNorm <<
" " << MSG_VECTOR((*sn));
112 std::cout <<
"Norm is not valid";
114 std::cout << std::endl;
116 G4ThreeVector
p2 = inputP + inputV *
distance;
118 std::cout <<
"DTO hit at " << MSG_VECTOR(
p2) <<
", "
122 #ifdef LWS_HARD_TEST_DTO
123 if(test_dto(inputP, inputV,
distance)){
125 std::cout <<
TypeStr() <<
" DisToOut" << MSG_VECTOR(inputP)
126 << MSG_VECTOR(inputV) << std::endl;
140 G4ThreeVector &
B,
const int p_fan)
const
142 LWSDBG(6, std::cout <<
"oip: " <<
p <<
" " <<
B);
146 unsigned int niter = 0;
161 LWSDBG(7, std::cout <<
" -> " <<
B <<
" " <<
diff.mag());
162 LWSDBG(6, std::cout << std::endl);
170 const G4ThreeVector &
a,
const G4ThreeVector &
b, G4ThreeVector &
C,
const int p_fan
173 LWSDBG(6, std::cout <<
"sfmrp " <<
a <<
" " <<
b << std::endl);
174 G4ThreeVector
diff(
b -
a);
182 unsigned int niter = 0;
190 LWSDBG(7, std::cout <<
"sfmrp -> " <<
C <<
" " << fabs(
d1)
191 <<
" " << (
C -
a).
unit() <<
" "
192 << (
C -
a).
mag() << std::endl);