|
ATLAS Offline Software
|
Tool to perform ROB fragments to CPM towers, CMX-CP TOBs and CMX-CP hits, and CP container to raw data conversions.
More...
#include <CpByteStreamV2Tool.h>
|
| CpByteStreamV2Tool (const std::string &type, const std::string &name, const IInterface *parent) |
|
virtual | ~CpByteStreamV2Tool () |
|
virtual StatusCode | initialize () override |
|
StatusCode | convert (const std::string &sgKey, DataVector< LVL1::CPMTower > *ttCollection) const |
| Convert ROB fragments to CPM towers. More...
|
|
StatusCode | convert (const std::string &sgKey, const IROBDataProviderSvc::VROBFRAG &robFrags, DataVector< LVL1::CPMTower > *ttCollection) const |
|
StatusCode | convert (const std::string &sgKey, DataVector< LVL1::CMXCPTob > *tobCollection) const |
| Convert ROB fragments to CMX-CP TOBs. More...
|
|
StatusCode | convert (const std::string &sgKey, const IROBDataProviderSvc::VROBFRAG &robFrags, DataVector< LVL1::CMXCPTob > *tobCollection) const |
|
StatusCode | convert (const std::string &sgKey, DataVector< LVL1::CMXCPHits > *hitCollection) const |
| Convert ROB fragments to CMX-CP hits. More...
|
|
StatusCode | convert (const std::string &sgKey, const IROBDataProviderSvc::VROBFRAG &robFrags, DataVector< LVL1::CMXCPHits > *hitCollection) const |
|
StatusCode | convert (const LVL1::CPBSCollectionV2 *cp) const |
| Convert CP Container to bytestream. More...
|
|
const std::vector< uint32_t > & | sourceIDs () const |
| Return reference to vector with all possible Source Identifiers. More...
|
|
ServiceHandle< StoreGateSvc > & | evtStore () |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | evtStore () const |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | detStore () const |
| The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
virtual StatusCode | sysInitialize () override |
| Perform system initialization for an algorithm. More...
|
|
virtual StatusCode | sysStart () override |
| Handle START transition. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | inputHandles () const override |
| Return this algorithm's input handles. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | outputHandles () const override |
| Return this algorithm's output handles. More...
|
|
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Property< T > &t) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc="none") |
| Declare a new Gaudi property. More...
|
|
void | updateVHKA (Gaudi::Details::PropertyBase &) |
|
MsgStream & | msg () const |
|
MsgStream & | msg (const MSG::Level lvl) const |
|
bool | msgLvl (const MSG::Level lvl) const |
|
|
std::vector< uint32_t > | makeSourceIDs () const |
| Create list of all source IDs. More...
|
|
StatusCode | convertBs (const std::string &sgKey, const IROBDataProviderSvc::VROBFRAG &robFrags, CpByteStreamToolData &data) const |
| Convert bytestream to given container type. More...
|
|
void | decodeCmxCp (CmxCpSubBlock *subBlock, int trigCpm, CpByteStreamToolData &data, LocalData &ld) const |
| Unpack CMX-CP sub-block. More...
|
|
void | decodeCpm (CpmSubBlockV2 *subBlock, int trigCpm, CpmTowerData &data, LocalData &ld) const |
| Unpack CPM sub-block. More...
|
|
const LVL1::CPMTower * | findCpmTower (unsigned int key, const ConstCpmTowerMap &ttMap) const |
| Find a CPM tower for given key. More...
|
|
LVL1::CPMTower * | findCpmTower (const CpmTowerData &data, unsigned int key) const |
|
const LVL1::CMXCPTob * | findCmxCpTob (int key, const ConstCmxCpTobMap &tobMap) const |
| Find CMX-CP TOB for given key. More...
|
|
LVL1::CMXCPTob * | findCmxCpTob (const CmxCpTobData &data, int key) const |
|
const LVL1::CMXCPHits * | findCmxCpHits (int key, const ConstCmxCpHitsMap &hitsMap) const |
| Find CMX-CP hits for given key. More...
|
|
LVL1::CMXCPHits * | findCmxCpHits (const CmxCpHitsData &data, int key) const |
|
void | setupCpmTowerMap (const CpmTowerCollection *ttCollection, ConstCpmTowerMap &ttMap, LVL1::TriggerTowerKey &towerKey) const |
| Set up CPM tower map. More...
|
|
void | setupCmxCpTobMap (const CmxCpTobCollection *tobCollection, ConstCmxCpTobMap &tobMap) const |
| Set up CMX-CP TOB map. More...
|
|
void | setupCmxCpHitsMap (const CmxCpHitsCollection *hitCollection, ConstCmxCpHitsMap &hitsMap) const |
| Set up CMX-CP hits map. More...
|
|
int | tobKey (int crate, int cmx, int cpm, int chip, int loc) const |
| Key for TOBs. More...
|
|
int | hitsKey (int crate, int cmx, int source) const |
| Key for Hits. More...
|
|
bool | slinkSlices (int crate, int module, int modulesPerSlink, int ×lices, int &trigJem, const ConstCpmTowerMap &ttMap, const ConstCmxCpTobMap &tobMap, const ConstCmxCpHitsMap &hitsMap, LVL1::TriggerTowerKey &towerKey) const |
| Get number of slices and triggered slice offset for next slink. More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKey> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &) |
| specialization for handling Gaudi::Property<SG::VarHandleBase> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &) |
| specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
|
|
Tool to perform ROB fragments to CPM towers, CMX-CP TOBs and CMX-CP hits, and CP container to raw data conversions.
Based on ROD document version X_xxx.
- Author
- Peter Faulkner
Definition at line 54 of file CpByteStreamV2Tool.h.
◆ CmxCpHitsCollection
◆ CmxCpHitsMap
◆ CmxCpTobCollection
◆ CmxCpTobMap
◆ ConstCmxCpHitsMap
◆ ConstCmxCpTobMap
◆ ConstCpmTowerMap
◆ CpmTowerCollection
◆ CpmTowerMap
◆ ROBIterator
◆ ROBPointer
◆ RODPointer
◆ StoreGateSvc_t
◆ CollectionType
◆ CpByteStreamV2Tool()
LVL1BS::CpByteStreamV2Tool::CpByteStreamV2Tool |
( |
const std::string & |
type, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
parent |
|
) |
| |
Definition at line 49 of file CpByteStreamV2Tool.cxx.
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");
◆ ~CpByteStreamV2Tool()
LVL1BS::CpByteStreamV2Tool::~CpByteStreamV2Tool |
( |
| ) |
|
|
virtual |
◆ convert() [1/7]
Convert CP Container to bytestream.
Definition at line 186 of file CpByteStreamV2Tool.cxx.
190 return StatusCode::FAILURE;
229 int timeslicesNew = 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;
279 L1CaloUserHeader userHeader;
280 userHeader.setCpm(trigCpmNew);
284 theROD->push_back(userHeader.header());
293 CpmSubBlockV2 *
const subBlock =
new CpmSubBlockV2();
295 hwCrate,
module, timeslicesNew);
297 if (neutralFormat)
break;
310 const unsigned int key = towerKey.
ttKey(phi, eta);
314 std::vector<int> emData;
315 std::vector<int> hadData;
316 std::vector<int> emError;
317 std::vector<int> hadError;
332 const int index = ( neutralFormat ) ? 0 :
slice;
333 CpmSubBlockV2 *
const subBlock = cpmBlocks[
index];
335 hadData[
slice], emErr, hadErr);
346 subBlock->setStatus(failingBCN, gLinkTimeout, gLinkDown,
347 moduleError, fIFOOverflow, bCNMismatch,
348 gLinkProtocol, gLinkParity);
360 CpmSubBlockV2 *
const subBlock = *
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: "
369 << subBlock->dataWords() <<
endmsg;
371 subBlock->write(theROD);
377 for (
int cmx = 0; cmx <
m_cmxs; ++cmx)
387 CmxCpSubBlock *
const block =
new CmxCpSubBlock();
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);
408 std::vector<int> isolation;
409 std::vector<int>
error;
410 std::vector<unsigned int> presence;
424 const int index = ( neutralFormat ) ? 0 :
slice;
425 CmxCpSubBlock *
const subBlock = cmxBlocks[
index];
428 subBlock->setPresenceMap(
slice, cpm, presence[
slice]);
443 std::vector<unsigned int> hits0;
444 std::vector<unsigned int> hits1;
445 std::vector<int> err0;
446 std::vector<int> err1;
455 const int index = ( neutralFormat ) ? 0 :
slice;
456 CmxCpSubBlock *
const subBlock = cmxBlocks[
index];
469 for (CmxCpSubBlock* subBlock : cmxBlocks)
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;
◆ convert() [2/7]
◆ convert() [3/7]
◆ convert() [4/7]
◆ convert() [5/7]
Convert ROB fragments to CMX-CP hits.
Definition at line 163 of file CpByteStreamV2Tool.cxx.
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);
◆ convert() [6/7]
Convert ROB fragments to CMX-CP TOBs.
Definition at line 141 of file CpByteStreamV2Tool.cxx.
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);
◆ convert() [7/7]
Convert ROB fragments to CPM towers.
Definition at line 119 of file CpByteStreamV2Tool.cxx.
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);
◆ convertBs()
Convert bytestream to given container type.
Definition at line 524 of file CpByteStreamV2Tool.cxx.
531 ld.coreOverlap = sgKey.ends_with(
"Overlap") || sgKey.ends_with (
"OverlapAux.");
536 CmxCpSubBlock cmxCpSubBlock;
537 CpmSubBlockV2 cpmSubBlock;
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();
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;
618 msg() <<
"Treating crate " << rodCrate
629 L1CaloUserHeader userHeader(*
payload);
630 userHeader.setVersion(minorVersion);
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;
673 cmxCpSubBlock.clear();
675 if (cmxCpSubBlock.crate() != rodCrate)
677 if (
debug)
msg() <<
"Inconsistent crate number in ROD source ID"
705 if (cpmSubBlock.crate() != rodCrate)
707 if (
debug)
msg() <<
"Inconsistent crate number in ROD source ID"
714 decodeCpm(&cpmSubBlock, trigCpm,
static_cast<CpmTowerData&
>(
data),
ld);
728 return StatusCode::SUCCESS;
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleBase
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 245 of file AthCommonDataStore.h.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
253 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleKey
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 221 of file AthCommonDataStore.h.
229 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This is the generic version, for types that do not derive from SG::VarHandleKey
. It just forwards to the base class version of declareProperty
.
Definition at line 333 of file AthCommonDataStore.h.
338 return PBASE::declareProperty(
name, property,
doc);
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This dispatches to either the generic declareProperty
or the one for VarHandle/Key/KeyArray.
Definition at line 352 of file AthCommonDataStore.h.
◆ declareProperty() [6/6]
◆ decodeCmxCp()
Unpack CMX-CP sub-block.
Definition at line 733 of file CpByteStreamV2Tool.cxx.
740 const int hwCrate = subBlock->crate();
741 const int cmx = subBlock->cmxPosition();
742 const int firmware = subBlock->cmxFirmware();
743 const int summing = subBlock->cmxSumming();
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;
772 if (subBlock->dataWords() && !subBlock->unpack())
776 std::string errMsg(subBlock->unpackErrorMsg());
777 msg() <<
"CMX-CP sub-block unpacking failed: " << errMsg <<
endmsg;
779 ld.rodErr = subBlock->unpackErrorCode();
788 const int subStatus = dErr.
error();
792 const int sliceBeg = ( neutralFormat ) ? 0 : sliceNum;
793 const int sliceEnd = ( neutralFormat ) ? timeslices : sliceNum + 1;
799 CmxCpTobData& tdata =
static_cast<CmxCpTobData&
> (
data);
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);
810 int error = subBlock->tobError(
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);
825 error = errBits.error();
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);
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()));
843 tdata.m_tobCollection->push_back(std::move(tbp));
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"
869 ld.presenceMapVec[
slice] = presenceMap;
870 tb->addTob(
ld.energyVec,
ld.isolVec,
ld.errorVec,
ld.presenceMapVec);
878 CmxCpHitsData& hdata =
static_cast<CmxCpHitsData&
> (
data);
889 const unsigned int hits0 = subBlock->hits(
slice,
source, 0);
890 const unsigned int hits1 = subBlock->hits(
slice,
source, 1);
893 int overflow = subBlock->roiOverflow(
slice,
source);
897 err0 = err0Bits.error();
901 err1 = err1Bits.error();
902 if (hits0 || hits1 || err0 || err1)
908 ld.hitsVec0.assign(timeslices, 0);
909 ld.hitsVec1.assign(timeslices, 0);
910 ld.errVec0.assign(timeslices, 0);
911 ld.errVec1.assign(timeslices, 0);
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()));
921 hdata.m_hitCollection->push_back(std::move(chp));
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"
948 ch->addHits(
ld.hitsVec0,
ld.hitsVec1,
ld.errVec0,
ld.errVec1);
◆ decodeCpm()
Unpack CPM sub-block.
Definition at line 960 of file CpByteStreamV2Tool.cxx.
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
976 <<
" Total slices " << timeslices
977 <<
" Slice " << sliceNum <<
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;
1001 if (subBlock->dataWords() && !subBlock->unpack())
1005 std::string errMsg(subBlock->unpackErrorMsg());
1006 msg() <<
"CPM sub-block unpacking failed: " << errMsg <<
endmsg;
1008 ld.rodErr = subBlock->unpackErrorCode();
1016 const int subStatus = dErr.
error();
1018 const int sliceBeg = ( neutralFormat ) ? 0 : sliceNum;
1019 const int sliceEnd = ( neutralFormat ) ? timeslices : sliceNum + 1;
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)
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);
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"
1095 if (
debug)
msg() <<
"Duplicate data for slice "
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 "
◆ detStore()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ extraDeps_update_handler()
Add StoreName to extra input/output deps as needed.
use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given
◆ findCmxCpHits() [1/2]
Definition at line 1175 of file CpByteStreamV2Tool.cxx.
1178 CmxCpHitsMap::const_iterator mapIter =
data.m_hitsMap.find(
key);
1179 if (mapIter !=
data.m_hitsMap.end())
return mapIter->second;
◆ findCmxCpHits() [2/2]
Find CMX-CP hits for given key.
Definition at line 1167 of file CpByteStreamV2Tool.cxx.
1170 ConstCmxCpHitsMap::const_iterator mapIter = hitsMap.find(
key);
1171 if (mapIter != hitsMap.end())
return mapIter->second;
◆ findCmxCpTob() [1/2]
Definition at line 1156 of file CpByteStreamV2Tool.cxx.
1159 CmxCpTobMap::const_iterator mapIter =
data.m_tobMap.find(
key);
1160 if (mapIter !=
data.m_tobMap.end())
return mapIter->second;
◆ findCmxCpTob() [2/2]
Find CMX-CP TOB for given key.
Definition at line 1148 of file CpByteStreamV2Tool.cxx.
1151 ConstCmxCpTobMap::const_iterator mapIter = tobMap.find(
key);
1152 if (mapIter != tobMap.end())
return mapIter->second;
◆ findCpmTower() [1/2]
Definition at line 1137 of file CpByteStreamV2Tool.cxx.
1140 CpmTowerMap::const_iterator mapIter =
data.m_ttMap.find(
key);
1141 if (mapIter !=
data.m_ttMap.end())
return mapIter->second;
◆ findCpmTower() [2/2]
Find a CPM tower for given key.
Definition at line 1129 of file CpByteStreamV2Tool.cxx.
1132 ConstCpmTowerMap::const_iterator mapIter = ttMap.find(
key);
1133 if (mapIter != ttMap.end())
return mapIter->second;
◆ hitsKey()
int LVL1BS::CpByteStreamV2Tool::hitsKey |
( |
int |
crate, |
|
|
int |
cmx, |
|
|
int |
source |
|
) |
| const |
|
private |
◆ initialize()
StatusCode LVL1BS::CpByteStreamV2Tool::initialize |
( |
| ) |
|
|
overridevirtual |
◆ inputHandles()
Return this algorithm's input handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ interfaceID()
const InterfaceID & LVL1BS::CpByteStreamV2Tool::interfaceID |
( |
| ) |
|
|
static |
◆ makeSourceIDs()
std::vector< uint32_t > LVL1BS::CpByteStreamV2Tool::makeSourceIDs |
( |
| ) |
const |
|
private |
Create list of all source IDs.
Definition at line 491 of file CpByteStreamV2Tool.cxx.
503 for (
int slink = 0; slink < maxSlinks; ++slink)
505 const int daqOrRoi = 0;
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ outputHandles()
Return this algorithm's output handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ renounce()
◆ renounceArray()
◆ setupCmxCpHitsMap()
◆ setupCmxCpTobMap()
Set up CMX-CP TOB map.
Definition at line 1206 of file CpByteStreamV2Tool.cxx.
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));
◆ setupCpmTowerMap()
◆ slinkSlices()
Get number of slices and triggered slice offset for next slink.
Definition at line 1270 of file CpByteStreamV2Tool.cxx.
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);
1294 (
tt->emEnergyVec()).end(), 0);
1296 (
tt->hadEnergyVec()).end(), 0);
1298 (
tt->emErrorVec()).end(), 0);
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;
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);
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;
1369 const int numdat = 4;
1370 std::vector<unsigned int> sums(numdat);
1371 std::vector<int> sizes(numdat);
1373 (
hits->hitsVec0()).end(), 0);
1375 (
hits->hitsVec1()).end(), 0);
1377 (
hits->errorVec0()).end(), 0);
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;
◆ sourceIDs()
const std::vector< uint32_t > & LVL1BS::CpByteStreamV2Tool::sourceIDs |
( |
| ) |
const |
◆ sysInitialize()
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ tobKey()
int LVL1BS::CpByteStreamV2Tool::tobKey |
( |
int |
crate, |
|
|
int |
cmx, |
|
|
int |
cpm, |
|
|
int |
chip, |
|
|
int |
loc |
|
) |
| const |
|
private |
Key for TOBs.
Definition at line 1254 of file CpByteStreamV2Tool.cxx.
1257 return (((((((crate << 1) | cmx) << 4) | cpm) << 4) | chip) << 2) | loc;
◆ updateVHKA()
◆ m_byteStreamCnvSvc
◆ m_channels
const int LVL1BS::CpByteStreamV2Tool::m_channels |
|
private |
◆ m_chips
const int LVL1BS::CpByteStreamV2Tool::m_chips |
|
private |
◆ m_cmxs
const int LVL1BS::CpByteStreamV2Tool::m_cmxs |
|
private |
◆ m_cpmMaps
◆ m_crateMax
int LVL1BS::CpByteStreamV2Tool::m_crateMax |
|
private |
◆ m_crateMin
int LVL1BS::CpByteStreamV2Tool::m_crateMin |
|
private |
◆ m_crateOffsetHw
int LVL1BS::CpByteStreamV2Tool::m_crateOffsetHw |
|
private |
◆ m_crateOffsetSw
int LVL1BS::CpByteStreamV2Tool::m_crateOffsetSw |
|
private |
◆ m_crates
int LVL1BS::CpByteStreamV2Tool::m_crates |
|
private |
◆ m_dataFormat
int LVL1BS::CpByteStreamV2Tool::m_dataFormat |
|
private |
◆ m_detStore
◆ m_dfltSlices
int LVL1BS::CpByteStreamV2Tool::m_dfltSlices |
|
private |
◆ m_enableEncoding
Gaudi::Property<bool> LVL1BS::CpByteStreamV2Tool::m_enableEncoding |
|
private |
Initial value:{
this, "enableEncoding", true, "Enable conversion from RDO to ByteStream"}
Definition at line 93 of file CpByteStreamV2Tool.h.
◆ m_errorTool
◆ m_evtStore
◆ m_forceSlices
int LVL1BS::CpByteStreamV2Tool::m_forceSlices |
|
private |
◆ m_locs
const int LVL1BS::CpByteStreamV2Tool::m_locs |
|
private |
◆ m_maxTobs
const int LVL1BS::CpByteStreamV2Tool::m_maxTobs |
|
private |
◆ m_modules
const int LVL1BS::CpByteStreamV2Tool::m_modules |
|
private |
◆ m_robDataProvider
◆ m_slinks
int LVL1BS::CpByteStreamV2Tool::m_slinks |
|
private |
◆ m_sourceIDsProp
std::vector<uint32_t> LVL1BS::CpByteStreamV2Tool::m_sourceIDsProp |
|
private |
◆ m_srcIdMap
◆ m_subDetector
const eformat::SubDetector LVL1BS::CpByteStreamV2Tool::m_subDetector |
|
private |
◆ m_varHandleArraysDeclared
◆ m_version
int LVL1BS::CpByteStreamV2Tool::m_version |
|
private |
◆ m_vhka
The documentation for this class was generated from the following files:
uint16_t minorVersionPreLS1() const
Return last ROD header minor version for pre-LS1 data.
char data[hepevt_bytes_allocation_ATLAS]
int slink(uint32_t code) const
Return slink from unpacked moduleID.
int cmx() const
returns CMX number (0/1)==(Left/Right)==(Tau/Em)
Template class for assembling a full atlas raw event from subfragments.
DataModel_detail::const_iterator< DataVector > const_iterator
Standard const_iterator.
static int peak(int oldPeak, int oldSlices, int newSlices)
Return new triggered slice offset.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
bool accumulate(AccumulateMap &map, std::vector< module_t > const &modules, FPGATrackSimMatrixAccumulator const &acc)
Accumulates an accumulator (e.g.
const std::vector< int > & errorVec() const
returns error
Summary of CP (EM/tau) hits produced by the merger modules.
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
const T * get(size_type n) const
Access an element, as an rvalue.
bool msgLvl(const MSG::Level lvl) const
uint32_t getRobID(uint32_t rod_id) const
Make a ROB Source ID from a ROD source ID.
static bool cmxBlock(uint32_t word)
Determine if header word corresponds to CMX.
virtual void setOwner(IDataHandleHolder *o)=0
const std::vector< int > & isolationVec() const
returns isolation
The CPMTower class contains the TriggerTower information received by the Cluster Processor Modules.
static void data(const std::vector< int > &oldVec, std::vector< int > &newVec, int newSlices)
Return modified data vector<int>
(Non-const) Iterator class for DataVector/DataList.
const std::vector< int > & energyVec() const
For multi-slice readout.
void set(ErrorBit bit, int value=1)
Set an error bit or data.
int crate(uint32_t code) const
Return crate from unpacked moduleID.
#define CHECK(...)
Evaluate an expression and check for errors.
std::vector< const ROBF * > VROBFRAG
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
static SubBlockWordType wordType(uint32_t word)
Word identification.
int error() const
Return the full error word.
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
int chip() const
returns chip number (3 or 4 bits?)
int crate() const
Data accessors.
uint16_t minorVersion() const
Return ROD header minor version to use when writing BS.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
static CmxFirmwareCode cmxType(uint32_t word)
CMX differentiation (CMX_CP, CMX_JET, or CMX_ENERGY)
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
int peak() const
returns peak slice number
eformat::SubDetector subDet(uint32_t code) const
Return sub-detector for given ID.
void setRodMinorVersion(uint16_t m)
change the ROD minor version
int cpm() const
returns CPM number
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
uint32_t getRodID(int crate, int slink, int daqOrRoi, eformat::SubDetector subdet) const
Make a ROD Source ID.
int location() const
returns location (3 or 2 bits?)
std::vector< uint32_t > RODDATA
ROD data as a vector of unsigned int.
virtual unsigned int ttKey(const TriggerTower &tower)
returns the key of the passed tower
int maxSlinks() const
Return the maximum possible number of slinks.
TOB data received by the merger modules.
int daqOrRoi(uint32_t code) const
Return daqOrRoi from unpacked moduleID.
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
The TriggerTowerKey object provides the key for each trigger tower depending on its eta-phi coords.
RODDATA * getRodData(uint32_t id)
get a block of ROD data
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.