Commit 0fbe7131 authored by Simon Spannagel's avatar Simon Spannagel
Browse files

Objects: clean up member variables

parent 95e5dbec
......@@ -65,8 +65,6 @@ public:
size_t size() { return m_pixels.size(); }
double columnWidth() { return m_columnWidth; }
double rowWidth() { return m_rowWidth; }
long long int timestamp() { return m_timestamp; }
std::string detectorID() { return m_detectorID; }
Pixels* pixels() { return (&m_pixels); }
// Set cluster parameters
......@@ -84,8 +82,6 @@ public:
m_localZ = z;
}
void setError(double error) { m_error = error; }
void setTimestamp(long long int timestamp) { m_timestamp = timestamp; }
void setDetectorID(std::string detectorID) { m_detectorID = detectorID; }
private:
// Member variables
......@@ -96,14 +92,12 @@ private:
double m_error;
double m_columnWidth;
double m_rowWidth;
long long int m_timestamp;
double m_globalX;
double m_globalY;
double m_globalZ;
double m_localX;
double m_localY;
double m_localZ;
std::string m_detectorID;
std::map<int, bool> m_rowHits;
std::map<int, bool> m_columnHits;
......
......@@ -11,20 +11,9 @@ namespace corryvreckan {
// Constructors and destructors
Pixel() = default;
virtual ~Pixel() {}
Pixel(std::string detectorID, int row, int col, int tot) {
m_detectorID = detectorID;
m_row = row;
m_column = col;
m_adc = tot;
m_timestamp = 0;
}
Pixel(std::string detectorID, int row, int col, int tot, long long int timestamp) {
m_detectorID = detectorID;
m_row = row;
m_column = col;
m_adc = tot;
m_timestamp = timestamp;
}
Pixel(std::string detectorID, int row, int col, int tot) : Pixel(detectorID, row, col, tot, 0.) {}
Pixel(std::string detectorID, int row, int col, int tot, double timestamp)
: TestBeamObject(detectorID, timestamp), m_row(row), m_column(col), m_adc(tot) {}
// Member variables
int m_row;
......
......@@ -18,13 +18,18 @@ namespace corryvreckan {
public:
// Constructors and destructors
TestBeamObject() {}
TestBeamObject() : m_detectorID(), m_timestamp(0) {}
TestBeamObject(std::string detectorID) : m_detectorID(detectorID), m_timestamp(0) {}
TestBeamObject(std::string detectorID, double timestamp) : m_detectorID(detectorID), m_timestamp(timestamp) {}
virtual ~TestBeamObject() { m_timestamp = 0; }
// Methods to get member variables
std::string getDetectorID() { return m_detectorID; }
long long int timestamp() { return m_timestamp; }
void timestamp(long long int time) { m_timestamp = time; }
std::string detectorID() { return getDetectorID(); }
double timestamp() { return m_timestamp; }
void timestamp(double time) { m_timestamp = time; }
void setTimestamp(double time) { timestamp(time); }
// Methods to set member variables
void setDetectorID(std::string detectorID) { m_detectorID = detectorID; }
......@@ -34,13 +39,13 @@ namespace corryvreckan {
static TestBeamObject* Factory(std::string, TestBeamObject* object = NULL);
static TestBeamObject* Factory(std::string, std::string, TestBeamObject* object = NULL);
protected:
// Member variables
std::string m_detectorID;
long long int m_timestamp;
double m_timestamp;
// ROOT I/O class definition - update version number when you change this
// class!
ClassDef(TestBeamObject, 1)
// ROOT I/O class definition - update version number when you change this class!
ClassDef(TestBeamObject, 2)
};
// Vector type declaration
......
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