Commit 06d3465d authored by Lennart Huth's avatar Lennart Huth
Browse files

added a binary flag for sensors without an adc/tot measurement. Set to false...

added a binary flag for sensors without an adc/tot measurement. Set to false per default. Pixels return 1 as adc/tot if the binary flag is set to true
parent 79ae8084
......@@ -3,5 +3,6 @@
using namespace corryvreckan;
void Pixel::print(std::ostream& out) const {
out << "Pixel " << this->column() << ", " << this->row() << ", " << this->adc() << ", " << this->timestamp();
out << "Pixel " << this->column() << ", " << this->row() << ", " << this->adc() << ", " << this->timestamp()
<< ", is Binary" << (m_isBinary == true ? "true" : "false");
}
......@@ -15,17 +15,21 @@ namespace corryvreckan {
Pixel() = default;
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)
: Object(detectorID, timestamp), m_row(row), m_column(col), m_adc(tot), m_charge(tot) {}
: Pixel(detectorID, row, col, tot, timestamp, false) {}
Pixel(std::string detectorID, int row, int col, int tot, double timestamp, bool binary)
: Object(detectorID, timestamp), m_row(row), m_column(col), m_adc(tot), m_charge(tot), m_isBinary(binary) {}
int row() const { return m_row; }
int column() const { return m_column; }
std::pair<int, int> coordinates() { return std::make_pair(m_column, m_row); }
int adc() const { return m_adc; }
int adc() const { return (m_isBinary == true ? 1 : m_adc); }
int tot() const { return adc(); }
double charge() const { return m_charge; }
void setCharge(double charge) { m_charge = charge; }
void setToT(int tot) { m_adc = tot; }
void setBinary(bool binary) { m_isBinary = binary; }
/**
* @brief Print an ASCII representation of Pixel to the given stream
......@@ -43,8 +47,8 @@ namespace corryvreckan {
int m_row;
int m_column;
int m_adc;
double m_charge;
bool m_isBinary;
};
// 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