ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigT1
TrigT1CaloEvent
src
CPTopoTOB.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
TrigT1CaloEvent/CPTopoTOB.h
"
6
#include <cmath>
7
8
namespace
LVL1
{
9
10
// Static constants
11
12
const
int
CPTopoTOB::s_cpmBit
;
13
const
int
CPTopoTOB::s_chipBit
;
14
const
int
CPTopoTOB::s_locationBit
;
15
const
int
CPTopoTOB::s_isolBit
;
16
const
int
CPTopoTOB::s_etBit
;
17
18
const
int
CPTopoTOB::s_cpmMask
;
19
const
int
CPTopoTOB::s_chipMask
;
20
const
int
CPTopoTOB::s_locationMask
;
21
const
int
CPTopoTOB::s_isolMask
;
22
const
int
CPTopoTOB::s_etMask
;
23
24
const
int
CPTopoTOB::s_chipPhiWidth
;
25
const
int
CPTopoTOB::s_cpmEtaWidth
;
26
const
int
CPTopoTOB::s_cpmPhiWidth
;
27
const
int
CPTopoTOB::s_cpmEtaOffset
;
28
const
int
CPTopoTOB::s_cpmPhiOffset
;
29
const
int
CPTopoTOB::s_cpmPhiBins
;
30
31
32
CPTopoTOB::CPTopoTOB
() :
m_crate
(0),
m_cmx
(0),
m_tobWord
(0)
33
{
34
}
35
36
CPTopoTOB::CPTopoTOB
(
int
crate
,
int
cmx
, uint32_t
tobWord
) :
m_crate
(
crate
),
m_cmx
(
cmx
),
m_tobWord
(
tobWord
)
37
{
38
}
39
40
CPTopoTOB::CPTopoTOB
(
int
crate
,
int
cmx
,
int
cpm
,
int
chip
,
int
location
,
int
isolation
,
int
et
) :
m_crate
(
crate
),
m_cmx
(
cmx
)
41
{
42
m_tobWord
= 0;
43
m_tobWord
|= (
cpm
&
s_cpmMask
) <<
s_cpmBit
;
44
m_tobWord
|= (
chip
&
s_chipMask
) <<
s_chipBit
;
45
m_tobWord
|= (
location
&
s_locationMask
) <<
s_locationBit
;
46
m_tobWord
|= (
isolation
&
s_isolMask
) <<
s_isolBit
;
47
m_tobWord
|= (
et
&
s_etMask
) <<
s_etBit
;
48
}
49
50
51
CPTopoTOB::CPTopoTOB
(uint32_t
roiWord
)
52
{
53
m_crate
= (
roiWord
>>26) & 0x3;
54
if
((
roiWord
&0xf0000000) == 0xa0000000)
m_cmx
= 0;
55
else
m_cmx
= 1;
56
57
uint32_t
coord
= (
roiWord
>>16) & 0x3ff;
58
uint32_t data = (
roiWord
&0x1fff);
59
m_tobWord
= data + (
coord
<<13);
60
}
61
62
CPTopoTOB::~CPTopoTOB
()
63
{
64
}
65
67
int
CPTopoTOB::etaIndex
()
const
68
{
69
int
loc =
location
();
70
return
cpm
()*
s_cpmEtaWidth
+ (loc >> 2)*2 + (loc&1);
71
}
72
73
// Integer eta coordinate of RoI
74
75
int
CPTopoTOB::ieta
()
const
76
{
77
return
etaIndex
() -
s_cpmEtaOffset
+ 1;
78
}
79
80
// Extract eta coordinate from TOB data (RoI centre coordinate)
81
82
float
CPTopoTOB::eta
()
const
83
{
84
return
ieta
()*0.1;
85
}
86
88
int
CPTopoTOB::phiIndex
()
const
89
{
90
return
((
location
()>>1)&1) +
chip
()*
s_chipPhiWidth
+
m_crate
*
s_cpmPhiWidth
;
91
}
92
93
// Extract integer phi coordinate from TOB data
94
95
int
CPTopoTOB::iphi
()
const
96
{
97
int
iphi
=
phiIndex
() + 1;
98
if
(
iphi
> 63)
iphi
-= 64;
99
return
iphi
;
100
}
101
102
int
CPTopoTOB::iphiSigned
()
const
103
{
104
int
iphi
=
phiIndex
() + 1;
105
if
(
iphi
> 32)
iphi
-= 64;
106
return
iphi
;
107
}
108
109
// Extract phi coordinate from TOB data
110
111
float
CPTopoTOB::phi
()
const
112
{
113
return
iphiSigned
()*
M_PI
/32;
114
}
115
116
// Construct RoI word and return
117
uint32_t
CPTopoTOB::roiWord
()
const
118
{
119
// ET, isolation
120
uint32_t word =
m_tobWord
&0x1fff;
121
// Coordinate within crate
122
word += ((
m_tobWord
&0x7fe000)<<3);
123
// Crate number
124
word += (
m_crate
<<26);
125
// Type
126
if
(
m_cmx
== 0) word += 0xa0000000;
127
else
word += 0xb0000000;
128
129
return
word;
130
}
131
132
}
// end namespace
M_PI
#define M_PI
Definition
ActiveFraction.h:14
CPTopoTOB.h
coord
double coord
Type of coordination system.
Definition
JetVoronoiDiagramHelpers.h:43
LVL1::CPTopoTOB::iphi
int iphi() const
Definition
CPTopoTOB.cxx:95
LVL1::CPTopoTOB::s_cpmPhiBins
static const int s_cpmPhiBins
Definition
CPTopoTOB.h:85
LVL1::CPTopoTOB::s_locationMask
static const int s_locationMask
Definition
CPTopoTOB.h:76
LVL1::CPTopoTOB::s_chipBit
static const int s_chipBit
Definition
CPTopoTOB.h:69
LVL1::CPTopoTOB::iphiSigned
int iphiSigned() const
Definition
CPTopoTOB.cxx:102
LVL1::CPTopoTOB::chip
int chip() const
Return CP chip number (0-7).
Definition
CPTopoTOB.h:113
LVL1::CPTopoTOB::roiWord
uint32_t roiWord() const
Return corresponding RoI word (useful for Topo simulation).
Definition
CPTopoTOB.cxx:117
LVL1::CPTopoTOB::m_tobWord
uint32_t m_tobWord
RoI word.
Definition
CPTopoTOB.h:94
LVL1::CPTopoTOB::et
unsigned int et() const
ET value.
Definition
CPTopoTOB.h:128
LVL1::CPTopoTOB::m_crate
int m_crate
crate
Definition
CPTopoTOB.h:88
LVL1::CPTopoTOB::s_etMask
static const int s_etMask
Definition
CPTopoTOB.h:78
LVL1::CPTopoTOB::s_isolMask
static const int s_isolMask
Definition
CPTopoTOB.h:77
LVL1::CPTopoTOB::s_etBit
static const int s_etBit
Definition
CPTopoTOB.h:72
LVL1::CPTopoTOB::CPTopoTOB
CPTopoTOB()
Definition
CPTopoTOB.cxx:32
LVL1::CPTopoTOB::s_isolBit
static const int s_isolBit
Definition
CPTopoTOB.h:71
LVL1::CPTopoTOB::s_cpmEtaOffset
static const int s_cpmEtaOffset
Definition
CPTopoTOB.h:83
LVL1::CPTopoTOB::s_cpmPhiWidth
static const int s_cpmPhiWidth
Definition
CPTopoTOB.h:82
LVL1::CPTopoTOB::location
unsigned int location() const
Return location (RoI local coords) (0-7).
Definition
CPTopoTOB.h:118
LVL1::CPTopoTOB::s_cpmMask
static const int s_cpmMask
Definition
CPTopoTOB.h:74
LVL1::CPTopoTOB::~CPTopoTOB
~CPTopoTOB()
Definition
CPTopoTOB.cxx:62
LVL1::CPTopoTOB::phi
float phi() const
Definition
CPTopoTOB.cxx:111
LVL1::CPTopoTOB::tobWord
uint32_t tobWord() const
Return packed TOB word.
Definition
CPTopoTOB.h:133
LVL1::CPTopoTOB::eta
float eta() const
Definition
CPTopoTOB.cxx:82
LVL1::CPTopoTOB::s_cpmBit
static const int s_cpmBit
Definition
CPTopoTOB.h:68
LVL1::CPTopoTOB::s_cpmEtaWidth
static const int s_cpmEtaWidth
Definition
CPTopoTOB.h:81
LVL1::CPTopoTOB::m_cmx
int m_cmx
CMX (EM or Tau).
Definition
CPTopoTOB.h:91
LVL1::CPTopoTOB::s_chipPhiWidth
static const int s_chipPhiWidth
Definition
CPTopoTOB.h:80
LVL1::CPTopoTOB::ieta
int ieta() const
Definition
CPTopoTOB.cxx:75
LVL1::CPTopoTOB::crate
int crate() const
Return crate number (0-3).
Definition
CPTopoTOB.h:98
LVL1::CPTopoTOB::cpm
int cpm() const
Return CPM number (1-14).
Definition
CPTopoTOB.h:108
LVL1::CPTopoTOB::phiIndex
int phiIndex() const
Extract phi index from the TOB data (0-63).
Definition
CPTopoTOB.cxx:88
LVL1::CPTopoTOB::s_locationBit
static const int s_locationBit
Definition
CPTopoTOB.h:70
LVL1::CPTopoTOB::etaIndex
int etaIndex() const
Extract eta index from the TOB data (0-49).
Definition
CPTopoTOB.cxx:67
LVL1::CPTopoTOB::isolation
unsigned int isolation() const
Return isolation mask.
Definition
CPTopoTOB.h:123
LVL1::CPTopoTOB::s_chipMask
static const int s_chipMask
Definition
CPTopoTOB.h:75
LVL1::CPTopoTOB::s_cpmPhiOffset
static const int s_cpmPhiOffset
Definition
CPTopoTOB.h:84
LVL1::CPTopoTOB::cmx
int cmx() const
Return CMX number (0-1).
Definition
CPTopoTOB.h:103
LVL1
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
Definition
IZdcDataAccess.h:13
Generated on
for ATLAS Offline Software by
1.17.0