33 std::cout <<
"***** ALILine::intersect (constructor) two lines: " << std::endl
34 <<
" line1: " << *
this << std::endl
35 <<
" line2: " << l2 << std::endl;
37 CLHEP::Hep3Vector inters;
39 double acosvec =
vec().dot(l2.
vec()) /
vec().mag() / l2.
vec().mag();
43 std::cout <<
"\t Determination of acosvec = vec().dot(l2.vec()) / vec().mag() / l2.vec().mag() "
44 << std::endl << std::endl;
48 std::cout <<
"\t vec().mag() = " <<
vec().mag() << std::endl;
49 std::cout <<
"\t l2.vec().mag() = " << l2.
vec().mag() << std::endl << std::endl;
54 if( 1 - fabs(acosvec) < 1E-8 ) {
56 std::cerr <<
" !!!EXITING ALILine::intersect: two lines are parallel"
85 -
vec().y() *
pt().x() +
vec().x() *
pt().y() )
86 / (
vec().x() * l2.
vec().y() -
vec().y() * l2.
vec().x() );
91 std::cout << std::endl << std::endl <<
"*** START CALC OF FACT ***" << std::endl;
92 std::cout <<
" ==================" << std::endl << std::endl;
93 std::cout <<
"*** Determination of fact ->";
95 -
vec().y() *
pt().x() +
vec().x() *
pt().y() <<
"/";
107 if(fabs(fact) > 1e8 || fabs(old_fact_denominator) < 1.
e-10)
114 if(
ALIUtils::debug >= 2 && fabs(old_fact_denominator) < 1.
e-10)
std::cout <<
" ** Problem: old_fact_denominator -> " << old_fact_denominator << std::endl;
122 fact = ( -1 *
vec().y() * l2.
pt().z() +
vec().z() * l2.
pt().y()
123 +
vec().y() *
pt().z() -
vec().z() *
pt().y() )
124 / ( -1*
vec().z() * l2.
vec().y() +
vec().y() * l2.
vec().z() );
128 old_fact_denominator2 = -1*
vec().z() * l2.
vec().y() +
vec().y() * l2.
vec().z();
131 if(fabs(-1*
vec().
z() * l2.
vec().y() +
vec().y() * l2.
vec().z())< 1.
e-10)
135 if(
ALIUtils::debug >= 2 && fabs(old_fact_denominator2) < 1.e-10)
std::cout <<
" ** Problem: old_fact_denominator2 -> " << old_fact_denominator2 << std::endl;
138 fact = ( -1*
vec().z() * l2.
pt().x() +
vec().x() * l2.
pt().z()
139 +
vec().z() *
pt().x() -
vec().x() *
pt().z() )
140 / ( -1*
vec().x() * l2.
vec().z() +
vec().z() * l2.
vec().x() );
156 l2.
pt().y() -
vec().y() *
pt().x() +
vec().x() *
pt().y() <<
" / " <<
vec().x() * l2.
vec().y()
157 -
vec().y()* l2.
vec().x() <<
" ) = " << fact << std::endl;
171 inters = l2.
pt() + fact * l2.
vec();
174 std::cout <<
"Determination of intersection = l2.pt() + fact * l2.vec()" << std::endl << std::endl;
176 std::cout <<
"\t --> fact = " << fact << std::endl;
177 std::cout <<
"\t --> l2.vec() = " << l2.
vec() << std::endl;
189 out <<
" ALILine point " << li.
_point << std::endl;
210 std::cerr <<
" !!!! INTERSECTION NOT POSSIBLE: LightRay is perpendicular to plane " << std::endl;
227 dtemp = (vtemp * plane.
normal()) / dtemp;
230 }
else std::cerr <<
"!!! LightRay: Intersect With Plane: plane and light ray parallel: no intersection" << std::endl;
236 CLHEP::Hep3Vector inters = vtemp +
_point;
std::ostream & operator<<(std::ostream &out, const ALILine &li)
const CLHEP::Hep3Vector & pt() const
const CLHEP::Hep3Vector & point() const
CLHEP::Hep3Vector _direction
static void dump3v(const CLHEP::Hep3Vector &vec, const std::string &msg)
CLHEP::Hep3Vector intersect(const ALILine &l2, bool notParallel=0)
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