|
ATLAS Offline Software
|
Tool to perform ROB fragments to CPM RoI and CPM RoI to raw data conversions.
More...
#include <CpmRoiByteStreamV1Tool.h>
|
| CpmRoiByteStreamV1Tool (const std::string &type, const std::string &name, const IInterface *parent) |
|
virtual | ~CpmRoiByteStreamV1Tool () |
|
virtual StatusCode | initialize () override |
|
StatusCode | convert (const IROBDataProviderSvc::VROBFRAG &robFrags, DataVector< LVL1::CPMRoI > *roiCollection) const |
| Convert ROB fragments to CPM RoIs. More...
|
|
StatusCode | convert (const DataVector< LVL1::CPMRoI > *roiCollection) const |
| Convert CPM RoI 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 |
|
Tool to perform ROB fragments to CPM RoI and CPM RoI to raw data conversions.
Based on ROD document version 1_09h.
- Author
- Peter Faulkner
Definition at line 47 of file CpmRoiByteStreamV1Tool.h.
◆ CpmRoiCollection
◆ CpmRoiMap
◆ ROBIterator
◆ ROBPointer
◆ RODPointer
◆ StoreGateSvc_t
◆ CpmRoiByteStreamV1Tool()
LVL1BS::CpmRoiByteStreamV1Tool::CpmRoiByteStreamV1Tool |
( |
const std::string & |
type, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
parent |
|
) |
| |
Definition at line 38 of file CpmRoiByteStreamV1Tool.cxx.
42 m_errorTool(
"LVL1BS::L1CaloErrorByteStreamTool/L1CaloErrorByteStreamTool"),
46 declareInterface<CpmRoiByteStreamV1Tool>(
this);
49 "Tool to collect errors for monitoring");
51 "Offset of CP crate numbers in bytestream");
53 "Offset of CP crate numbers in RDOs");
57 "ROB fragment source identifiers");
59 "ROB fragment source identifiers for RoIBs");
63 "Format version number in sub-block header");
65 "Format identifier (0-1) in sub-block header");
67 "The number of S-Links per crate");
69 "Minimum crate number, allows partial output");
71 "Maximum crate number, allows partial output");
◆ ~CpmRoiByteStreamV1Tool()
LVL1BS::CpmRoiByteStreamV1Tool::~CpmRoiByteStreamV1Tool |
( |
| ) |
|
|
virtual |
◆ convert() [1/2]
Convert CPM RoI to bytestream.
Definition at line 272 of file CpmRoiByteStreamV1Tool.cxx.
282 "CpmRoiByteStreamV1") );
291 CpmRoiSubBlockV1 subBlock;
298 CpmRoiMap::const_iterator mapIter = roiMap.begin();
299 CpmRoiMap::const_iterator mapIterEnd = roiMap.end();
314 if (
mod%modulesPerSlink == 0) {
315 const int daqOrRoi = 1;
316 const int slink = (
m_slinks == 2) ? 2*(
mod/modulesPerSlink)
317 :
mod/modulesPerSlink;
319 msg() <<
"Treating crate " << hwCrate
320 <<
" slink " << slink <<
endmsg
328 const L1CaloUserHeader userHeader;
329 theROD->push_back(userHeader.header());
343 for (; mapIter != mapIterEnd; ++mapIter) {
345 if (roi->
crate() < crate)
continue;
346 if (roi->
crate() > crate)
break;
350 if (neutralFormat) subBlock.fillRoi(*roi);
351 else theROD->push_back(roi->
roiWord());
358 if ( !subBlock.pack()) {
359 msg(MSG::ERROR) <<
"CPMRoI sub-block packing failed" <<
endmsg;
360 return StatusCode::FAILURE;
363 msg() <<
"CPMRoI sub-block data words: "
364 << subBlock.dataWords() <<
endmsg;
366 subBlock.write(theROD);
371 return StatusCode::SUCCESS;
◆ convert() [2/2]
Convert ROB fragments to CPM RoIs.
Definition at line 96 of file CpmRoiByteStreamV1Tool.cxx.
104 CpmRoiSubBlockV1 subBlock;
109 std::set<uint32_t> dupCheck;
110 std::set<uint32_t> dupRoiCheck;
113 for (; rob != robEnd; ++rob) {
117 msg() <<
"Treating ROB fragment " << robCount <<
endmsg;
122 uint32_t robid = (*rob)->source_id();
123 if ((*rob)->nstatus() > 0) {
125 (*rob)->status(robData);
128 if (
debug)
msg() <<
"ROB status error - skipping fragment" <<
endmsg;
135 if (!dupCheck.insert(robid).second) {
146 (*rob)->rod_data(payloadBeg);
147 payloadEnd = payloadBeg + (*rob)->rod_ndata();
155 const uint32_t sourceID = (*rob)->rod_source_id();
164 msg() <<
"Wrong source identifier in data: "
165 << MSG::hex << sourceID << MSG::dec <<
endmsg;
171 const int minorVersion = (*rob)->rod_version() & 0xffff;
178 msg() <<
"Treating crate " << rodCrate
184 L1CaloUserHeader userHeader(*
payload);
185 userHeader.setVersion(minorVersion);
186 const int headerWords = userHeader.words();
187 if (headerWords != 1 ) {
189 if (
debug)
msg() <<
"Unexpected number of user header words: "
193 for (
int i = 0;
i < headerWords; ++
i) ++
payload;
199 while (
payload != payloadEnd) {
205 msg() <<
"CPM RoI sub-block: Crate " << subBlock.crate()
206 <<
" Module " << subBlock.module() <<
endmsg;
209 if (subBlock.dataWords() && !subBlock.unpack()) {
211 std::string errMsg(subBlock.unpackErrorMsg());
212 msg() <<
"CPM RoI sub-block unpacking failed: " << errMsg <<
endmsg;
214 rodErr = subBlock.unpackErrorCode();
217 const int numChips = 8;
218 const int numLocs = 2;
219 for (
int chip = 0; chip < numChips; ++chip) {
220 for (
int loc = 0; loc < numLocs; ++loc) {
232 if (
debug)
msg() <<
"Inconsistent RoI crate number: "
238 if (
debug)
msg() <<
"Invalid CPM number: "
243 const uint32_t location = (*payload) & 0xfffc0000;
244 if (dupRoiCheck.insert(location).second) {
249 if (
debug)
msg() <<
"Duplicate RoI word "
255 if (
debug)
msg() <<
"Invalid RoI word "
267 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()
◆ 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
◆ initialize()
StatusCode LVL1BS::CpmRoiByteStreamV1Tool::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::CpmRoiByteStreamV1Tool::interfaceID |
( |
| ) |
|
|
static |
◆ makeSourceIDs()
std::vector< uint32_t > LVL1BS::CpmRoiByteStreamV1Tool::makeSourceIDs |
( |
bool |
roiDaq | ) |
const |
|
private |
Definition at line 376 of file CpmRoiByteStreamV1Tool.cxx.
392 for (
int slink = 0; slink < maxSlinks; ++slink)
394 const int daqOrRoi = 1;
400 if (slink < 2)
sourceIDs.push_back(robId);
402 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()
◆ setupCpmRoiMap()
◆ sourceIDs()
const std::vector< uint32_t > & LVL1BS::CpmRoiByteStreamV1Tool::sourceIDs |
( |
const std::string & |
sgKey | ) |
const |
Return reference to vector with all possible Source Identifiers.
Definition at line 410 of file CpmRoiByteStreamV1Tool.cxx.
413 const std::string
flag(
"RoIB");
414 const std::string::size_type
pos = sgKey.find(
flag);
416 (
pos == std::string::npos ||
pos != sgKey.length() -
flag.length());
423 static const std::vector<uint32_t> sourceIDsRoIB =
makeSourceIDs(roiDaq);
424 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::CpmRoiByteStreamV1Tool::m_crateMax |
|
private |
◆ m_crateMin
int LVL1BS::CpmRoiByteStreamV1Tool::m_crateMin |
|
private |
◆ m_crateOffsetHw
int LVL1BS::CpmRoiByteStreamV1Tool::m_crateOffsetHw |
|
private |
◆ m_crateOffsetSw
int LVL1BS::CpmRoiByteStreamV1Tool::m_crateOffsetSw |
|
private |
◆ m_crates
const int LVL1BS::CpmRoiByteStreamV1Tool::m_crates |
|
private |
◆ m_dataFormat
int LVL1BS::CpmRoiByteStreamV1Tool::m_dataFormat |
|
private |
◆ m_detStore
◆ m_errorTool
◆ m_evtStore
◆ m_modules
const int LVL1BS::CpmRoiByteStreamV1Tool::m_modules |
|
private |
◆ m_slinks
int LVL1BS::CpmRoiByteStreamV1Tool::m_slinks |
|
private |
◆ m_sourceIDsProp
std::vector<uint32_t> LVL1BS::CpmRoiByteStreamV1Tool::m_sourceIDsProp |
|
private |
◆ m_sourceIDsRoIBProp
std::vector<uint32_t> LVL1BS::CpmRoiByteStreamV1Tool::m_sourceIDsRoIBProp |
|
private |
◆ m_srcIdMap
◆ m_subDetector
const eformat::SubDetector LVL1BS::CpmRoiByteStreamV1Tool::m_subDetector |
|
private |
◆ m_varHandleArraysDeclared
◆ m_version
int LVL1BS::CpmRoiByteStreamV1Tool::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.
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.
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 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 hits() const
Return hit thresholds map.
virtual void setOwner(IDataHandleHolder *o)=0
int cpm() const
Return CPM number (1-14)
int crate(uint32_t code) const
Return crate from unpacked moduleID.
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
int error() const
Return error flags (bit 0 Saturation, bit 1 Parity)
static SubBlockWordType wordType(uint32_t word)
Word identification.
virtual void renounce()=0
uint32_t roiWord() const
Return packed RoI word.
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
bool setRoiWord(uint32_t roiWord)
Set RoI word with ID check.
value_type push_back(value_type pElem)
Add an element to 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.
int maxSlinks() const
Return the maximum possible number of slinks.
int crate() const
Return crate number (0-1)
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