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

Detector: make members private and add new getter functions for l2g & g2l

parent a226de99
Pipeline #235795 failed with stages
in 2 minutes and 53 seconds
......@@ -96,7 +96,7 @@ void Alignment::MinimiseTrackChi2(Int_t& npar, Double_t* grad, Double_t& result,
// Recalculate the global position from the local
PositionVector3D<Cartesian3D<double>> positionLocal(
trackCluster->localX(), trackCluster->localY(), trackCluster->localZ());
PositionVector3D<Cartesian3D<double>> positionGlobal = *(globalDetector->m_localToGlobal) * positionLocal;
PositionVector3D<Cartesian3D<double>> positionGlobal = *(globalDetector->localToGlobal()) * positionLocal;
trackCluster->setClusterCentre(positionGlobal.X(), positionGlobal.Y(), positionGlobal.Z());
}
......@@ -148,7 +148,7 @@ void Alignment::MinimiseResiduals(Int_t& npar, Double_t* grad, Double_t& result,
// Recalculate the global position from the local
PositionVector3D<Cartesian3D<double>> positionLocal(
associatedCluster->localX(), associatedCluster->localY(), associatedCluster->localZ());
PositionVector3D<Cartesian3D<double>> positionGlobal = *(globalDetector->m_localToGlobal) * positionLocal;
PositionVector3D<Cartesian3D<double>> positionGlobal = *(globalDetector->localToGlobal()) * positionLocal;
// Get the track intercept with the detector
ROOT::Math::XYZPoint intercept = track->intercept(positionGlobal.Z());
// Calculate the residuals
......
......@@ -222,7 +222,7 @@ StatusCode ClicpixAnalysis::run(Clipboard* clipboard) {
// Get the track intercept with the clicpix plane (global and local
// co-ordinates)
PositionVector3D<Cartesian3D<double>> trackIntercept = detector->getIntercept(track);
PositionVector3D<Cartesian3D<double>> trackInterceptLocal = *(detector->m_globalToLocal) * trackIntercept;
PositionVector3D<Cartesian3D<double>> trackInterceptLocal = *(detector->globalToLocal()) * trackIntercept;
// Plot the difference between track intercepts and all clicpix clusters
// Also record which cluster is the closest
......@@ -549,7 +549,7 @@ void ClicpixAnalysis::fillResponseHistos(double trackInterceptX, double trackInt
Pixel* pixel = (*itp);
// Get the pixel local then global position
PositionVector3D<Cartesian3D<double>> pixelPositionLocal = detector->getLocalPosition(pixel->m_row, pixel->m_column);
PositionVector3D<Cartesian3D<double>> pixelPositionGlobal = *(detector->m_localToGlobal) * pixelPositionLocal;
PositionVector3D<Cartesian3D<double>> pixelPositionGlobal = *(detector->localToGlobal()) * pixelPositionLocal;
// Fill the response histograms
hPixelResponseX->Fill(pixelPositionGlobal.X() - trackInterceptX);
......
......@@ -175,7 +175,7 @@ void SpatialClustering::calculateClusterCentre(Detector* detector, Cluster* clus
detector->pitchY() * (row - detector->nPixelsY() / 2.),
0);
// Calculate global cluster position
PositionVector3D<Cartesian3D<double>> positionGlobal = *(detector->m_localToGlobal) * positionLocal;
PositionVector3D<Cartesian3D<double>> positionGlobal = *(detector->localToGlobal()) * positionLocal;
// Set the cluster parameters
cluster->setRow(row);
......
......@@ -200,7 +200,7 @@ void Timepix3Clustering::calculateClusterCentre(Cluster* cluster) {
PositionVector3D<Cartesian3D<double>> positionLocal(
detector->pitchX() * (column - detector->nPixelsX() / 2), detector->pitchY() * (row - detector->nPixelsY() / 2), 0);
// Calculate global cluster position
PositionVector3D<Cartesian3D<double>> positionGlobal = *(detector->m_localToGlobal) * positionLocal;
PositionVector3D<Cartesian3D<double>> positionGlobal = *(detector->localToGlobal()) * positionLocal;
// Set the cluster parameters
cluster->setRow(row);
......
......@@ -104,8 +104,11 @@ namespace corryvreckan {
double inPixelX(PositionVector3D<Cartesian3D<double>> localPosition);
double inPixelY(PositionVector3D<Cartesian3D<double>> localPosition);
// Member variables
Transform3D* localToGlobal() { return m_localToGlobal; };
Transform3D* globalToLocal() { return m_globalToLocal; };
private:
// Member variables
// Detector information
std::string m_detectorType;
std::string m_detectorName;
......
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