ATLAS Offline Software
Loading...
Searching...
No Matches
CPTopoTOB.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
3*/
4#ifndef TRIGT1CALO_CPTOPOTOB_H
5#define TRIGT1CALO_CPTOPOTOB_H
6
7#include <stdint.h>
8
9namespace LVL1 {
10
18
19class CPTopoTOB {
20
21 public:
22
23 CPTopoTOB();
24 CPTopoTOB(int crate, int cmx, uint32_t tobWord);
25 CPTopoTOB(int crate, int cmx, int cpm, int chip, int location, int isolation, int et);
26 CPTopoTOB(uint32_t roiWord);
27
28 ~CPTopoTOB();
29
31 int crate() const;
33 int cmx() const;
35 int cpm() const;
37 int chip() const;
39 unsigned int location() const;
41 unsigned int isolation() const;
43 unsigned int et() const;
44
45 // eta index
46 int etaIndex() const;
47 // phi index
48 int phiIndex() const;
49 // Integer eta index
50 int ieta() const;
51 // Integer phi index
52 int iphi() const;
53 int iphiSigned() const;
54 // Floating eta coordinate
55 float eta() const;
56 // Floating phi coordinate
57 float phi() const;
58
60 uint32_t tobWord() const;
61
63 uint32_t roiWord() const;
64
65 private:
66
67 // Data locations within word
68 static const int s_cpmBit = 19;
69 static const int s_chipBit = 16;
70 static const int s_locationBit = 13;
71 static const int s_isolBit = 8;
72 static const int s_etBit = 0;
73 // Data masks
74 static const int s_cpmMask = 0xf;
75 static const int s_chipMask = 0x7;
76 static const int s_locationMask = 0x7;
77 static const int s_isolMask = 0x1f;
78 static const int s_etMask = 0xff;
79 // For decoding coordinates
80 static const int s_chipPhiWidth = 2;
81 static const int s_cpmEtaWidth = 4;
82 static const int s_cpmPhiWidth = 16;
83 static const int s_cpmEtaOffset = 32;
84 static const int s_cpmPhiOffset = 0;
85 static const int s_cpmPhiBins = 64;
86
89
91 int m_cmx;
92
94 uint32_t m_tobWord;
95
96};
97
98inline int CPTopoTOB::crate() const
99{
100 return m_crate;
101}
102
103inline int CPTopoTOB::cmx() const
104{
105 return m_cmx;
106}
107
108inline int CPTopoTOB::cpm() const
109{
110 return (m_tobWord >> s_cpmBit) & s_cpmMask;
111}
112
113inline int CPTopoTOB::chip() const
114{
115 return (m_tobWord >> s_chipBit) & s_chipMask;
116}
117
118inline unsigned int CPTopoTOB::location() const
119{
121}
122
123inline unsigned int CPTopoTOB::isolation() const
124{
125 return (m_tobWord >> s_isolBit) & s_isolMask;
126}
127
128inline unsigned int CPTopoTOB::et() const
129{
130 return (m_tobWord >> s_etBit) & s_etMask;
131}
132
133inline uint32_t CPTopoTOB::tobWord() const
134{
135 return m_tobWord;
136}
137
138
139} // end namespace
140
141#endif
int iphi() const
Definition CPTopoTOB.cxx:95
static const int s_cpmPhiBins
Definition CPTopoTOB.h:85
static const int s_locationMask
Definition CPTopoTOB.h:76
static const int s_chipBit
Definition CPTopoTOB.h:69
int iphiSigned() const
int chip() const
Return CP chip number (0-7)
Definition CPTopoTOB.h:113
uint32_t roiWord() const
Return corresponding RoI word (useful for Topo simulation)
uint32_t m_tobWord
RoI word.
Definition CPTopoTOB.h:94
unsigned int et() const
ET value.
Definition CPTopoTOB.h:128
int m_crate
crate
Definition CPTopoTOB.h:88
static const int s_etMask
Definition CPTopoTOB.h:78
static const int s_isolMask
Definition CPTopoTOB.h:77
static const int s_etBit
Definition CPTopoTOB.h:72
static const int s_isolBit
Definition CPTopoTOB.h:71
static const int s_cpmEtaOffset
Definition CPTopoTOB.h:83
static const int s_cpmPhiWidth
Definition CPTopoTOB.h:82
unsigned int location() const
Return location (RoI local coords) (0-7)
Definition CPTopoTOB.h:118
static const int s_cpmMask
Definition CPTopoTOB.h:74
float phi() const
uint32_t tobWord() const
Return packed TOB word.
Definition CPTopoTOB.h:133
float eta() const
Definition CPTopoTOB.cxx:82
static const int s_cpmBit
Definition CPTopoTOB.h:68
static const int s_cpmEtaWidth
Definition CPTopoTOB.h:81
int m_cmx
CMX (EM or Tau)
Definition CPTopoTOB.h:91
static const int s_chipPhiWidth
Definition CPTopoTOB.h:80
int ieta() const
Definition CPTopoTOB.cxx:75
int crate() const
Return crate number (0-3)
Definition CPTopoTOB.h:98
int cpm() const
Return CPM number (1-14)
Definition CPTopoTOB.h:108
int phiIndex() const
Extract phi index from the TOB data (0-63)
Definition CPTopoTOB.cxx:88
static const int s_locationBit
Definition CPTopoTOB.h:70
int etaIndex() const
Extract eta index from the TOB data (0-49)
Definition CPTopoTOB.cxx:67
unsigned int isolation() const
Return isolation mask.
Definition CPTopoTOB.h:123
static const int s_chipMask
Definition CPTopoTOB.h:75
static const int s_cpmPhiOffset
Definition CPTopoTOB.h:84
int cmx() const
Return CMX number (0-1)
Definition CPTopoTOB.h:103
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...