ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
LArCalorimeter
LArRawEvent
src
LArFebHeader.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
LArRawEvent/LArFebHeader.h
"
6
7
LArFebHeader::LArFebHeader
() {}
8
9
//Constructor
10
LArFebHeader::LArFebHeader
(
const
HWIdentifier
febid):
m_FEBId
(febid) {
11
12
}
13
14
int
LArFebHeader::degray
(
unsigned
int
x
)
15
{
// like explained in: http://mathworld.wolfram.com/GrayCode.html
16
17
int
i,j,sum;
18
19
if
(
x
==138 )
return
141;
20
else
if
(
x
== 136 )
return
142;
21
else
if
(
x
== 128 )
return
143;
22
else
{
23
for
(i=0; i<32; i++)
24
{
25
sum=0;
26
for
(j=i+1; j<32; j++)
27
{
28
sum += (
x
>>j)&0x1;
29
}
30
// printf("x=%8x sum=%d\n",x,sum );
31
32
if
(sum%2) {
33
if
(
x
&(1<<i))
34
{
35
unsigned
int
tmp1,tmp2=0;
36
if
(i < 31)
37
tmp1 = (
x
>>(i+1))<<(i+1);
38
else
39
tmp1 = 0;
40
if
(i>0)
41
tmp2 =
x
& ((1u<<i)-1);
42
// printf("tmp1 =%x tmp2=%x\n",tmp1,tmp2 );
43
44
x
=tmp1|tmp2;
45
}
46
else
47
x
|= (1<<i);
48
}
49
}
50
return
x
;
51
}
52
}
LArFebHeader.h
x
#define x
HWIdentifier
Definition
HWIdentifier.h:13
LArFebHeader::LArFebHeader
LArFebHeader()
for ROOT I/O
Definition
LArFebHeader.cxx:7
LArFebHeader::degray
static int degray(unsigned int x)
like explained in: http://mathworld.wolfram.com/GrayCode.html
Definition
LArFebHeader.cxx:14
LArFebHeader::m_FEBId
const HWIdentifier m_FEBId
Feb Identifier.
Definition
LArFebHeader.h:214
Generated on
for ATLAS Offline Software by
1.17.0