|
ATLAS Offline Software
|
Tool to perform ROB fragments to CPM towers, CPM hits and CMM-CP hits, and CP container to raw data conversions.
More...
#include <CpByteStreamTool.h>
|
| CpByteStreamTool (const std::string &type, const std::string &name, const IInterface *parent) |
|
virtual | ~CpByteStreamTool () |
|
virtual StatusCode | initialize () override |
|
StatusCode | convert (const std::string &sgKey, const IROBDataProviderSvc::VROBFRAG &robFrags, DataVector< LVL1::CPMTower > *ttCollection) const |
| Convert ROB fragments to CPM towers. More...
|
|
StatusCode | convert (const std::string &sgKey, const IROBDataProviderSvc::VROBFRAG &robFrags, DataVector< LVL1::CPMHits > *hitCollection) const |
| Convert ROB fragments to CPM hits. More...
|
|
StatusCode | convert (const std::string &sgKey, const IROBDataProviderSvc::VROBFRAG &robFrags, DataVector< LVL1::CMMCPHits > *hitCollection) const |
| Convert ROB fragments to CMM-CP hits. More...
|
|
StatusCode | convert (const LVL1::CPBSCollection *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 | decodeCmmCp (CmmCpSubBlock *subBlock, int trigCmm, CmmHitsData &data, LocalData &ld) const |
| Unpack CMM-CP sub-block. More...
|
|
void | decodeCpm (CpmSubBlock *subBlock, int trigCpm, CpByteStreamToolData &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::CPMHits * | findCpmHits (int crate, int module, const ConstCpmHitsMap &hitsMap) const |
| Find CPM hits for given crate, module. More...
|
|
LVL1::CPMHits * | findCpmHits (const CpmHitsData &data, int crate, int module) const |
|
const LVL1::CMMCPHits * | findCmmCpHits (int crate, int dataID, const ConstCmmCpHitsMap &cmmHitsMap) const |
| Find CMM-CP hits for given crate, data ID. More...
|
|
LVL1::CMMCPHits * | findCmmCpHits (const CmmHitsData &data, int crate, int dataID) const |
|
void | setupCpmTowerMap (const CpmTowerCollection *ttCollection, ConstCpmTowerMap &ttMap, LVL1::TriggerTowerKey &towerKey) const |
| Set up CPM tower map. More...
|
|
void | setupCpmHitsMap (const CpmHitsCollection *hitCollection, ConstCpmHitsMap &hitsMap) const |
| Set up CPM hits map. More...
|
|
void | setupCmmCpHitsMap (const CmmCpHitsCollection *hitCollection, ConstCmmCpHitsMap &cmmHitsMap) const |
| Set up CMM-CP hits map. More...
|
|
bool | slinkSlices (int crate, int module, int modulesPerSlink, int ×lices, int &trigJem, const ConstCpmTowerMap &ttMap, const ConstCpmHitsMap &hitsMap, const ConstCmmCpHitsMap &cmmHitsMap, 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, CPM hits and CMM-CP hits, and CP container to raw data conversions.
Based on ROD document version 1_09h.
- Author
- Peter Faulkner
Definition at line 53 of file CpByteStreamTool.h.
◆ CmmCpHitsCollection
◆ CmmCpHitsMap
◆ ConstCmmCpHitsMap
◆ ConstCpmHitsMap
◆ ConstCpmTowerMap
◆ CpmHitsCollection
◆ CpmHitsMap
◆ CpmTowerCollection
◆ CpmTowerMap
◆ ROBIterator
◆ ROBPointer
◆ RODPointer
◆ StoreGateSvc_t
◆ CollectionType
◆ CpByteStreamTool()
LVL1BS::CpByteStreamTool::CpByteStreamTool |
( |
const std::string & |
type, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
parent |
|
) |
| |
Definition at line 48 of file CpByteStreamTool.cxx.
52 m_cpmMaps(
"LVL1::CpmMappingTool/CpmMappingTool"),
53 m_errorTool(
"LVL1BS::L1CaloErrorByteStreamTool/L1CaloErrorByteStreamTool"),
57 declareInterface<CpByteStreamTool>(
this);
60 "Crate/Module/Channel to Eta/Phi/Layer mapping tool");
63 "Offset of CP crate numbers in bytestream");
65 "Offset of CP crate numbers in RDOs");
69 "ROB fragment source identifiers");
73 "Format version number in sub-block header");
75 "Format identifier (0-1) in sub-block header");
77 "The number of S-Links per crate");
79 "The number of slices in the simulation");
81 "If >0, the number of slices in bytestream");
◆ ~CpByteStreamTool()
LVL1BS::CpByteStreamTool::~CpByteStreamTool |
( |
| ) |
|
|
virtual |
◆ convert() [1/4]
Convert CP Container to bytestream.
Vector for current CMM-CP hit0 sub-blocks
Vector for current CMM-CP hit1 sub-blocks
Definition at line 140 of file CpByteStreamTool.cxx.
178 int timeslicesNew = 1;
180 for (
int crate=0; crate <
m_crates; ++crate) {
189 if (
mod%modulesPerSlink == 0) {
190 const int daqOrRoi = 0;
191 const int slink = (
m_slinks == 2) ? 2*(
mod/modulesPerSlink)
192 :
mod/modulesPerSlink;
194 msg() <<
"Treating crate " << hwCrate
195 <<
" slink " << slink <<
endmsg;
206 msg(MSG::ERROR) <<
"Inconsistent number of slices or "
207 <<
"triggered slice offsets in data for crate "
208 << hwCrate <<
" slink " << slink <<
endmsg;
209 return StatusCode::FAILURE;
216 <<
"Slices/offset: " << timeslices <<
" " << trigCpm;
217 if (timeslices != timeslicesNew) {
218 msg() <<
" modified to " << timeslicesNew <<
" " << trigCpmNew;
222 L1CaloUserHeader userHeader;
223 userHeader.setCpm(trigCpmNew);
227 theROD->push_back(userHeader.header());
237 CpmSubBlock*
const subBlock =
new CpmSubBlock();
239 hwCrate,
module, timeslicesNew);
241 if (neutralFormat)
break;
252 const unsigned int key = towerKey.
ttKey(phi, eta);
255 std::vector<int> emData;
256 std::vector<int> hadData;
257 std::vector<int> emError;
258 std::vector<int> hadError;
272 const int index = ( neutralFormat ) ? 0 :
slice;
273 CpmSubBlock*
const subBlock = cpmBlocks[
index];
275 hadData[
slice], emErr, hadErr);
285 std::vector<unsigned int> vec0;
286 std::vector<unsigned int> vec1;
290 const int index = ( neutralFormat ) ? 0 :
slice;
291 CpmSubBlock*
const subBlock = cpmBlocks[
index];
300 CpmSubBlock*
const subBlock = *
pos;
301 if ( !subBlock->pack()) {
302 msg(MSG::ERROR) <<
"CPM sub-block packing failed" <<
endmsg;
303 return StatusCode::FAILURE;
306 msg() <<
"CPM sub-block data words: "
307 << subBlock->dataWords() <<
endmsg;
309 subBlock->write(theROD);
325 CmmCpSubBlock*
const h0Block =
new CmmCpSubBlock();
330 CmmCpSubBlock*
const h1Block =
new CmmCpSubBlock();
335 if (neutralFormat)
break;
341 for (
int dataID = 1; dataID < maxDataID; ++dataID) {
368 std::vector<unsigned int> hits0;
369 std::vector<unsigned int> hits1;
370 std::vector<int> err0;
371 std::vector<int> err1;
379 const int index = ( neutralFormat ) ? 0 :
slice;
380 CmmCpSubBlock* subBlock = cmmHit0Blocks[
index];
383 subBlock = cmmHit1Blocks[
index];
390 for (;
cos != cmmHit0Blocks.
end(); ++
cos) {
391 CmmCpSubBlock*
const subBlock = *
cos;
392 if ( !subBlock->pack()) {
393 msg(MSG::ERROR) <<
"CMM-Cp sub-block packing failed" <<
endmsg;
394 return StatusCode::FAILURE;
397 msg() <<
"CMM-Cp sub-block data words: "
398 << subBlock->dataWords() <<
endmsg;
400 subBlock->write(theROD);
403 for (;
cos != cmmHit1Blocks.
end(); ++
cos) {
404 CmmCpSubBlock*
const subBlock = *
cos;
405 if ( !subBlock->pack()) {
406 msg(MSG::ERROR) <<
"CMM-Cp sub-block packing failed" <<
endmsg;
407 return StatusCode::FAILURE;
410 msg() <<
"CMM-Cp sub-block data words: "
411 << subBlock->dataWords() <<
endmsg;
413 subBlock->write(theROD);
417 return StatusCode::SUCCESS;
◆ convert() [2/4]
◆ convert() [3/4]
◆ convert() [4/4]
◆ convertBs()
Convert bytestream to given container type.
Definition at line 455 of file CpByteStreamTool.cxx.
463 const static std::string
flag(
"Overlap");
464 const std::string::size_type
pos = sgKey.find(
flag);
466 (
pos == std::string::npos ||
pos != sgKey.length() -
flag.length()) ? 0 : 1;
473 CmmCpSubBlock cmmCpSubBlock;
474 CpmSubBlock cpmSubBlock;
477 std::set<uint32_t> dupCheck;
480 for (; rob != robEnd; ++rob) {
484 msg() <<
"Treating ROB fragment " << robCount <<
endmsg;
489 uint32_t robid = (*rob)->source_id();
490 if ((*rob)->nstatus() > 0) {
492 (*rob)->status(robData);
495 if (
debug)
msg() <<
"ROB status error - skipping fragment" <<
endmsg;
502 if (!dupCheck.insert(robid).second) {
513 (*rob)->rod_data(payloadBeg);
514 payloadEnd = payloadBeg + (*rob)->rod_ndata();
522 const uint32_t sourceID = (*rob)->rod_source_id();
531 msg() <<
"Wrong source identifier in data: ROD "
532 << MSG::hex << sourceID <<
" ROB " << robid
539 msg() <<
"Treating crate " << rodCrate
549 L1CaloUserHeader userHeader(*
payload);
550 const int minorVersion = (*rob)->rod_version() & 0xffff;
551 userHeader.setVersion(minorVersion);
552 const int headerWords = userHeader.words();
553 if (headerWords != 1) {
555 if (
debug)
msg() <<
"Unexpected number of user header words: "
559 for (
int i = 0;
i < headerWords; ++
i) ++
payload;
561 int trigCpm = userHeader.cpm();
562 int trigCmm = userHeader.cpCmm();
564 msg() <<
"Minor format version number: " << MSG::hex
565 << minorVersion << MSG::dec <<
endmsg
566 <<
"CPM triggered slice offset: " << trigCpm <<
endmsg
567 <<
"CMM triggered slice offset: " << trigCmm <<
endmsg;
569 if (trigCpm != trigCmm) {
570 const int newTrig = (trigCpm > trigCmm) ? trigCpm : trigCmm;
573 if (
debug)
msg() <<
"Changed both offsets to " << newTrig <<
endmsg;
579 while (
payload != payloadEnd) {
589 cmmCpSubBlock.clear();
591 if (cmmCpSubBlock.crate() != rodCrate) {
592 if (
debug)
msg() <<
"Inconsistent crate number in ROD source ID"
612 CpmSubBlock subBlock;
615 if (cpmSubBlock.crate() != rodCrate) {
616 if (
debug)
msg() <<
"Inconsistent crate number in ROD source ID"
634 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]
◆ decodeCmmCp()
Unpack CMM-CP sub-block.
Definition at line 639 of file CpByteStreamTool.cxx.
646 const int hwCrate = subBlock->crate();
647 const int module = subBlock->cmmPosition();
648 const int firmware = subBlock->cmmFirmware();
649 const int summing = subBlock->cmmSumming();
650 const int timeslices = subBlock->timeslices();
651 const int sliceNum = subBlock->slice();
653 msg() <<
"CMM-CP: Crate " << hwCrate
655 <<
" Firmware " << firmware
656 <<
" Summing " << summing
657 <<
" Total slices " << timeslices
658 <<
" Slice " << sliceNum <<
endmsg;
660 if (timeslices <= trigCmm) {
661 if (
debug)
msg() <<
"Triggered CMM slice from header "
662 <<
"inconsistent with number of slices: "
663 << trigCmm <<
", " << timeslices <<
endmsg;
667 if (timeslices <= sliceNum) {
668 if (
debug)
msg() <<
"Total slices inconsistent with slice number: "
669 << timeslices <<
", " << sliceNum <<
endmsg;
674 if (subBlock->dataWords() && !subBlock->unpack()) {
676 std::string errMsg(subBlock->unpackErrorMsg());
677 msg() <<
"CMM-CP sub-block unpacking failed: " << errMsg <<
endmsg;
679 ld.rodErr = subBlock->unpackErrorCode();
686 const uint32_t subStatus = subBlock->subStatus();
690 const int sliceBeg = ( neutralFormat ) ? 0 : sliceNum;
691 const int sliceEnd = ( neutralFormat ) ? timeslices : sliceNum + 1;
730 ld.hitsVec0.assign(timeslices, 0);
731 ld.hitsVec1.assign(timeslices, 0);
732 ld.errVec0.assign(timeslices, 0);
733 ld.errVec1.assign(timeslices, 0);
742 std::make_unique<LVL1::CMMCPHits>(swCrate, dataID,
ld.hitsVec0,
ld.hitsVec1,
743 ld.errVec0,
ld.errVec1, trigCmm);
744 const int key = crate*100 + dataID;
745 data.m_cmmHitsMap.insert(std::make_pair(
key, chp.get()));
746 data.m_cmmHitCollection->push_back(std::move(chp));
748 ld.hitsVec0 =
ch->HitsVec0();
749 ld.hitsVec1 =
ch->HitsVec1();
750 ld.errVec0 =
ch->ErrorVec0();
751 ld.errVec1 =
ch->ErrorVec1();
752 const int nsl =
ld.hitsVec0.size();
753 if (timeslices != nsl) {
754 if (
debug)
msg() <<
"Inconsistent number of slices in sub-blocks"
773 ch->addHits(
ld.hitsVec0,
ld.hitsVec1,
ld.errVec0,
ld.errVec1);
◆ decodeCpm()
Unpack CPM sub-block.
Definition at line 784 of file CpByteStreamTool.cxx.
792 const int hwCrate = subBlock->crate();
793 const int module = subBlock->module();
794 const int timeslices = subBlock->timeslices();
795 const int sliceNum = subBlock->slice();
797 msg() <<
"CPM: Crate " << hwCrate
799 <<
" Total slices " << timeslices
800 <<
" Slice " << sliceNum <<
endmsg;
807 if (timeslices <= trigCpm) {
808 if (
debug)
msg() <<
"Triggered CPM slice from header "
809 <<
"inconsistent with number of slices: "
810 << trigCpm <<
", " << timeslices <<
endmsg;
814 if (timeslices <= sliceNum) {
815 if (
debug)
msg() <<
"Total slices inconsistent with slice number: "
816 << timeslices <<
", " << sliceNum <<
endmsg;
821 if (subBlock->dataWords() && !subBlock->unpack()) {
823 std::string errMsg(subBlock->unpackErrorMsg());
824 msg() <<
"CPM sub-block unpacking failed: " << errMsg <<
endmsg;
826 ld.rodErr = subBlock->unpackErrorCode();
835 const int ssError = dErr.
error();
838 const int sliceBeg = ( neutralFormat ) ? 0 : sliceNum;
839 const int sliceEnd = ( neutralFormat ) ? timeslices : sliceNum + 1;
843 CpmTowerData& tdata =
static_cast<CpmTowerData&
> (
data);
848 if (!ssError && !subBlock->anyTowerData(
chan))
continue;
849 const int em = subBlock->emData(
slice,
chan);
850 const int had = subBlock->hadData(
slice,
chan);
851 const int emErr = subBlock->emError(
slice,
chan);
852 const int hadErr = subBlock->hadError(
slice,
chan);
853 int emErr1 = ssError;
858 emErr1 = emErrBits.error();
860 int hadErr1 = ssError;
865 hadErr1 = hadErrBits.error();
867 if (em || had || emErr1 || hadErr1) {
873 const unsigned int key =
ld.towerKey->ttKey(phi, eta);
876 ld.emVec.assign(timeslices, 0);
877 ld.hadVec.assign(timeslices, 0);
878 ld.emErrVec.assign(timeslices, 0);
879 ld.hadErrVec.assign(timeslices, 0);
885 std::make_unique<LVL1::CPMTower>(phi, eta,
ld.emVec,
ld.emErrVec,
886 ld.hadVec,
ld.hadErrVec, trigCpm);
887 tdata.m_ttMap.insert(std::make_pair(
key, ttp.get()));
888 tdata.m_ttCollection->push_back(std::move(ttp));
890 ld.emVec =
tt->emEnergyVec();
891 ld.hadVec =
tt->hadEnergyVec();
892 ld.emErrVec =
tt->emErrorVec();
893 ld.hadErrVec =
tt->hadErrorVec();
894 const int nsl =
ld.emVec.size();
895 if (timeslices != nsl) {
897 msg() <<
"Inconsistent number of slices in sub-blocks"
905 if (
debug)
msg() <<
"Duplicate data for slice "
914 tt->fill(
ld.emVec,
ld.emErrVec,
ld.hadVec,
ld.hadErrVec, trigCpm);
917 }
else if (
verbose && (em || had || emErr || hadErr)) {
918 msg(
MSG::VERBOSE) <<
"Non-zero data but no channel mapping for channel "
929 CpmHitsData& hdata =
static_cast<CpmHitsData&
> (
data);
933 const unsigned int hits0 = subBlock->hits0(
slice);
934 const unsigned int hits1 = subBlock->hits1(
slice);
935 if (hits0 || hits1) {
938 ld.hitsVec0.assign(timeslices, 0);
939 ld.hitsVec1.assign(timeslices, 0);
943 std::make_unique<LVL1::CPMHits>(swCrate,
module,
ld.hitsVec0,
ld.hitsVec1, trigCpm);
944 hdata.m_hitsMap.insert(std::make_pair(crate*
m_modules+
module-1, chp.get()));
945 hdata.m_hitCollection->push_back(std::move(chp));
947 ld.hitsVec0 =
ch->HitsVec0();
948 ld.hitsVec1 =
ch->HitsVec1();
949 const int nsl =
ld.hitsVec0.size();
950 if (timeslices != nsl) {
951 if (
debug)
msg() <<
"Inconsistent number of slices in sub-blocks"
963 ch->addHits(
ld.hitsVec0,
ld.hitsVec1);
◆ 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
◆ findCmmCpHits() [1/2]
Definition at line 1029 of file CpByteStreamTool.cxx.
1033 CmmCpHitsMap::const_iterator mapIter =
data.m_cmmHitsMap.find(crate*100 + dataID);
1034 if (mapIter !=
data.m_cmmHitsMap.end())
return mapIter->second;
◆ findCmmCpHits() [2/2]
Find CMM-CP hits for given crate, data ID.
Definition at line 1020 of file CpByteStreamTool.cxx.
1024 ConstCmmCpHitsMap::const_iterator mapIter = cmmHitsMap.find(crate*100 + dataID);
1025 if (mapIter != cmmHitsMap.end())
return mapIter->second;
◆ findCpmHits() [1/2]
Definition at line 1008 of file CpByteStreamTool.cxx.
1011 CpmHitsMap::const_iterator mapIter =
1013 if (mapIter !=
data.m_hitsMap.end())
return mapIter->second;
◆ findCpmHits() [2/2]
Find CPM hits for given crate, module.
Definition at line 998 of file CpByteStreamTool.cxx.
1002 ConstCpmHitsMap::const_iterator mapIter =
1004 if (mapIter != hitsMap.end())
return mapIter->second;
◆ findCpmTower() [1/2]
Definition at line 987 of file CpByteStreamTool.cxx.
990 CpmTowerMap::const_iterator mapIter =
data.m_ttMap.find(
key);
991 if (mapIter !=
data.m_ttMap.end())
return mapIter->second;
◆ findCpmTower() [2/2]
Find a CPM tower for given key.
Definition at line 979 of file CpByteStreamTool.cxx.
982 ConstCpmTowerMap::const_iterator mapIter = ttMap.find(
key);
983 if (mapIter != ttMap.end())
return mapIter->second;
◆ initialize()
StatusCode LVL1BS::CpByteStreamTool::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::CpByteStreamTool::interfaceID |
( |
| ) |
|
|
static |
◆ makeSourceIDs()
std::vector< uint32_t > LVL1BS::CpByteStreamTool::makeSourceIDs |
( |
| ) |
const |
|
private |
Create list of all source IDs.
Definition at line 422 of file CpByteStreamTool.cxx.
434 for (
int slink = 0; slink < maxSlinks; ++slink)
436 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()
◆ setupCmmCpHitsMap()
Set up CMM-CP hits map.
Definition at line 1078 of file CpByteStreamTool.cxx.
1083 if (hitCollection) {
1086 for (;
pos != pose; ++
pos) {
1089 const int key = crate*100 +
hits->dataID();
1090 cmmHitsMap.insert(std::make_pair(
key,
hits));
◆ setupCpmHitsMap()
◆ setupCpmTowerMap()
◆ slinkSlices()
Get number of slices and triggered slice offset for next slink.
Definition at line 1097 of file CpByteStreamTool.cxx.
1114 const unsigned int key = towerKey.
ttKey(phi, eta);
1116 if ( !
tt )
continue;
1117 const int numdat = 4;
1118 std::vector<int> sums(numdat);
1119 std::vector<int> sizes(numdat);
1121 (
tt->emEnergyVec()).end(), 0);
1123 (
tt->hadEnergyVec()).end(), 0);
1125 (
tt->emErrorVec()).end(), 0);
1127 (
tt->hadErrorVec()).end(), 0);
1128 sizes[0] = (
tt->emEnergyVec()).
size();
1129 sizes[1] = (
tt->hadEnergyVec()).
size();
1130 sizes[2] = (
tt->emErrorVec()).
size();
1131 sizes[3] = (
tt->hadErrorVec()).
size();
1132 const int peak =
tt->peak();
1133 for (
int i = 0;
i < numdat; ++
i) {
1134 if (sums[
i] == 0)
continue;
1138 }
else if (
slices != sizes[
i] || trigC != peak)
return false;
1143 const int numdat = 2;
1144 std::vector<unsigned int> sums(numdat);
1145 std::vector<int> sizes(numdat);
1147 (
hits->HitsVec0()).end(), 0);
1149 (
hits->HitsVec1()).end(), 0);
1150 sizes[0] = (
hits->HitsVec0()).
size();
1151 sizes[1] = (
hits->HitsVec1()).
size();
1152 const int peak =
hits->peak();
1153 for (
int i = 0;
i < numdat; ++
i) {
1154 if (sums[
i] == 0)
continue;
1158 }
else if (
slices != sizes[
i] || trigC != peak)
return false;
1165 for (
int dataID = 0; dataID < maxDataID; ++dataID) {
1166 const int numdat = 4;
1167 std::vector<unsigned int> sums(numdat);
1168 std::vector<int> sizes(numdat);
1172 (
hits->HitsVec0()).end(), 0);
1174 (
hits->HitsVec1()).end(), 0);
1176 (
hits->ErrorVec0()).end(), 0);
1178 (
hits->ErrorVec1()).end(), 0);
1179 sizes[0] = (
hits->HitsVec0()).
size();
1180 sizes[1] = (
hits->HitsVec1()).
size();
1181 sizes[2] = (
hits->ErrorVec0()).
size();
1182 sizes[3] = (
hits->ErrorVec1()).
size();
1183 const int peak =
hits->peak();
1184 for (
int i = 0;
i < numdat; ++
i) {
1185 if (sums[
i] == 0)
continue;
1189 }
else if (
slices != sizes[
i] || trigC != peak)
return false;
◆ sourceIDs()
const std::vector< uint32_t > & LVL1BS::CpByteStreamTool::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.
◆ updateVHKA()
◆ m_byteStreamCnvSvc
◆ m_channels
const int LVL1BS::CpByteStreamTool::m_channels |
|
private |
◆ m_cpmMaps
◆ m_crateOffsetHw
int LVL1BS::CpByteStreamTool::m_crateOffsetHw |
|
private |
◆ m_crateOffsetSw
int LVL1BS::CpByteStreamTool::m_crateOffsetSw |
|
private |
◆ m_crates
const int LVL1BS::CpByteStreamTool::m_crates |
|
private |
◆ m_dataFormat
int LVL1BS::CpByteStreamTool::m_dataFormat |
|
private |
◆ m_detStore
◆ m_dfltSlices
int LVL1BS::CpByteStreamTool::m_dfltSlices |
|
private |
◆ m_errorTool
◆ m_evtStore
◆ m_forceSlices
int LVL1BS::CpByteStreamTool::m_forceSlices |
|
private |
◆ m_modules
const int LVL1BS::CpByteStreamTool::m_modules |
|
private |
◆ m_slinks
int LVL1BS::CpByteStreamTool::m_slinks |
|
private |
◆ m_sourceIDsProp
std::vector<uint32_t> LVL1BS::CpByteStreamTool::m_sourceIDsProp |
|
private |
◆ m_srcIdMap
◆ m_subDetector
const eformat::SubDetector LVL1BS::CpByteStreamTool::m_subDetector |
|
private |
◆ m_varHandleArraysDeclared
◆ m_version
int LVL1BS::CpByteStreamTool::m_version |
|
private |
◆ m_vhka
The documentation for this class was generated from the following files:
static CmmFirmwareCode cmmType(uint32_t word)
CMM differentiation (CMM_CP, CMM_JET, or CMM_ENERGY)
char data[hepevt_bytes_allocation_ATLAS]
int slink(uint32_t code) const
Return slink from unpacked moduleID.
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.
static bool cmmBlock(uint32_t word)
Determine if header word corresponds to CMM.
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
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.
The CPMHits object contains the hit data produced by a given Cluster Processor Module,...
virtual void setOwner(IDataHandleHolder *o)=0
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.
Summary of CP (EM/tau) hits received by the merger modules.
void set(ErrorBit bit, int value=1)
Set an error bit or data.
int crate(uint32_t code) const
Return crate from unpacked moduleID.
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
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.
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
eformat::SubDetector subDet(uint32_t code) const
Return sub-detector for given ID.
void setRodMinorVersion(uint16_t m)
change the ROD minor version
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.
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.
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.