CMS 3D CMS Logo

AMCdata.h
Go to the documentation of this file.
1 #ifndef EventFilter_GEMRawToDigi_AMCdata_h
2 #define EventFilter_GEMRawToDigi_AMCdata_h
3 #include "GEBdata.h"
4 #include <vector>
5 
6 namespace gem {
7 
8  union AMCheader1 {
10  struct {
11  uint64_t dataLength : 20; // Overall size of this FED event fragment
12  uint64_t bxID : 12; // Bunch crossing ID
13  uint64_t l1AID : 24; // L1A number – basically this is like event number, but it’s reset by resync
14  uint64_t AMCnum : 4; // Slot number of the AMC
15  uint64_t reserved : 4; // not used
16  };
17  };
18  union AMCheader2 {
20  struct {
21  uint64_t boardID : 16; // 8bit long GLIB serial number
22  uint64_t orbitNum : 16;
23  uint64_t param3 : 8;
24  uint64_t param2 : 8;
25  uint64_t param1 : 8;
26  uint64_t runType : 4; // run types like physics, cosmics, threshold scan, latency scan, etc..
27  uint64_t formatVer : 4; // Current format version = 0x0
28  };
29  };
30  union AMCTrailer {
32  struct {
33  uint64_t dataLengthT: 20; // Overall size of this FED event fragment
34  uint64_t l1AIDT : 12; // 8bit long GLIB serial number (first 8 bits)
35  uint64_t crc : 32;
36  };
37  };
38  union EventHeader {
40  struct {
41  uint64_t ttsState : 11; // GLIB TTS state at the moment when this event was built.
42  uint64_t davCnt : 5; // Number of chamber blocks
43  uint64_t buffState : 24; // buffer error
44  uint64_t davList : 24; // Bitmask indicating which inputs/chambers have data
45  };
46  };
47  union EventTrailer {
49  struct {
50  uint64_t oosGlib : 40; // GLIB is out‐of‐sync (critical): L1A ID is different for different chambers in this event (1 bit)
51  uint64_t chTimeOut : 24; // GLIB did not receive data from a particular input for this L1A
52  };
53  };
54 
55  class AMCdata
56  {
57 
58  public:
59  AMCdata() {};
60  ~AMCdata() {gebd_.clear();}
61 
62  void setAMCheader1(uint64_t word) { amch1_ = word;}
63  void setAMCheader1(uint32_t dataLength, uint16_t bxID, uint32_t l1AID, uint8_t AMCnum);
64  uint64_t getAMCheader1() const { return amch1_;}
65 
66  void setAMCheader2(uint64_t word) { amch2_ = word;}
67  void setAMCheader2(uint16_t boardID, uint16_t orbitNum, uint8_t runType);
68  uint64_t getAMCheader2() const { return amch2_;}
69 
70  void setAMCTrailer(uint64_t word) { amct_ = word;}
71  uint64_t getAMCTrailer() const { return amct_;}
72 
74  void setGEMeventHeader(uint8_t davCnt, uint32_t davList);
75  uint64_t getGEMeventHeader() const { return eh_;}
76 
78  uint64_t getGEMeventTrailer() const { return et_;}
79 
80  uint32_t dataLength() const {return AMCheader1{amch1_}.dataLength;}
81  uint16_t bx() const {return AMCheader1{amch1_}.bxID;}
82  uint32_t l1A() const {return AMCheader1{amch1_}.l1AID;}
83  uint8_t amcNum() const {return AMCheader1{amch1_}.AMCnum;}
84 
85  uint16_t boardId() const {return AMCheader2{amch2_}.boardID;}
86  uint16_t orbitNum() const {return AMCheader2{amch2_}.orbitNum;}
87  uint8_t param3() const {return AMCheader2{amch2_}.param3;}
88  uint8_t param2() const {return AMCheader2{amch2_}.param2;}
89  uint8_t param1() const {return AMCheader2{amch2_}.param1;}
90  uint8_t runType() const {return AMCheader2{amch2_}.runType;}
91  uint8_t formatVer() const {return AMCheader2{amch2_}.formatVer;}
92 
93  uint16_t ttsState() const {return EventHeader{eh_}.ttsState;}
94  uint8_t davCnt() const {return EventHeader{eh_}.davCnt;}
95  uint32_t buffState() const {return EventHeader{eh_}.buffState;}
96  uint32_t davList() const {return EventHeader{eh_}.davList;}
97 
98  uint8_t oosGlib() const {return EventTrailer{et_}.oosGlib;}
99  uint32_t chTimeOut() const {return EventTrailer{et_}.chTimeOut;}
100 
102  void addGEB(GEBdata g) {gebd_.push_back(g);}
104  const std::vector<GEBdata> * gebs() const {return &gebd_;}
105 
106  private:
107 
113 
114  std::vector<GEBdata> gebd_;
115  };
116 }
117 #endif
uint64_t getAMCTrailer() const
Definition: AMCdata.h:71
uint64_t bxID
Definition: AMCdata.h:12
const std::vector< GEBdata > * gebs() const
Returns a vector of GEB data.
Definition: AMCdata.h:104
uint64_t chTimeOut
Definition: AMCdata.h:51
uint8_t amcNum() const
Definition: AMCdata.h:83
uint64_t word
Definition: AMCdata.h:48
uint64_t oosGlib
Definition: AMCdata.h:50
uint16_t orbitNum() const
Definition: AMCdata.h:86
uint32_t dataLength() const
Definition: AMCdata.h:80
uint64_t param1
Definition: AMCdata.h:25
uint64_t word
Definition: AMCdata.h:19
uint64_t davList
Definition: AMCdata.h:44
uint64_t amch2_
Definition: AMCdata.h:109
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
Definition: Activities.doc:4
uint16_t boardId() const
Definition: AMCdata.h:85
uint64_t param2
Definition: AMCdata.h:24
Definition: AMC13Event.h:6
uint64_t et_
Definition: AMCdata.h:112
uint16_t bx() const
Definition: AMCdata.h:81
uint64_t amct_
Definition: AMCdata.h:110
uint8_t runType() const
Definition: AMCdata.h:90
void setAMCheader1(uint64_t word)
Definition: AMCdata.h:62
void setGEMeventHeader(uint64_t word)
Definition: AMCdata.h:73
uint64_t getGEMeventTrailer() const
Definition: AMCdata.h:78
uint8_t oosGlib() const
Definition: AMCdata.h:98
uint32_t l1A() const
Definition: AMCdata.h:82
uint8_t param2() const
Definition: AMCdata.h:88
uint64_t eh_
Definition: AMCdata.h:111
uint64_t amch1_
Definition: AMCdata.h:108
uint64_t dataLength
Definition: AMCdata.h:11
uint32_t chTimeOut() const
Definition: AMCdata.h:99
uint32_t davList() const
Definition: AMCdata.h:96
void setAMCTrailer(uint64_t word)
Definition: AMCdata.h:70
std::vector< GEBdata > gebd_
Vector of GEB data.
Definition: AMCdata.h:114
uint64_t buffState
Definition: AMCdata.h:43
uint64_t runType
Definition: AMCdata.h:26
uint64_t orbitNum
Definition: AMCdata.h:22
uint64_t getAMCheader2() const
Definition: AMCdata.h:68
uint8_t param3() const
Definition: AMCdata.h:87
unsigned long long uint64_t
Definition: Time.h:15
uint8_t param1() const
Definition: AMCdata.h:89
uint8_t davCnt() const
Definition: AMCdata.h:94
uint64_t davCnt
Definition: AMCdata.h:42
uint64_t word
Definition: AMCdata.h:9
uint64_t reserved
Definition: AMCdata.h:15
uint16_t ttsState() const
Definition: AMCdata.h:93
uint32_t buffState() const
Definition: AMCdata.h:95
void setGEMeventTrailer(uint64_t word)
Definition: AMCdata.h:77
uint64_t ttsState
Definition: AMCdata.h:41
uint64_t boardID
Definition: AMCdata.h:21
uint8_t formatVer() const
Definition: AMCdata.h:91
uint64_t l1AID
Definition: AMCdata.h:13
uint64_t getGEMeventHeader() const
Definition: AMCdata.h:75
void setAMCheader2(uint64_t word)
Definition: AMCdata.h:66
uint64_t word
Definition: AMCdata.h:39
uint64_t word
Definition: AMCdata.h:31
void addGEB(GEBdata g)
Adds GEB data to vector.
Definition: AMCdata.h:102
uint64_t param3
Definition: AMCdata.h:23
uint64_t AMCnum
Definition: AMCdata.h:14
uint64_t formatVer
Definition: AMCdata.h:27
uint64_t getAMCheader1() const
Definition: AMCdata.h:64