ATLAS Offline Software
Loading...
Searching...
No Matches
ALFA_RawDataReadOut.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
6
8 m_dataWord(0),
10 m_SlotId(0),
11 m_LsbTdcId(0),
12 m_ecnt_BOT(0),
13 m_ecnt_EOT(0),
14 m_bcId(0),
15 m_wcnt(0),
16 m_MBId(0),
17 m_bit26_27(0),
18 m_bit24_27(0),
19 m_WordId(0),
20 m_PMFId(0),
21 m_fiber(0),
22 m_ADC(0),
23 m_pattern(),
24 m_scaler(0),
25 m_bit16(0),
27 m_bit18(0)
28{ }
29
32
33void ALFA_RawDataReadOut::decodeWord(uint32_t dataWord)
34
35{
36
37 // Zero all the decoded quantities
38 setZero();
39 m_dataWord = dataWord;
40 m_word = dataWord;
42
43 if (is_TDCt()) // TDC single measurement
44 {
45 m_bit18 = (bool) getBits(getBitsWord(18,18));
46 m_error_bit17 = (bool) getBits(getBitsWord(17,17));
48 m_PMFId = getBits(getBitsWord(23,19));
49 m_bit16 = (bool) getBits(getBitsWord(16,16));
52 m_ADC = getBits(getBitsWord(11,0)); // PMF24: Word 2 -> ADC 1, Word 3 -> ADC 2
53
54 for(int i = 15; i > -1; i--) // PMF 24 Word 0 bits from 15 to 0 contain trigger information (current and previous 3 bunch crossings)
55 {
56 if(getBits(getBitsWord(i,i))) m_pattern.push_back(true);
57 else m_pattern.push_back(false);
58 }
59
60 m_scaler = getBits(getBitsWord(15,0)); // PMF 24 Word 1
61 m_MBId = getBits(getBitsWord(7,0)); // PMF0 - WordId 0 -> position from 1-15
62 }
63
64
65 else if (is_BOT()) // Beginning of TDC
66 {
67 // One header bit is used for TDC numbers > 15
70 m_bcId = getBits(getBitsWord(11,0));
71 }
72 else if (is_EOT()) // End of TDC
73 {
76 m_wcnt = getBits(getBitsWord(11,0));
78 }
79
80
81
82}
83
84
86{
87 m_SlotId = 0;
88 m_LsbTdcId = 0;
89 m_ecnt_BOT = 0;
90 m_ecnt_EOT = 0;
91 m_bcId = 0;
92 m_wcnt = 0;
93 m_WordId = 0;
94 m_PMFId=0;
95 m_fiber =0;
96 m_ADC=0;
97 m_pattern.clear();
98 m_scaler=0;
99 m_bit16=false;
100 m_error_bit17=false;
101 m_bit18=false;
102 m_MBId = 0;
103 m_bit26_27=0;
104 m_bit24_27=0;
105}
106
107//-------------------------------------------------------------------------
void decodeWord(uint32_t dataWord)
static constexpr uint16_t s_headerPos
static constexpr uint16_t s_headerBits
std::vector< bool > m_pattern
uint32_t m_word
constexpr std::pair< uint32_t, uint16_t > getBitsWord(const uint16_t bstart, const uint16_t bstop)
uint32_t getBits(std::pair< uint32_t, uint16_t > in)