ATLAS Offline Software
Loading...
Searching...
No Matches
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
6#include <cmath>
7
8namespace LVL1 {
9
10// Static constants
11
12const int CPTopoTOB::s_cpmBit;
13const int CPTopoTOB::s_chipBit;
15const int CPTopoTOB::s_isolBit;
16const int CPTopoTOB::s_etBit;
17
18const int CPTopoTOB::s_cpmMask;
19const int CPTopoTOB::s_chipMask;
21const int CPTopoTOB::s_isolMask;
22const int CPTopoTOB::s_etMask;
23
30
31
35
39
49
50
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
65
68{
69 int loc = location();
70 return cpm()*s_cpmEtaWidth + (loc >> 2)*2 + (loc&1);
71}
72
73// Integer eta coordinate of RoI
74
75int CPTopoTOB::ieta() const
76{
77 return etaIndex() - s_cpmEtaOffset + 1;
78}
79
80// Extract eta coordinate from TOB data (RoI centre coordinate)
81
82float CPTopoTOB::eta() const
83{
84 return ieta()*0.1;
85}
86
89{
90 return ((location()>>1)&1) + chip()*s_chipPhiWidth + m_crate*s_cpmPhiWidth;
91}
92
93// Extract integer phi coordinate from TOB data
94
95int CPTopoTOB::iphi() const
96{
97 int iphi = phiIndex() + 1;
98 if (iphi > 63) iphi -= 64;
99 return iphi;
100}
101
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
111float CPTopoTOB::phi() const
112{
113 return iphiSigned()*M_PI/32;
114}
115
116// Construct RoI word and return
117uint32_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
#define M_PI
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
double coord
Type of coordination system.
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...