10#include "GaudiKernel/IInterface.h"
11#include "GaudiKernel/MsgStream.h"
12#include "GaudiKernel/StatusCode.h"
50 const std::string &name,
51 const IInterface *parent)
53 m_cpmMaps(
"LVL1::CpmMappingTool/CpmMappingTool"),
54 m_errorTool(
"LVL1BS::L1CaloErrorByteStreamTool/L1CaloErrorByteStreamTool"),
60 declareInterface<CpByteStreamV2Tool>(
this);
63 "Crate/Module/Channel to Eta/Phi/Layer mapping tool");
65 "Tool to collect errors for monitoring");
68 "Offset of CP crate numbers in bytestream");
70 "Offset of CP crate numbers in RDOs");
74 "ROB fragment source identifiers");
78 "Format version number in sub-block header");
80 "Format identifier (0-1) in sub-block header");
82 "The number of S-Links per crate");
84 "The number of slices in the simulation");
86 "If >0, the number of slices in bytestream");
88 "Minimum crate number, allows partial output");
90 "Maximum crate number, allows partial output");
115 return StatusCode::SUCCESS;
120 const std::string& sgKey,
123 const std::vector<uint32_t>& vID(
sourceIDs());
126 m_robDataProvider->getROBData(Gaudi::Hive::currentContext(), vID, robFrags,
"CpByteStreamV2Tool");
127 ATH_MSG_DEBUG(
"Number of ROB fragments:" << robFrags.size());
128 return convert(sgKey, robFrags, ttCollection);
132 const std::string& sgKey,
142 const std::string& sgKey,
145 const std::vector<uint32_t>& vID(
sourceIDs());
148 m_robDataProvider->getROBData(Gaudi::Hive::currentContext(), vID, robFrags,
"CpByteStreamV2Tool");
149 ATH_MSG_DEBUG(
"Number of ROB fragments:" << robFrags.size());
150 return convert(sgKey, robFrags, tobCollection);
154 const std::string& sgKey,
164 const std::string& sgKey,
167 const std::vector<uint32_t>& vID(
sourceIDs());
170 m_robDataProvider->getROBData(Gaudi::Hive::currentContext(), vID, robFrags,
"CpByteStreamV2Tool");
171 ATH_MSG_DEBUG(
"Number of ROB fragments:" << robFrags.size());
172 return convert(sgKey, robFrags, hitCollection);
176 const std::string& sgKey,
190 return StatusCode::FAILURE;
200 const uint16_t minorVersion =
m_srcIdMap.minorVersion();
229 int timeslicesNew = 1;
236 for (
int module = 1;
module <= m_modules; ++module)
238 const int mod =
module - 1;
242 if (mod % modulesPerSlink == 0)
244 const int daqOrRoi = 0;
245 const int slink = (
m_slinks == 2) ? 2 * (mod / modulesPerSlink)
246 : mod / modulesPerSlink;
249 msg() <<
"Treating crate " << hwCrate
250 <<
" slink " << slink <<
endmsg;
261 msg(MSG::ERROR) <<
"Inconsistent number of slices or "
262 <<
"triggered slice offsets in data for crate "
263 << hwCrate <<
" slink " << slink <<
endmsg;
264 return StatusCode::FAILURE;
272 <<
"Slices/offset: " << timeslices <<
" " << trigCpm;
273 if (timeslices != timeslicesNew)
275 msg() <<
" modified to " << timeslicesNew <<
" " << trigCpmNew;
280 userHeader.
setCpm(trigCpmNew);
281 const uint32_t rodIdCpm =
m_srcIdMap.getRodID(hwCrate, slink, daqOrRoi,
284 theROD->push_back(userHeader.
header());
286 if (
debug)
msg() <<
"Module " <<
module << endmsg;
291 for (
int slice = 0; slice < timeslicesNew; ++slice)
295 hwCrate, module, timeslicesNew);
297 if (neutralFormat)
break;
314 std::vector<int> emData;
315 std::vector<int> hadData;
316 std::vector<int> emError;
317 std::vector<int> hadError;
322 for (
int slice = 0; slice < timeslicesNew; ++slice)
332 const int index = ( neutralFormat ) ? 0 : slice;
335 hadData[slice], emErr, hadErr);
346 subBlock->
setStatus(failingBCN, gLinkTimeout, gLinkDown,
347 moduleError, fIFOOverflow, bCNMismatch,
348 gLinkProtocol, gLinkParity);
358 for (pos = cpmBlocks.
begin(); pos != cpmBlocks.
end(); ++pos)
361 if ( !subBlock->
pack())
363 msg(MSG::ERROR) <<
"CPM sub-block packing failed" <<
endmsg;
364 return StatusCode::FAILURE;
368 msg() <<
"CPM sub-block data words: "
371 subBlock->
write(theROD);
377 for (
int cmx = 0; cmx <
m_cmxs; ++cmx)
385 for (
int slice = 0; slice < timeslicesNew; ++slice)
391 if (neutralFormat)
break;
396 for (
int cpm = 1; cpm <=
m_modules; ++cpm)
398 for (
int chip = 0; chip <
m_chips; ++chip)
400 for (
int loc = 0; loc <
m_locs; ++loc)
402 const int key =
tobKey(crate, cmx, cpm, chip, loc);
407 std::vector<int> energy;
408 std::vector<int> isolation;
409 std::vector<int>
error;
410 std::vector<unsigned int> presence;
415 for (
int slice = 0; slice < timeslicesNew; ++slice)
424 const int index = ( neutralFormat ) ? 0 : slice;
426 subBlock->
setTob(slice, cpm, chip, loc, energy[slice],
427 isolation[slice], err);
439 const int key =
hitsKey(crate, cmx, source);
443 std::vector<unsigned int> hits0;
444 std::vector<unsigned int> hits1;
445 std::vector<int> err0;
446 std::vector<int> err1;
451 for (
int slice = 0; slice < timeslicesNew; ++slice)
455 const int index = ( neutralFormat ) ? 0 : slice;
457 subBlock->
setHits(slice, source, 0, hits0[slice],
459 subBlock->
setHits(slice, source, 1, hits1[slice],
471 if ( !subBlock->pack())
473 msg(MSG::ERROR) <<
"CMX-Cp sub-block packing failed" <<
endmsg;
474 return StatusCode::FAILURE;
478 msg() <<
"CMX-Cp sub-block data words: "
479 << subBlock->dataWords() <<
endmsg;
481 subBlock->write(theROD);
486 return StatusCode::SUCCESS;
503 for (
int slink = 0; slink < maxSlinks; ++slink)
505 const int daqOrRoi = 0;
506 const uint32_t rodId =
m_srcIdMap.getRodID(hwCrate, slink, daqOrRoi,
508 const uint32_t robId =
m_srcIdMap.getRobID(rodId);
525 const std::string& sgKey,
531 ld.coreOverlap = sgKey.ends_with(
"Overlap") || sgKey.ends_with (
"OverlapAux.");
542 std::set<uint32_t> dupCheck;
545 for (; rob != robEnd; ++rob)
548 ATH_MSG_DEBUG(
"Treating ROB fragment " << robCount <<
" source_id = " << std::hex << (*rob)->rob_source_id() << std::dec);
552 const uint32_t robid = (*rob)->source_id();
553 if ((*rob)->nstatus() > 0)
556 (*rob)->status(robData);
560 if (
debug)
msg() <<
"ROB status error - skipping fragment" <<
endmsg;
567 if (!dupCheck.insert(robid).second)
579 (*rob)->rod_data(payloadBeg);
580 payloadEnd = payloadBeg + (*rob)->rod_ndata();
581 payload = payloadBeg;
582 if (payload == payloadEnd)
589 const uint32_t sourceID = (*rob)->rod_source_id();
600 msg() <<
"Wrong source identifier in data: ROD "
601 << MSG::hex << sourceID <<
" ROB " << robid
608 const int minorVersion = (*rob)->rod_version() & 0xffff;
610 if (minorVersion <=
m_srcIdMap.minorVersionPreLS1())
615 const int rodCrate =
m_srcIdMap.crate(sourceID);
618 msg() <<
"Treating crate " << rodCrate
631 const int headerWords = userHeader.
words();
632 if (headerWords != 1)
635 if (
debug)
msg() <<
"Unexpected number of user header words: "
639 for (
int i = 0; i < headerWords; ++i) ++payload;
641 const int trigCpm = userHeader.
cpm();
644 msg() <<
"Minor format version number: " << MSG::hex
645 << minorVersion << MSG::dec <<
endmsg
646 <<
"Triggered slice offset: " << trigCpm <<
endmsg;
652 while (payload != payloadEnd)
673 cmxCpSubBlock.
clear();
674 payload = cmxCpSubBlock.
read(payload, payloadEnd);
675 if (cmxCpSubBlock.
crate() != rodCrate)
677 if (
debug)
msg() <<
"Inconsistent crate number in ROD source ID"
704 payload = cpmSubBlock.
read(payload, payloadEnd);
705 if (cpmSubBlock.
crate() != rodCrate)
707 if (
debug)
msg() <<
"Inconsistent crate number in ROD source ID"
728 return StatusCode::SUCCESS;
740 const int hwCrate = subBlock->
crate();
744 const int timeslices = subBlock->
timeslices();
745 const int sliceNum = subBlock->
slice();
748 msg() <<
"CMX-CP: Crate " << hwCrate
749 <<
" Position " << cmx
750 <<
" Firmware " << firmware
751 <<
" Summing " << summing
752 <<
" Total slices " << timeslices
753 <<
" Slice " << sliceNum
756 if (timeslices <= trigCpm)
758 if (
debug)
msg() <<
"Triggered slice from header "
759 <<
"inconsistent with number of slices: "
760 << trigCpm <<
", " << timeslices <<
endmsg;
764 if (timeslices <= sliceNum)
766 if (
debug)
msg() <<
"Total slices inconsistent with slice number: "
767 << timeslices <<
", " << sliceNum <<
endmsg;
777 msg() <<
"CMX-CP sub-block unpacking failed: " << errMsg <<
endmsg;
788 const int subStatus = dErr.
error();
792 const int sliceBeg = ( neutralFormat ) ? 0 : sliceNum;
793 const int sliceEnd = ( neutralFormat ) ? timeslices : sliceNum + 1;
794 for (
int slice = sliceBeg; slice < sliceEnd; ++slice)
803 for (
int cpm = 1; cpm <=
m_modules; ++cpm)
805 const unsigned int presenceMap = subBlock->
presenceMap(slice, cpm);
806 for (
int tob = 0; tob <
m_maxTobs; ++tob)
808 const int energy = subBlock->
energy(slice, cpm, tob);
809 const int isolation = subBlock->
isolation(slice, cpm, tob);
811 if (energy == 0 && isolation == 0 &&
error == 0)
break;
812 const int loc = subBlock->
localCoord(slice, cpm, tob);
813 const int chip = subBlock->
chip(slice, cpm, tob);
826 const int key =
tobKey(crate, cmx, cpm, chip, loc);
830 ld.energyVec.assign(timeslices, 0);
831 ld.isolVec.assign(timeslices, 0);
832 ld.errorVec.assign(timeslices, 0);
833 ld.presenceMapVec.assign(timeslices, 0);
834 ld.energyVec[slice] = energy;
835 ld.isolVec[slice] = isolation;
836 ld.errorVec[slice] =
error;
837 ld.presenceMapVec[slice] = presenceMap;
839 std::make_unique<LVL1::CMXCPTob>(swCrate, cmx, cpm, chip, loc,
840 ld.energyVec, ld.isolVec, ld.errorVec,
841 ld.presenceMapVec, trigCpm);
842 tdata.
m_tobMap.insert(std::make_pair(key, tbp.get()));
847 ld.energyVec = tb->energyVec();
848 ld.isolVec = tb->isolationVec();
849 ld.errorVec = tb->errorVec();
850 ld.presenceMapVec = tb->presenceMapVec();
851 const int nsl = ld.energyVec.size();
852 if (timeslices != nsl)
854 if (
debug)
msg() <<
"Inconsistent number of slices in sub-blocks"
859 if (ld.energyVec[slice] != 0 || ld.isolVec[slice] != 0 ||
860 ld.errorVec[slice] != 0)
862 if (
debug)
msg() <<
"Duplicate data for slice " << slice <<
endmsg;
866 ld.energyVec[slice] = energy;
867 ld.isolVec[slice] = isolation;
868 ld.errorVec[slice] =
error;
869 ld.presenceMapVec[slice] = presenceMap;
870 tb->addTob(ld.energyVec, ld.isolVec, ld.errorVec, ld.presenceMapVec);
882 for (
int source = 0; source < maxSid; ++source)
889 const unsigned int hits0 = subBlock->
hits(slice, source, 0);
890 const unsigned int hits1 = subBlock->
hits(slice, source, 1);
891 int err0 = subBlock->
hitsError(slice, source, 0);
892 int err1 = subBlock->
hitsError(slice, source, 1);
893 int overflow = subBlock->
roiOverflow(slice, source);
897 err0 = err0Bits.
error();
901 err1 = err1Bits.
error();
902 if (hits0 || hits1 || err0 || err1)
904 const int key =
hitsKey(crate, cmx, source);
908 ld.hitsVec0.assign(timeslices, 0);
909 ld.hitsVec1.assign(timeslices, 0);
910 ld.errVec0.assign(timeslices, 0);
911 ld.errVec1.assign(timeslices, 0);
912 ld.hitsVec0[slice] = hits0;
913 ld.hitsVec1[slice] = hits1;
914 ld.errVec0[slice] = err0;
915 ld.errVec1[slice] = err1;
917 std::make_unique<LVL1::CMXCPHits>(swCrate, cmx, source,
918 ld.hitsVec0, ld.hitsVec1,
919 ld.errVec0, ld.errVec1, trigCpm);
920 hdata.
m_hitsMap.insert(std::make_pair(key, chp.get()));
925 ld.hitsVec0 = ch->hitsVec0();
926 ld.hitsVec1 = ch->hitsVec1();
927 ld.errVec0 = ch->errorVec0();
928 ld.errVec1 = ch->errorVec1();
929 const int nsl = ld.hitsVec0.size();
930 if (timeslices != nsl)
932 if (
debug)
msg() <<
"Inconsistent number of slices in sub-blocks"
937 if (ld.hitsVec0[slice] != 0 || ld.hitsVec1[slice] != 0 ||
938 ld.errVec0[slice] != 0 || ld.errVec1[slice] != 0)
940 if (
debug)
msg() <<
"Duplicate data for slice " << slice <<
endmsg;
944 ld.hitsVec0[slice] = hits0;
945 ld.hitsVec1[slice] = hits1;
946 ld.errVec0[slice] = err0;
947 ld.errVec1[slice] = err1;
948 ch->addHits(ld.hitsVec0, ld.hitsVec1, ld.errVec0, ld.errVec1);
968 const int hwCrate = subBlock->
crate();
969 const int module = subBlock->
module();
970 const int timeslices = subBlock->
timeslices();
971 const int sliceNum = subBlock->
slice();
974 msg() <<
"CPM: Crate " << hwCrate
975 <<
" Module " << module
976 <<
" Total slices " << timeslices
977 <<
" Slice " << sliceNum <<
endmsg;
981 if (
debug)
msg() <<
"Unexpected module number: " <<
module << endmsg;
985 if (timeslices <= trigCpm)
987 if (
debug)
msg() <<
"Triggered slice from header "
988 <<
"inconsistent with number of slices: "
989 << trigCpm <<
", " << timeslices <<
endmsg;
993 if (timeslices <= sliceNum)
995 if (
debug)
msg() <<
"Total slices inconsistent with slice number: "
996 << timeslices <<
", " << sliceNum <<
endmsg;
1006 msg() <<
"CPM sub-block unpacking failed: " << errMsg <<
endmsg;
1016 const int subStatus = dErr.
error();
1018 const int sliceBeg = ( neutralFormat ) ? 0 : sliceNum;
1019 const int sliceEnd = ( neutralFormat ) ? timeslices : sliceNum + 1;
1020 for (
int slice = sliceBeg; slice < sliceEnd; ++slice)
1025 for (
int chan = 0; chan <
m_channels; ++chan)
1027 if (!subStatus && !subBlock->
anyTowerData(chan))
continue;
1028 const int em = subBlock->
emData(slice, chan);
1029 const int had = subBlock->
hadData(slice, chan);
1030 const int emErr = subBlock->
emError(slice, chan);
1031 const int hadErr = subBlock->
hadError(slice, chan);
1032 int emErr1 = subStatus;
1038 emErr1 = emErrBits.
error();
1040 int hadErr1 = subStatus;
1046 hadErr1 = hadErrBits.
error();
1048 if (em || had || emErr1 || hadErr1)
1055 if (layer == ld.coreOverlap)
1057 const unsigned int key = ld.towerKey.ttKey(
phi,
eta);
1061 ld.emVec.assign(timeslices, 0);
1062 ld.hadVec.assign(timeslices, 0);
1063 ld.emErrVec.assign(timeslices, 0);
1064 ld.hadErrVec.assign(timeslices, 0);
1065 ld.emVec[slice] = em;
1066 ld.hadVec[slice] = had;
1067 ld.emErrVec[slice] = emErr1;
1068 ld.hadErrVec[slice] = hadErr1;
1070 std::make_unique<LVL1::CPMTower>(
phi,
eta, ld.emVec, ld.emErrVec,
1071 ld.hadVec, ld.hadErrVec, trigCpm);
1072 data.m_ttMap.insert(std::make_pair(key, ttp.get()));
1073 data.m_ttCollection->push_back(std::move(ttp));
1077 ld.emVec = tt->emEnergyVec();
1078 ld.hadVec = tt->hadEnergyVec();
1079 ld.emErrVec = tt->emErrorVec();
1080 ld.hadErrVec = tt->hadErrorVec();
1081 const int nsl = ld.emVec.size();
1082 if (timeslices != nsl)
1086 msg() <<
"Inconsistent number of slices in sub-blocks"
1092 if (ld.emVec[slice] != 0 || ld.hadVec[slice] != 0 ||
1093 ld.emErrVec[slice] != 0 || ld.hadErrVec[slice] != 0)
1095 if (
debug)
msg() <<
"Duplicate data for slice "
1100 ld.emVec[slice] = em;
1101 ld.hadVec[slice] = had;
1102 ld.emErrVec[slice] = emErr1;
1103 ld.hadErrVec[slice] = hadErr1;
1104 tt->fill(ld.emVec, ld.emErrVec, ld.hadVec, ld.hadErrVec, trigCpm);
1108 else if (
verbose && (em || had || emErr || hadErr))
1110 msg(MSG::VERBOSE) <<
"Non-zero data but no channel mapping for channel "
1117 msg(MSG::VERBOSE) <<
"No CPM tower data for channel "
1118 << chan <<
" slice " << slice <<
endmsg;
1132 ConstCpmTowerMap::const_iterator mapIter = ttMap.find(key);
1133 if (mapIter != ttMap.end())
return mapIter->second;
1138 const unsigned int key)
const
1140 CpmTowerMap::const_iterator mapIter =
data.m_ttMap.find(key);
1141 if (mapIter !=
data.m_ttMap.end())
return mapIter->second;
1151 ConstCmxCpTobMap::const_iterator mapIter = tobMap.find(key);
1152 if (mapIter != tobMap.end())
return mapIter->second;
1157 const int key)
const
1159 CmxCpTobMap::const_iterator mapIter =
data.m_tobMap.find(key);
1160 if (mapIter !=
data.m_tobMap.end())
return mapIter->second;
1170 ConstCmxCpHitsMap::const_iterator mapIter = hitsMap.find(key);
1171 if (mapIter != hitsMap.end())
return mapIter->second;
1176 const int key)
const
1178 CmxCpHitsMap::const_iterator mapIter =
data.m_hitsMap.find(key);
1179 if (mapIter !=
data.m_hitsMap.end())
return mapIter->second;
1195 for (; pos != pose; ++pos)
1198 const unsigned int key = towerKey.
ttKey(tt->phi(), tt->eta());
1199 ttMap.insert(std::make_pair(key, tt));
1207 const tobCollection,
1215 for (; pos != pose; ++pos)
1219 const int cmx = tob->
cmx();
1220 const int cpm = tob->
cpm();
1221 const int chip = tob->
chip();
1223 const int key =
tobKey(crate, cmx, cpm, chip, loc);
1224 tobMap.insert(std::make_pair(key, tob));
1232 const hitCollection,
1240 for (; pos != pose; ++pos)
1244 const int cmx = hits->cmx();
1245 const int source = hits->source();
1246 const int key =
hitsKey(crate, cmx, source);
1247 hitsMap.insert(std::make_pair(key, hits));
1255 const int chip,
const int loc)
const
1257 return (((((((crate << 1) | cmx) << 4) | cpm) << 4) | chip) << 2) | loc;
1263 const int source)
const
1265 return (((crate << 1) | cmx) << 3) | source;
1271 const int modulesPerSlink,
int ×lices,
int &trigCpm,
1279 for (
int mod = module; mod < module + modulesPerSlink; ++mod)
1281 for (
int chan = 0; chan <
m_channels; ++chan)
1286 if ( !
m_cpmMaps->mapping(crate, mod, chan,
eta,
phi, layer))
continue;
1287 const unsigned int key = towerKey.
ttKey(
phi,
eta);
1289 if ( !tt )
continue;
1290 const int numdat = 4;
1291 std::vector<int> sums(numdat);
1292 std::vector<int> sizes(numdat);
1293 sums[0] = std::accumulate((tt->emEnergyVec()).begin(),
1294 (tt->emEnergyVec()).end(), 0);
1295 sums[1] = std::accumulate((tt->hadEnergyVec()).begin(),
1296 (tt->hadEnergyVec()).end(), 0);
1297 sums[2] = std::accumulate((tt->emErrorVec()).begin(),
1298 (tt->emErrorVec()).end(), 0);
1299 sums[3] = std::accumulate((tt->hadErrorVec()).begin(),
1300 (tt->hadErrorVec()).end(), 0);
1301 sizes[0] = (tt->emEnergyVec()).size();
1302 sizes[1] = (tt->hadEnergyVec()).size();
1303 sizes[2] = (tt->emErrorVec()).size();
1304 sizes[3] = (tt->hadErrorVec()).size();
1305 const int peak = tt->peak();
1306 for (
int i = 0; i < numdat; ++i)
1308 if (sums[i] == 0)
continue;
1314 else if (slices != sizes[i] || trigC != peak)
return false;
1319 if (module / modulesPerSlink ==
m_slinks - 1)
1321 for (
int cmx = 0; cmx <
m_cmxs; ++cmx)
1323 for (
int cpm = 1; cpm <=
m_modules; ++ cpm)
1325 for (
int chip = 0; chip <
m_chips; ++chip)
1327 for (
int loc = 0; loc <
m_locs; ++loc)
1329 const int key =
tobKey(crate, cmx, cpm, chip, loc);
1334 const int numdat = 3;
1335 std::vector<int> sums(numdat);
1336 std::vector<int> sizes(numdat);
1337 sums[0] = std::accumulate((tob->
energyVec()).begin(),
1339 sums[1] = std::accumulate((tob->
isolationVec()).begin(),
1341 sums[2] = std::accumulate((tob->
errorVec()).begin(),
1345 sizes[2] = (tob->
errorVec()).size();
1346 const int peak = tob->
peak();
1347 for (
int i = 0; i < numdat; ++i)
1349 if (sums[i] == 0)
continue;
1355 else if (slices != sizes[i] || trigC != peak)
return false;
1363 const int key =
hitsKey(crate, cmx, source);
1369 const int numdat = 4;
1370 std::vector<unsigned int> sums(numdat);
1371 std::vector<int> sizes(numdat);
1372 sums[0] = std::accumulate((hits->hitsVec0()).begin(),
1373 (hits->hitsVec0()).end(), 0);
1374 sums[1] = std::accumulate((hits->hitsVec1()).begin(),
1375 (hits->hitsVec1()).end(), 0);
1376 sums[2] = std::accumulate((hits->errorVec0()).begin(),
1377 (hits->errorVec0()).end(), 0);
1378 sums[3] = std::accumulate((hits->errorVec1()).begin(),
1379 (hits->errorVec1()).end(), 0);
1380 sizes[0] = (hits->hitsVec0()).size();
1381 sizes[1] = (hits->hitsVec1()).size();
1382 sizes[2] = (hits->errorVec0()).size();
1383 sizes[3] = (hits->errorVec1()).size();
1384 const int peak = hits->peak();
1385 for (
int i = 0; i < numdat; ++i)
1387 if (sums[i] == 0)
continue;
1393 else if (slices != sizes[i] || trigC != peak)
return false;
1400 timeslices = slices;
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define ATH_CHECK
Evaluate an expression and check for errors.
#define CHECK(...)
Evaluate an expression and check for errors.
char data[hepevt_bytes_allocation_ATLAS]
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
bool msgLvl(const MSG::Level lvl) const
DataModel_detail::const_iterator< DataVector > const_iterator
value_type push_back(value_type pElem)
Add an element to the end of the collection.
DataModel_detail::iterator< DataVector > iterator
Standard iterator.
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
Template class for assembling a full atlas raw event from subfragments.
void setRodMinorVersion(uint16_t m)
change the ROD minor version
std::vector< uint32_t > RODDATA
ROD data as a vector of unsigned int.
RODDATA * getRodData(uint32_t id)
get a block of ROD data
std::vector< const ROBF * > VROBFRAG
Sub-Block class for CMX-CP data post LS1.
unsigned int hits(int slice, int source, int flag) const
Return hit/topo counts for given source ID and HL flag.
int roiOverflow(int slice, int source) const
Return RoI overflow for given source ID.
void clear()
Clear all data.
int energy(int slice, int cpm, int tob) const
Return energy for given cpm and tob.
bool unpack()
Unpack data.
void setPresenceMap(int slice, int cpm, unsigned int map)
Store presence map.
int hitsError(int slice, int source, int flag) const
Return hit error for given source ID and HL flag.
unsigned int presenceMap(int slice, int cpm) const
Return presence map for given CPM.
void setHits(int slice, int source, int flag, unsigned int hits, int error)
Store hit counts for given source ID and HL flag.
void setRoiOverflow(int slice, int source, int overflow)
Store RoI overflow for given source ID.
int chip(int slice, int cpm, int tob) const
Return chip for given cpm and tob.
int localCoord(int slice, int cpm, int tob) const
Return Local coordinate for given cpm and tob.
int isolation(int slice, int cpm, int tob) const
Return isolation for given cpm and tob.
int tobError(int slice, int cpm, int tob) const
Return error bits for given cpm and tob.
void setTob(int slice, int cpm, int chip, int loc, int energy, int isol, int error)
Store TOB (RoI) data for given CPM, chip, local coord.
static bool cmxBlock(uint32_t word)
Determine if header word corresponds to CMX.
void setCmxHeader(int version, int format, int slice, int crate, int summing, int firmware, int position, int timeslices)
Store CMX header.
static CmxFirmwareCode cmxType(uint32_t word)
CMX differentiation (CMX_CP, CMX_JET, or CMX_ENERGY)
Sub-Block class for CPM data post LS1.
int hadData(int slice, int channel) const
Return Had data for given channel.
int hadError(int slice, int channel) const
Return Had error for given channel.
int emError(int slice, int channel) const
Return Em error for given channel.
bool unpack()
Unpack data.
int emData(int slice, int channel) const
Return Em data for given channel.
void clear()
Clear all data.
int timeslices() const
Return number of timeslices.
void fillTowerData(int slice, int channel, int em, int had, int emErr, int hadErr)
Store trigger tower data.
void setCpmHeader(int version, int format, int slice, int crate, int module, int timeslices)
Store CPM header.
bool anyTowerData(int channel) const
Return true if there is tower data for given channel.
void setStatus(uint32_t failingBCN, bool glinkTimeout, bool glinkDown, bool upstreamError, bool daqOverflow, bool bcnMismatch, bool glinkProtocol, bool glinkParity)
Store error status trailer.
int unpackErrorCode() const
Return the unpacking error code.
uint32_t subStatus() const
Return Sub-status word.
int dataWords() const
Return number of data words.
static SubBlockWordType wordType(uint32_t word)
Word identification.
void write(FullEventAssembler< L1CaloSrcIdMap >::RODDATA *theROD) const
Output complete packed sub-block to ROD vector.
std::string unpackErrorMsg() const
Return the unpacking error message for printing.
OFFLINE_FRAGMENTS_NAMESPACE::PointerType read(const OFFLINE_FRAGMENTS_NAMESPACE::PointerType beg, const OFFLINE_FRAGMENTS_NAMESPACE::PointerType end)
Input complete packed sub-block from ROD array.
static void data(const std::vector< int > &oldVec, std::vector< int > &newVec, int newSlices)
Return modified data vector<int>
static int peak(int oldPeak, int oldSlices, int newSlices)
Return new triggered slice offset.
Summary of CP (EM/tau) hits produced by the merger modules.
TOB data received by the merger modules.
int peak() const
returns peak slice number
const std::vector< int > & isolationVec() const
returns isolation
const std::vector< int > & errorVec() const
returns error
int crate() const
Data accessors.
const std::vector< int > & energyVec() const
For multi-slice readout.
int chip() const
returns chip number (3 or 4 bits?)
int cmx() const
returns CMX number (0/1)==(Left/Right)==(Tau/Em)
int cpm() const
returns CPM number
int location() const
returns location (3 or 2 bits?)
Cluster Processor container for writing bytestream.
The CPMTower class contains the TriggerTower information received by the Cluster Processor Modules.
int error() const
Return the full error word.
void set(ErrorBit bit, int value=1)
Set an error bit or data.
int get(ErrorBit bit) const
Return an error bit or data.
The TriggerTowerKey object provides the key for each trigger tower depending on its eta-phi coords.
virtual unsigned int ttKey(const TriggerTower &tower)
returns the key of the passed tower
static const InterfaceID IID_ICpByteStreamV2Tool("CpByteStreamV2Tool", 1, 1)