Commit 957827d5 authored by Simon Spannagel's avatar Simon Spannagel
Browse files

Store intrinsic resolution in detector class, default to previously hardcoded value.

This is part of #30
parent 3e79c5da
Pipeline #434435 passed with stages
in 5 minutes and 42 seconds
......@@ -31,6 +31,10 @@ Detector::Detector(const Configuration& config) {
auto npixels = config.get<ROOT::Math::DisplacementVector2D<Cartesian2D<int>>>("number_of_pixels");
// Size of the pixels
m_pitch = config.get<ROOT::Math::XYVector>("pixel_pitch");
// Intrinsic position resolution, defaults to 4um:
m_resolution = config.get<ROOT::Math::XYVector>("resolution", ROOT::Math::XYVector(0.004, 0.004));
m_detectorName = config.getName();
if(Units::convert(m_pitch.X(), "mm") >= 1 or Units::convert(m_pitch.Y(), "mm") >= 1 or
......@@ -165,6 +169,9 @@ Configuration Detector::getConfiguration() {
// Size of the pixels
config.set("pixel_pitch", m_pitch, {"um"});
// Intrinsic resolution:
config.set("resolution", m_resolution, {"um"});
if(m_timingOffset != 0.) {
config.set("time_offset", m_timingOffset, {"ns", "us", "ms", "s"});
}
......
......@@ -43,6 +43,7 @@ namespace corryvreckan {
ROOT::Math::XYVector size() { return ROOT::Math::XYVector(m_pitch.X() * m_nPixelsX, m_pitch.Y() * m_nPixelsY); }
ROOT::Math::XYVector pitch() { return m_pitch; }
ROOT::Math::XYVector resolution() { return m_resolution; }
int nPixelsX() { return m_nPixelsX; }
int nPixelsY() { return m_nPixelsY; }
......@@ -112,6 +113,7 @@ namespace corryvreckan {
std::string m_detectorType;
std::string m_detectorName;
ROOT::Math::XYVector m_pitch;
ROOT::Math::XYVector m_resolution;
int m_nPixelsX;
int m_nPixelsY;
double m_timingOffset;
......
......@@ -199,8 +199,10 @@ void SpatialClustering::calculateClusterCentre(Detector* detector, Cluster* clus
cluster->setRow(row);
cluster->setColumn(column);
cluster->setTot(tot);
cluster->setErrorX(0.004);
cluster->setErrorY(0.004);
// Set uncertainty on position from intrinstic detector resolution:
cluster->setError(detector->resolution());
cluster->setDetectorID(detectorID);
cluster->setClusterCentre(positionGlobal.X(), positionGlobal.Y(), positionGlobal.Z());
cluster->setClusterCentreLocal(positionLocal.X(), positionLocal.Y(), positionLocal.Z());
......
......@@ -214,8 +214,10 @@ void Timepix3Clustering::calculateClusterCentre(Cluster* cluster) {
cluster->setRow(row);
cluster->setColumn(column);
cluster->setTot(tot);
cluster->setErrorX(0.004);
cluster->setErrorY(0.004);
// Set uncertainty on position from intrinstic detector resolution:
cluster->setError(detector->resolution());
cluster->setTimestamp(timestamp);
cluster->setDetectorID(detectorID);
cluster->setClusterCentre(positionGlobal.X(), positionGlobal.Y(), positionGlobal.Z());
......
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