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

Pixel object: update with stream writer

parent 6de44207
......@@ -27,7 +27,6 @@ ROOT_GENERATE_DICTIONARY(CorryvreckanObjectsDictionary
LINKDEF
${CMAKE_CURRENT_SOURCE_DIR}/Linkdef.h
OPTIONS
-Wno-inconsistent-missing-override
-inlineInputHeader
-I${CMAKE_CURRENT_SOURCE_DIR}
MODULE
......@@ -50,6 +49,7 @@ ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/CorryvreckanObjectsDiction
# Define the library adding the object file created above
ADD_LIBRARY(CorryvreckanObjects SHARED
Object.cpp
Pixel.cpp
${CMAKE_CURRENT_BINARY_DIR}/CorryvreckanObjectsDictionary.cxx.o
)
......
#include "Pixel.h"
using namespace corryvreckan;
void Pixel::print(std::ostream& out) const {
out << "Pixel " << this->column() << ", " << this->row() << ", " << this->adc() << ", " << this->timestamp();
}
......@@ -15,20 +15,32 @@ namespace corryvreckan {
Pixel(std::string detectorID, int row, int col, int tot, double timestamp)
: Object(detectorID, timestamp), m_row(row), m_column(col), m_adc(tot) {}
int row() { return m_row; }
int column() { return m_column; }
int row() const { return m_row; }
int column() const { return m_column; }
int adc() { return m_adc; }
int tot() { return adc(); }
int adc() const { return m_adc; }
int tot() const { return adc(); }
double charge() const { return m_charge; }
void setCharge(double charge) { m_charge = charge; }
/**
* @brief Print an ASCII representation of Pixel to the given stream
* @param out Stream to print to
*/
void print(std::ostream& out) const override;
/**
* @brief ROOT class definition
*/
ClassDefOverride(Pixel, 3);
private:
// Member variables
int m_row;
int m_column;
int m_adc;
// ROOT I/O class definition - update version number when you change this class!
ClassDef(Pixel, 2)
double m_charge;
};
// 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