13 std::cout <<
"LArFanSections at " <<
this << std::endl
14 <<
"Amin = " <<
Amin <<
", Amax = " <<
Amax
16 <<
"Bmin = " <<
Bmin <<
", Bmax = " <<
Bmax << std::endl
17 <<
"xmin = " <<
xmin <<
", xmax = " <<
xmax
18 <<
"Cflat2 = " <<
Cflat2 << std::endl;
22 G4double ri1, G4double ri2, G4double ro1, G4double ro2,
23 G4double Xmax, G4double z1, G4double z2
25 : Amin ((ri2 - ri1) / (z2 - z1)),
26 Amax ((ro2 - ro1) / (z2 - z1)),
27 Bmin (ri1 - Amin * z1),
28 Bmax (ro1 - Amax * z1),
42 G4double &
t1, G4double
A, G4double
B, G4double
C, G4bool
out
48 const G4double D =
B*
B -
A*
C;
49 LWSDBG(8, std::cout <<
"check D=" << D <<
" out=" <<
out << std::endl);
50 if(D < 0.)
return false;
54 LWSDBG(8, std::cout <<
"Case A=B=0" << std::endl);
58 LWSDBG(8, std::cout <<
"t1=" <<
t1 <<
" - only one solution" << std::endl);
61 const G4double D1 = sqrt(D);
62 const G4double inv_A = 1.0 /
A;
63 t1 = (-
B + D1) * inv_A;
64 t2 = (-
B - D1) * inv_A;
65 LWSDBG(8, std::cout <<
"t1=" <<
t1 <<
" t2=" <<
t2 << std::endl);
104 const G4ThreeVector &
p,
const G4ThreeVector &
v,
105 G4ThreeVector &
q)
const
107 LWSDBG(7, std::cout <<
"fcl" << std::endl);
109 const G4double
B =
p.x()*
v.x() +
p.y()*
v.y()
116 LWSDBG(8, std::cout <<
"fcl out_dist(p)=" << out_dist <<
" Tolerance=" <<
s_Tolerance << std::endl);
117 const G4bool
out = out_dist >= 0.0;
119 const G4double zz1 =
p.z() +
v.z() *
t1;
121 LWSDBG(8, std::cout <<
"fcl out on Z " << zz1 << std::endl);
124 const G4double xx1 =
p.x() +
v.x() *
t1;
126 LWSDBG(8, std::cout <<
"fcl out on X " << xx1 << std::endl);
137 const G4double xx2 =
p.x() +
v.x() *
t1 * 0.5;
138 const G4double yy2 =
p.y() +
v.y() *
t1 * 0.5;
139 const G4double dev = fabs(sqrt(xx2 *xx2 + yy2*yy2)
143 LWSDBG(8, std::cout <<
"fcl on the surface" << std::endl);
146 LWSDBG(8, std::cout <<
"fcl out = in" << std::endl);
152 q.setY(
p.y() +
v.y() *
t1);
154 LWSDBG(8, std::cout <<
"fcl got " <<
t1 << std::endl);
157 LWSDBG(8, std::cout <<
"fcl no intersection" << std::endl);
166 const G4ThreeVector &
p,
const G4ThreeVector &
v,
167 G4ThreeVector &
q)
const
169 LWSDBG(7, std::cout <<
"fcu" << std::endl);
170 G4double
A =
v.perp2();
171 G4double
B =
p.x()*
v.x() +
p.y()*
v.y();
172 G4double
C =
p.perp2();
175 const G4double &Af =
A, &Bf =
B;
179 if(
check_D(b1, Af, Bf, Cf, Cf >= 0.)){
180 const G4double zz1 =
p.z() +
v.z() * b1;
182 const G4double xx1 =
p.x() +
v.x() * b1;
185 q.setY(
p.y() +
v.y() * b1);
190 LWSDBG(8, std::cout <<
"fcu no cyl intersection" << std::endl);
200 const G4double zz1 =
p.z() +
v.z() *
t1;
201 LWSDBG(8, std::cout <<
"fcu z = " << zz1 <<
", lim: (" <<
m_Zsect.front() <<
", " <<
m_Zmid <<
")" << std::endl);
203 const G4double xx1 =
p.x() +
v.x() *
t1;
204 LWSDBG(8, std::cout <<
"fcu x = " << xx1 <<
", lim: (" <<
m_fs->
xmin <<
", " <<
m_fs->
xmax <<
")" << std::endl);
207 q.setY(
p.y() +
v.y() *
t1);
211 LWSDBG(8, std::cout <<
"fcu no cone intersection" << std::endl);
217 const G4ThreeVector &
p,
const G4ThreeVector &
v,
218 G4ThreeVector &
q)
const
220 LWSDBG(6, std::cout <<
"in fep p" << MSG_VECTOR(
p)<<
", v"<< MSG_VECTOR(
v) <<
", q" << MSG_VECTOR(
q) << std::endl);
228 LWSDBG(6, std::cout <<
"after fs_cross_lower q" << MSG_VECTOR(
q) << std::endl);
230 LWSDBG(6, std::cout <<
"after fs_cross_upper q" << MSG_VECTOR(
q) << std::endl);
243 }
else if(
v.z() < 0.){
254 LWSDBG(7, std::cout <<
"fep side " <<
d <<
" " <<
result <<
" q" << MSG_VECTOR(
q) << std::endl);
256 LWSDBG(7, std::cout <<
"fep out_distlower(q)=" << out_distlower <<
" Tolerance=" <<
s_Tolerance << std::endl);
257 if (out_distlower >= 0.0) {
270 LWSDBG(7, std::cout <<
"fep out_distupper(q)=" << out_distupper <<
" Tolerance=" <<
s_Tolerance << std::endl);
271 if (out_distupper <= 0.0) {
277 assert((
q -
p).
mag() < kInfinity);