File indexing completed on 2024-04-06 12:10:41
0001
0002 #ifndef AMC13Header_H_included
0003 #define AMC13Header_H_included
0004
0005 #include <cstdint>
0006
0007 namespace hcal {
0008
0009
0010
0011
0012 class AMC13Header {
0013 public:
0014
0015 inline int sourceId() const { return int(cdfHeader >> 8) & 0xFFF; }
0016
0017 inline int bunchId() const { return int(cdfHeader >> 20) & 0xFFF; }
0018
0019 inline int l1aNumber() const { return int((cdfHeader >> 32) & 0x00FFFFFF); }
0020
0021 inline int CDFEventType() const { return (int(cdfHeader >> 56) & 0x0F); }
0022
0023 inline unsigned int orbitNumber() const { return (unsigned int)((amc13Header >> 4) & 0xFFFFFFFFu); }
0024
0025 inline int NAMC() const { return int((amc13Header >> 52) & 0xF); }
0026
0027 inline int AMC13FormatVersion() const { return int((amc13Header >> 60) & 0xF); }
0028
0029
0030
0031 inline uint16_t AMCId(int i) const { return uint16_t(modulesHeaders[i] & 0xFFFF); }
0032
0033 inline int AMCSlot(int i) const { return int((modulesHeaders[i] >> 16) & 0xF); }
0034
0035 inline int AMCBlockNumber(int i) const { return int((modulesHeaders[i] >> 20) & 0xFF); }
0036
0037 inline int AMCSize(int i) const { return int((modulesHeaders[i] >> 32) & 0xFFFFFF); }
0038
0039 inline bool AMCMore(int i) const { return ((modulesHeaders[i] >> 61) & 0x1) != 0; }
0040
0041 inline bool AMCSegmented(int i) const { return ((modulesHeaders[i] >> 60) & 0x1) != 0; }
0042
0043 inline bool AMCLengthOk(int i) const { return ((modulesHeaders[i] >> 62) & 0x1) == 0; }
0044
0045 inline bool AMCCRCOk(int i) const { return ((modulesHeaders[i] >> 56) & 0x1) != 0; }
0046
0047 inline bool AMCDataPresent(int i) const { return ((modulesHeaders[i] >> 58) & 0x1) != 0; }
0048
0049 inline bool AMCDataValid(int i) const { return ((modulesHeaders[i] >> 57) & 0x1) != 0; }
0050
0051 inline bool AMCEnabled(int i) const { return ((modulesHeaders[i] >> 59) & 0x1) != 0; }
0052
0053
0054 const uint64_t* AMCPayload(int i) const;
0055
0056 private:
0057 uint64_t cdfHeader;
0058 uint64_t amc13Header;
0059 uint64_t modulesHeaders[12];
0060 };
0061 }
0062
0063 #endif