51 if(posx12 == 0. ) posx12 = -0.045;
53 CLHEP::HepRotation rmt =
rmGlob();
63 CLHEP::Hep3Vector line_dowel21 = (dowel1-dowel2 );
64 CLHEP::Hep3Vector ZAxis(0.,0,1.);
66 CLHEP::Hep3Vector line_dowel21_perp = ZAxis.cross( line_dowel21 );
75 if( CCDlength == 0. ) CCDlength = 2048*14 * 1.E-6;
84 <<
"******************" << std::endl << std::endl;
88 if(!eexists) posY = CCDlength + 0.004;
90 CLHEP::Hep3Vector posxy( posX, posY, 0);
97 ALILine upCCD( dowel2 + posxy, line_dowel21 );
101 <<
"********************" << std::endl << std::endl ;
104 if(!eexists) posY = 0.002;
105 posxy = CLHEP::Hep3Vector( posX, posY, 0);
112 ALILine downCCD( dowel2 + posxy, line_dowel21 );
118 <<
"********************" << std::endl << std::endl;
121 if(!eexists) posX = -CCDlength - 0.002;
123 posxy = CLHEP::Hep3Vector( posX, posY, 0);
130 ALILine leftCCD( dowel2 + posxy, -line_dowel21_perp );
135 <<
"*********************" << std::endl<< std::endl ;
138 if(!eexists) posX = - 0.004;
140 posxy = CLHEP::Hep3Vector( posX, posY, 0);
147 ALILine rightCCD( dowel2 + posxy, -line_dowel21_perp );
151 std::cout <<
" %%% Positions of CCDs in global RF: " << std::endl<< std::endl;
152 std::cout <<
" upCCD: " << upCCD << std::endl;
153 std::cout <<
" downCCD: " << downCCD << std::endl;
154 std::cout <<
" leftCCD: " << leftCCD << std::endl;
155 std::cout <<
" rightCCD: " << rightCCD << std::endl << std::endl;
162 CLHEP::Hep3Vector inters = lightray.
point();
168 if (
ALIUtils::debug >= 5)
std::cout <<
"1. Get the OptO x-hair laser from the measurement list of OptOs" << std::endl;
173 CLHEP::Hep3Vector YAxis_xhair(0.,1.,0.);
174 CLHEP::HepRotation rmtx = xhairOptO->
rmGlob();
175 YAxis_xhair = rmtx * YAxis_xhair;
176 ALILine Yline_xhair( inters, copsPlane.project( YAxis_xhair ));
178 std::cout <<
" %%%% Projecting x-hair laser on COPS: " << std::endl;
180 std::cout <<
" Y line of laser projected on COPS " << Yline_xhair << std::endl;
183 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;
187 if(!eexists) anglebx =
PI/2.;
188 CLHEP::Hep3Vector XAxis_xhair = YAxis_xhair;
191 ZAxis = CLHEP::Hep3Vector(0.,0.,1.);
192 ZAxis = rmtx * ZAxis;
193 XAxis_xhair.rotate(anglebx, ZAxis );
194 ALILine Xline_xhair( inters, copsPlane.project( XAxis_xhair ) );
196 std::cout <<
"angleBetweenAxis = " << anglebx << std::endl;
198 std::cout <<
" X line of laser projected on COPS " << Xline_xhair << std::endl;
260 ALIstring measNames[4] ={
"up",
"down",
"left",
"right"};
262 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;
265 for( ii = 0; ii < 4; ii++ ) {
268 <<
" " << fabs( measv[ii][0] ) <<
" " << fabs( measv[ii][1] ) <<
" isnan() = " <<
285 laserLine = fabs( measv[ii][0] ) < fabs( measv[ii][1] );
298 if(
ALIUtils::debug >= 2)
std::cout <<
"***** OptOCOPS::makeMeasurement - identify pathological cases U and D intersected by same line" <<std::endl;
300 for( ii = 0; ii < 4; ii++ ) {
304 if( xlaserDir[0] ^ xlaserDir[1] ) {
305 std::cerr <<
"!!EXITING up and down CCDs intersected by different x-laser line " << xlaserDir[0] <<
" " << xlaserDir[1] << std::endl;
308 if( xlaserDir[2] ^ xlaserDir[3] ) {
309 std::cerr <<
"!!EXITING right and left CCDs intersected by different x-laser line " << xlaserDir[0] <<
" " << xlaserDir[1] << std::endl;
317 std::cout <<
"REAL value: " << chrg <<
"U: " << 1000*meas.
value()[0] << chrg
318 <<
" D: " << 1000*meas.
value()[1]
319 <<
" L: " << 1000*meas.
value()[2]
320 <<
" R: " << 1000*meas.
value()[3]
321 <<
" (mm) " << (
this)->
name() << std::endl;
326 std::cout <<
"SIMU value: " << chrg <<
"U: "
329 << chrg <<
" D: " << detD
330 << chrg <<
" L: " << detL
331 << chrg <<
" R: " << detR
332 <<
" (mm) " << (
this)->
name() << std::endl;
std::vector< OpticalObject * > & OptOList()
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
void setValueSimulated(ALIint coor, ALIdouble value)
virtual int xlaserLine(ALIuint ii)
const ALIdouble findExtraEntryValue(const ALIstring &eename) 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