Commit 3f60a223 authored by Daniel Hynds's avatar Daniel Hynds
Browse files

Merge branch 'master' of ssh://gitlab.cern.ch:7999/CLICdp/tbAnalysis


Former-commit-id: 412bfeaface095aec4145be2f074130707bcad19
parents 66e34715 d5351af9
...@@ -186,11 +186,11 @@ public: ...@@ -186,11 +186,11 @@ public:
// Functions to get row and column from local position // Functions to get row and column from local position
double getRow(PositionVector3D<Cartesian3D<double> > localPosition){ double getRow(PositionVector3D<Cartesian3D<double> > localPosition){
double row = (localPosition.Y()/m_pitchY) + m_nPixelsY/2.; double row = ((localPosition.Y() + m_pitchY/2.)/m_pitchY) + m_nPixelsY/2.;
return row; return row;
} }
double getColumn(PositionVector3D<Cartesian3D<double> > localPosition){ double getColumn(PositionVector3D<Cartesian3D<double> > localPosition){
double column = (localPosition.X()/m_pitchX) + m_nPixelsX/2.; double column = ((localPosition.X()+ m_pitchY/2.)/m_pitchX) + m_nPixelsX/2.;
return column; return column;
} }
...@@ -207,12 +207,12 @@ public: ...@@ -207,12 +207,12 @@ public:
// Function to get in-pixel position (value returned in microns) // Function to get in-pixel position (value returned in microns)
double inPixelX(PositionVector3D<Cartesian3D<double> > localPosition){ double inPixelX(PositionVector3D<Cartesian3D<double> > localPosition){
double column = getColumn(localPosition); double column = getColumn(localPosition);
double inPixelX = m_pitchX * (column + m_pitchX/2. - floor(column + m_pitchX/2.)); double inPixelX = m_pitchX * (column - floor(column));
return 1000.*inPixelX; return 1000.*inPixelX;
} }
double inPixelY(PositionVector3D<Cartesian3D<double> > localPosition){ double inPixelY(PositionVector3D<Cartesian3D<double> > localPosition){
double row = getRow(localPosition); double row = getRow(localPosition);
double inPixelY = m_pitchY * (row + m_pitchY/2. - floor(row + m_pitchY/2.)); double inPixelY = m_pitchY * (row - floor(row));
return 1000.*inPixelY; return 1000.*inPixelY;
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment