ATLAS Offline Software
Loading...
Searching...
No Matches
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
10namespace LVL1 {
11
19
20class CPMRoI {
21
22 public:
23
24 CPMRoI();
25 CPMRoI(uint32_t roiWord);
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;
46 bool setRoiWord(uint32_t roiWord);
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
77 uint32_t m_roiWord;
78
79};
80
81inline int CPMRoI::crate() const
82{
83 return (m_roiWord >> s_crateBit) & s_crateMask;
84}
85
86inline int CPMRoI::cpm() const
87{
88 return (m_roiWord >> s_cpmBit) & s_cpmMask;
89}
90
91inline int CPMRoI::chip() const
92{
93 return (m_roiWord >> s_chipBit) & s_chipMask;
94}
95
96inline int CPMRoI::location() const
97{
99}
100
101inline int CPMRoI::hits() const
102{
103 return (m_roiWord >> s_hitsBit) & s_hitsMask;
104}
105
106inline int CPMRoI::error() const
107{
108 return (parity() << 1) | saturation();
109}
110
111inline uint32_t CPMRoI::roiWord() const
112{
113 return m_roiWord;
114}
115
116inline int CPMRoI::parity() const
117{
118 return (m_roiWord >> s_parityBit) & s_parityMask;
119}
120
121inline int CPMRoI::saturation() const
122{
124}
125
126
127typedef std::map<int, const CPMRoI*> CPMRoIMap_t;
128
129} // end namespace
130
131#ifndef CPMRoI_ClassDEF_H
133#endif
134
135#endif
uint32_t roiWord() const
Return packed RoI word.
int crate() const
Return crate number (0-1)
int parity() const
Return parity error flag (0/1)
int hits() const
Return hit thresholds map.
int location() const
Return location (RoI local coords) (0-7)
int cpm() const
Return CPM number (1-14)
bool setRoiWord(uint32_t roiWord)
Set RoI word with ID check.
Definition CPMRoI.cxx:57
int saturation() const
Return saturation flag (0/1)
int chip() const
Return CP chip number (0-7)
int error() const
Return error flags (bit 0 Saturation, bit 1 Parity)
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
std::map< int, const CPMRoI * > CPMRoIMap_t