1 #ifndef EUDAQ_INCLUDED_DEPFETEvent
2 #define EUDAQ_INCLUDED_DEPFETEvent
6 #include "eudaq/DetectorEvent.hh"
12 typedef std::vector<unsigned char> vec_t;
26 unsigned GetID()
const {
return m_id; }
29 const vec_t &GetDataVector()
const {
return m_data; }
30 void Print(std::ostream &)
const;
33 unsigned char GetByte(
size_t i)
const {
return m_data[i]; }
35 static vec_t make_vector(
const T *data,
size_t bytes) {
36 const unsigned char *ptr =
reinterpret_cast<const unsigned char *
>(data);
37 return vec_t(ptr, ptr + bytes);
39 template <
typename T>
static vec_t make_vector(
const std::vector<T> &data) {
40 const unsigned char *ptr =
41 reinterpret_cast<const unsigned char *
>(&data[0]);
42 return vec_t(ptr, ptr + data.size() *
sizeof(T));
48 inline std::ostream &operator<<(std::ostream &os,
const DEPFETBoard &fr) {
82 virtual void Print(std::ostream &)
const;
85 virtual std::string
GetType()
const {
return "DEPFETEvent"; }
87 unsigned NumBoards()
const {
return m_boards.size(); }
88 DEPFETBoard &GetBoard(
unsigned i) {
return m_boards[i]; }
89 const DEPFETBoard &GetBoard(
unsigned i)
const {
return m_boards[i]; }
104 std::vector<DEPFETBoard> m_boards;
150 #endif // EUDAQ_INCLUDED_DEPFETEvent
Definition: Serializer.hh:156
Definition: DEPFETEvent.hh:56
Definition: Serializable.hh:13
Definition: Serializer.hh:19
virtual std::string GetType() const
Return "DEPFETEvent" as type.
Definition: DEPFETEvent.hh:85
Definition: DEPFETEvent.hh:10