24 std::cout <<
"DeviationsFromFileSensor2D::readFile " <<
this << ifdevi.
name() << std::endl;
33 std::vector<ALIstring>
wl;
64 <<
" " << oldposY << std::endl;
66 std::cerr <<
"!!!EXITING first scan direction has to be Y for the moment " << ifdevi.
name() << std::endl;
72 if (dev->
posY() > oldposY) {
80 if (dev->
posX() > oldposX) {
101 if (dev->
posY() > oldposY) {
108 if (dev->
posX() > oldposX) {
118 oldposX = dev->
posX();
119 oldposY = dev->
posY();
133 std::cerr <<
"!!WARNING: error reading deviation file: number of X points <> number of Y points : Number of "
135 << dvsiz <<
" nl " << nl - 1 <<
" file " << ifdevi.
name() << std::endl;
150 std::cout <<
" entering getdevis " << intersX <<
" " << intersY <<
" " <<
this << std::endl;
151 vvd::iterator vvdite;
165 auto yrows = std::make_unique<unsigned int[]>(
theNPoints);
170 for (vdite = (*vvdite).begin(); vdite != ((*vvdite).end() - 1); ++vdite) {
172 std::cout <<
" check posy " << (*(vdite))->posY() <<
" " << (*(vdite + 1))->posY() <<
" " << (*(vdite))
181 yrows[
ii] = vdite - (*vvdite).begin();
183 std::cout << intersY <<
" DeviationsFromFileSensor2D yrows " <<
ii <<
" " << yrows[
ii] <<
" : "
184 << (*(vdite))->posY() << std::endl;
191 if (insideMatrix == 0) {
192 std::cerr <<
"!!EXITING intersection in Y outside matrix of deviations from file " << intersY << std::endl;
195 insideMatrix =
false;
209 thePoints.push_back(dev1);
210 thePoints.push_back(dev2);
213 std::cout <<
" column up " <<
ii <<
" " << dev1->
posX() <<
" " << dev2->
posX() <<
" : " << intersX << std::endl;
220 rn = yrows[
ii + 1] + 1;
225 thePoints.push_back(dev1);
226 thePoints.push_back(dev2);
228 std::cout <<
" column down " <<
ii <<
" " << dev1->
posX() <<
" " << dev2->
posX() <<
" : " << intersX
232 if (thePoints.size() == 4)
236 if (insideMatrix == 0) {
237 std::cerr <<
"!!EXITING intersection in X outside matrix of deviations from file " << intersX << std::endl;
244 ALIdouble dist, disttot = 0, deviX = 0, deviY = 0;
247 std::cout <<
" thepoints size " << thePoints.size() << std::endl;
249 for (
ii = 0;
ii < 4;
ii++) {
251 disttot += 1. / dist;
252 deviX += thePoints[
ii]->devX() / dist;
253 deviY += thePoints[
ii]->devY() / dist;
256 std::cout <<
ii <<
" distances: " << dist <<
" " << deviX <<
" " << deviY <<
" devX " << thePoints[
ii]->devX()
257 <<
" devY " << thePoints[
ii]->devY() << std::endl;
267 std::cout <<
" devisX/Y: " << deviX <<
" " << deviY <<
" intersX/Y " << intersX <<
" " << intersY << std::endl;
273 return std::pair<ALIdouble, ALIdouble>(deviX * 1.
e-6, deviY * 1
e-6);