ATLAS Offline Software
Loading...
Searching...
No Matches
Trigger/TrigT1/TrigT1CaloEvent/TrigT1CaloEvent/CPMTobRoI.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4#ifndef TRIGT1CALO_CPMTOBROI_H
5#define TRIGT1CALO_CPMTOBROI_H
6
7#include <stdint.h>
8
9namespace LVL1 {
10
18
19class CPMTobRoI {
20
21 public:
22
23 CPMTobRoI();
24 CPMTobRoI(uint32_t roiWord);
25 CPMTobRoI(int crate, int cpm, int chip, int location, int type,
26 int energy, int isol);
27
28 ~CPMTobRoI();
29
31 int crate() const;
33 int cpm() const;
35 int chip() const;
37 int location() const;
39 int type() const;
41 int energy() const;
43 int isolation() const;
44
46 uint32_t roiWord() const;
48 bool setRoiWord(uint32_t roiWord);
49
50 private:
51
53 static const unsigned int s_wordIdVal = 0xa;
54 // Data locations
55 static const int s_wordIdBit = 28;
56 static const int s_crateBit = 26;
57 static const int s_cpmBit = 22;
58 static const int s_chipBit = 19;
59 static const int s_locationBit = 16;
60 static const int s_isolBit = 8;
61 static const int s_energyBit = 0;
62 // Data masks
63 static const int s_wordIdMask = 0xf;
64 static const int s_crateMask = 0x3;
65 static const int s_cpmMask = 0xf;
66 static const int s_chipMask = 0x7;
67 static const int s_locationMask = 0x7;
68 static const int s_isolMask = 0x1f;
69 static const int s_energyMask = 0xff;
70 static const int s_typeMask = 0x1;
71
73 uint32_t m_roiWord;
74
75};
76
77inline int CPMTobRoI::crate() const
78{
79 return (m_roiWord >> s_crateBit) & s_crateMask;
80}
81
82inline int CPMTobRoI::cpm() const
83{
84 return (m_roiWord >> s_cpmBit) & s_cpmMask;
85}
86
87inline int CPMTobRoI::chip() const
88{
89 return (m_roiWord >> s_chipBit) & s_chipMask;
90}
91
92inline int CPMTobRoI::location() const
93{
95}
96
97inline int CPMTobRoI::type() const
98{
99 return (m_roiWord >> s_wordIdBit) & s_typeMask;
100}
101
102inline int CPMTobRoI::energy() const
103{
104 return (m_roiWord >> s_energyBit) & s_energyMask;
105}
106
107inline int CPMTobRoI::isolation() const
108{
109 return (m_roiWord >> s_isolBit) & s_isolMask;
110}
111
112inline uint32_t CPMTobRoI::roiWord() const
113{
114 return m_roiWord;
115}
116
117} // end namespace
118
119#ifndef CPMTobRoI_ClassDEF_H
121#endif
122
123#endif
uint32_t roiWord() const
Return packed RoI word.
int location() const
Return location (RoI local coords) (0-7)
bool setRoiWord(uint32_t roiWord)
Set RoI word with ID check.
Definition CPMTobRoI.cxx:57
static const unsigned int s_wordIdVal
RoI word ID.
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...