EUDAQ
 All Classes Namespaces Files Functions Variables Pages
TLU2Packet.hh
1 
2 #ifndef EUDAQ_INCLUDED_TLU2Packet
3 #define EUDAQ_INCLUDED_TLU2Packet
4 
5 #include <string>
6 #include <vector>
7 #include <map>
8 #include <iosfwd>
9 #include <iostream>
10 
11 #include "eudaq/AidaPacket.hh"
12 
13 namespace eudaq {
14 
15  class DLLEXPORT TLU2Packet : public AidaPacket {
16  EUDAQ_DECLARE_PACKET();
17 
18  public:
19  TLU2Packet(uint64_t subtype) {
20  m_header.data.marker = identifier().number;
21  m_header.data.packetType = get_type();
22  m_header.data.packetSubType = subtype;
23  m_header.data.packetNumber = -1;
24  };
25 
26  /*
27  * packet header
28  *
29  * methods inherited from AidaPacket:
30  inline uint64_t GetPacketNumber() const { return m_header.data.packetNumber;
31  };
32  inline void SetPacketNumber( uint64_t n ) { m_header.data.packetNumber = n;
33  };
34  inline uint64_t GetPacketType() const { return m_header.data.packetType; };
35  inline uint64_t GetPacketSubType() const { return
36  m_header.data.packetSubType; };
37  inline void SetPacketSubType( uint64_t type ) { m_header.data.packetSubType
38  = type; };
39  */
40 
41  //
42  // meta data
43  //
44 
45  DECLARE_ENUM_CLASS(TLU2MetaDataType, RUN_NUMBER, TRIGGER_COUNTER,
46  TRIGGER_TIMESTAMP);
47 
48  /*
49  * methods inherited from AidaPacket:
50  *
51 MetaData& GetMetaData() {
52  return m_meta_data;
53 }
54 
55 static inline int GetType( uint64_t meta_data ) { return getBits(ENTRY_TYPE,
56 meta_data ); };
57 static inline void SetType( uint64_t& meta_data, int type ) {
58 setBits(ENTRY_TYPE, meta_data, type ); };
59 static inline bool IsTLUBitSet( uint64_t meta_data ) { return getBits(TLU,
60 meta_data ); };
61 static inline uint64_t GetCounter( uint64_t meta_data ) { return
62 getBits(COUNTER, meta_data ); };
63 static inline void SetCounter( uint64_t& meta_data, uint64_t data ) {
64 setBits(COUNTER, meta_data, data ); };
65  */
66 
67  protected:
68  template <typename T_Packet> friend struct RegisterPacketType;
70  : AidaPacket(header, ds){};
71  };
72 }
73 
74 #endif // EUDAQ_INCLUDED_AidaPacket
Definition: TLU2Packet.hh:15
Definition: Serializer.hh:156
Definition: AidaPacket.hh:39
Definition: AidaPacket.hh:185
Definition: AidaPacket.hh:51