ATLAS Offline Software
Public Member Functions | Private Attributes | Static Private Attributes | List of all members
LVL1::CPTopoTOB Class Reference

CP TOB data for L1Topo. More...

#include <CPTopoTOB.h>

Collaboration diagram for LVL1::CPTopoTOB:

Public Member Functions

 CPTopoTOB ()
 
 CPTopoTOB (int crate, int cmx, uint32_t tobWord)
 
 CPTopoTOB (int crate, int cmx, int cpm, int chip, int location, int isolation, int et)
 
 CPTopoTOB (uint32_t roiWord)
 
 ~CPTopoTOB ()
 
int crate () const
 Return crate number (0-3) More...
 
int cmx () const
 Return CMX number (0-1) More...
 
int cpm () const
 Return CPM number (1-14) More...
 
int chip () const
 Return CP chip number (0-7) More...
 
unsigned int location () const
 Return location (RoI local coords) (0-7) More...
 
unsigned int isolation () const
 Return isolation mask. More...
 
unsigned int et () const
 ET value. More...
 
int etaIndex () const
 Extract eta index from the TOB data (0-49) More...
 
int phiIndex () const
 Extract phi index from the TOB data (0-63) More...
 
int ieta () const
 
int iphi () const
 
int iphiSigned () const
 
float eta () const
 
float phi () const
 
uint32_t tobWord () const
 Return packed TOB word. More...
 
uint32_t roiWord () const
 Return corresponding RoI word (useful for Topo simulation) More...
 

Private Attributes

int m_crate
 crate More...
 
int m_cmx
 CMX (EM or Tau) More...
 
uint32_t m_tobWord
 RoI word. More...
 

Static Private Attributes

static const int s_cpmBit = 19
 
static const int s_chipBit = 16
 
static const int s_locationBit = 13
 
static const int s_isolBit = 8
 
static const int s_etBit = 0
 
static const int s_cpmMask = 0xf
 
static const int s_chipMask = 0x7
 
static const int s_locationMask = 0x7
 
static const int s_isolMask = 0x1f
 
static const int s_etMask = 0xff
 
static const int s_chipPhiWidth = 2
 
static const int s_cpmEtaWidth = 4
 
static const int s_cpmPhiWidth = 16
 
static const int s_cpmEtaOffset = 32
 
static const int s_cpmPhiOffset = 0
 
static const int s_cpmPhiBins = 64
 

Detailed Description

CP TOB data for L1Topo.

Contains a Cluster Processor TOB word plus crate and CMX numbers. Plus functions to return individual data members

Author
Alan Watson

Definition at line 19 of file CPTopoTOB.h.

Constructor & Destructor Documentation

◆ CPTopoTOB() [1/4]

LVL1::CPTopoTOB::CPTopoTOB ( )

Definition at line 32 of file CPTopoTOB.cxx.

32  : m_crate(0), m_cmx(0), m_tobWord(0)
33 {
34 }

◆ CPTopoTOB() [2/4]

LVL1::CPTopoTOB::CPTopoTOB ( int  crate,
int  cmx,
uint32_t  tobWord 
)

Definition at line 36 of file CPTopoTOB.cxx.

37 {
38 }

◆ CPTopoTOB() [3/4]

LVL1::CPTopoTOB::CPTopoTOB ( int  crate,
int  cmx,
int  cpm,
int  chip,
int  location,
int  isolation,
int  et 
)

Definition at line 40 of file CPTopoTOB.cxx.

40  : m_crate(crate), m_cmx(cmx)
41 {
42  m_tobWord = 0;
43  m_tobWord |= (cpm & s_cpmMask) << s_cpmBit;
47  m_tobWord |= (et & s_etMask) << s_etBit;
48 }

◆ CPTopoTOB() [4/4]

LVL1::CPTopoTOB::CPTopoTOB ( uint32_t  roiWord)

Definition at line 51 of file CPTopoTOB.cxx.

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 }

◆ ~CPTopoTOB()

LVL1::CPTopoTOB::~CPTopoTOB ( )

