ATLAS Offline Software
LArFebHeader.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 //Constructor
8 LArFebHeader::LArFebHeader(const HWIdentifier febid):m_FEBId(febid) {
9  m_RodHeader.FormatVersion=0;
10  m_RodHeader.SourceId=0;
11  m_RodHeader.RunNumber=0;
12  m_RodHeader.ELVL1Id=0;
13  m_RodHeader.BCId=0;
14  m_RodHeader.LVL1TigType=0;
15  m_RodHeader.DetEventType=0;
16 
17  m_DspHeader.CodeVersion=0;
18  m_DspHeader.EventCounter=0;
19 
20  m_ELVL1Id=0;
21  m_BCId=0;
22  m_Status=0;
23 
26  m_RawDataSize=0;
29  m_NbSamples=0;
32 }
33 
34 int LArFebHeader::degray(unsigned int x)
35 { // like explained in: http://mathworld.wolfram.com/GrayCode.html
36 
37  int i,j,sum;
38 
39  if ( x==138 ) return 141;
40  else if ( x== 136 ) return 142;
41  else if ( x== 128 ) return 143;
42  else {
43  for (i=0; i<32; i++)
44  {
45  sum=0;
46  for (j=i+1; j<32; j++)
47  {
48  sum += (x>>j)&0x1;
49  }
50  // printf("x=%8x sum=%d\n",x,sum );
51 
52  if (sum%2) {
53  if (x&(1<<i))
54  {
55  unsigned int tmp1,tmp2=0;
56  if (i < 31)
57  tmp1 = (x>>(i+1))<<(i+1);
58  else
59  tmp1 = 0;
60  if (i>0)
61  tmp2 = x & ((1u<<i)-1);
62  // printf("tmp1 =%x tmp2=%x\n",tmp1,tmp2 );
63 
64  x=tmp1|tmp2;
65  }
66  else
67  x |= (1<<i);
68  }
69  }
70  return x;
71  }
72 }
LArFebHeader::m_ELVL1Id
uint16_t m_ELVL1Id
FEB EventId.
Definition: LArFebHeader.h:210
plotBeamSpotCompare.x1
x1
Definition: plotBeamSpotCompare.py:216
LArFebHeader::degray
static int degray(unsigned int x)
like explained in: http://mathworld.wolfram.com/GrayCode.html
Definition: LArFebHeader.cxx:34
DeMoUpdate.tmp2
string tmp2
Definition: DeMoUpdate.py:1168
LArFebHeader::m_OnlineChecksum
uint32_t m_OnlineChecksum
Definition: LArFebHeader.h:221
HWIdentifier
Definition: HWIdentifier.h:13
x
#define x
LArFebHeader::m_NbSamples
uint16_t m_NbSamples
Definition: LArFebHeader.h:220
Trk::u
@ u
Enums for curvilinear frames.
Definition: ParamDefs.h:83
LArFebHeader::m_BCId
uint16_t m_BCId
FEB BCId.
Definition: LArFebHeader.h:213
convertTimingResiduals.sum
sum
Definition: convertTimingResiduals.py:55
lumiFormat.i
int i
Definition: lumiFormat.py:92
LArFebHeader::m_OfflineChecksum
uint32_t m_OfflineChecksum
Definition: LArFebHeader.h:222
LArFebHeader::m_Results2Size
uint16_t m_Results2Size
Definition: LArFebHeader.h:216
LArFebHeader::m_Results1Size
uint16_t m_Results1Size
Definition: LArFebHeader.h:215
LArFebHeader::LArFebHeader
LArFebHeader(const HWIdentifier febid)
Constructor with FEB Id.
Definition: LArFebHeader.cxx:8
LArFebHeader::m_NbSweetCells1
uint16_t m_NbSweetCells1
Definition: LArFebHeader.h:218
LArFebHeader::m_NbSweetCells2
uint16_t m_NbSweetCells2
Definition: LArFebHeader.h:219
LArFebHeader.h
LArFebHeader::m_RawDataSize
uint16_t m_RawDataSize
Definition: LArFebHeader.h:217
LArFebHeader::m_DspHeader
struct LArFebHeader::@162 m_DspHeader
DSP-Header (most of it is actually in the DSP-Trailer)
LArFebHeader::m_RodHeader
struct LArFebHeader::@161 m_RodHeader
ROD-Header, always present (is part of the FEB-Header)
LArFebHeader::m_Status
uint32_t m_Status
ROD Status word.
Definition: LArFebHeader.h:225