|
ATLAS Offline Software
|
Tool to perform ROB fragments to JEM RoI and CMX RoI, and JEP RoI container to raw data conversions.
More...
#include <JepRoiByteStreamV2Tool.h>
|
| JepRoiByteStreamV2Tool (const std::string &type, const std::string &name, const IInterface *parent) |
|
virtual | ~JepRoiByteStreamV2Tool () |
|
virtual StatusCode | initialize () override |
|
virtual StatusCode | finalize () override |
|
StatusCode | convert (const std::string &name, DataVector< LVL1::JEMTobRoI > *jeCollection) const |
| Convert ROB fragments to JEM RoIs. More...
|
|
StatusCode | convert (const IROBDataProviderSvc::VROBFRAG &robFrags, DataVector< LVL1::JEMTobRoI > *jeCollection) const |
|
StatusCode | convert (const std::string &name, LVL1::CMXRoI *cmCollection) const |
| Convert ROB fragments to CMX RoIs. More...
|
|
StatusCode | convert (const IROBDataProviderSvc::VROBFRAG &robFrags, LVL1::CMXRoI *cmCollection) const |
|
StatusCode | convert (const LVL1::JEPRoIBSCollectionV2 *jep) const |
| Convert JEP RoI Container to bytestream. More...
|
|
const std::vector< uint32_t > & | sourceIDs (const std::string &sgKey) 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 |
|
|
StatusCode | convertBs (const IROBDataProviderSvc::VROBFRAG &robFrags, DataVector< LVL1::JEMTobRoI > *jeCollection, LVL1::CMXRoI *cmCollection) const |
| Convert bytestream to given container type. More...
|
|
const LVL1::CMXEtSums * | findCmxSums (int crate, int source, const CmxSumsMap &cmxEtMap) const |
| Find CMX energy sums for given crate, source. More...
|
|
std::vector< uint32_t > | makeSourceIDs (bool roiDaq) const |
|
void | setupJemRoiMap (const JemRoiCollection *jeCollection, JemRoiMap &roiMap) const |
| Set up JEM RoIs map. More...
|
|
void | setupCmxEtMap (const CmxSumsCollection *enCollection, CmxSumsMap &cmxEtMap) const |
| Set up CMX energy sums map. More...
|
|
void | energySubBlockTypes (int source, CmxEnergySubBlock::SourceType &srcType, CmxEnergySubBlock::SumType &sumType, CmxEnergySubBlock::HitsType &hitType) const |
| Get energy subBlock types from CMXEtSums source type. 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 JEM RoI and CMX RoI, and JEP RoI container to raw data conversions.
Based on ROD document version X_xxx. <<== CHECK
- Author
- Peter Faulkner
Definition at line 50 of file JepRoiByteStreamV2Tool.h.
◆ CmxSumsCollection
◆ CmxSumsMap
◆ JemRoiCollection
◆ JemRoiMap
◆ ROBIterator
◆ ROBPointer
◆ RODPointer
◆ StoreGateSvc_t
◆ JepRoiByteStreamV2Tool()
LVL1BS::JepRoiByteStreamV2Tool::JepRoiByteStreamV2Tool |
( |
const std::string & |
type, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
parent |
|
) |
| |
Definition at line 44 of file JepRoiByteStreamV2Tool.cxx.
49 m_errorTool(
"LVL1BS::L1CaloErrorByteStreamTool/L1CaloErrorByteStreamTool"),
53 declareInterface<JepRoiByteStreamV2Tool>(
this);
56 "Tool to collect errors for monitoring");
58 "Offset of JEP crate numbers in bytestream");
60 "Offset of JEP crate numbers in RDOs");
64 "ROB fragment source identifiers");
66 "ROB fragment source identifiers");
70 "Format version number in sub-block header");
72 "Format identifier (0-1) in sub-block header");
74 "The number of S-Links per crate");
76 "Minimum crate number, allows partial output");
78 "Maximum crate number, allows partial output");
◆ ~JepRoiByteStreamV2Tool()
LVL1BS::JepRoiByteStreamV2Tool::~JepRoiByteStreamV2Tool |
( |
| ) |
|
|
virtual |
◆ convert() [1/5]
◆ convert() [2/5]
◆ convert() [3/5]
Convert JEP RoI Container to bytestream.
Definition at line 152 of file JepRoiByteStreamV2Tool.cxx.
161 "JepRoiByteStreamV2") );
170 JemRoiSubBlockV2 subBlock;
179 JemRoiMap::const_iterator mapIter = roiMap.begin();
180 JemRoiMap::const_iterator mapIterEnd = roiMap.end();
198 if (
module % modulesPerSlink == 0) {
199 const int daqOrRoi = 1;
200 const int slink =
module / modulesPerSlink;
202 msg() <<
"Treating crate " << hwCrate
203 <<
" slink " << slink <<
endmsg
211 const L1CaloUserHeader userHeader;
212 theROD->push_back(userHeader.header());
227 for (; mapIter != mapIterEnd; ++mapIter) {
229 if (roi->
crate() < crate)
continue;
230 if (roi->
crate() > crate)
break;
234 if (neutralFormat) subBlock.fillRoi(*roi);
235 else theROD->push_back(roi->
roiWord());
242 if ( !subBlock.pack()) {
243 msg(MSG::ERROR) <<
"JEM RoI sub-block packing failed" <<
endmsg;
244 return StatusCode::FAILURE;
247 msg() <<
"JEM RoI sub-block data words: "
248 << subBlock.dataWords() <<
endmsg;
250 subBlock.write(theROD);
257 if (crate !=
m_crates - 1)
continue;
262 const int timeslices = 1;
267 CmxEnergySubBlock subBlock;
268 const int cmxEnergyVersion = 3;
276 const unsigned int ex = sums->
Ex();
277 const unsigned int ey = sums->
Ey();
278 const unsigned int et = sums->
Et();
279 const int exErr = sums->
ExError();
280 const int eyErr = sums->
EyError();
281 const int etErr = sums->
EtError();
283 subBlock.setSubsums(
slice,
source, ex, ey,
et, exErr, eyErr, etErr);
290 subBlock.setSubsums(
slice, srcType, sumType, ex, ey,
et,
291 exErr, eyErr, etErr);
293 subBlock.setEtHits(
slice, hitType, sumType,
et);
298 if ( !subBlock.pack()) {
299 msg(MSG::ERROR) <<
"CMX-Energy sub-block packing failed" <<
endmsg;
300 return StatusCode::FAILURE;
303 msg() <<
"CMX-Energy sub-block data words: "
304 << subBlock.dataWords() <<
endmsg;
306 subBlock.write(theROD);
316 theROD->push_back(roi->
roiWord(word));
322 return StatusCode::SUCCESS;
◆ convert() [4/5]
◆ convert() [5/5]
StatusCode LVL1BS::JepRoiByteStreamV2Tool::convert |
( |
const std::string & |
name, |
|
|
LVL1::CMXRoI * |
cmCollection |
|
) |
| const |
◆ convertBs()
Convert bytestream to given container type.
Definition at line 381 of file JepRoiByteStreamV2Tool.cxx.
392 std::set<uint32_t> dupCheck;
393 std::set<uint32_t> dupRoiCheck;
396 for (; rob != robEnd; ++rob) {
400 msg() <<
"Treating ROB fragment " << robCount <<
endmsg;
405 uint32_t robid = (*rob)->source_id();
406 if ((*rob)->nstatus() > 0) {
408 (*rob)->status(robData);
411 if (
debug)
msg() <<
"ROB status error - skipping fragment" <<
endmsg;
418 if (!dupCheck.insert(robid).second) {
429 (*rob)->rod_data(payloadBeg);
430 payloadEnd = payloadBeg + (*rob)->rod_ndata();
438 const uint32_t sourceID = (*rob)->rod_source_id();
447 msg() <<
"Wrong source identifier in data: "
448 << MSG::hex << sourceID << MSG::dec <<
endmsg;
454 const int minorVersion = (*rob)->rod_version() & 0xffff;
461 msg() <<
"Treating crate " << rodCrate
467 L1CaloUserHeader userHeader(*
payload);
468 userHeader.setVersion(minorVersion);
469 const int headerWords = userHeader.words();
470 if (headerWords != 1) {
472 if (
debug)
msg() <<
"Unexpected number of user header words: "
476 for (
int i = 0;
i < headerWords; ++
i) ++
payload;
482 while (
payload != payloadEnd) {
489 CmxEnergySubBlock subBlock;
491 if (cmCollection !=
nullptr) {
492 if (subBlock.dataWords() && !subBlock.unpack()) {
494 std::string errMsg(subBlock.unpackErrorMsg());
495 msg() <<
"CMX-Energy sub-block unpacking failed: "
498 rodErr = subBlock.unpackErrorCode();
555 JemRoiSubBlockV2 subBlock;
557 if (jeCollection !=
nullptr) {
558 if (subBlock.dataWords() && !subBlock.unpack()) {
560 std::string errMsg(subBlock.unpackErrorMsg());
561 msg() <<
"JEM RoI sub-block unpacking failed: "
564 rodErr = subBlock.unpackErrorCode();
567 for (
int frame = 0; frame <
m_frames; ++frame) {
580 if (jeCollection !=
nullptr) {
582 if (
debug)
msg() <<
"Inconsistent RoI crate number: "
587 const uint32_t location = (*payload) & 0xfff80000;
588 if (dupRoiCheck.insert(location).second) {
593 if (
debug)
msg() <<
"Duplicate RoI word "
600 if (cmCollection !=
nullptr) {
601 const uint32_t roiType = (*payload) & 0xfc000000;
603 if (dupRoiCheck.insert(roiType).second) {
606 if (
debug)
msg() <<
"Duplicate RoI word "
613 if (
debug)
msg() <<
"Invalid RoI word "
625 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]
◆ detStore()
◆ energySubBlockTypes()
◆ 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
◆ finalize()
StatusCode LVL1BS::JepRoiByteStreamV2Tool::finalize |
( |
| ) |
|
|
overridevirtual |
◆ findCmxSums()
Find CMX energy sums for given crate, source.
Definition at line 630 of file JepRoiByteStreamV2Tool.cxx.
635 CmxSumsMap::const_iterator mapIter;
636 mapIter = cmxEtMap.find(crate * 100 +
source);
637 if (mapIter != cmxEtMap.end()) sums = mapIter->second;
◆ initialize()
StatusCode LVL1BS::JepRoiByteStreamV2Tool::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::JepRoiByteStreamV2Tool::interfaceID |
( |
| ) |
|
|
static |
◆ makeSourceIDs()
std::vector< uint32_t > LVL1BS::JepRoiByteStreamV2Tool::makeSourceIDs |
( |
bool |
roiDaq | ) |
const |
|
private |
Definition at line 327 of file JepRoiByteStreamV2Tool.cxx.
343 for (
int slink = 0; slink < maxSlinks; ++slink)
345 const int daqOrRoi = 1;
351 if (slink < 2)
sourceIDs.push_back(robId);
353 else if (slink >= 2)
sourceIDs.push_back(robId);
◆ 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()
◆ setupCmxEtMap()
◆ setupJemRoiMap()
◆ sourceIDs()
const std::vector< uint32_t > & LVL1BS::JepRoiByteStreamV2Tool::sourceIDs |
( |
const std::string & |
sgKey | ) |
const |
Return reference to vector with all possible Source Identifiers.
Definition at line 361 of file JepRoiByteStreamV2Tool.cxx.
364 const std::string
flag(
"RoIB");
365 const std::string::size_type
pos = sgKey.find(
flag);
367 (
pos == std::string::npos ||
pos != sgKey.length() -
flag.length());
374 static const std::vector<uint32_t> sourceIDsRoIB =
makeSourceIDs(roiDaq);
375 return sourceIDsRoIB;
◆ 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_crateMax
int LVL1BS::JepRoiByteStreamV2Tool::m_crateMax |
|
private |
◆ m_crateMin
int LVL1BS::JepRoiByteStreamV2Tool::m_crateMin |
|
private |
◆ m_crateOffsetHw
int LVL1BS::JepRoiByteStreamV2Tool::m_crateOffsetHw |
|
private |
◆ m_crateOffsetSw
int LVL1BS::JepRoiByteStreamV2Tool::m_crateOffsetSw |
|
private |
◆ m_crates
const int LVL1BS::JepRoiByteStreamV2Tool::m_crates |
|
private |
◆ m_dataFormat
int LVL1BS::JepRoiByteStreamV2Tool::m_dataFormat |
|
private |
◆ m_detStore
◆ m_errorTool
◆ m_evtStore
◆ m_frames
const int LVL1BS::JepRoiByteStreamV2Tool::m_frames |
|
private |
◆ m_maxRoiWords
const int LVL1BS::JepRoiByteStreamV2Tool::m_maxRoiWords |
|
private |
◆ m_modules
const int LVL1BS::JepRoiByteStreamV2Tool::m_modules |
|
private |
◆ m_robDataProvider
◆ m_slinks
int LVL1BS::JepRoiByteStreamV2Tool::m_slinks |
|
private |
◆ m_sourceIDsProp
std::vector<uint32_t> LVL1BS::JepRoiByteStreamV2Tool::m_sourceIDsProp |
|
private |
◆ m_sourceIDsRoIBProp
std::vector<uint32_t> LVL1BS::JepRoiByteStreamV2Tool::m_sourceIDsRoIBProp |
|
private |
◆ m_srcIdMap
◆ m_subDetector
const eformat::SubDetector LVL1BS::JepRoiByteStreamV2Tool::m_subDetector |
|
private |
◆ m_varHandleArraysDeclared
◆ m_version
int LVL1BS::JepRoiByteStreamV2Tool::m_version |
|
private |
◆ m_vhka
The documentation for this class was generated from the following files:
const CMXRoI * CmxRoi() const
Return pointer to CMX RoIs.
uint16_t minorVersionPreLS1() const
Return last ROD header minor version for pre-LS1 data.
unsigned int Ey() const
returns module Ey sum for peak sample
int slink(uint32_t code) const
Return slink from unpacked moduleID.
Extra patterns decribing particle interation process.
Template class for assembling a full atlas raw event from subfragments.
DataModel_detail::const_iterator< DataVector > const_iterator
Standard const_iterator.
int source() const
returns data source
const DataVector< CMXEtSums > * CmxSums() const
Return pointer to CMX energy sums collection.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool setRoiWord(uint32_t roiWord)
Set RoI word with ID check.
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.
int EyError() const
returns module Ey sum error for peak sample
static bool cmxBlock(uint32_t word)
Determine if header word corresponds to CMX.
virtual void setOwner(IDataHandleHolder *o)=0
unsigned int Et() const
For triggered time slice.
uint32_t roiWord() const
Return packed RoI word.
unsigned int Ex() const
returns module Ex sum for peak sample
int crate(uint32_t code) const
Return crate from unpacked moduleID.
int ExError() const
returns module Ex sum error for peak sample
std::vector< const ROBF * > VROBFRAG
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
static SubBlockWordType wordType(uint32_t word)
Word identification.
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
int energySmall() const
Return energy small window size.
@ MISSING_ET_SIG_STANDARD
uint16_t minorVersion() const
Return ROD header minor version to use when writing BS.
const DataVector< JEMTobRoI > * JemRoi() const
Return pointer to JEM RoI collection.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
CMXEtSums object stores Et sums from the Energy CMXs.
static CmxFirmwareCode cmxType(uint32_t word)
CMX differentiation (CMX_CP, CMX_JET, or CMX_ENERGY)
eformat::SubDetector subDet(uint32_t code) const
Return sub-detector for given ID.
bool setRoiWord(uint32_t roiWord)
Set RoI word with ID check.
int EtError() const
returns module ET sum error for peak sample
void setRodMinorVersion(uint16_t m)
change the ROD minor version
int jem() const
Return JEM number (0-15)
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
int energyLarge() const
Return energy large window size.
uint32_t getRodID(int crate, int slink, int daqOrRoi, eformat::SubDetector subdet) const
Make a ROD Source ID.
int crate() const
Data accessors.
std::vector< uint32_t > RODDATA
ROD data as a vector of unsigned int.
int crate() const
Return crate number (0-1)
int maxSlinks() const
Return the maximum possible number of slinks.
uint32_t roiWord(int word) const
Return packed Energy RoI word (0-5)
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>
RODDATA * getRodData(uint32_t id)
get a block of ROD data