1 #ifndef EUDAQ_INCLUDED_Clusters
2 #define EUDAQ_INCLUDED_Clusters
4 #include "eudaq/Exception.hh"
10 Clusters(std::pair<int, int> pos,
int eve) {
11 m_x.push_back(pos.first);
12 m_y.push_back(pos.second);
16 Clusters(std::istream &in) : m_event(-1) { read(in); }
17 void read(std::istream &in);
18 void SetEventNum(
int eve);
19 int EventNum()
const {
return m_event; }
20 uint64_t EventTimestamp()
const {
return m_timestamp; }
21 int NumClusters()
const {
return m_x.size(); }
22 int ClusterX(
int i)
const {
return m_x[i]; }
23 int ClusterY(
int i)
const {
return m_y[i]; }
24 int ClusterA(
int i)
const {
return m_a[i]; }
29 std::vector<int> m_x, m_y, m_a;
32 inline void Clusters::read(std::istream &in) {
33 int lastevent = m_event;
35 std::getline(in, line);
38 std::istringstream str(line);
40 if (m_event <= lastevent)
53 for (
int i = 0; i < nclust; ++i) {
54 std::getline(in, line);
55 std::istringstream str(line);
61 EUDAQ_THROW(
"Bad data file: unexpected end of file");
65 #endif // EUDAQ_INCLUDED_Clusters
Definition: Clusters.hh:8
std::string to_string(const T &x, int digits=0)
Definition: Utils.hh:54