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

Fix units when juggling with pitches in EtaCorrection.

parent 233354f9
Pipeline #291393 passed with stages
in 7 minutes and 15 seconds
......@@ -62,8 +62,8 @@ StatusCode EtaCorrection::run(Clipboard* clipboard) {
// Get the in-pixel track intercept
PositionVector3D<Cartesian3D<double>> trackIntercept = m_detector->getIntercept(track);
PositionVector3D<Cartesian3D<double>> trackInterceptLocal = *(m_detector->globalToLocal()) * trackIntercept;
double pixelInterceptX = m_detector->inPixelX(trackInterceptLocal) / 1000.;
double pixelInterceptY = m_detector->inPixelY(trackInterceptLocal) / 1000.;
double pixelInterceptX = m_detector->inPixelX(trackInterceptLocal);
double pixelInterceptY = m_detector->inPixelY(trackInterceptLocal);
(pixelInterceptX > m_detector->pitchX() / 2. ? pixelInterceptX -= m_detector->pitchX() / 2.
: pixelInterceptX += m_detector->pitchX() / 2.);
(pixelInterceptY > m_detector->pitchY() / 2. ? pixelInterceptY -= m_detector->pitchY() / 2.
......@@ -90,9 +90,9 @@ StatusCode EtaCorrection::run(Clipboard* clipboard) {
double newX = floor(dutCluster->localX() / m_detector->pitchX()) * m_detector->pitchX() +
m_etaCorrectorX->Eval(inPixelX);
PositionVector3D<Cartesian3D<double>> positionLocal(newX, dutCluster->localY(), 0);
PositionVector3D<Cartesian3D<double>> positionGlobal = *(m_detector->localToGlobal()) * positionLocal;
dutCluster->setClusterCentre(positionGlobal.X(), positionGlobal.Y(), positionGlobal.Z());
dutCluster->setClusterCentreLocal(positionLocal.X(), positionLocal.Y(), positionLocal.Z());
PositionVector3D<Cartesian3D<double>> positionGlobal = m_detector->localToGlobal(positionLocal);
dutCluster->setClusterCentre(positionGlobal);
dutCluster->setClusterCentreLocal(positionLocal);
}
if(dutCluster->rowWidth() == 2) {
m_etaDistributionY->Fill(inPixelY, pixelInterceptY);
......
......@@ -243,10 +243,10 @@ PositionVector3D<Cartesian3D<double>> Detector::getLocalPosition(double row, dou
double Detector::inPixelX(PositionVector3D<Cartesian3D<double>> localPosition) {
double column = getColumn(localPosition);
double inPixelX = m_pitch.X() * (column - floor(column));
return 1000. * inPixelX;
return inPixelX;
}
double Detector::inPixelY(PositionVector3D<Cartesian3D<double>> localPosition) {
double row = getRow(localPosition);
double inPixelY = m_pitch.Y() * (row - floor(row));
return 1000. * inPixelY;
return inPixelY;
}
......@@ -79,6 +79,7 @@ public:
m_global.SetY(y);
m_global.SetZ(z);
}
void setClusterCentreLocal(ROOT::Math::XYZPoint local) { m_local = local; }
void setClusterCentreLocal(double x, double y, double z) {
m_local.SetX(x);
m_local.SetY(y);
......
Markdown is supported
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