34 std::cout <<
"***** ALILine::intersect (constructor) two lines: " << std::endl
35 <<
" line1: " << *
this << std::endl
36 <<
" line2: " << l2 << std::endl;
38 CLHEP::Hep3Vector inters;
40 double acosvec =
vec().dot(l2.
vec()) /
vec().mag() / l2.
vec().mag();
44 std::cout <<
"\t Determination of acosvec = vec().dot(l2.vec()) / vec().mag() / l2.vec().mag() " 45 << std::endl << std::endl;
49 std::cout <<
"\t vec().mag() = " <<
vec().mag() << std::endl;
50 std::cout <<
"\t l2.vec().mag() = " << l2.
vec().mag() << std::endl << std::endl;
57 std::cerr <<
" !!!EXITING ALILine::intersect: two lines are parallel" 86 -
vec().y() *
pt().x() +
vec().x() *
pt().y() )
87 / (
vec().x() * l2.
vec().y() -
vec().y() * l2.
vec().x() );
92 std::cout << std::endl << std::endl <<
"*** START CALC OF FACT ***" << std::endl;
93 std::cout <<
" ==================" << std::endl << std::endl;
94 std::cout <<
"*** Determination of fact ->";
96 -
vec().y() *
pt().x() +
vec().x() *
pt().y() <<
"/";
123 fact = ( -1 *
vec().y() * l2.
pt().z() +
vec().z() * l2.
pt().y()
124 +
vec().y() *
pt().z() -
vec().z() *
pt().y() )
125 / ( -1*
vec().z() * l2.
vec().y() +
vec().y() * l2.
vec().z() );
129 old_fact_denominator2 = -1*
vec().z() * l2.
vec().y() +
vec().y() * l2.
vec().z();
136 if(
ALIUtils::debug >= 2 &&
std::abs(old_fact_denominator2) < 1.e-10)
std::cout <<
" ** Problem: old_fact_denominator2 -> " << old_fact_denominator2 << std::endl;
139 fact = ( -1*
vec().z() * l2.
pt().x() +
vec().x() * l2.
pt().z()
140 +
vec().z() *
pt().x() -
vec().x() *
pt().z() )
141 / ( -1*
vec().x() * l2.
vec().z() +
vec().z() * l2.
vec().x() );
157 l2.
pt().y() -
vec().y() *
pt().x() +
vec().x() *
pt().y() <<
" / " <<
vec().x() * l2.
vec().y()
158 -
vec().y()* l2.
vec().x() <<
" ) = " << fact << std::endl;
172 inters = l2.
pt() + fact * l2.
vec();
175 std::cout <<
"Determination of intersection = l2.pt() + fact * l2.vec()" << std::endl << std::endl;
177 std::cout <<
"\t --> fact = " << fact << std::endl;
178 std::cout <<
"\t --> l2.vec() = " << l2.
vec() << std::endl;
190 out <<
" ALILine point " << li.
_point << std::endl;
211 std::cerr <<
" !!!! INTERSECTION NOT POSSIBLE: LightRay is perpendicular to plane " << std::endl;
228 dtemp = (vtemp * plane.
normal()) / dtemp;
231 }
else std::cerr <<
"!!! LightRay: Intersect With Plane: plane and light ray parallel: no intersection" << std::endl;
237 CLHEP::Hep3Vector inters = vtemp +
_point;
CLHEP::Hep3Vector intersect(const ALILine &l2, bool notParallel=false)
friend std::ostream & operator<<(std::ostream &, const ALILine &li)
const CLHEP::Hep3Vector & pt() const
Abs< T >::type abs(const T &t)
const CLHEP::Hep3Vector & point() const
CLHEP::Hep3Vector _direction
static void dump3v(const CLHEP::Hep3Vector &vec, const std::string &msg)
const CLHEP::Hep3Vector & normal() const
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
const CLHEP::Hep3Vector & vec() const