52 std::vector<int> errors;
53 std::vector<std::reference_wrapper<Monitored::IMonitoredVariable>> variables;
71 uint32_t TauHits0 = 0;
72 uint32_t TauHits1 = 0;
79 for (; cmxIterator != cmxIteratorEnd; ++cmxIterator) {
81 const uint8_t source = (*cmxIterator)->sourceComponent();
82 const uint8_t crate = (*cmxIterator)->crate();
83 const uint8_t cmx = (*cmxIterator)->cmx();
87 EMHits0 = (*cmxIterator)->hits0();
88 EMHits1 = (*cmxIterator)->hits1();
91 TauHits0 = (*cmxIterator)->hits0();
92 TauHits1 = (*cmxIterator)->hits1();
109 return StatusCode::FAILURE;
115 int Jet3BitHits0 = 0;
116 int Jet3BitHits1 = 0;
117 int Jet2BitHits0 = 0;
118 int Jet2BitHits1 = 0;
124 for (; cmxJetIterator != cmxJetIteratorEnd; ++cmxJetIterator) {
125 const uint32_t source = (*cmxJetIterator)->sourceComponent();
126 const uint32_t crate = (*cmxJetIterator)->crate();
129 Jet3BitHits0 = (*cmxJetIterator)->hits0();
130 Jet3BitHits1 = (*cmxJetIterator)->hits1();
131 Jet3BitHits = Jet3BitHits0 + (Jet3BitHits1<<15);
134 Jet2BitHits0 = (*cmxJetIterator)->hits0();
135 Jet2BitHits1 = (*cmxJetIterator)->hits1();
136 Jet2BitHits = Jet2BitHits0 + (Jet2BitHits1<<16);
146 return StatusCode::FAILURE;
158 for (; cmxEtSumsIterator != cmxEtSumsIteratorEnd; ++ cmxEtSumsIterator) {
159 const uint32_t source = (*cmxEtSumsIterator)->sourceComponent();
160 const uint32_t crate = (*cmxEtSumsIterator)->crate();
164 TEHits = (*cmxEtSumsIterator)->et();
169 XEHits = (*cmxEtSumsIterator)->et();
174 XSHits = (*cmxEtSumsIterator)->et();
179 TERestHits = (*cmxEtSumsIterator)->et();
184 XERestHits = (*cmxEtSumsIterator)->et();
197 return StatusCode::FAILURE;
202 std::vector<uint32_t> ctp_data=const_ctpRdo->getDataWords();
203 CTP_RDO ctpRdo(4,std::move(ctp_data));
208 ATH_MSG_DEBUG(
"CTP version number not set, skipping CTP test");
215 if (l1aPos >= ctp.getBunchCrossings().size()) {
217 return StatusCode::SUCCESS;
220 ATH_MSG_DEBUG(
"CTP l1aPos, size : " << l1aPos <<
", " << ctp.getBunchCrossings().size());
221 const CTP_BC& bunch = ctp.getBunchCrossings().at(l1aPos);
229 const int max_JET_2bit_Threshold_Number = 15;
230 const int max_JET_3bit_Threshold_Number = 10;
231 const int max_XE_Threshold_Number = 16;
232 const int max_TE_Threshold_Number = 16;
233 const int max_XS_Threshold_Number = 8;
255 totalBits = threshBits*max_JET_3bit_Threshold_Number;
261 totalBits = threshBits*max_JET_2bit_Threshold_Number;
267 totalBits = threshBits*max_TE_Threshold_Number/2;
272 totalBits = threshBits*max_XE_Threshold_Number/2;
277 totalBits = threshBits*max_XS_Threshold_Number;
282 totalBits = threshBits*max_TE_Threshold_Number/2;
287 totalBits = threshBits*max_XE_Threshold_Number/2;
290 variables.push_back(
run);
294 return StatusCode::SUCCESS;
306 const int max_JET_2bit_Threshold_Number = 15;
307 const int max_JET_3bit_Threshold_Number = 10;
308 const int max_TAU_3bit_Threshold_Number = 16;
309 const int max_XE_Threshold_Number = 16;
310 const int max_TE_Threshold_Number = 16;
311 const int max_XS_Threshold_Number = 8;
313 std::map<std::string, int> threshMap;
315 const std::vector<std::shared_ptr<TrigConf::L1Threshold>>& thresholds =
getL1Menu(ctx)->thresholds();
316 ATH_MSG_DEBUG(
"Size of thresholds vector: " << thresholds.size());
318 for (
const auto& it : thresholds) {
321 const int threshNumber = it->mapping();
322 int fixedThreshNumber = threshNumber;
334 if (threshNumber >= (
int)max_TAU_3bit_Threshold_Number/2) {
335 thisOffset += nbits*max_TAU_3bit_Threshold_Number/2;
336 fixedThreshNumber -= max_TAU_3bit_Threshold_Number/2;
340 thisOffset += nbits*max_TAU_3bit_Threshold_Number;
342 if (threshNumber >= (
int)max_JET_3bit_Threshold_Number) {
343 thisOffset += 3*max_JET_3bit_Threshold_Number;
344 fixedThreshNumber -= max_JET_3bit_Threshold_Number;
349 thisOffset += 3*max_JET_3bit_Threshold_Number;
351 thisOffset += 2*max_JET_2bit_Threshold_Number;
354 if (threshNumber >= (
int)max_TE_Threshold_Number/2) {
355 thisOffset += nbits*max_TE_Threshold_Number/2 + nbits*max_XE_Threshold_Number/2 + nbits*max_XS_Threshold_Number;
356 fixedThreshNumber -= max_TE_Threshold_Number/2;
360 thisOffset += nbits*max_TE_Threshold_Number/2;
362 if (threshNumber >= (
int)max_XE_Threshold_Number/2) {
363 thisOffset += nbits*max_TE_Threshold_Number/2 + nbits*max_XE_Threshold_Number/2 + nbits*max_XS_Threshold_Number;
364 fixedThreshNumber -= max_XE_Threshold_Number/2;
368 thisOffset += nbits*max_XE_Threshold_Number/2;
370 thisOffset += nbits*max_XS_Threshold_Number;
374 if (nbits == 0)
continue;
375 if (threshNumber < 0)
continue;
376 threshMap.insert(std::make_pair(it->name(),
377 thisOffset + fixedThreshNumber*nbits));
378 ATH_MSG_DEBUG(
"threshMap: name, offset, threshNumber, nbits " << it->name() <<
" " << thisOffset <<
" " << fixedThreshNumber <<
" " << nbits);
383 std::vector<std::pair<std::string, int>> newMap;
386 for (
const auto& entry : threshMap) {
390 int numBits = trigger_line.
nbits();
392 for (
int bit = 0; bit < numBits; ++bit) {
393 int newValue = entry.second + bit;
396 newMap.push_back(std::make_pair(entry.first, newValue));
401 std::sort(newMap.begin(), newMap.end(), [](
const auto& lhs,
const auto& rhs) {
402 return lhs.second < rhs.second;
414 ATH_MSG_DEBUG(
"offset: " << offset <<
" totalBits: " << totalBits);
421 for (
int bit = 0; bit < totalBits; ++bit) {
422 const int TIPid = (newMap[offset + bit]).second;
428 const int HITbit= ((hits >> bit) & 0x1);
429 const int TIPbit = bunch.
getTIP().test( TIPid );
432 tipHits |= (TIPbit << bit);
434 if (HITbit && HITbit == TIPbit){
435 ctp_1d_TIPMatches = TIPid;
438 else if (HITbit != TIPbit) {
440 ctp_1d_HitNoTIPMismatch = TIPid;
444 ctp_1d_TIPNoHitMismatch = TIPid;
451 if (tipHits != (hits&mask)) {
452 ctp_1d_L1CaloNeCTPSummary =
type;
456 ctp_1d_L1CaloEqCTPSummary =
type;