|
ATLAS Offline Software
|
Tool to perform ROB fragments to CPM TOB RoI and CPM TOB RoI to raw data conversions.
More...
#include <CpmRoiByteStreamV2Tool.h>
|
| CpmRoiByteStreamV2Tool (const std::string &type, const std::string &name, const IInterface *parent) |
|
virtual | ~CpmRoiByteStreamV2Tool () |
|
virtual StatusCode | initialize () override |
|
StatusCode | convert (const std::string &robFrags, DataVector< LVL1::CPMTobRoI > *roiCollection) const |
| Convert ROB fragments to CPM RoIs. More...
|
|
StatusCode | convert (const IROBDataProviderSvc::VROBFRAG &robFrags, DataVector< LVL1::CPMTobRoI > *roiCollection) const |
|
StatusCode | convert (const DataVector< LVL1::CPMTobRoI > *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 TOB RoI and CPM TOB RoI to raw data conversions.
Based on ROD document version X_xxx. <<== CHECK
- Author
- Peter Faulkner
Definition at line 47 of file CpmRoiByteStreamV2Tool.h.
◆ CpmRoiCollection
◆ CpmRoiMap
◆ ROBIterator
◆ ROBPointer
◆ RODPointer
◆ StoreGateSvc_t
◆ CpmRoiByteStreamV2Tool()
LVL1BS::CpmRoiByteStreamV2Tool::CpmRoiByteStreamV2Tool |
( |
const std::string & |
type, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
parent |
|
) |
| |
Definition at line 40 of file CpmRoiByteStreamV2Tool.cxx.
45 m_errorTool(
"LVL1BS::L1CaloErrorByteStreamTool/L1CaloErrorByteStreamTool"),
49 declareInterface<CpmRoiByteStreamV2Tool>(
this);
52 "Tool to collect errors for monitoring");
54 "Offset of CP crate numbers in bytestream");
56 "Offset of CP crate numbers in RDOs");
60 "ROB fragment source identifiers");
62 "ROB fragment source identifiers for RoIBs");
66 "Format version number in sub-block header");
68 "Format identifier (0-1) in sub-block header");
70 "The number of S-Links per crate");
72 "Minimum crate number, allows partial output");
74 "Maximum crate number, allows partial output");
77 "Set it for M7 raw data");
◆ ~CpmRoiByteStreamV2Tool()
LVL1BS::CpmRoiByteStreamV2Tool::~CpmRoiByteStreamV2Tool |
( |
| ) |
|
|
virtual |
◆ convert() [1/3]
Convert CPM RoI to bytestream.
Definition at line 333 of file CpmRoiByteStreamV2Tool.cxx.
342 "CpmRoiByteStreamV2") );
351 CpmRoiSubBlockV2 subBlock;
361 msg() <<
"Number of RoIs to be written = " << roiCollection->
size()
362 <<
" (collection), " << roiMap.size() <<
" (map)"
366 CpmRoiMap::const_iterator mapIter = roiMap.begin();
367 CpmRoiMap::const_iterator mapIterEnd = roiMap.end();
384 if (
mod % modulesPerSlink == 0)
386 const int daqOrRoi = 1;
387 const int slink = (
m_slinks == 2) ? 2 * (
mod / modulesPerSlink)
388 :
mod / modulesPerSlink;
391 msg() <<
"Treating crate " << hwCrate
392 <<
" slink " << slink <<
endmsg
401 const L1CaloUserHeader userHeader;
402 theROD->push_back(userHeader.header());
417 for (; mapIter != mapIterEnd; ++mapIter)
420 if (roi->
crate() < crate)
continue;
421 if (roi->
crate() > crate)
break;
426 if (neutralFormat) subBlock.fillRoi(*roi);
427 else theROD->push_back(roi->
roiWord());
436 if ( !subBlock.pack())
438 msg(MSG::ERROR) <<
"CPMTobRoI sub-block packing failed" <<
endmsg;
439 return StatusCode::FAILURE;
443 msg() <<
"CPMTobRoI sub-block data words: "
444 << subBlock.dataWords() <<
endmsg;
446 subBlock.write(theROD);
457 return StatusCode::SUCCESS;
◆ convert() [2/3]
Definition at line 114 of file CpmRoiByteStreamV2Tool.cxx.
122 CpmRoiSubBlockV2 subBlock;
127 std::set<uint32_t> dupCheck;
128 std::set<uint32_t> dupRoiCheck;
131 for (; rob != robEnd; ++rob)
137 msg() <<
"Treating ROB fragment " << robCount <<
endmsg;
142 uint32_t robid = (*rob)->source_id();
143 if ((*rob)->nstatus() > 0)
146 (*rob)->status(robData);
150 if (
debug)
msg() <<
"ROB status error - skipping fragment" <<
endmsg;
157 if (!dupCheck.insert(robid).second)
169 (*rob)->rod_data(payloadBeg);
170 payloadEnd = payloadBeg + (*rob)->rod_ndata();
179 const uint32_t sourceID = (*rob)->rod_source_id();
190 msg() <<
"Wrong source identifier in data: "
191 << MSG::hex << sourceID << MSG::dec <<
endmsg;
197 const int minorVersion = (*rob)->rod_version() & 0xffff;
206 msg() <<
"Treating crate " << rodCrate
213 L1CaloUserHeader userHeader(*
payload);
214 userHeader.setVersion(minorVersion);
215 const int headerWords = userHeader.words();
216 if (headerWords != 1 )
219 if (
debug)
msg() <<
"Unexpected number of user header words: "
223 for (
int i = 0;
i < headerWords; ++
i) ++
payload;
238 msg() <<
"CPM RoI sub-block: Crate " << subBlock.crate()
239 <<
" Module " << subBlock.module() <<
endmsg;
242 if (subBlock.dataWords() && !subBlock.unpack())
246 std::string errMsg(subBlock.unpackErrorMsg());
247 msg() <<
"CPM RoI sub-block unpacking failed: " << errMsg <<
endmsg;
249 rodErr = subBlock.unpackErrorCode();
252 const int numChips = 8;
253 const int numLocs = 2;
254 const int numTypes = 2;
255 for (
int chip = 0; chip < numChips; ++chip)
257 for (
int loc = 0; loc < numLocs; ++loc)
282 if (
debug)
msg() <<
"Inconsistent RoI crate number: "
289 if (
debug)
msg() <<
"Invalid CPM number: "
295 if (dupRoiCheck.insert(location).second)
304 if (
debug)
msg() <<
"Duplicate RoI word "
312 if (
debug)
msg() <<
"Invalid RoI word "
325 msg() <<
"Number of RoIs read = " << roiCollection->
size() <<
endmsg;
328 return StatusCode::SUCCESS;
◆ convert() [3/3]
◆ 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::CpmRoiByteStreamV2Tool::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::CpmRoiByteStreamV2Tool::interfaceID |
( |
| ) |
|
|
static |
◆ makeSourceIDs()
std::vector< uint32_t > LVL1BS::CpmRoiByteStreamV2Tool::makeSourceIDs |
( |
bool |
roiDaq | ) |
const |
|
private |
Definition at line 462 of file CpmRoiByteStreamV2Tool.cxx.
478 for (
int slink = 0; slink < maxSlinks; ++slink)
480 const int daqOrRoi = 1;
486 if (slink < 2)
sourceIDs.push_back(robId);
488 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()
Set up CPM RoI map.
Definition at line 516 of file CpmRoiByteStreamV2Tool.cxx.
525 for (;
pos != pose; ++
pos)
529 const int crate = roi->
crate();
530 const int cpm = roi->
cpm();
531 const int chip = roi->
chip();
532 const int loc = roi->
location() >> 2;
533 const uint32_t key = (((((((crate << 4) | cpm) << 3) | chip) << 1) | loc) << 1) |
type;
534 roiMap.insert(std::make_pair(
key, roi));
◆ sourceIDs()
const std::vector< uint32_t > & LVL1BS::CpmRoiByteStreamV2Tool::sourceIDs |
( |
const std::string & |
sgKey | ) |
const |
Return reference to vector with all possible Source Identifiers.
Definition at line 496 of file CpmRoiByteStreamV2Tool.cxx.
499 const std::string
flag(
"RoIB");
500 const std::string::size_type
pos = sgKey.find(
flag);
502 (
pos == std::string::npos ||
pos != sgKey.length() -
flag.length());
509 static const std::vector<uint32_t> sourceIDsRoIB =
makeSourceIDs(roiDaq);
510 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::CpmRoiByteStreamV2Tool::m_crateMax |
|
private |
◆ m_crateMin
int LVL1BS::CpmRoiByteStreamV2Tool::m_crateMin |
|
private |
◆ m_crateOffsetHw
int LVL1BS::CpmRoiByteStreamV2Tool::m_crateOffsetHw |
|
private |
◆ m_crateOffsetSw
int LVL1BS::CpmRoiByteStreamV2Tool::m_crateOffsetSw |
|
private |
◆ m_crates
const int LVL1BS::CpmRoiByteStreamV2Tool::m_crates |
|
private |
◆ m_dataFormat
int LVL1BS::CpmRoiByteStreamV2Tool::m_dataFormat |
|
private |
◆ m_detStore
◆ m_errorTool
◆ m_evtStore
◆ m_isM7Format
bool LVL1BS::CpmRoiByteStreamV2Tool::m_isM7Format |
|
private |
◆ m_modules
const int LVL1BS::CpmRoiByteStreamV2Tool::m_modules |
|
private |
◆ m_robDataProvider
◆ m_slinks
int LVL1BS::CpmRoiByteStreamV2Tool::m_slinks |
|
private |
◆ m_sourceIDsProp
std::vector<uint32_t> LVL1BS::CpmRoiByteStreamV2Tool::m_sourceIDsProp |
|
private |
◆ m_sourceIDsRoIBProp
std::vector<uint32_t> LVL1BS::CpmRoiByteStreamV2Tool::m_sourceIDsRoIBProp |
|
private |
◆ m_srcIdMap
◆ m_subDetector
const eformat::SubDetector LVL1BS::CpmRoiByteStreamV2Tool::m_subDetector |
|
private |
◆ m_varHandleArraysDeclared
◆ m_version
int LVL1BS::CpmRoiByteStreamV2Tool::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 cpm() const
Return CPM number (1-14)
int slink(uint32_t code) const
Return slink from unpacked moduleID.
int type() const
Return type em/tau (0/1)
int energy() const
Return energy.
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.
uint32_t roiWord() const
Return packed RoI word.
virtual void setOwner(IDataHandleHolder *o)=0
int crate(uint32_t code) const
Return crate from unpacked moduleID.
std::vector< const ROBF * > VROBFRAG
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
int crate() const
Return crate number (0-1)
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 chip() const
Return CP chip number (0-7)
uint16_t minorVersion() const
Return ROD header minor version to use when writing BS.
bool setRoiWord(uint32_t roiWord)
Set RoI word with ID check.
int isolation() const
Return isolation.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
int location() const
Return location (RoI local coords) (0-7)
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 daqOrRoi(uint32_t code) const
Return daqOrRoi from unpacked moduleID.
size_type size() const noexcept
Returns the number of elements in the collection.
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