ATLAS Offline Software
Trigger/TrigT1/TrigT1CaloEvent/TrigT1CaloEvent/CPMRoI.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_CPMROI_H
5 #define TRIGT1CALO_CPMROI_H
6 
7 #include <stdint.h>
8 #include <map>
9 
10 namespace LVL1 {
11 
20 class CPMRoI {
21 
22  public:
23 
24  CPMRoI();
26  CPMRoI(int crate, int cpm, int chip, int location, int hits, int error);
27 
28  ~CPMRoI();
29 
31  int crate() const;
33  int cpm() const;
35  int chip() const;
37  int location() const;
39  int hits() const;
41  int error() const;
42 
44  uint32_t roiWord() const;
47 
48  private:
49 
51  static const int s_wordIdVal = 0x0;
52  // Data locations
53  static const int s_wordIdBit = 30;
54  static const int s_crateBit = 28;
55  static const int s_cpmBit = 24;
56  static const int s_chipBit = 21;
57  static const int s_locationBit = 18;
58  static const int s_parityBit = 17;
59  static const int s_saturationBit = 16;
60  static const int s_hitsBit = 0;
61  // Data masks
62  static const int s_wordIdMask = 0x3;
63  static const int s_crateMask = 0x3;
64  static const int s_cpmMask = 0xf;
65  static const int s_chipMask = 0x7;
66  static const int s_locationMask = 0x7;
67  static const int s_parityMask = 0x1;
68  static const int s_saturationMask = 0x1;
69  static const int s_hitsMask = 0xffff;
70 
72  int parity() const;
74  int saturation() const;
75 
78 
79 };
80 
81 inline int CPMRoI::crate() const
82 {
83  return (m_roiWord >> s_crateBit) & s_crateMask;
84 }
85 
86 inline int CPMRoI::cpm() const
87 {
88  return (m_roiWord >> s_cpmBit) & s_cpmMask;
89 }
90 
91 inline int CPMRoI::chip() const
92 {
93  return (m_roiWord >> s_chipBit) & s_chipMask;
94 }
95 
96 inline int CPMRoI::location() const
97 {
99 }
100 
101 inline int CPMRoI::hits() const
102 {
103  return (m_roiWord >> s_hitsBit) & s_hitsMask;
104 }
105 
106 inline int CPMRoI::error() const
107 {
108  return (parity() << 1) | saturation();
109 }
110 
111 inline uint32_t CPMRoI::roiWord() const
112 {
113  return m_roiWord;
114 }
115 
116 inline int CPMRoI::parity() const
117 {
118  return (m_roiWord >> s_parityBit) & s_parityMask;
119 }
120 
121 inline int CPMRoI::saturation() const
122 {
124 }
125 
126 
127 typedef std::map<int, const CPMRoI*> CPMRoIMap_t;
128 
129 } // end namespace
130 
131 #ifndef CPMRoI_ClassDEF_H
133 #endif
134 
135 #endif
LVL1::CPMRoI::~CPMRoI
~CPMRoI()
Definition: CPMRoI.cxx:51
LVL1::CPMRoI::s_parityBit
static const int s_parityBit
Definition: Trigger/TrigT1/TrigT1CaloEvent/TrigT1CaloEvent/CPMRoI.h:58
LVL1::CPMRoI::s_chipMask
static const int s_chipMask
Definition: Trigger/TrigT1/TrigT1CaloEvent/TrigT1CaloEvent/CPMRoI.h:65
LVL1::CPMRoI::location
int location() const
Return location (RoI local coords) (0-7)
Definition: Trigger/TrigT1/TrigT1CaloEvent/TrigT1CaloEvent/CPMRoI.h:96
LVL1::CPMRoI::chip
int chip() const
Return CP chip number (0-7)
Definition: Trigger/TrigT1/TrigT1CaloEvent/TrigT1CaloEvent/CPMRoI.h:91
LVL1::CPMRoI::s_crateBit
static const int s_crateBit
Definition: Trigger/TrigT1/TrigT1CaloEvent/TrigT1CaloEvent/CPMRoI.h:54
CPMRoI_ClassDEF.h
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
LVL1::CPMRoI::s_parityMask
static const int s_parityMask
Definition: Trigger/TrigT1/TrigT1CaloEvent/TrigT1CaloEvent/CPMRoI.h:67
LVL1::CPMRoI::s_cpmMask
static const int s_cpmMask
Definition: Trigger/TrigT1/TrigT1CaloEvent/TrigT1CaloEvent/CPMRoI.h:64
LVL1::CPMRoI::CPMRoI
CPMRoI()
Definition: CPMRoI.cxx:31
LVL1::CPMRoI::hits
int hits() const
Return hit thresholds map.
Definition: Trigger/TrigT1/TrigT1CaloEvent/TrigT1CaloEvent/CPMRoI.h:101
LVL1
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
Definition: ICMMCPHitsCnvTool.h:18
LVL1::CPMRoI::s_wordIdVal
static const int s_wordIdVal
RoI word ID.
Definition: Trigger/TrigT1/TrigT1CaloEvent/TrigT1CaloEvent/CPMRoI.h:51
LVL1::CPMRoI::s_crateMask
static const int s_crateMask
Definition: Trigger/TrigT1/TrigT1CaloEvent/TrigT1CaloEvent/CPMRoI.h:63
LVL1::CPMRoI::m_roiWord
uint32_t m_roiWord
RoI word.
Definition: Trigger/TrigT1/TrigT1CaloEvent/TrigT1CaloEvent/CPMRoI.h:77
LVL1::CPMRoI::saturation
int saturation() const
Return saturation flag (0/1)
Definition: Trigger/TrigT1/TrigT1CaloEvent/TrigT1CaloEvent/CPMRoI.h:121
LVL1::CPMRoI::s_cpmBit
static const int s_cpmBit
Definition: Trigger/TrigT1/TrigT1CaloEvent/TrigT1CaloEvent/CPMRoI.h:55
LVL1::CPMRoI::cpm
int cpm() const
Return CPM number (1-14)
Definition: Trigger/TrigT1/TrigT1CaloEvent/TrigT1CaloEvent/CPMRoI.h:86
LVL1::CPMRoI::parity
int parity() const
Return parity error flag (0/1)
Definition: Trigger/TrigT1/TrigT1CaloEvent/TrigT1CaloEvent/CPMRoI.h:116
LVL1::CPMRoI
CPM RoI data.
Definition: Trigger/TrigT1/TrigT1CaloEvent/TrigT1CaloEvent/CPMRoI.h:20
LVL1::CPMRoI::s_saturationMask
static const int s_saturationMask
Definition: Trigger/TrigT1/TrigT1CaloEvent/TrigT1CaloEvent/CPMRoI.h:68
LVL1::CPMRoI::error
int error() const
Return error flags (bit 0 Saturation, bit 1 Parity)
Definition: Trigger/TrigT1/TrigT1CaloEvent/TrigT1CaloEvent/CPMRoI.h:106
LVL1::CPMRoI::roiWord
uint32_t roiWord() const
Return packed RoI word.
Definition: Trigger/TrigT1/TrigT1CaloEvent/TrigT1CaloEvent/CPMRoI.h:111
LVL1::CPMRoI::s_hitsMask
static const int s_hitsMask
Definition: Trigger/TrigT1/TrigT1CaloEvent/TrigT1CaloEvent/CPMRoI.h:69
LVL1::CPMRoI::setRoiWord
bool setRoiWord(uint32_t roiWord)
Set RoI word with ID check.
Definition: CPMRoI.cxx:57
LVL1::CPMRoI::s_locationMask
static const int s_locationMask
Definition: Trigger/TrigT1/TrigT1CaloEvent/TrigT1CaloEvent/CPMRoI.h:66
LVL1::CPMRoIMap_t
std::map< int, const CPMRoI * > CPMRoIMap_t
Definition: Trigger/TrigT1/TrigT1CaloEvent/TrigT1CaloEvent/CPMRoI.h:127
LVL1::CPMRoI::s_wordIdMask
static const int s_wordIdMask
Definition: Trigger/TrigT1/TrigT1CaloEvent/TrigT1CaloEvent/CPMRoI.h:62
LVL1::CPMRoI::s_locationBit
static const int s_locationBit
Definition: Trigger/TrigT1/TrigT1CaloEvent/TrigT1CaloEvent/CPMRoI.h:57
LVL1::CPMRoI::s_saturationBit
static const int s_saturationBit
Definition: Trigger/TrigT1/TrigT1CaloEvent/TrigT1CaloEvent/CPMRoI.h:59
LVL1::CPMRoI::s_wordIdBit
static const int s_wordIdBit
Definition: Trigger/TrigT1/TrigT1CaloEvent/TrigT1CaloEvent/CPMRoI.h:53
LVL1::CPMRoI::s_hitsBit
static const int s_hitsBit
Definition: Trigger/TrigT1/TrigT1CaloEvent/TrigT1CaloEvent/CPMRoI.h:60
error
Definition: IImpactPoint3dEstimator.h:70
LVL1::CPMRoI::crate
int crate() const
Return crate number (0-1)
Definition: Trigger/TrigT1/TrigT1CaloEvent/TrigT1CaloEvent/CPMRoI.h:81
LVL1::CPMRoI::s_chipBit
static const int s_chipBit
Definition: Trigger/TrigT1/TrigT1CaloEvent/TrigT1CaloEvent/CPMRoI.h:56