CMS 3D CMS Logo

AMC13Event.h
Go to the documentation of this file.
1 #ifndef EventFilter_GEMRawToDigi_AMC13Event_h
2 #define EventFilter_GEMRawToDigi_AMC13Event_h
3 #include <vector>
4 #include "AMCdata.h"
5 
6 namespace gem {
7  class AMC13Event
8  {
9  public:
11  ~AMC13Event(){m_amcHeaders.clear(); m_amcs.clear();}
12 
13  int nAMC() const {return unsigned(m_nAMC);}
14  int bx_id() const {return unsigned(m_BX_id);}
15  int lv1_id() const {return unsigned(m_LV1_id);}
16  int source_id() const {return unsigned(m_Source_id);}
17  //const std::vector<AMCdata> * amcs() const {return &m_amcs;}
18 
19  uint64_t getCDFHeader() const;
20  void setCDFHeader(uint8_t cb5, uint8_t Evt_ty, uint32_t LV1_id, uint16_t BX_id, uint16_t Source_id);
21  void setCDFHeader(uint64_t word);
22 
23  uint64_t getAMC13header() const;
24  void setAMC13header(uint8_t CalTyp, uint8_t nAMC, uint32_t OrN, uint8_t cb0);
25  void setAMC13header(uint64_t word);
26 
27  const std::vector<uint64_t> * getAMCheaders() const {return &m_amcHeaders;}
28  void addAMCheader(uint64_t word);
29  void addAMCheader(uint32_t AMC_size, uint8_t Blk_No, uint8_t AMC_No, uint16_t BoardID);
30 
31  const std::vector<AMCdata> * getAMCpayloads() const {return &m_amcs;}
32  void addAMCpayload(const AMCdata& a){m_amcs.push_back(a);}
33 
34  uint64_t getAMC13trailer() const;
35  void setAMC13trailer(uint32_t CRC_amc13, uint8_t Blk_NoT, uint8_t LV1_idT, uint16_t BX_idT);
36  void setAMC13trailer(uint64_t word);
37 
38  uint64_t getCDFTrailer() const;
39  void setCDFTrailer(uint8_t cbA, uint32_t EvtLength, uint16_t CRC_cdf);
40  void setCDFTrailer(uint64_t word);
41 
42  private:
43  // CDF Header
44  uint8_t m_cb5; // control bit, should be 0x5 bits 60-63
45  uint8_t m_Evt_ty;
46  uint32_t m_LV1_id;
47  uint16_t m_BX_id;
48  uint16_t m_Source_id;
49  // AMC13 header
50  uint8_t m_CalTyp;
51  uint8_t m_nAMC;
52  uint32_t m_OrN;
53  uint8_t m_cb0; // control bit, should be 0b0000
54  // AMC headers
55  std::vector<uint64_t> m_amcHeaders;
56  /* std::vector<uint32_t> m_AMC_size; */
57  /* std::vector<uint8_t> m_Blk_No; */
58  /* std::vector<uint8_t> m_AMC_No; */
59  /* std::vector<uint16_t> m_BoardID; */
60  // AMCs payload
61  std::vector<AMCdata> m_amcs;
62  //AMC13 trailer
63  uint32_t m_CRC_amc13;
64  uint8_t m_Blk_NoT;
65  uint8_t m_LV1_idT;
66  uint16_t m_BX_idT;
67  //CDF trailer
68  uint8_t m_cbA; // control bit, should be 0xA bits 60-63
69  uint32_t m_EvtLength;
70  uint16_t m_CRC_cdf;
71 
72  };
73 }
74 #endif
void addAMCpayload(const AMCdata &a)
Definition: AMC13Event.h:32
void addAMCheader(uint64_t word)
Definition: AMC13Event.cc:63
void setCDFHeader(uint8_t cb5, uint8_t Evt_ty, uint32_t LV1_id, uint16_t BX_id, uint16_t Source_id)
Definition: AMC13Event.cc:27
uint16_t m_CRC_cdf
Definition: AMC13Event.h:70
uint8_t m_Evt_ty
Definition: AMC13Event.h:45
uint8_t m_cb0
Definition: AMC13Event.h:53
uint8_t m_CalTyp
Definition: AMC13Event.h:50
A class for AMC data.
Definition: AMC13Event.h:6
uint16_t m_Source_id
Definition: AMC13Event.h:48
uint8_t m_cbA
Definition: AMC13Event.h:68
uint32_t m_EvtLength
Definition: AMC13Event.h:69
void setAMC13header(uint8_t CalTyp, uint8_t nAMC, uint32_t OrN, uint8_t cb0)
Definition: AMC13Event.cc:55
uint64_t getCDFTrailer() const
Definition: AMC13Event.cc:112
uint8_t m_nAMC
Definition: AMC13Event.h:51
uint64_t getCDFHeader() const
Definition: AMC13Event.cc:6
uint32_t m_OrN
Definition: AMC13Event.h:52
int nAMC() const
Definition: AMC13Event.h:13
std::vector< AMCdata > m_amcs
Definition: AMC13Event.h:61
uint32_t m_LV1_id
Definition: AMC13Event.h:46
const std::vector< uint64_t > * getAMCheaders() const
Definition: AMC13Event.h:27
uint8_t m_LV1_idT
Definition: AMC13Event.h:65
unsigned long long uint64_t
Definition: Time.h:15
std::vector< uint64_t > m_amcHeaders
Definition: AMC13Event.h:55
void setCDFTrailer(uint8_t cbA, uint32_t EvtLength, uint16_t CRC_cdf)
Definition: AMC13Event.cc:129
uint16_t m_BX_id
Definition: AMC13Event.h:47
uint64_t getAMC13trailer() const
Definition: AMC13Event.cc:85
uint16_t m_BX_idT
Definition: AMC13Event.h:66
double a
Definition: hdecay.h:121
const std::vector< AMCdata > * getAMCpayloads() const
Definition: AMC13Event.h:31
uint8_t m_cb5
Definition: AMC13Event.h:44
uint64_t getAMC13header() const
Definition: AMC13Event.cc:36
int lv1_id() const
Definition: AMC13Event.h:15
int bx_id() const
Definition: AMC13Event.h:14
uint8_t m_Blk_NoT
Definition: AMC13Event.h:64
int source_id() const
Definition: AMC13Event.h:16
uint32_t m_CRC_amc13
Definition: AMC13Event.h:63
void setAMC13trailer(uint32_t CRC_amc13, uint8_t Blk_NoT, uint8_t LV1_idT, uint16_t BX_idT)
Definition: AMC13Event.cc:104