ATLAS Offline Software
LArFebHeader.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef LARFEBHEADER_H
6 #define LARFEBHEADER_H
7 
9 #include <cstdint>
10 
11 
21 {
22  public:
23 
25  struct RodHeader {
33  };
34 
36  struct DspHeader {
37  uint32_t CodeVersion{}; // DSP code version
38  uint32_t EventCounter{}; // DSP event counter
39  };
40 
41 
43  LArFebHeader();
44 
46  LArFebHeader(const HWIdentifier febid);
47 
49  ~LArFebHeader() = default;
50 
52  inline HWIdentifier FEBId() const {return m_FEBId;}
53 
56 
58  inline uint32_t SourceId() const {return m_RodHeader.SourceId;}
59 
61  inline uint32_t RunNumber() const {return m_RodHeader. RunNumber;}
62 
64  inline uint16_t ELVL1Id() const {return m_RodHeader.ELVL1Id;}
65 
67  inline uint16_t BCId() const {return m_RodHeader.BCId;}
68 
70  inline uint32_t LVL1TigType() const {return m_RodHeader.LVL1TigType;}
71 
73  inline uint32_t DetEventType() const {return m_RodHeader.DetEventType;}
74 
77 
80 
82  inline uint16_t FebELVL1Id() const {return m_ELVL1Id;}
83 
85  inline uint16_t FebBCId() const {return m_BCId;}
86 
88  inline uint16_t RodResults1Size() const {return m_Results1Size;}
89  inline uint16_t RodResults2Size() const {return m_Results2Size;}
90  inline uint16_t RodRawDataSize() const {return m_RawDataSize;}
91 
93  inline uint16_t NbSamples() const {return m_NbSamples;}
94  inline uint16_t NbSweetCells1() const {return m_NbSweetCells1;}
95  inline uint16_t NbSweetCells2() const {return m_NbSweetCells2;}
96  inline uint32_t OnlineChecksum() const { return m_OnlineChecksum; }
97  inline uint32_t OfflineChecksum() const { return m_OfflineChecksum; }
98  inline bool ChecksumVerification() const { return m_OnlineChecksum==m_OfflineChecksum; }
99 
101  inline const std::vector <uint16_t> & FebCtrl1() const {return m_Ctrl1;}
102 
104  inline const std::vector <uint16_t> & FebCtrl2() const {return m_Ctrl2;}
105 
107  inline const std::vector <uint16_t> & FebCtrl3() const {return m_Ctrl3;}
108 
110  inline uint32_t RodStatus() const {return m_Status;}
111 
113  inline const std::vector <uint16_t> & SCA() const { return m_SCA; }
114 
116  inline bool CheckErrorELVL1Id() const { return (m_RodHeader.ELVL1Id&0x1f)!=m_ELVL1Id; }
117 
119  inline bool CheckErrorBCId() const { return m_RodHeader.BCId!=((m_BCId+1)&0xfff); }
120 
122  inline void SetFormatVersion(const uint32_t formatVersion)
123  { m_RodHeader.FormatVersion=formatVersion; return; }
124 
126  inline void SetSourceId(const uint32_t sourceID)
127  { m_RodHeader.SourceId=sourceID; return; }
128 
130  inline void SetRunNumber(const uint32_t runNumber)
131  { m_RodHeader.RunNumber=runNumber; return; }
132 
134  inline void SetELVL1Id(const uint16_t elvl1Id)
135  { m_RodHeader.ELVL1Id=elvl1Id; return; }
136 
138  inline void SetBCId(const uint16_t bcid)
139  { m_RodHeader.BCId=bcid; return; }
140 
142  inline void SetRodResults1Size(const uint16_t size)
143  { m_Results1Size=size; return; }
144  inline void SetRodResults2Size(const uint16_t size)
145  { m_Results2Size=size; return; }
146  inline void SetRodRawDataSize (const uint16_t size)
147  { m_RawDataSize=size; return; }
148 
150  inline void SetNbSweetCells1(const uint16_t n)
151  { m_NbSweetCells1=n; return; }
152  inline void SetNbSweetCells2(const uint16_t n)
153  { m_NbSweetCells2=n; return; }
154  inline void SetNbSamples(const uint16_t n)
155  { m_NbSamples=n; return; }
156  inline void SetOnlineChecksum(const uint32_t checksum)
157  { m_OnlineChecksum=checksum; return; }
158  inline void SetOfflineChecksum(const uint32_t checksum)
159  { m_OfflineChecksum=checksum; return; }
160 
162  inline void SetLVL1TigType(const uint32_t lvl1ttype)
163  { m_RodHeader.LVL1TigType=lvl1ttype; return; }
164 
166  inline void SetDetEventType(const uint32_t detEvType)
167  { m_RodHeader.DetEventType=detEvType; return; }
168 
170  inline void SetDspCodeVersion(const uint32_t codeVersion)
171  { m_DspHeader.CodeVersion=codeVersion; return; }
172 
174  inline void SetDspEventCounter(const uint32_t eventCounter)
175  { m_DspHeader.EventCounter=eventCounter; return; }
176 
178  inline void SetFebELVL1Id(const uint16_t elvl1Id)
179  { m_ELVL1Id=elvl1Id; return; }
180 
182  inline void SetFebBCId(const uint16_t bcid)
183  { m_BCId=bcid; return; }
184 
186  inline void SetFebCtrl1(const uint16_t ctrl1)
187  { m_Ctrl1.push_back(ctrl1); return; }
188 
190  inline void SetFebCtrl2(const uint16_t ctrl2)
191  { m_Ctrl2.push_back(ctrl2); return; }
192 
194  inline void SetFebCtrl3(const uint16_t ctrl3)
195  { m_Ctrl3.push_back(ctrl3); return; }
196 
198  inline void SetRodStatus(const uint32_t status)
199  { m_Status=status; return; }
200 
202  inline void SetFebSCA(const uint16_t sca)
203  { m_SCA.push_back(degray(sca)); return; }
204 
205 
206 
207 
208  private:
209 
211  static int degray(unsigned int x);
212 
215 
217 
219 
222 
225 
234 
237 
239  std::vector<uint16_t> m_SCA;
240 
242  std::vector<uint16_t> m_Ctrl1;
243 
245  std::vector<uint16_t> m_Ctrl2;
246 
248  std::vector<uint16_t> m_Ctrl3;
249 };
250 
251 #include "AthenaKernel/CLASS_DEF.h"
252 CLASS_DEF( LArFebHeader , 149839963 , 1 )
253 #endif
LArFebHeader::ELVL1Id
uint16_t ELVL1Id() const
get the EventID
Definition: LArFebHeader.h:64
LArFebHeader::FebCtrl3
const std::vector< uint16_t > & FebCtrl3() const
get the FEB Control Word #3
Definition: LArFebHeader.h:107
LArFebHeader::m_ELVL1Id
uint16_t m_ELVL1Id
FEB EventId.
Definition: LArFebHeader.h:221
LArFebHeader::degray
static int degray(unsigned int x)
like explained in: http://mathworld.wolfram.com/GrayCode.html
Definition: LArFebHeader.cxx:14
LArFebHeader::LVL1TigType
uint32_t LVL1TigType() const
get the Level1 trigger type ID
Definition: LArFebHeader.h:70
LArFebHeader::DspHeader::EventCounter
uint32_t EventCounter
Definition: LArFebHeader.h:38
LArFebHeader::FebCtrl1
const std::vector< uint16_t > & FebCtrl1() const
get the FEB Control Word #1
Definition: LArFebHeader.h:101
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
LArFebHeader::NbSamples
uint16_t NbSamples() const
get the number of samples and cells above threshold
Definition: LArFebHeader.h:93
LArFebHeader::m_Ctrl1
std::vector< uint16_t > m_Ctrl1
FEB Control word 1.
Definition: LArFebHeader.h:242
LArFebHeader::NbSweetCells1
uint16_t NbSweetCells1() const
Definition: LArFebHeader.h:94
LArFebHeader::DspHeader::CodeVersion
uint32_t CodeVersion
Definition: LArFebHeader.h:37
LArFebHeader::m_OnlineChecksum
uint32_t m_OnlineChecksum
Definition: LArFebHeader.h:232
LArFebHeader::SetFormatVersion
void SetFormatVersion(const uint32_t formatVersion)
set the format version
Definition: LArFebHeader.h:122
LArFebHeader::FormatVersion
uint32_t FormatVersion() const
get the format version
Definition: LArFebHeader.h:55
LArFebHeader::RodHeader::FormatVersion
uint32_t FormatVersion
Definition: LArFebHeader.h:26
HWIdentifier
Definition: HWIdentifier.h:13
LArFebHeader::SetELVL1Id
void SetELVL1Id(const uint16_t elvl1Id)
set the EventID
Definition: LArFebHeader.h:134
LArFebHeader::m_FEBId
const HWIdentifier m_FEBId
Feb Identifier.
Definition: LArFebHeader.h:214
x
#define x
LArFebHeader::NbSweetCells2
uint16_t NbSweetCells2() const
Definition: LArFebHeader.h:95
LArFebHeader::m_NbSamples
uint16_t m_NbSamples
Definition: LArFebHeader.h:231
LArFebHeader::FebCtrl2
const std::vector< uint16_t > & FebCtrl2() const
get the FEB Control Word #2
Definition: LArFebHeader.h:104
LArFebHeader::SetLVL1TigType
void SetLVL1TigType(const uint32_t lvl1ttype)
set the Level1 trigger type ID
Definition: LArFebHeader.h:162
LArFebHeader::OnlineChecksum
uint32_t OnlineChecksum() const
Definition: LArFebHeader.h:96
LArFebHeader::SetRodRawDataSize
void SetRodRawDataSize(const uint16_t size)
Definition: LArFebHeader.h:146
LArFebHeader::RodHeader
ROD-Header, always present (is part of the FEB-Header)
Definition: LArFebHeader.h:25
LArFebHeader::BCId
uint16_t BCId() const
get the Bunch Crossing ID
Definition: LArFebHeader.h:67
LArFebHeader::OfflineChecksum
uint32_t OfflineChecksum() const
Definition: LArFebHeader.h:97
LArFebHeader::SetBCId
void SetBCId(const uint16_t bcid)
set the Bunch Crossing ID
Definition: LArFebHeader.h:138
LArFebHeader::m_BCId
uint16_t m_BCId
FEB BCId.
Definition: LArFebHeader.h:224
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
LArFebHeader::RodHeader::RunNumber
uint32_t RunNumber
Definition: LArFebHeader.h:28
LArFebHeader::~LArFebHeader
~LArFebHeader()=default
Destructor.
LArFebHeader::RodHeader::LVL1TigType
uint32_t LVL1TigType
Definition: LArFebHeader.h:31
LArFebHeader::SCA
const std::vector< uint16_t > & SCA() const
get the SCA's
Definition: LArFebHeader.h:113
LArFebHeader::DetEventType
uint32_t DetEventType() const
get the Detector event type ID
Definition: LArFebHeader.h:73
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:88
LArFebHeader::SetFebELVL1Id
void SetFebELVL1Id(const uint16_t elvl1Id)
set the FEB Event ID
Definition: LArFebHeader.h:178
LArFebHeader::SourceId
uint32_t SourceId() const
get the source Id
Definition: LArFebHeader.h:58
beamspotman.n
n
Definition: beamspotman.py:731
LArFebHeader::FebELVL1Id
uint16_t FebELVL1Id() const
get the FEB Event ID
Definition: LArFebHeader.h:82
LArFebHeader::SetRunNumber
void SetRunNumber(const uint32_t runNumber)
set the run number
Definition: LArFebHeader.h:130
LArFebHeader::m_OfflineChecksum
uint32_t m_OfflineChecksum
Definition: LArFebHeader.h:233
LArFebHeader::m_DspHeader
DspHeader m_DspHeader
Definition: LArFebHeader.h:218
LArFebHeader::FEBId
HWIdentifier FEBId() const
get the FEBId
Definition: LArFebHeader.h:52
LArFebHeader::SetDspCodeVersion
void SetDspCodeVersion(const uint32_t codeVersion)
set the version of the DSP code
Definition: LArFebHeader.h:170
LArFebHeader::SetRodResults2Size
void SetRodResults2Size(const uint16_t size)
Definition: LArFebHeader.h:144
LArFebHeader::SetOnlineChecksum
void SetOnlineChecksum(const uint32_t checksum)
Definition: LArFebHeader.h:156
LArFebHeader::RodRawDataSize
uint16_t RodRawDataSize() const
Definition: LArFebHeader.h:90
LArFebHeader
Holds information from the FEB Header.
Definition: LArFebHeader.h:21
LArFebHeader::SetDspEventCounter
void SetDspEventCounter(const uint32_t eventCounter)
set the Event number counted by the DSP code
Definition: LArFebHeader.h:174
LArFebHeader::LArFebHeader
LArFebHeader()
for ROOT I/O
Definition: LArFebHeader.cxx:7
LArFebHeader::m_Results2Size
uint16_t m_Results2Size
Definition: LArFebHeader.h:227
LArFebHeader::m_Ctrl3
std::vector< uint16_t > m_Ctrl3
FEB Control word 3.
Definition: LArFebHeader.h:248
LArFebHeader::RodHeader::DetEventType
uint32_t DetEventType
Definition: LArFebHeader.h:32
LArFebHeader::DspHeader
DSP-Header (most of it is actually in the DSP-Trailer)
Definition: LArFebHeader.h:36
HWIdentifier.h
LArFebHeader::m_Results1Size
uint16_t m_Results1Size
Definition: LArFebHeader.h:226
LArFebHeader::SetSourceId
void SetSourceId(const uint32_t sourceID)
set the source Id
Definition: LArFebHeader.h:126
LArFebHeader::CheckErrorBCId
bool CheckErrorBCId() const
Check functions: return true if mismatch in Bunch Crossing ID.
Definition: LArFebHeader.h:119
xAOD::bcid
setEventNumber setTimeStamp bcid
Definition: EventInfo_v1.cxx:133
LArFebHeader::ChecksumVerification
bool ChecksumVerification() const
Definition: LArFebHeader.h:98
LArFebHeader::DspEventCounter
uint32_t DspEventCounter() const
get the Event number counted by the DSP code
Definition: LArFebHeader.h:79
LArFebHeader::SetRodResults1Size
void SetRodResults1Size(const uint16_t size)
set the ROD block sizes
Definition: LArFebHeader.h:142
LArFebHeader::SetFebCtrl2
void SetFebCtrl2(const uint16_t ctrl2)
set the FEB Control Word #2
Definition: LArFebHeader.h:190
DeMoAtlasDataLoss.runNumber
string runNumber
Definition: DeMoAtlasDataLoss.py:64
LArFebHeader::m_NbSweetCells1
uint16_t m_NbSweetCells1
Definition: LArFebHeader.h:229
LArFebHeader::RunNumber
uint32_t RunNumber() const
get the run number
Definition: LArFebHeader.h:61
LArFebHeader::SetNbSamples
void SetNbSamples(const uint16_t n)
Definition: LArFebHeader.h:154
LArFebHeader::m_NbSweetCells2
uint16_t m_NbSweetCells2
Definition: LArFebHeader.h:230
LArFebHeader::RodStatus
uint32_t RodStatus() const
get the ROD Status
Definition: LArFebHeader.h:110
LArFebHeader::SetFebSCA
void SetFebSCA(const uint16_t sca)
set the SCA's
Definition: LArFebHeader.h:202
LArFebHeader::RodResults2Size
uint16_t RodResults2Size() const
Definition: LArFebHeader.h:89
LArFebHeader::SetFebCtrl3
void SetFebCtrl3(const uint16_t ctrl3)
set the FEB Control Word #3
Definition: LArFebHeader.h:194
LArFebHeader::SetNbSweetCells2
void SetNbSweetCells2(const uint16_t n)
Definition: LArFebHeader.h:152
CLASS_DEF
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
Definition: Control/AthenaKernel/AthenaKernel/CLASS_DEF.h:64
LArFebHeader::m_RawDataSize
uint16_t m_RawDataSize
Definition: LArFebHeader.h:228
LArFebHeader::m_SCA
std::vector< uint16_t > m_SCA
SCA number for each samples.
Definition: LArFebHeader.h:239
LArFebHeader::DspCodeVersion
uint32_t DspCodeVersion() const
get the version of the DSP code
Definition: LArFebHeader.h:76
LArFebHeader::RodHeader::ELVL1Id
uint16_t ELVL1Id
Definition: LArFebHeader.h:29
merge.status
status
Definition: merge.py:17
LArFebHeader::m_RodHeader
RodHeader m_RodHeader
Definition: LArFebHeader.h:216
LArFebHeader::SetFebBCId
void SetFebBCId(const uint16_t bcid)
set the FEB Bunch Crossing ID
Definition: LArFebHeader.h:182
LArFebHeader::FebBCId
uint16_t FebBCId() const
get the FEB Bunch Crossing ID
Definition: LArFebHeader.h:85
LArFebHeader::SetFebCtrl1
void SetFebCtrl1(const uint16_t ctrl1)
set the FEB Control Word #1
Definition: LArFebHeader.h:186
LArFebHeader::RodHeader::SourceId
uint32_t SourceId
Definition: LArFebHeader.h:27
LArFebHeader::m_Ctrl2
std::vector< uint16_t > m_Ctrl2
@Brief FEB Control word 2
Definition: LArFebHeader.h:245
LArFebHeader::RodResults1Size
uint16_t RodResults1Size() const
get the ROD block sizes
Definition: LArFebHeader.h:88
LArFebHeader::SetDetEventType
void SetDetEventType(const uint32_t detEvType)
set the Detector event type ID
Definition: LArFebHeader.h:166
LArFebHeader::SetRodStatus
void SetRodStatus(const uint32_t status)
set the ROD Status
Definition: LArFebHeader.h:198
LArFebHeader::SetNbSweetCells1
void SetNbSweetCells1(const uint16_t n)
set the number of samples and cells above thresholds
Definition: LArFebHeader.h:150
CLASS_DEF.h
macros to associate a CLID to a type
LArFebHeader::SetOfflineChecksum
void SetOfflineChecksum(const uint32_t checksum)
Definition: LArFebHeader.h:158
LArFebHeader::m_Status
uint32_t m_Status
ROD Status word.
Definition: LArFebHeader.h:236
LArFebHeader::CheckErrorELVL1Id
bool CheckErrorELVL1Id() const
Check functions: return true if mismatch in Event ID.
Definition: LArFebHeader.h:116
LArFebHeader::RodHeader::BCId
uint16_t BCId
Definition: LArFebHeader.h:30