ATLAS Offline Software
ALFA_RawDataReadOut.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 ALFARAWDATAREADOUT_H
6 #define ALFARAWDATAREADOUT_H
7 
8 #include "ALFA_ReadOut.h"
9 #include <stdint.h>
10 
12 
13 #include "eformat/SourceIdentifier.h"
14 #include "eformat/Version.h"
16 
20 
21 
22 // Decoding methods for raw data words
23 // S. Diglio Sept 2009
24 
25 
27 
28  private:
29 
30  // Raw data word
32  // Data word header
34 
35  // Header info: event counter, bunch crossing ID and tdc number: EOT and BOT
36  uint16_t m_SlotId; // bit 28-24 BOT
37  uint16_t m_LsbTdcId; // bit 25-24 EOT
38  uint16_t m_ecnt_BOT; // bit 23-12 BOT(event counter, counted by TDC)
39  uint16_t m_ecnt_EOT; // bit 23-12 BOT(event counter, counted by TDC)
40  uint16_t m_bcId; // bit 11-0 BOT (bunch crossing Id)
41 
42  // Footer info: words counter
43  uint16_t m_wcnt; // bit 11-0 EOT (numer of word in TDC data block counting itself)
44 
45  // Data info TSM:
46 
47  uint16_t m_MBId; // bit 15-0 MB number PMF0 Word1
48 
51 
52  uint16_t m_WordId; // bit 25-24 (word number from 0 to3)
53  uint16_t m_PMFId; // bit 23-19 (PMF number from 1 to 23--> PMF0 also)
54  uint16_t m_fiber; // bit 15-0 (number of fiber)
55  uint16_t m_ADC; // bit 12-0 (ADC counter for 3rd and 4th word corresponding to PMF24)
56  std::vector<bool> m_pattern; // bit 15-12 (trigger type for 1st word corresponding to PMF24: bit 15->O2, bit14-> M2, bit 13-> O1, bit 12-> M1)
57  uint16_t m_scaler; // bit 15-0 (trigger counter (in 1 ms) for 2nd word corresponding to PMF24)
58  bool m_bit16;
60  bool m_bit18;
61 
62  std::vector<uint32_t> m_MarocChan;
63 
64  // Define the data structure and the word header values
65 
66  // Word header Position and values
67  // The word header occupies the 4 highest bits of each TDC data word
68  static constexpr uint16_t s_headerPos = 28; // from bit 28 to 31
69  static constexpr uint16_t s_headerBits = 0xf;
70 
71  // Beginning of TDC
72  static constexpr uint16_t s_BOTvalue = 0xa;
73 
74  // End of TDC
75  static constexpr uint16_t s_EOTvalue = 0xc;
76 
77  // TDC single measurement
78  static constexpr uint16_t s_TSMvalue = 0x3;
79 
80  public:
81 
82  // constructor and destructor
85 
86  // Methods for decoding and encoding dataWords
87  void decodeWord(uint32_t dataWord);
88 
89  //StatusCode encodeWord(uint16_t headerVal);
90 
91  // Methods to identify the word type
92  // Beginning of TDC
93  bool is_BOT() const {return (m_wordHeader == s_BOTvalue);};
94  // End of TDC
95  bool is_EOT() const{return (m_wordHeader == s_EOTvalue);};
96  // TDC single measurement
97  bool is_TDCt()const {return (m_wordHeader == s_TSMvalue);};
98 
99  // Methods to retrieve the decoded word content (Get)
100 
101  uint16_t MBId() const {return m_MBId;}
102 
103  uint16_t SlotId() const {return m_SlotId;}
104  uint16_t LsbTdcId() const {return m_LsbTdcId;}
105  uint16_t ecnt_BOT() const {return m_ecnt_BOT;}
106  uint16_t ecnt_EOT() const {return m_ecnt_EOT;}
107  uint16_t bcId() const {return m_bcId;}
108  uint16_t WordId() const {return m_WordId;}
109  uint16_t PMFId() const {return m_PMFId;}
110  uint16_t fiber() const {return m_fiber;}
111  uint16_t ADC() const {return m_ADC;}
112  const std::vector<bool>& pattern() const {return m_pattern;}
113  uint16_t scaler() const {return m_scaler;}
114  bool bit16() const {return m_bit16;}
115  bool error_bit17() const{return m_error_bit17;}
116  bool bit18() const {return m_bit18;}
117  bool isError()const {return m_error_bit17;}
118  uint16_t bit26_27() const {return m_bit26_27;}
119  uint16_t bit24_27() const {return m_bit24_27;}
120 
121  const std::vector<uint32_t>& HitChan() const {return m_MarocChan;}
122 
123  private:
124 
125  void setZero();
126 
127  // Methods for the decoding
128  //ALFA_RawDataReadOut * m_ALFA_RawDataReadOut;
129 
130 };
131 
132 #endif // ALFARAWDATAREADOUT_H
ALFA_RawDataReadOut::HitChan
const std::vector< uint32_t > & HitChan() const
Definition: ALFA_RawDataReadOut.h:121
ALFA_RawDataReadOut::bit16
bool bit16() const
Definition: ALFA_RawDataReadOut.h:114
ALFA_RawDataReadOut
Definition: ALFA_RawDataReadOut.h:26
ALFA_RawDataReadOut::fiber
uint16_t fiber() const
Definition: ALFA_RawDataReadOut.h:110
ALFA_RawDataReadOut::is_EOT
bool is_EOT() const
Definition: ALFA_RawDataReadOut.h:95
ALFA_RawDataReadOut::m_WordId
uint16_t m_WordId
Definition: ALFA_RawDataReadOut.h:52
ALFA_RawDataReadOut::m_wcnt
uint16_t m_wcnt
Definition: ALFA_RawDataReadOut.h:43
ALFA_RawDataReadOut::m_ecnt_EOT
uint16_t m_ecnt_EOT
Definition: ALFA_RawDataReadOut.h:39
ALFA_RawDataContainer.h
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
ALFA_RawDataReadOut::bit26_27
uint16_t bit26_27() const
Definition: ALFA_RawDataReadOut.h:118
ALFA_RawDataReadOut::m_MarocChan
std::vector< uint32_t > m_MarocChan
Definition: ALFA_RawDataReadOut.h:62
ALFA_RawDataReadOut::isError
bool isError() const
Definition: ALFA_RawDataReadOut.h:117
ALFA_RawDataReadOut::m_scaler
uint16_t m_scaler
Definition: ALFA_RawDataReadOut.h:57
ALFA_RawDataReadOut::ADC
uint16_t ADC() const
Definition: ALFA_RawDataReadOut.h:111
ALFA_RawDataReadOut::m_error_bit17
bool m_error_bit17
Definition: ALFA_RawDataReadOut.h:59
ALFA_RawDataReadOut::SlotId
uint16_t SlotId() const
Definition: ALFA_RawDataReadOut.h:103
ALFA_RawDataReadOut::~ALFA_RawDataReadOut
~ALFA_RawDataReadOut()
Definition: ALFA_RawDataReadOut.cxx:30
ALFA_RawDataReadOut::WordId
uint16_t WordId() const
Definition: ALFA_RawDataReadOut.h:108
ALFA_RawDataReadOut::setZero
void setZero()
Definition: ALFA_RawDataReadOut.cxx:85
ALFA_RawDataReadOut::m_LsbTdcId
uint16_t m_LsbTdcId
Definition: ALFA_RawDataReadOut.h:37
ALFA_RawDataReadOut::s_headerBits
static constexpr uint16_t s_headerBits
Definition: ALFA_RawDataReadOut.h:69
ALFA_RawDataReadOut::bit18
bool bit18() const
Definition: ALFA_RawDataReadOut.h:116
ALFA_RawDataReadOut::m_ADC
uint16_t m_ADC
Definition: ALFA_RawDataReadOut.h:55
ALFA_RawDataReadOut::decodeWord
void decodeWord(uint32_t dataWord)
Definition: ALFA_RawDataReadOut.cxx:33
ALFA_RawDataReadOut::ecnt_EOT
uint16_t ecnt_EOT() const
Definition: ALFA_RawDataReadOut.h:106
ALFA_RawDataReadOut::PMFId
uint16_t PMFId() const
Definition: ALFA_RawDataReadOut.h:109
ALFA_RawDataReadOut::ALFA_RawDataReadOut
ALFA_RawDataReadOut()
Definition: ALFA_RawDataReadOut.cxx:7
ALFA_RawDataReadOut::m_bit18
bool m_bit18
Definition: ALFA_RawDataReadOut.h:60
ALFA_RawData.h
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:88
ALFA_RawDataReadOut::m_dataWord
uint32_t m_dataWord
Definition: ALFA_RawDataReadOut.h:31
ALFA_RawDataReadOut::m_pattern
std::vector< bool > m_pattern
Definition: ALFA_RawDataReadOut.h:56
RawEvent.h
ALFA_RawDataReadOut::m_bit16
bool m_bit16
Definition: ALFA_RawDataReadOut.h:58
AthAlgTool.h
ALFA_RawDataReadOut::s_headerPos
static constexpr uint16_t s_headerPos
Definition: ALFA_RawDataReadOut.h:68
ALFA_RawDataReadOut::m_bcId
uint16_t m_bcId
Definition: ALFA_RawDataReadOut.h:40
ALFA_RawDataReadOut::m_fiber
uint16_t m_fiber
Definition: ALFA_RawDataReadOut.h:54
ALFA_ReadOut
Definition: ALFA_ReadOut.h:14
ALFA_RawDataReadOut::m_PMFId
uint16_t m_PMFId
Definition: ALFA_RawDataReadOut.h:53
ALFA_RawDataReadOut::m_wordHeader
uint16_t m_wordHeader
Definition: ALFA_RawDataReadOut.h:33
ALFA_RawDataReadOut::m_ecnt_BOT
uint16_t m_ecnt_BOT
Definition: ALFA_RawDataReadOut.h:38
ALFA_RawDataReadOut::m_SlotId
uint16_t m_SlotId
Definition: ALFA_RawDataReadOut.h:36
ALFA_RawDataReadOut::bit24_27
uint16_t bit24_27() const
Definition: ALFA_RawDataReadOut.h:119
ALFA_RawDataReadOut::MBId
uint16_t MBId() const
Definition: ALFA_RawDataReadOut.h:101
ALFA_RawDataReadOut::bcId
uint16_t bcId() const
Definition: ALFA_RawDataReadOut.h:107
ALFA_RawDataReadOut::pattern
const std::vector< bool > & pattern() const
Definition: ALFA_RawDataReadOut.h:112
ALFA_RawDataReadOut::s_EOTvalue
static constexpr uint16_t s_EOTvalue
Definition: ALFA_RawDataReadOut.h:75
ALFA_RawDataReadOut::m_bit26_27
uint16_t m_bit26_27
Definition: ALFA_RawDataReadOut.h:49
ALFA_RawDataReadOut::s_TSMvalue
static constexpr uint16_t s_TSMvalue
Definition: ALFA_RawDataReadOut.h:78
ALFA_RawDataReadOut::ecnt_BOT
uint16_t ecnt_BOT() const
Definition: ALFA_RawDataReadOut.h:105
ALFA_ReadOut.h
ALFA_RawDataReadOut::m_MBId
uint16_t m_MBId
Definition: ALFA_RawDataReadOut.h:47
ALFA_RawDataCollection.h
ALFA_RawDataReadOut::error_bit17
bool error_bit17() const
Definition: ALFA_RawDataReadOut.h:115
ALFA_RawDataReadOut::LsbTdcId
uint16_t LsbTdcId() const
Definition: ALFA_RawDataReadOut.h:104
ALFA_RawDataReadOut::is_TDCt
bool is_TDCt() const
Definition: ALFA_RawDataReadOut.h:97
ALFA_RawDataReadOut::is_BOT
bool is_BOT() const
Definition: ALFA_RawDataReadOut.h:93
ALFA_RawDataReadOut::scaler
uint16_t scaler() const
Definition: ALFA_RawDataReadOut.h:113
ALFA_RawDataReadOut::m_bit24_27
uint16_t m_bit24_27
Definition: ALFA_RawDataReadOut.h:50
ALFA_RawDataReadOut::s_BOTvalue
static constexpr uint16_t s_BOTvalue
Definition: ALFA_RawDataReadOut.h:72