62 {
63
65
67 ATH_CHECK(eventInfo.isValid() ? StatusCode::SUCCESS : StatusCode::FAILURE);
68
73 if (chkLB==0) { chkLB=-1; }
74
77
78 SG::ReadCondHandle<PixelDCSHVData> dcsHV(
m_readKeyHV,ctx);
79 SG::ReadCondHandle<PixelDCSTempData> dcsTemp(
m_readKeyTemp,ctx);
83
84 int maxHash =
m_pixelID->wafer_hash_max();
85 std::vector<float> biasVoltage;
86 std::vector<float> temperature;
87 std::vector<int> activeState;
88 std::vector<int> activeStatus;
89 std::vector<int> feMaskIndex;
90 std::vector<int> feMaskStatus;
91 bool storeLB = false;
92 if (!isMC) {
93 if (chkLB!=LB) {
94 storeLB = true;
96 }
97 }
98 else {
99 if (chkLB==-1) {
100 storeLB = true;
102 }
103 }
104
105 if (storeLB) {
106 for (int ihash=0; ihash<maxHash; ihash++) {
107 biasVoltage.push_back(dcsHV->getBiasVoltage(ihash));
108 temperature.push_back(dcsTemp->getTemperature(ihash));
109 activeState.push_back(dcsState->getModuleStatus(ihash));
110 activeStatus.push_back(dcsStatus->getModuleStatus(ihash));
111
112 int moduleStatus = deadMap->getModuleStatus(ihash);
113 int chipStatus = deadMap->getChipStatus(ihash);
114 if (moduleStatus || chipStatus) {
115 feMaskIndex.push_back(ihash);
116 if (moduleStatus) {
117 feMaskStatus.push_back(0);
118 }
119 else {
120 feMaskStatus.push_back(chipStatus);
121 }
122 }
123 }
124 }
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159 std::vector<uint64_t> bsErrIndex;
160 std::vector<uint64_t> bsErrWord;
161 if (!isMC) {
163 SG::ReadHandle<IDCInDetBSErrContainer> idcErrCont;
165 idcErrCont = SG::ReadHandle<IDCInDetBSErrContainer>(
m_idcErrContKey,ctx);
168 }
169 }
170
171 if (maxHash==2048) {
172
173 for (int ihash=0; ihash<maxHash; ihash++) {
174 for (int chFE=0; chFE<16; chFE++) {
175 int indexFE = (1+chFE)*maxHash+ihash;
182
183 if (word>0) {
184 bsErrIndex.push_back(indexFE);
185 bsErrWord.push_back(word);
186 }
187 }
188 }
189
190 int indexOffset = 17*maxHash;
191 for (int ihash=156; ihash<436; ihash++) {
192 for (int chFE=0; chFE<2; chFE++) {
193 for (int serviceCode=0; serviceCode<32; serviceCode++) {
194 int indexSvcCounter = indexOffset+serviceCode*280*2+2*(ihash-156)+chFE;
201
202 if (word>0) {
203 bsErrIndex.push_back(indexSvcCounter);
204 bsErrWord.push_back(word);
205 }
206 }
207 }
208 }
209 }
210 }
212 assert(decorModuleCondition.size()==2);
213 decorModuleCondition[0](*eventInfo) = std::move(biasVoltage);
214 decorModuleCondition[1](*eventInfo) = std::move(temperature);
215
217 assert(decorModuleFEmask.size()==2);
218 decorModuleFEmask[0](*eventInfo) = std::move(feMaskIndex);
219 decorModuleFEmask[1](*eventInfo) = std::move(feMaskStatus);
220 decorModuleFEmask[2](*eventInfo) = std::move(activeState);
221 decorModuleFEmask[3](*eventInfo) = std::move(activeStatus);
222
224 assert(decorModuleBSErr.size()==2);
225 decorModuleBSErr[0](*eventInfo) = std::move(bsErrIndex);
226 decorModuleBSErr[1](*eventInfo) = std::move(bsErrWord);
227
228 return StatusCode::SUCCESS;
229 }
#define ATH_CHECK
Evaluate an expression and check for errors.
#define VALIDATE_STATUS_ARRAY(use_info, info_val, summary_val)
SG::ReadHandle< InDet::SiDetectorElementStatus > getPixelDetElStatus(const SG::ReadHandleKey< InDet::SiDetectorElementStatus > &key, const EventContext &ctx) const
const PixelID * m_pixelID
SG::ReadCondHandleKey< PixelDeadMapCondData > m_condDeadMapKey
unsigned int m_readoutTechnologyMask
ToolHandle< IInDetConditionsTool > m_pixelSummary
std::vector< SG::WriteDecorHandleKey< xAOD::EventInfo > > m_moduleBSErrKeys
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
std::atomic_uint m_lbCounter
SG::ReadCondHandleKey< PixelDCSStatusData > m_condDCSStatusKey
SG::ReadCondHandleKey< PixelDCSTempData > m_readKeyTemp
SG::ReadCondHandleKey< PixelDCSHVData > m_readKeyHV
std::vector< SG::WriteDecorHandleKey< xAOD::EventInfo > > m_moduleFEmaskKeys
SG::ReadHandleKey< IDCInDetBSErrContainer > m_idcErrContKey
SG::ReadHandleKey< InDet::SiDetectorElementStatus > m_pixelDetElStatusActiveOnly
std::vector< SG::WriteDecorHandleKey< xAOD::EventInfo > > m_moduleConditionKeys
SG::ReadCondHandleKey< PixelDCSStateData > m_condDCSStateKey
virtual bool isValid() override final
Can the handle be successfully dereferenced?
uint32_t lumiBlock() const
The current event's luminosity block number.
@ IS_SIMULATION
true: simulation, false: data
std::vector< SG::WriteDecorHandle< T_Cont, T > > createDecorators(const std::vector< SG::WriteDecorHandleKey< T_Cont > > &keys, const EventContext &ctx)
unsigned int getBSErrorWord(const InDet::SiDetectorElementStatus &elementStatus, const IDCInDetBSErrContainer &bsErrorContainer, const IdentifierHash &moduleIdHash, unsigned int index, unsigned int readOutTechnologyMask=(Pixel::makeReadoutTechnologyBit(InDetDD::PixelReadoutTechnology::FEI4)|(Pixel::makeReadoutTechnologyBit(InDetDD::PixelReadoutTechnology::FEI3))))
Retrieve the bytestream error word for the given module if the readout technology of the module is co...
retrieve(aClass, aKey=None)
EventInfo_v1 EventInfo
Definition of the latest event info version.