45 int iybin = int(newybin);
46 float fractionY = newybin - iybin;
50 int iybin0 = (iybin%54);
51 int numROC = iybin/54;
55 cout<<
" very bad, newbiny "<<iybin0<<endl;
57 <<newybin<<
" "<<iybin<<
" "<<fractionY<<
" "<<iybin0<<
" "
60 }
else if (iybin0==53) {
62 fractionY = (fractionY+1.)/2.;
63 }
else if (iybin0==52) {
65 fractionY = fractionY/2.;
66 }
else if (iybin0>1) {
68 }
else if (iybin0==1) {
70 fractionY = (fractionY+1.)/2.;
71 }
else if (iybin0==0) {
73 fractionY = fractionY/2.;
76 cout<<
" very bad, newbiny "<<newybin<<endl;
78 <<newybin<<
" "<<iybin<<
" "<<fractionY<<
" "
79 <<iybin0<<
" "<<numROC<<endl;
82 float mpY = float(numROC*52. + iybin0) + fractionY;
83 if(
TP_DEBUG && (mpY<0. || mpY>=416.)) {
84 cout<<
" bad pix y "<<mpY<<endl;
86 <<newybin<<
" "<<iybin<<
" "<<fractionY<<
" "
87 <<iybin0<<
" "<<numROC<<endl;
92 int ixbin = int(newxbin);
93 float fractionX = newxbin - ixbin;
102 cout<<
" very bad, newbinx "<<ixbin<<endl;
104 <<newxbin<<
" "<<ixbin<<
" "<<fractionX<<endl;
106 }
else if (ixbin>82) {
108 }
else if (ixbin==82) {
110 fractionX = (fractionX+1.)/2.;
111 }
else if (ixbin==81) {
113 fractionX = fractionX/2.;
114 }
else if (ixbin==80) {
116 fractionX = (fractionX+1.)/2.;
117 }
else if (ixbin==79) {
119 fractionX = fractionX/2.;
120 }
else if (ixbin<0) {
122 cout<<
" very bad, newbinx "<<ixbin<<endl;
124 <<newxbin<<
" "<<ixbin<<
" "<<fractionX<<endl;
128 float mpX = float(ixbin) + fractionX;
130 if(
TP_DEBUG && (mpX<0. || mpX>=160.) ) {
131 cout<<
" bad pix x "<<mpX<<
" "<<endl;
133 <<newxbin<<
" "<<ixbin<<
" "<<fractionX<<endl;
136 return std::pair<float,float>(mpX,mpY);
152 cout<<
" wrong mp y, fix "<<mpy<<
" "
157 cout<<
" wrong mp y, fix "<<mpy<<
" "
162 cout<<
" wrong mp x, fix "<<mpx<<
" "
167 cout<<
" wrong mp x, fix "<<mpx<<
" "
334 int binoffx=int(mpx);
335 float fractionX = mpx - binoffx;
341 }
else if (binoffx==80) {
345 }
else if (binoffx==79) {
348 }
else if (binoffx>=0) {
353 cout<<
" very bad, binx "<<binoffx<<endl;
354 cout<<mpx<<
" "<<binoffx<<
" "
355 <<fractionX<<
" "<<local_pitchx<<
" "<<
m_xoffset<<endl;
360 float lpX = float(binoffx*
m_pitchx) + fractionX*local_pitchx +
363 if(
TP_DEBUG && (lpX<m_xoffset || lpX>(-m_xoffset)) ) {
364 cout<<
" bad lp x "<<lpX<<endl;
365 cout<<mpx<<
" "<<binoffx<<
" "
366 <<fractionX<<
" "<<local_pitchx<<
" "<<m_xoffset<<endl;
377 int binoffy = int(mpy);
378 float fractionY = mpy - binoffy;
384 }
else if (binoffy==416) {
388 }
else if (binoffy==415) {
391 }
else if (binoffy>364) {
393 }
else if (binoffy==364) {
397 }
else if (binoffy==363) {
400 }
else if (binoffy>312) {
402 }
else if (binoffy==312) {
406 }
else if (binoffy==311) {
409 }
else if (binoffy>260) {
411 }
else if (binoffy==260) {
415 }
else if (binoffy==259) {
418 }
else if (binoffy>208) {
420 }
else if (binoffy==208) {
424 }
else if (binoffy==207) {
427 }
else if (binoffy>156) {
429 }
else if (binoffy==156) {
433 }
else if (binoffy==155) {
436 }
else if (binoffy>104) {
438 }
else if (binoffy==104) {
442 }
else if (binoffy==103) {
445 }
else if (binoffy>52) {
447 }
else if (binoffy==52) {
451 }
else if (binoffy==51) {
454 }
else if (binoffy>0) {
456 }
else if (binoffy==0) {
461 cout<<
" very bad, biny "<<binoffy<<endl;
462 cout<<mpy<<
" "<<binoffy<<
" "
463 <<fractionY<<
" "<<local_pitchy<<
" "<<
m_yoffset<<endl;
468 float lpY = float(binoffy*
m_pitchy) + fractionY*local_pitchy +
470 if(
TP_DEBUG && (lpY<m_yoffset || lpY>(-m_yoffset)) ) {
471 cout<<
" bad lp y "<<lpY<<endl;
472 cout<<mpy<<
" "<<binoffy<<
" "
473 <<fractionY<<
" "<<local_pitchy<<
" "<<m_yoffset<<endl;
484 int binoffy=int(mp.
y());
488 int binoffx=int(mp.
x());
492 me.
vv()*float(pitchy*pitchy));
502 int iybin0 = iybin%54;
504 if(iybin0==0 || iybin0==1 || iybin0==52 || iybin0==53 )
510 if(ixbin>=79 && ixbin<=82) pitchx = 2. *
m_pitchx;
513 le.
yy()/float(pitchy*pitchy));
518 for(
int i=ixmin;
i!=ixmax+1;
i++) {
526 for(
int i=iymin;
i!=iymax+1;
i++) {
virtual float localY(const float mpY) const
virtual MeasurementError measurementError(const LocalPoint &, const LocalError &) const
virtual bool isItBigPixelInY(const int iybin) const
bool containsBigPixelInY(const int &iymin, const int &iymax) const
bool containsBigPixelInX(const int &ixmin, const int &ixmax) const
virtual LocalError localError(const MeasurementPoint &, const MeasurementError &) const
virtual LocalPoint localPosition(const MeasurementPoint &mp) const
virtual float localX(const float mpX) const
virtual std::pair< float, float > pixel(const LocalPoint &p) const
virtual bool isItBigPixelInX(const int ixbin) const