Commit 3e79c5da authored by Simon Spannagel's avatar Simon Spannagel
Browse files

Cluster: store uncertainty as ROOT::XYVector for col/row direction

parent 6ed2e4de
#ifndef CLUSTER_H #ifndef CLUSTER_H
#define CLUSTER_H 1 #define CLUSTER_H 1
#include <Math/Point3D.h>
#include <Math/Vector2D.h>
#include <iostream> #include <iostream>
#include "Math/Point3D.h"
#include "Pixel.h" #include "Pixel.h"
/* /*
...@@ -29,8 +30,7 @@ namespace corryvreckan { ...@@ -29,8 +30,7 @@ namespace corryvreckan {
Cluster(Cluster* cluster) { Cluster(Cluster* cluster) {
m_global = cluster->global(); m_global = cluster->global();
m_local = cluster->local(); m_local = cluster->local();
m_error_x = cluster->errorX(); m_error = ROOT::Math::XYVector(cluster->errorX(), cluster->errorY());
m_error_y = cluster->errorY();
m_detectorID = cluster->detectorID(); m_detectorID = cluster->detectorID();
m_timestamp = cluster->timestamp(); m_timestamp = cluster->timestamp();
m_columnWidth = cluster->columnWidth(); m_columnWidth = cluster->columnWidth();
...@@ -56,9 +56,9 @@ namespace corryvreckan { ...@@ -56,9 +56,9 @@ namespace corryvreckan {
double row() { return m_row; } double row() { return m_row; }
double column() { return m_column; } double column() { return m_column; }
double tot() { return m_tot; } double tot() { return m_tot; }
double error() { return sqrt(m_error_x * m_error_x + m_error_y * m_error_y); } double error() { return sqrt(m_error.X() * m_error.X() + m_error.Y() * m_error.Y()); }
double errorX() { return m_error_x; } double errorX() { return m_error.X(); }
double errorY() { return m_error_y; } double errorY() { return m_error.Y(); }
bool isSplit() { return m_split; } bool isSplit() { return m_split; }
void setSplit(bool split) { m_split = split; } void setSplit(bool split) { m_split = split; }
...@@ -107,8 +107,9 @@ namespace corryvreckan { ...@@ -107,8 +107,9 @@ namespace corryvreckan {
m_local.SetY(y); m_local.SetY(y);
m_local.SetZ(z); m_local.SetZ(z);
} }
void setErrorX(double error) { m_error_x = error; } void setErrorX(double error) { m_error.SetX(error); }
void setErrorY(double error) { m_error_y = error; } void setErrorY(double error) { m_error.SetY(error); }
void setError(ROOT::Math::XYVector error) { m_error = error; }
private: private:
// Member variables // Member variables
...@@ -116,8 +117,7 @@ namespace corryvreckan { ...@@ -116,8 +117,7 @@ namespace corryvreckan {
double m_row; double m_row;
double m_column; double m_column;
double m_tot; double m_tot;
double m_error_x; ROOT::Math::XYVector m_error;
double m_error_y;
double m_columnWidth; double m_columnWidth;
double m_rowWidth; double m_rowWidth;
bool m_split; bool m_split;
...@@ -129,7 +129,7 @@ namespace corryvreckan { ...@@ -129,7 +129,7 @@ namespace corryvreckan {
std::map<int, bool> m_columnHits; std::map<int, bool> m_columnHits;
// ROOT I/O class definition - update version number when you change this class! // ROOT I/O class definition - update version number when you change this class!
ClassDef(Cluster, 6) ClassDef(Cluster, 7)
}; };
// Vector type declaration // Vector type declaration
......
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