Definition at line 62 of file CPTopoTOB.cxx.

63 {
64 }

Member Function Documentation

◆ chip()

int LVL1::CPTopoTOB::chip ( ) const
inline

Return CP chip number (0-7)

Definition at line 113 of file CPTopoTOB.h.

114 {
115  return (m_tobWord >> s_chipBit) & s_chipMask;
116 }

◆ cmx()

int LVL1::CPTopoTOB::cmx ( ) const
inline

Return CMX number (0-1)

Definition at line 103 of file CPTopoTOB.h.

104 {
105  return m_cmx;
106 }

◆ cpm()

int LVL1::CPTopoTOB::cpm ( ) const
inline

Return CPM number (1-14)

Definition at line 108 of file CPTopoTOB.h.

109 {
110  return (m_tobWord >> s_cpmBit) & s_cpmMask;
111 }

◆ crate()

int LVL1::CPTopoTOB::crate ( ) const
inline

Return crate number (0-3)

Definition at line 98 of file CPTopoTOB.h.

99 {
100  return m_crate;
101 }

◆ et()

unsigned int LVL1::CPTopoTOB::et ( ) const
inline

ET value.

Definition at line 128 of file CPTopoTOB.h.

129 {
130  return (m_tobWord >> s_etBit) & s_etMask;
131 }

◆ eta()

float LVL1::CPTopoTOB::eta ( ) const

Definition at line 82 of file CPTopoTOB.cxx.

83 {
84  return ieta()*0.1;
85 }

◆ etaIndex()

int LVL1::CPTopoTOB::etaIndex ( ) const

Extract eta index from the TOB data (0-49)

Definition at line 67 of file CPTopoTOB.cxx.

68 {
69  int loc = location();
70  return cpm()*s_cpmEtaWidth + (loc >> 2)*2 + (loc&1);
71 }

◆ ieta()

int LVL1::CPTopoTOB::ieta ( ) const

Definition at line 75 of file CPTopoTOB.cxx.

76 {
77  return etaIndex() - s_cpmEtaOffset + 1;
78 }

◆ iphi()

int LVL1::CPTopoTOB::iphi ( ) const

Definition at line 95 of file CPTopoTOB.cxx.

96 {
97  int iphi = phiIndex() + 1;
98  if (iphi > 63) iphi -= 64;
99  return iphi;
100 }

◆ iphiSigned()

int LVL1::CPTopoTOB::iphiSigned ( ) const

Definition at line 102 of file CPTopoTOB.cxx.

103 {
104  int iphi = phiIndex() + 1;
105  if (iphi > 32) iphi -= 64;
106  return iphi;
107 }

◆ isolation()

unsigned int LVL1::CPTopoTOB::isolation ( ) const
inline

Return isolation mask.

Definition at line 123 of file CPTopoTOB.h.

124 {
125  return (m_tobWord >> s_isolBit) & s_isolMask;
126 }

◆ location()

unsigned int LVL1::CPTopoTOB::location ( ) const
inline

Return location (RoI local coords) (0-7)

Definition at line 118 of file CPTopoTOB.h.

119 {
120  return (m_tobWord >> s_locationBit) & s_locationMask;
121 }

◆ phi()

float LVL1::CPTopoTOB::phi ( ) const

Definition at line 111 of file CPTopoTOB.cxx.

112 {
113  return iphiSigned()*M_PI/32;
114 }

◆ phiIndex()

int LVL1::CPTopoTOB::phiIndex ( ) const

Extract phi index from the TOB data (0-63)

Definition at line 88 of file CPTopoTOB.cxx.

89 {
90  return ((location()>>1)&1) + chip()*s_chipPhiWidth + m_crate*s_cpmPhiWidth;
91 }

◆ roiWord()

uint32_t LVL1::CPTopoTOB::roiWord ( ) const

Return corresponding RoI word (useful for Topo simulation)

Definition at line 117 of file CPTopoTOB.cxx.

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 }

◆ tobWord()

uint32_t LVL1::CPTopoTOB::tobWord ( ) const
inline

Return packed TOB word.

