ATLAS Offline Software
ALFA_RawDataCollectionReadOut.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef RAWDATACOLLECTIONREADOUT_H
6 #define RAWDATACOLLECTIONREADOUT_H
7 
8 #include "ALFA_ReadOut.h"
9 #include "ALFA_RawDataReadOut.h"
11 #include <stdint.h>
12 
14 
15 #include "eformat/SourceIdentifier.h"
16 #include "eformat/Version.h"
18 
22 
26 
27 // Decoding methods for a block
28 // S. Diglio
29 
30 
32 {
33 
34  private:
35 
36  // Raw data word and word header
40 
41 
42  // Decoded data
43  uint32_t m_lvl1Id; // Lvl1 Id bit 23-0 BOB
44  uint32_t m_clwc; // MB word count bit 15-0 LWC: 2*18+3*22+LWC+BOL+TLP+TWC=0x6a
45  uint16_t m_ftyp; // flag type
46 
47  uint16_t m_ecnt_LWC; // Event counter bit 19-16 LWC
48  uint16_t m_ecnt_TWC; // Event counter bit 23-12 TWC
49  uint16_t m_ecnt_EOB; // Event counter bit 15-0 EOB
50 
51  uint16_t m_ctwc; // Trailer word count bit 11-0 EOT
52 
53  uint16_t m_BOLflag; // Bol flags bit 23-16 BOL
54 
55  uint16_t m_MrodNum; // MROD number bit 15-4 BOL
56  uint16_t m_RODinput; // ROD input bit 3-0 BOL
57  uint32_t m_KaptId; // Kapton number bit 19-0 TLP
58 
59  // Word header Position and values
60  // The word header occupies the 8 highest bits of each word
61  static constexpr uint16_t s_headerPos = 24;
62  static constexpr uint16_t s_headerBits = 0xff;
63 
64  // Word header Position and values
65  // The word header occupies the 12 highest bits of each word
66  static constexpr uint16_t s_headerPos2 = 20;
67  static constexpr uint16_t s_headerBits2 = 0xfff;
68 
69  // Beginning of buffer
70  static constexpr uint16_t s_BOBvalue = 0x80;
71  // Link Word Count: first word of a link block
72  static constexpr uint16_t s_LWCvalue = 0x810;
73  // Beginning of Link: signals which link is giving its data
74  static constexpr uint16_t s_BOLvalue = 0x18;
75  // TDC Link Present
76  static constexpr uint16_t s_TLPvalue = 0x890;
77  // Trailer Word Count: last word of a link block
78  static constexpr uint16_t s_TWCvalue = 0x8a;
79  // End of Block (end of data from the s)
80  static constexpr uint16_t s_EOBvalue = 0xf0;
81 
82  public:
84 
85  void decodeWord(uint32_t dataWord);
86 
87  bool is_BOB() const {return m_wordHeader == s_BOBvalue;};
88  bool is_LWC() const {return m_wordHeader2 == s_LWCvalue;};
89  bool is_BOL() const {return m_wordHeader == s_BOLvalue;};
90  bool is_TLP() const {return m_wordHeader2 == s_TLPvalue;};
91  bool is_TWC() const {return m_wordHeader == s_TWCvalue;};
92  bool is_EOB() const {return m_wordHeader == s_EOBvalue;};
93 
94  // Methods to access the decoded information
95  uint32_t lvl1Id() const {return m_lvl1Id;}
96  uint32_t clwc() const {return m_clwc;}
97  uint16_t BOLflag() const {return m_BOLflag;}
98  uint16_t ftyp() const {return m_ftyp;}
99 
100  uint16_t ecnt_LWC() const {return m_ecnt_LWC;}
101  uint16_t ecnt_TWC() const {return m_ecnt_TWC;}
102  uint16_t ecnt_EOB() const {return m_ecnt_EOB;}
103  uint16_t ctwc() const {return m_ctwc;}
104  uint16_t MrodNum() const {return m_MrodNum;}
105  uint16_t RODinput() const {return m_RODinput;}
106  uint16_t KaptId() const {return m_KaptId;}
107 
108  private:
109 
110  // Private methods
111  void setZero();
112 
113  // Methods for the decoding
114  //ALFA_RawDataCollectionReadOut * m_ALFA_RawDataCollectionReadOut;
115  //ALFA_RawDataReadOut * m_ALFA_RawDataReadOut;
116 
117 };
118 
119 #endif // RAWDATACOLLECTIONREADOUT_H
120 
121 
122 
123 
ALFA_RawDataCollectionReadOut::s_headerBits2
static constexpr uint16_t s_headerBits2
Definition: ALFA_RawDataCollectionReadOut.h:67
ALFA_RawDataContainer_charge.h
ALFA_RawDataCollectionReadOut::s_headerPos2
static constexpr uint16_t s_headerPos2
Definition: ALFA_RawDataCollectionReadOut.h:66
ALFA_RawDataCollectionReadOut::ecnt_EOB
uint16_t ecnt_EOB() const
Definition: ALFA_RawDataCollectionReadOut.h:102
ALFA_RawDataCollectionReadOut::ecnt_LWC
uint16_t ecnt_LWC() const
Definition: ALFA_RawDataCollectionReadOut.h:100
ALFA_RawDataCollectionReadOut::m_RODinput
uint16_t m_RODinput
Definition: ALFA_RawDataCollectionReadOut.h:56
ALFA_RawDataCollectionReadOut::ftyp
uint16_t ftyp() const
Definition: ALFA_RawDataCollectionReadOut.h:98
ALFA_RawDataCollectionReadOut::m_ftyp
uint16_t m_ftyp
Definition: ALFA_RawDataCollectionReadOut.h:45
ALFA_RawDataContainer.h
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
ALFA_RawDataCollectionReadOut::s_EOBvalue
static constexpr uint16_t s_EOBvalue
Definition: ALFA_RawDataCollectionReadOut.h:80
ALFA_RawDataCollectionReadOut::m_MrodNum
uint16_t m_MrodNum
Definition: ALFA_RawDataCollectionReadOut.h:55
ALFA_RawDataCollectionReadOut::s_BOLvalue
static constexpr uint16_t s_BOLvalue
Definition: ALFA_RawDataCollectionReadOut.h:74
ALFA_RawDataCollectionReadOut::is_TWC
bool is_TWC() const
Definition: ALFA_RawDataCollectionReadOut.h:91
ALFA_RawDataCollectionReadOut::BOLflag
uint16_t BOLflag() const
Definition: ALFA_RawDataCollectionReadOut.h:97
ALFA_RawDataReadOut_charge.h
ALFA_RawDataCollectionReadOut::s_headerPos
static constexpr uint16_t s_headerPos
Definition: ALFA_RawDataCollectionReadOut.h:61
ALFA_RawDataCollectionReadOut::m_ecnt_TWC
uint16_t m_ecnt_TWC
Definition: ALFA_RawDataCollectionReadOut.h:48
ALFA_RawDataCollectionReadOut::m_ecnt_EOB
uint16_t m_ecnt_EOB
Definition: ALFA_RawDataCollectionReadOut.h:49
ALFA_RawDataCollectionReadOut::setZero
void setZero()
Definition: ALFA_RawDataCollectionReadOut.cxx:70
ALFA_RawData_charge.h
ALFA_RawDataCollectionReadOut::is_BOL
bool is_BOL() const
Definition: ALFA_RawDataCollectionReadOut.h:89
ALFA_RawDataCollectionReadOut::s_headerBits
static constexpr uint16_t s_headerBits
Definition: ALFA_RawDataCollectionReadOut.h:62
ALFA_RawDataCollectionReadOut::m_lvl1Id
uint32_t m_lvl1Id
Definition: ALFA_RawDataCollectionReadOut.h:43
ALFA_RawDataCollectionReadOut::is_LWC
bool is_LWC() const
Definition: ALFA_RawDataCollectionReadOut.h:88
ALFA_RawDataCollectionReadOut::m_KaptId
uint32_t m_KaptId
Definition: ALFA_RawDataCollectionReadOut.h:57
ALFA_RawDataCollectionReadOut::ecnt_TWC
uint16_t ecnt_TWC() const
Definition: ALFA_RawDataCollectionReadOut.h:101
ALFA_RawDataCollectionReadOut::s_TWCvalue
static constexpr uint16_t s_TWCvalue
Definition: ALFA_RawDataCollectionReadOut.h:78
ALFA_RawData.h
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:88
ALFA_RawDataCollectionReadOut::s_LWCvalue
static constexpr uint16_t s_LWCvalue
Definition: ALFA_RawDataCollectionReadOut.h:72
RawEvent.h
ALFA_RawDataCollectionReadOut::decodeWord
void decodeWord(uint32_t dataWord)
Definition: ALFA_RawDataCollectionReadOut.cxx:27
ALFA_RawDataCollectionReadOut::KaptId
uint16_t KaptId() const
Definition: ALFA_RawDataCollectionReadOut.h:106
ALFA_RawDataCollectionReadOut::m_clwc
uint32_t m_clwc
Definition: ALFA_RawDataCollectionReadOut.h:44
ALFA_RawDataCollectionReadOut::m_BOLflag
uint16_t m_BOLflag
Definition: ALFA_RawDataCollectionReadOut.h:53
AthAlgTool.h
ALFA_RawDataCollectionReadOut::m_ctwc
uint16_t m_ctwc
Definition: ALFA_RawDataCollectionReadOut.h:51
ALFA_RawDataCollectionReadOut::lvl1Id
uint32_t lvl1Id() const
Definition: ALFA_RawDataCollectionReadOut.h:95
ALFA_ReadOut
Definition: ALFA_ReadOut.h:14
ALFA_RawDataCollectionReadOut::ctwc
uint16_t ctwc() const
Definition: ALFA_RawDataCollectionReadOut.h:103
ALFA_RawDataCollectionReadOut::ALFA_RawDataCollectionReadOut
ALFA_RawDataCollectionReadOut()
Definition: ALFA_RawDataCollectionReadOut.cxx:8
ALFA_RawDataCollectionReadOut::m_wordHeader2
uint16_t m_wordHeader2
Definition: ALFA_RawDataCollectionReadOut.h:39
ALFA_RawDataCollectionReadOut
Definition: ALFA_RawDataCollectionReadOut.h:32
ALFA_RawDataCollectionReadOut::m_wordHeader
uint16_t m_wordHeader
Definition: ALFA_RawDataCollectionReadOut.h:38
ALFA_RawDataCollectionReadOut::clwc
uint32_t clwc() const
Definition: ALFA_RawDataCollectionReadOut.h:96
ALFA_RawDataCollectionReadOut::m_ecnt_LWC
uint16_t m_ecnt_LWC
Definition: ALFA_RawDataCollectionReadOut.h:47
ALFA_RawDataCollectionReadOut::RODinput
uint16_t RODinput() const
Definition: ALFA_RawDataCollectionReadOut.h:105
ALFA_RawDataCollectionReadOut::MrodNum
uint16_t MrodNum() const
Definition: ALFA_RawDataCollectionReadOut.h:104
ALFA_RawDataCollectionReadOut::is_EOB
bool is_EOB() const
Definition: ALFA_RawDataCollectionReadOut.h:92
ALFA_RawDataCollectionReadOut::s_BOBvalue
static constexpr uint16_t s_BOBvalue
Definition: ALFA_RawDataCollectionReadOut.h:70
ALFA_RawDataCollectionReadOut::is_TLP
bool is_TLP() const
Definition: ALFA_RawDataCollectionReadOut.h:90
ALFA_ReadOut.h
ALFA_RawDataCollection.h
ALFA_RawDataCollectionReadOut::s_TLPvalue
static constexpr uint16_t s_TLPvalue
Definition: ALFA_RawDataCollectionReadOut.h:76
ALFA_RawDataCollection_charge.h
ALFA_RawDataCollectionReadOut::is_BOB
bool is_BOB() const
Definition: ALFA_RawDataCollectionReadOut.h:87
ALFA_RawDataCollectionReadOut::m_dataWord
uint32_t m_dataWord
Definition: ALFA_RawDataCollectionReadOut.h:37
ALFA_RawDataReadOut.h