19 _point = CLHEP::Hep3Vector(0., 0., 0.);
28 std::cout << std::endl <<
"LR: CREATE LIGHTRAY " << opto->
name() <<
" OptO type is " << opto->
type() << std::endl;
31 CLHEP::Hep3Vector ZAxis(0., 0., 1.);
32 const CLHEP::HepRotation& rmt = opto->
rmGlob();
50 std::cout << std::endl <<
"LR:CREATE LIGHTRAY FROM SOURCE" << opto2->
name() << std::endl;
52 CLHEP::Hep3Vector _ZAxis(0., 0., 1.);
82 std::cout <<
"% LR INTERSECT WITH OPTO" << std::endl;
83 CLHEP::Hep3Vector ZAxis(0., 0., 1.);
84 const CLHEP::HepRotation& rmt = opto.
rmGlob();
95 std::cout <<
"% LR INTERSECT WITH PLANE" << std::endl;
104 std::cerr <<
" !!!! INTERSECTION NOT POSSIBLE: LightRay is perpendicular to plane " << std::endl;
117 std::cout <<
" lightray* plate normal" << dtemp << std::endl;
119 dtemp = (vtemp * plane.
normal()) / dtemp;
121 std::cout <<
" n_r*plate normal" << dtemp << std::endl;
123 std::cerr <<
"!!! LightRay: Intersect With Plane: plane and light ray parallel: no intersection" << std::endl;
128 CLHEP::Hep3Vector inters = vtemp +
_point;
141 std::cout <<
"% LR: REFLECT IN PLANE " << std::endl;
144 std::cout <<
" cosang = " << cosang << std::endl;
149 dumpData(
"LightRay after reflection: ");
160 <<
"refra_ind1 = " << refra_ind1 <<
" refra_ind2 = " << refra_ind2 << std::endl;
161 std::cout <<
"@ First intersect with plate plane " << std::endl;
169 if (Axis1.mag() < 1.E-6) {
171 std::cout <<
" light ray normal to plane, no refraction " << std::endl;
174 dumpData(
"LightRay after refraction: ");
183 Axis1 = Axis1.cross(plate.
normal());
184 Axis1 *= 1. / Axis1.mag();
196 ALIdouble sinangp = sinang * refra_ind1 / refra_ind2;
198 std::cerr <<
" !!!EXITING LightRay::refract: incidence ray on plane too close to face, refraction will not allow " 203 std::cout <<
" refraction index first medium " << refra_ind1 <<
" refraction index second medium " << refra_ind2
209 std::cout <<
"LightRay refract on plane 1: sin(ang) before = " << sinang <<
" sinang after " << sinangp
220 dumpData(
"LightRay refract: direction before plate");
221 std::cout <<
" sign projection on plate normal " << signN <<
" sign projection on Axis1 " << sign1 << std::endl;
227 dumpData(
"LightRay refract: direction after plate");
257 std::cout <<
" shift X " << shiftX <<
" shift Y " << shiftY << std::endl;
258 std::cout <<
" devi X " << deviX <<
" devi Y " << deviY << std::endl;
273 CLHEP::Hep3Vector XAxis(1., 0., 0.);
274 CLHEP::Hep3Vector YAxis(0., 1., 0.);
275 CLHEP::Hep3Vector ZAxis(0., 0., 1.);
276 const CLHEP::HepRotation& rmt = opto->
rmGlob();
288 CLHEP::Hep3Vector pointold =
_point;
307 std::cout <<
" deviX " << deviX << std::endl;
312 std::cout <<
" deviY " << deviY << std::endl;
317 std::cout <<
" deviZ " << deviZ << std::endl;
const ALIdouble findExtraEntryValue(const ALIstring &eename) const
const CLHEP::Hep3Vector & centreGlob() const
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 ALIstring & name() const
void setDirection(const CLHEP::Hep3Vector &direc)
void setPoint(const CLHEP::Hep3Vector &point)
const CLHEP::Hep3Vector & direction() const
std::vector< double > vec1
void dumpData(const ALIstring &str) const
Abs< T >::type abs(const T &t)
CLHEP::Hep3Vector _direction
const CLHEP::HepRotation & rmGlob() const
static void dump3v(const CLHEP::Hep3Vector &vec, const std::string &msg)
void intersect(const ALIPlane &plane)
const CLHEP::Hep3Vector & point() const
void startLightRay(OpticalObject *opto)
void reflect(const ALIPlane &plane)
const ALIstring & type() const
const CLHEP::Hep3Vector & normal() const