Commit 49445031 authored by Simon Spannagel's avatar Simon Spannagel
Browse files

Swap column/row in Detector::getLocalPosition to be consistent

parent 38f40f19
Pipeline #760142 passed with stages
in 17 minutes and 55 seconds
......@@ -322,7 +322,7 @@ double Detector::getColumn(const PositionVector3D<Cartesian3D<double>> localPosi
}
// Function to get local position from row and column
PositionVector3D<Cartesian3D<double>> Detector::getLocalPosition(double row, double column) const {
PositionVector3D<Cartesian3D<double>> Detector::getLocalPosition(double column, double row) const {
return PositionVector3D<Cartesian3D<double>>(
m_pitch.X() * (column - m_nPixels.X() / 2.), m_pitch.Y() * (row - m_nPixels.Y() / 2.), 0.);
......
......@@ -203,8 +203,8 @@ namespace corryvreckan {
double getRow(PositionVector3D<Cartesian3D<double>> localPosition) const;
double getColumn(PositionVector3D<Cartesian3D<double>> localPosition) const;
// Function to get local position from row and column
PositionVector3D<Cartesian3D<double>> getLocalPosition(double row, double column) const;
// Function to get local position from column (x) and row (y) coordinates
PositionVector3D<Cartesian3D<double>> getLocalPosition(double column, double row) const;
/**
* Transformation from local (sensor) coordinates to in-pixel coordinates
......
......@@ -409,7 +409,7 @@ StatusCode AnalysisCLICpix::run(std::shared_ptr<Clipboard> clipboard) {
// Get the pixel global position
LOG(TRACE) <<"New pixel, row = "<<(*itPixel)->row()<<", column = "<<(*itPixel)->column();
PositionVector3D<Cartesian3D<double> > pixelPositionLocal =
m_detector->getLocalPosition((*itPixel)->row(),(*itPixel)->column()); PositionVector3D<Cartesian3D<double> >
m_detector->getLocalPosition((*itPixel)->column(),(*itPixel)->row()); PositionVector3D<Cartesian3D<double> >
pixelPositionGlobal = *(m_detector->m_localToGlobal) * pixelPositionLocal;
// Check if it is close to the track
......@@ -586,7 +586,7 @@ void AnalysisCLICpix::fillResponseHistos(double trackInterceptX, double trackInt
Pixel* pixel = (*itp);
// Get the pixel local then global position
PositionVector3D<Cartesian3D<double>> pixelPositionLocal =
m_detector->getLocalPosition(pixel->row(), pixel->column());
m_detector->getLocalPosition(pixel->column(), pixel->row());
PositionVector3D<Cartesian3D<double>> pixelPositionGlobal = m_detector->localToGlobal(pixelPositionLocal);
// Fill the response histograms
......
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