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);
79 const G4double dy = (
m_Ymin - p.y()) / v.y();
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);
87 G4double distance = 0.;
89 LWSDBG(5, std::cout <<
"q=" << MSG_VECTOR(q)
90 <<
" outside fan cur distance="
91 << distance <<
", m_FHTplusT="
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) <<
", "
119 << inside(i) << std::endl;
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);
145 G4ThreeVector
A(p),
C,
diff;
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);
198 if(d1 * d1 - d2 * d2 > 0.)
A =
C;
Scalar mag() const
mag method
const PlainObject unit() const
This is a plugin that makes Eigen look like CLHEP & defines some convenience methods.
void diff(const Jet &rJet1, const Jet &rJet2, std::map< std::string, double > varDiff)
Difference between jets - Non-Class function required by trigger.
double DistanceToTheNeutralFibre(const CLHEP::Hep3Vector &p, int fan_number) const
Calculates aproximate, probably underestimate, distance to the neutral fibre of the vertical fan.
static const G4double s_IterationPrecision
static const unsigned int s_IterationsLimit
G4double DistanceToOut(const G4ThreeVector &, const G4ThreeVector &, const G4bool calcNorm=false, G4bool *validNorm=0, G4ThreeVector *n=0) const
const LArWheelCalculator * GetCalculator(void) const
static const G4double s_Tolerance
G4double m_FanHalfThickness
static const G4double s_IterationPrecision2
EInside Inside(const G4ThreeVector &) const
G4String TypeStr(void) const
G4double out_iteration_process(const G4ThreeVector &, G4ThreeVector &, const int) const
G4VSolid * m_BoundingShape
G4bool search_for_most_remoted_point(const G4ThreeVector &, const G4ThreeVector &, G4ThreeVector &, const int) const
hold the test vectors and ease the comparison