ATLAS Offline Software
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 
9 namespace LVL1 {
10 
19 class 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);
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 
88  int m_crate;
89 
91  int m_cmx;
92 
95 
96 };
97 
98 inline int CPTopoTOB::crate() const
99 {
100  return m_crate;
101 }
102 
103 inline int CPTopoTOB::cmx() const
104 {
105  return m_cmx;
106 }
107 
108 inline int CPTopoTOB::cpm() const
109 {
110  return (m_tobWord >> s_cpmBit) & s_cpmMask;
111 }
112 
113 inline int CPTopoTOB::chip() const
114 {
115  return (m_tobWord >> s_chipBit) & s_chipMask;
116 }
117 
118 inline unsigned int CPTopoTOB::location() const
119 {
120  return (m_tobWord >> s_locationBit) & s_locationMask;
121 }
122 
123 inline unsigned int CPTopoTOB::isolation() const
124 {
125  return (m_tobWord >> s_isolBit) & s_isolMask;
126 }
127 
128 inline unsigned int CPTopoTOB::et() const
129 {
130  return (m_tobWord >> s_etBit) & s_etMask;
131 }
132 
134 {
135  return m_tobWord;
136 }
137 
138 
139 } // end namespace
140 
141 #endif
LVL1::CPTopoTOB::phiIndex
int phiIndex() const
Extract phi index from the TOB data (0-63)
Definition: CPTopoTOB.cxx:88
LVL1::CPTopoTOB::CPTopoTOB
CPTopoTOB()
Definition: CPTopoTOB.cxx:32
LVL1::CPTopoTOB::s_isolMask
static const int s_isolMask
Definition: CPTopoTOB.h:77
et
Extra patterns decribing particle interation process.
LVL1::CPTopoTOB::eta
float eta() const
Definition: CPTopoTOB.cxx:82
LVL1::CPTopoTOB::cpm
int cpm() const
Return CPM number (1-14)
Definition: CPTopoTOB.h:108
LVL1::CPTopoTOB::s_chipBit
static const int s_chipBit
Definition: CPTopoTOB.h:69
LVL1::CPTopoTOB::location
unsigned int location() const
Return location (RoI local coords) (0-7)
Definition: CPTopoTOB.h:118
LVL1::CPTopoTOB::s_locationBit
static const int s_locationBit
Definition: CPTopoTOB.h:70
LVL1::CPTopoTOB::s_cpmMask
static const int s_cpmMask
Definition: CPTopoTOB.h:74
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
LVL1::CPTopoTOB::roiWord
uint32_t roiWord() const
Return corresponding RoI word (useful for Topo simulation)
Definition: CPTopoTOB.cxx:117
LVL1::CPTopoTOB::m_crate
int m_crate
crate
Definition: CPTopoTOB.h:88
LVL1::CPTopoTOB::s_locationMask
static const int s_locationMask
Definition: CPTopoTOB.h:76
LVL1
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
Definition: ICMMCPHitsCnvTool.h:18
LVL1::CPTopoTOB::s_cpmPhiBins
static const int s_cpmPhiBins
Definition: CPTopoTOB.h:85
LVL1::CPTopoTOB::s_cpmEtaOffset
static const int s_cpmEtaOffset
Definition: CPTopoTOB.h:83
LVL1::CPTopoTOB::iphi
int iphi() const
Definition: CPTopoTOB.cxx:95
LVL1::CPTopoTOB::s_cpmPhiWidth
static const int s_cpmPhiWidth
Definition: CPTopoTOB.h:82
LVL1::CPTopoTOB
CP TOB data for L1Topo.
Definition: CPTopoTOB.h:19
LVL1::CPTopoTOB::crate
int crate() const
Return crate number (0-3)
Definition: CPTopoTOB.h:98
LVL1::CPTopoTOB::s_cpmBit
static const int s_cpmBit
Definition: CPTopoTOB.h:68
LVL1::CPTopoTOB::s_isolBit
static const int s_isolBit
Definition: CPTopoTOB.h:71
LVL1::CPTopoTOB::m_tobWord
uint32_t m_tobWord
RoI word.
Definition: CPTopoTOB.h:94
LVL1::CPTopoTOB::s_cpmPhiOffset
static const int s_cpmPhiOffset
Definition: CPTopoTOB.h:84
LVL1::CPTopoTOB::m_cmx
int m_cmx
CMX (EM or Tau)
Definition: CPTopoTOB.h:91
LVL1::CPTopoTOB::tobWord
uint32_t tobWord() const
Return packed TOB word.
Definition: CPTopoTOB.h:133
LVL1::CPTopoTOB::iphiSigned
int iphiSigned() const
Definition: CPTopoTOB.cxx:102
LVL1::CPTopoTOB::s_etBit
static const int s_etBit
Definition: CPTopoTOB.h:72
LVL1::CPTopoTOB::s_chipMask
static const int s_chipMask
Definition: CPTopoTOB.h:75
LVL1::CPTopoTOB::et
unsigned int et() const
ET value.
Definition: CPTopoTOB.h:128
LVL1::CPTopoTOB::s_cpmEtaWidth
static const int s_cpmEtaWidth
Definition: CPTopoTOB.h:81
LVL1::CPTopoTOB::isolation
unsigned int isolation() const
Return isolation mask.
Definition: CPTopoTOB.h:123
LVL1::CPTopoTOB::phi
float phi() const
Definition: CPTopoTOB.cxx:111
LVL1::CPTopoTOB::chip
int chip() const
Return CP chip number (0-7)
Definition: CPTopoTOB.h:113
LVL1::CPTopoTOB::cmx
int cmx() const
Return CMX number (0-1)
Definition: CPTopoTOB.h:103
LVL1::CPTopoTOB::~CPTopoTOB
~CPTopoTOB()
Definition: CPTopoTOB.cxx:62
LVL1::CPTopoTOB::etaIndex
int etaIndex() const
Extract eta index from the TOB data (0-49)
Definition: CPTopoTOB.cxx:67
LVL1::CPTopoTOB::ieta
int ieta() const
Definition: CPTopoTOB.cxx:75
LVL1::CPTopoTOB::s_etMask
static const int s_etMask
Definition: CPTopoTOB.h:78
LVL1::CPTopoTOB::s_chipPhiWidth
static const int s_chipPhiWidth
Definition: CPTopoTOB.h:80