52 if(posx12 == 0. ) posx12 = -0.045;
54 CLHEP::HepRotation rmt =
rmGlob();
64 CLHEP::Hep3Vector line_dowel21 = (dowel1-dowel2 );
65 CLHEP::Hep3Vector ZAxis(0.,0,1.);
67 CLHEP::Hep3Vector line_dowel21_perp = ZAxis.cross( line_dowel21 );
76 if( CCDlength == 0. ) CCDlength = 2048*14 * 1.E-6;
85 <<
"******************" << std::endl << std::endl;
89 if(!eexists) posY = CCDlength + 0.004;
91 CLHEP::Hep3Vector posxy( posX, posY, 0);
98 ALILine upCCD( dowel2 + posxy, line_dowel21 );
102 <<
"********************" << std::endl << std::endl ;
105 if(!eexists) posY = 0.002;
106 posxy = CLHEP::Hep3Vector( posX, posY, 0);
113 ALILine downCCD( dowel2 + posxy, line_dowel21 );
119 <<
"********************" << std::endl << std::endl;
122 if(!eexists) posX = -CCDlength - 0.002;
124 posxy = CLHEP::Hep3Vector( posX, posY, 0);
131 ALILine leftCCD( dowel2 + posxy, -line_dowel21_perp );
136 <<
"*********************" << std::endl<< std::endl ;
139 if(!eexists) posX = - 0.004;
141 posxy = CLHEP::Hep3Vector( posX, posY, 0);
148 ALILine rightCCD( dowel2 + posxy, -line_dowel21_perp );
152 std::cout <<
" %%% Positions of CCDs in global RF: " << std::endl<< std::endl;
153 std::cout <<
" upCCD: " << upCCD << std::endl;
154 std::cout <<
" downCCD: " << downCCD << std::endl;
155 std::cout <<
" leftCCD: " << leftCCD << std::endl;
156 std::cout <<
" rightCCD: " << rightCCD << std::endl << std::endl;
163 CLHEP::Hep3Vector inters = lightray.
point();
169 if (
ALIUtils::debug >= 5)
std::cout <<
"1. Get the OptO x-hair laser from the measurement list of OptOs" << std::endl;
174 CLHEP::Hep3Vector YAxis_xhair(0.,1.,0.);
175 CLHEP::HepRotation rmtx = xhairOptO->
rmGlob();
176 YAxis_xhair = rmtx * YAxis_xhair;
177 ALILine Yline_xhair( inters, copsPlane.project( YAxis_xhair ));
179 std::cout <<
" %%%% Projecting x-hair laser on COPS: " << std::endl;
181 std::cout <<
" Y line of laser projected on COPS " << Yline_xhair << std::endl;
184 if (
ALIUtils::debug >= 5)
std::cout <<
" 3. Get the X of the laser (correct it if cross is not 90o) and project it on the COPS" << std::endl;
188 if(!eexists) anglebx =
PI/2.;
189 CLHEP::Hep3Vector XAxis_xhair = YAxis_xhair;
192 ZAxis = CLHEP::Hep3Vector(0.,0.,1.);
193 ZAxis = rmtx * ZAxis;
194 XAxis_xhair.rotate(anglebx, ZAxis );
195 ALILine Xline_xhair( inters, copsPlane.project( XAxis_xhair ) );
197 std::cout <<
"angleBetweenAxis = " << anglebx << std::endl;
199 std::cout <<
" X line of laser projected on COPS " << Xline_xhair << std::endl;
261 ALIstring measNames[4] ={
"up",
"down",
"left",
"right"};
263 if (
ALIUtils::debug >= 2)
std::cout << std::endl <<
"--> Now comparing measurement in ccds by x and y laser lines (will always choose the smaller one) " <<std::endl;
266 for( ii = 0; ii < 4; ii++ ) {
269 <<
" " <<
std::abs( measv[ii][0] ) <<
" " <<
std::abs( measv[ii][1] ) <<
" edm::isNotFinite() = " <<
299 if(
ALIUtils::debug >= 2)
std::cout <<
"***** OptOCOPS::makeMeasurement - identify pathological cases U and D intersected by same line" <<std::endl;
301 for( ii = 0; ii < 4; ii++ ) {
305 if( xlaserDir[0] ^ xlaserDir[1] ) {
306 std::cerr <<
"!!EXITING up and down CCDs intersected by different x-laser line " << xlaserDir[0] <<
" " << xlaserDir[1] << std::endl;
309 if( xlaserDir[2] ^ xlaserDir[3] ) {
310 std::cerr <<
"!!EXITING right and left CCDs intersected by different x-laser line " << xlaserDir[0] <<
" " << xlaserDir[1] << std::endl;
318 std::cout <<
"REAL value: " << chrg <<
"U: " << 1000*meas.
value()[0] << chrg
319 <<
" D: " << 1000*meas.
value()[1]
320 <<
" L: " << 1000*meas.
value()[2]
321 <<
" R: " << 1000*meas.
value()[3]
322 <<
" (mm) " << (
this)->
name() << std::endl;
327 std::cout <<
"SIMU value: " << chrg <<
"U: "
330 << chrg <<
" D: " << detD
331 << chrg <<
" L: " << detL
332 << chrg <<
" R: " << detR
333 <<
" (mm) " << (
this)->
name() << std::endl;
const ALIbool findExtraEntryValueIfExists(const ALIstring &eename, ALIdouble &value) const
const CLHEP::HepRotation & rmGlob() const
virtual void setXlaserLine(ALIuint ii, int val)
const CLHEP::Hep3Vector & point() const
Abs< T >::type abs(const T &t)
void setValueSimulated(ALIint coor, ALIdouble value)
virtual int xlaserLine(ALIuint ii)
const ALIdouble findExtraEntryValue(const ALIstring &eename) const
const std::vector< OpticalObject * > & OptOList() const
static void dump3v(const CLHEP::Hep3Vector &vec, const std::string &msg)
void intersect(const ALIPlane &plane)
const CLHEP::Hep3Vector & centreGlob() const
const ALIdouble * value() const
const ALIdouble valueSimulated(ALIuint ii) const
ALIdouble getMeasFromInters(ALILine &line_xhair, ALILine &ccd, CLHEP::Hep3Vector &cops_line)
const ALIstring & name() const