104 std::vector< const LVL1CTP::Lvl1Item* > items;
105 std::vector<ROIB::CTPRoI> bitsBP =
result.cTPResult().TBP();
106 std::vector<ROIB::CTPRoI> bitsAP =
result.cTPResult().TAP();
107 std::vector<ROIB::CTPRoI> bitsAV =
result.cTPResult().TAV();
113 int ctpVersion =
result.cTPResult().header().formatVersion() & 0xf ;
114 CTPdataformatVersion v(ctpVersion);
116 unsigned first_item = calib_flag ? v.getMaxTrigItems()-3 : 0;
118 for (
unsigned i = first_item; i < lvl1ItemConfig.size(); i++ ) {
119 if ( !lvl1ItemConfig[ i ] )
continue;
126 item->prescaleFactor() );
127 items.push_back(item);
128 ATH_MSG_DEBUG(
"Set bits on "<< item->name() <<
" PS="<< item->prescaleFactor() <<
" BP=" <<
getBit(bitsBP, i)<<
" AP="<<
getBit(bitsAP, i)<<
" AV="<<
getBit(bitsAV, i));
133 auto lvl1Result = std::make_unique<LVL1CTP::Lvl1Result>(
true);
136 const std::vector<ROIB::CTPRoI> ctpRoIVecAV =
result.cTPResult().TAV();
137 for (
unsigned int iWord = 0; iWord < ctpRoIVecAV.size(); ++iWord) {
138 uint32_t roIWord = ctpRoIVecAV[iWord].roIWord();
139 lvl1Result->itemsAfterVeto().push_back(roIWord);
140 ATH_MSG_DEBUG(
"TAV word #" << iWord <<
" is 0x" << std::hex << std::setw( 8 ) << std::setfill(
'0' ) << roIWord << std::dec);
144 const std::vector<ROIB::CTPRoI> ctpRoIVecBP =
result.cTPResult().TBP();
145 for (
unsigned int iWord=0; iWord < ctpRoIVecBP.size(); ++iWord) {
146 uint32_t roIWord = ctpRoIVecBP[iWord].roIWord();
147 lvl1Result->itemsBeforePrescale().push_back(roIWord);
149 << std::setw( 8 ) << std::setfill(
'0' ) << roIWord << std::dec);
153 const std::vector<ROIB::CTPRoI> ctpRoIVecAP =
result.cTPResult().TAP();
154 for (
unsigned int iWord=0; iWord < ctpRoIVecAP.size(); ++iWord) {
155 uint32_t roIWord = ctpRoIVecAP[iWord].roIWord();
156 lvl1Result->itemsAfterPrescale().push_back(roIWord);
158 ATH_MSG_DEBUG(
"TAP word #" << iWord <<
" is 0x" << std::hex << std::setw( 8 ) << std::setfill(
'0' ) << roIWord << std::dec);
162 if (lvl1Result->itemsBeforePrescale().size() < 8) lvl1Result->itemsBeforePrescale().resize(8, 0);
163 if (lvl1Result->itemsAfterPrescale().size() < 8) lvl1Result->itemsAfterPrescale().resize(8, 0);
164 if (lvl1Result->itemsAfterVeto().size() < 8) lvl1Result->itemsAfterVeto().resize(8, 0);
165 *lvl1ResultOut = lvl1Result.get();
176 const int MAXTAU = 5;
177 const int MAXJET = 4;
179 std::map<std::pair<int,int>,
int> em, tau,
jet;
204 std::bitset<3> overflow;
205 overflow[0] = std::count_if(em.begin(), em.end(), [](
const decltype(em)
::value_type& i){return i.second>MAXEM;});
206 overflow[1] = std::count_if(tau.begin(), tau.end(), [](
const decltype(tau)
::value_type& i){return i.second>MAXTAU;});
207 overflow[2] = std::count_if(
jet.begin(),
jet.end(), [](
const decltype(
jet)
::value_type& i){return i.second>MAXJET;});
209 if (msgLvl(MSG::DEBUG)) {
210 msg() <<
"EM RoI multiplicities by crate,module: ";
211 for (
const auto& i : em)
msg() <<
"(" << i.first.first <<
"," << i.first.second <<
"):" << i.second <<
" ";
213 msg() <<
endmsg <<
"Tau RoI multiplicities by crate,module: ";
214 for (
const auto& i : tau)
msg() <<
"(" << i.first.first <<
"," << i.first.second <<
"):" << i.second <<
" ";
216 msg() <<
endmsg <<
"Jet RoI multiplicities by crate,module: ";
217 for (
const auto& i :
jet)
msg() <<
"(" << i.first.first <<
"," << i.first.second <<
"):" << i.second <<
" ";