ATLAS Offline Software
Loading...
Searching...
No Matches
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"
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
37 uint32_t m_dataWord;
38 uint16_t m_wordHeader;
39 uint16_t m_wordHeader2;
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