Definition at line 133 of file CPTopoTOB.h.

134 {
135  return m_tobWord;
136 }

Member Data Documentation

◆ m_cmx

int LVL1::CPTopoTOB::m_cmx
private

CMX (EM or Tau)

Definition at line 91 of file CPTopoTOB.h.

◆ m_crate

int LVL1::CPTopoTOB::m_crate
private

crate

Definition at line 88 of file CPTopoTOB.h.

◆ m_tobWord

uint32_t LVL1::CPTopoTOB::m_tobWord
private

RoI word.

Definition at line 94 of file CPTopoTOB.h.

◆ s_chipBit

const int LVL1::CPTopoTOB::s_chipBit = 16
staticprivate

Definition at line 69 of file CPTopoTOB.h.

◆ s_chipMask

const int LVL1::CPTopoTOB::s_chipMask = 0x7
staticprivate

Definition at line 75 of file CPTopoTOB.h.

◆ s_chipPhiWidth

const int LVL1::CPTopoTOB::s_chipPhiWidth = 2
staticprivate

Definition at line 80 of file CPTopoTOB.h.

◆ s_cpmBit

const int LVL1::CPTopoTOB::s_cpmBit = 19
staticprivate

Definition at line 68 of file CPTopoTOB.h.

◆ s_cpmEtaOffset

const int LVL1::CPTopoTOB::s_cpmEtaOffset = 32
staticprivate

Definition at line 83 of file CPTopoTOB.h.

◆ s_cpmEtaWidth

const int LVL1::CPTopoTOB::s_cpmEtaWidth = 4
staticprivate

Definition at line 81 of file CPTopoTOB.h.

◆ s_cpmMask

const int LVL1::CPTopoTOB::s_cpmMask = 0xf
staticprivate

Definition at line 74 of file CPTopoTOB.h.

◆ s_cpmPhiBins

const int LVL1::CPTopoTOB::s_cpmPhiBins = 64
staticprivate

Definition at line 85 of file CPTopoTOB.h.

◆ s_cpmPhiOffset

const int LVL1::CPTopoTOB::s_cpmPhiOffset = 0
staticprivate

Definition at line 84 of file CPTopoTOB.h.

◆ s_cpmPhiWidth

const int LVL1::CPTopoTOB::s_cpmPhiWidth = 16
staticprivate

Definition at line 82 of file CPTopoTOB.h.

◆ s_etBit

const int LVL1::CPTopoTOB::s_etBit = 0
staticprivate

Definition at line 72 of file CPTopoTOB.h.

◆ s_etMask

const int LVL1::CPTopoTOB::s_etMask = 0xff
staticprivate

Definition at line 78 of file CPTopoTOB.h.

◆ s_isolBit

const int LVL1::CPTopoTOB::s_isolBit = 8
staticprivate

Definition at line 71 of file CPTopoTOB.h.

◆ s_isolMask

const int LVL1::CPTopoTOB::s_isolMask = 0x1f
staticprivate

Definition at line 77 of file CPTopoTOB.h.

◆ s_locationBit

const int LVL1::CPTopoTOB::s_locationBit = 13
staticprivate

Definition at line 70 of file CPTopoTOB.h.

◆ s_locationMask

const int LVL1::CPTopoTOB::s_locationMask = 0x7
staticprivate

Definition at line 76 of file CPTopoTOB.h.


The documentation for this class was generated from the following files:
LVL1::CPTopoTOB::phiIndex
int phiIndex() const
Extract phi index from the TOB data (0-63)
Definition: CPTopoTOB.cxx:88
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
LVL1::CPTopoTOB::s_isolMask
static const int s_isolMask
Definition: CPTopoTOB.h:77
et
Extra patterns decribing particle interation process.
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
M_PI
#define M_PI
Definition: ActiveFraction.h:11
LVL1::CPTopoTOB::s_locationMask
static const int s_locationMask
Definition: CPTopoTOB.h:76
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::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::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::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
JetVoronoiDiagramHelpers::coord
double coord
Definition: JetVoronoiDiagramHelpers.h:45
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::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