20 _point = CLHEP::Hep3Vector(0.,0.,0.);
32 CLHEP::Hep3Vector ZAxis(0.,0.,1.);
33 CLHEP::HepRotation rmt = opto->
rmGlob();
55 CLHEP::Hep3Vector _ZAxis(0.,0.,1.);
74 CLHEP::Hep3Vector
dir = vec2 -
vec1;
89 CLHEP::Hep3Vector ZAxis(0.,0.,1.);
90 CLHEP::HepRotation rmt = opto.
rmGlob();
111 std::cerr <<
" !!!! INTERSECTION NOT POSSIBLE: LightRay is perpendicular to plane " << std::endl;
124 dtemp = (vtemp * plane.
normal()) / dtemp;
127 std::cerr <<
"!!! LightRay: Intersect With Plane: plane and light ray parallel: no intersection" << std::endl;
131 CLHEP::Hep3Vector inters = vtemp +
_point;
148 std::cout <<
" cosang = " << cosang << std::endl;
165 std::cout <<
"% LR REFRACT: " <<
"refra_ind1 = " << refra_ind1 <<
" refra_ind2 = " << refra_ind2 <<std::endl;
166 std::cout <<
"@ First intersect with plate plane " << std::endl;
174 if( Axis1.mag() < 1.E-6 ) {
176 std::cout <<
" light ray normal to plane, no refraction " << std::endl;
179 dumpData(
"LightRay after refraction: ");
188 Axis1 = Axis1.cross( plate.
normal() );
189 Axis1 *= 1./Axis1.mag();
202 ALIdouble sinangp = sinang * refra_ind1 / refra_ind2;
203 if( fabs(sinangp) > 1. ) {
204 std::cerr <<
" !!!EXITING LightRay::refract: incidence ray on plane too close to face, refraction will not allow entering " << std::endl;
207 std::cout <<
" refraction index first medium " << refra_ind1 <<
" refraction index second medium " << refra_ind2 << std::endl;
212 std::cout <<
"LightRay refract on plane 1: sin(ang) before = " << sinang
213 <<
" sinang after " << sinangp << std::endl;
219 signN /= fabs(signN);
221 sign1 /= fabs(sign1);
223 dumpData(
"LightRay refract: direction before plate");
224 std::cout <<
" sign projection on plate normal " << signN <<
" sign projection on Axis1 " << sign1 << std::endl;
230 dumpData(
"LightRay refract: direction after plate");
263 std::cout <<
" shift X " << shiftX <<
" shift Y " << shiftY << std::endl;
264 std::cout <<
" devi X " << deviX <<
" devi Y " << deviY << std::endl;
276 CLHEP::Hep3Vector XAxis(1.,0.,0.);
277 CLHEP::Hep3Vector YAxis(0.,1.,0.);
278 CLHEP::Hep3Vector ZAxis(0.,0.,1.);
279 CLHEP::HepRotation rmt = opto->
rmGlob();
291 CLHEP::Hep3Vector pointold =
_point;
310 std::cout <<
" deviX " << deviX << std::endl;
315 std::cout <<
" deviY " << deviY << std::endl;
320 std::cout <<
" deviZ " << deviZ << std::endl;
void shiftAndDeviateWhileTraversing(const OpticalObject *opto, char behav)
static void dumprm(const CLHEP::HepRotation &rm, const std::string &msg, std::ostream &out=std::cout)
void refract(const ALIPlane &plate, const ALIdouble refra_ind1, const ALIdouble refra_ind2)
const CLHEP::HepRotation & rmGlob() const
void setDirection(const CLHEP::Hep3Vector &direc)
void setPoint(const CLHEP::Hep3Vector &point)
std::vector< double > vec1
const ALIdouble findExtraEntryValue(const ALIstring &eename) const
const CLHEP::Hep3Vector & point() const
CLHEP::Hep3Vector _direction
static void dump3v(const CLHEP::Hep3Vector &vec, const std::string &msg)
void intersect(const ALIPlane &plane)
const CLHEP::Hep3Vector & centreGlob() const
void dumpData(const ALIstring &str) const
const ALIstring & name() const
void startLightRay(OpticalObject *opto)
void reflect(const ALIPlane &plane)
const CLHEP::Hep3Vector & normal() const
const CLHEP::Hep3Vector & direction() const
const ALIstring & type() const