 |
ATLAS Offline Software
|
#include <ITkStripsRodDecoder.h>
|
| int | makeRDO (const bool isOld, SharedData &data, CacheHelper &cache, DataPool< SCT3_RawData > *dataItemsPool) const |
| | Builds RawData RDO and adds to RDO container. More...
|
| |
| StatusCode | addRODError (uint32_t rodID, SCT_ByteStreamErrors::ErrorType error, SCT_RodDecoderErrorsHelper &errs, const std::unordered_set< IdentifierHash > *foundHashes=nullptr) const |
| | Add an error for each wafer in the problematic ROD. More...
|
| |
| StatusCode | addSingleError (const IdentifierHash &hashID, SCT_ByteStreamErrors::ErrorType error, SCT_RodDecoderErrorsHelper &errs) const |
| | Add single eror. More...
|
| |
| StatusCode | processHeader (const uint16_t inData, const uint32_t robID, SharedData &data, SCT_RDO_Container &rdoIDCont, DataPool< SCT3_RawData > *dataItemsPool, CacheHelper &cache, SCT_RodDecoderErrorsHelper &errs, bool &hasError, bool &breakNow, const EventContext &ctx) const |
| | Process header word. More...
|
| |
| StatusCode | processRawData (const uint16_t inData, const uint32_t robID, SharedData &data, SCT_RodDecoderErrorsHelper &errs, bool &hasError) const |
| | Process raw data word. More...
|
| |
Definition at line 73 of file ITkStripsRodDecoder.h.
◆ ITk_DecoderNumbers
Define frequently used magic numbers.
| Enumerator |
|---|
| N_SIDES | |
| N_CHIPS_PER_SIDE | |
| N_STRIPS_PER_CHIP | |
| N_STRIPS_PER_SIDE | |
Definition at line 115 of file ITkStripsRodDecoder.h.
◆ ~ITkStripsRodDecoder()
| virtual ITkStripsRodDecoder::~ITkStripsRodDecoder |
( |
| ) |
|
|
virtualdefault |
◆ addRODError()
Add an error for each wafer in the problematic ROD.
- Parameters
-
| rodID | Identifer of ROD. |
| errorType | Error type info. |
| errs | Byte stream error container. |
| foundHashes | FE-links whose headers are found. Used only for MissingLinkHeaderError. |
Definition at line 200 of file ITkStripsRodDecoder.cxx.
204 return StatusCode::SUCCESS;
◆ addSingleError()
Add single eror.
- Parameters
-
| hashID | Identifier for hash. |
| bsErrorType | Byte Stream error type info. |
| errs | Byte stream error container. |
Definition at line 209 of file ITkStripsRodDecoder.cxx.
213 return StatusCode::SUCCESS;
◆ fillCollection()
Fill SCT RDO Collection with decoded ROB data.
Decode the rob data fragment and fill the collection SCT_RDO_Collection with the RDO built by the makeRDO(..) method. rdoIdc, and errs are updated based on robFrag and vecHash.
- Parameters
-
| robFrag | ROB fragment. |
| rdoIDCont | RDO ID Container to be filled. |
| errs | Byte stream error container. |
| vecHash | Vector of hashes. |
Definition at line 43 of file ITkStripsRodDecoder.cxx.
58 cache.vecHash = vecHash;
61 const unsigned long int vecROBDataSize{robFrag.rod_ndata()};
63 robFrag.rod_data(vecROBData);
66 const uint8_t* vecROBData_8bits =
reinterpret_cast<const uint8_t*
>(vecROBData);
67 const size_t total_bytes = vecROBDataSize *
sizeof(
uint32_t);
69 for (
size_t i = 0;
i + 9 < total_bytes;
i += 10) {
84 if (hasError)
sc = StatusCode::RECOVERABLE;
90 for (
int j = 0; j < 4; ++j) {
91 uint16_t cluster = (vecROBData_8bits[
i + 2 + j * 2] << 8) | vecROBData_8bits[
i + 3 + j * 2];
92 if (cluster == 0x7FFF){
99 if (
data.isStripValid()) {
100 if (not
data.isSaved(
false) and
data.isOldStripValid()) {
101 const int rdoMade{
makeRDO(
false,
data, cache, dataItemsPool)};
103 sc = StatusCode::RECOVERABLE;
107 data.setSaved(
false, rdoMade);
112 for (
auto& [
hash, rdoColl] :
data.rdoCollMap) {
113 if (rdoColl==
nullptr)
continue;
115 if (rdoColl->empty()) {
117 errs.removeIfEmpty(
hash);
124 if (
sc.isFailure())
ATH_MSG_DEBUG(
"One or more ByteStream errors found ");
◆ initialize()
| StatusCode ITkStripsRodDecoder::initialize |
( |
| ) |
|
|
overridevirtual |
Initialize.
Definition at line 20 of file ITkStripsRodDecoder.cxx.
34 if (element->swapPhiReadoutDirection()) {
39 return StatusCode::SUCCESS;
◆ makeRDO()
Builds RawData RDO and adds to RDO container.
Method that builds the RawData RDO and add it to the collection rdoIdc and cache are updated based on other arguments.
- Returns
- Method has 3 possible return values: 1 if RDO was successfully created 0 if collection was deliberately skipped (for trigger) -1 if there was an error in the decoding - will be passed on as StatusCode::RECOVERABLE by fillCollection()
- Parameters
-
| isOld | if true use data.oldStrip, otherwise use data.strip. |
| data | Struct to hold data shared in methods used in fillCollection method |
| cache | Cache. |
Definition at line 130 of file ITkStripsRodDecoder.cxx.
137 if (rdoColl==
nullptr)
return 0;
142 <<
" in collection " <<
data.linkIDHash <<
" out of range. Will not make RDO");
148 if (
data.linkIDHash == cache.skipHash) {
152 else if (
data.linkIDHash != cache.lastHash) {
153 cache.lastHash =
data.linkIDHash;
155 std::vector<IdentifierHash>::const_iterator hashIDIterator{
find(cache.vecHash->begin(),
156 cache.vecHash->end(),
158 if (hashIDIterator == cache.vecHash->end()) {
161 cache.skipHash =
data.linkIDHash;
180 const unsigned int rawDataWord{
static_cast<unsigned int>(
data.groupSize | (
strip << 11) | (
data.timeBin <<22) | (
data.errors << 25))};
182 ATH_MSG_DEBUG(
"Output Raw Data " << std::hex <<
" Coll " <<
data.collID.getString()
191 rdoColl->push_back(sct_rdo);
193 rdoColl->push_back(std::make_unique<SCT3_RawData>(digitID, rawDataWord, &(
data.errorHit)));
◆ processHeader()
Process header word.
- Parameters
-
| inData | input 16 bit data word for header |
| robID | ROB ID |
| data | Struct to hold data shared in methods used in fillCollection method |
| rdoIDCont | RDO ID Container to be filled. |
| cache | Cache. |
| errs | SCT_RodDecoderErrorsHelper to fill IDCInDetBSErrContainer |
| hasError | false means no error, true means at least one error |
| breakNow | to tell if need to break after this method execution. |
Definition at line 216 of file ITkStripsRodDecoder.cxx.
229 data.foundHeader =
true;
233 if (
data.isStripValid()) {
234 if (not
data.isSaved(
false) and
data.isOldStripValid()) {
236 const int rdoMade{
makeRDO(
false,
data, cache, dataItemsPool)};
242 data.setSaved(
false, rdoMade);
251 const int rodlinkNumber{
static_cast<int>(inData & 0x7F)};
254 data.linkNumber = (((rodlinkNumber >>4)&0x7)*12+(rodlinkNumber &0xF));
255 const uint32_t onlineID{(robID & 0xFFFFFF) | (
data.linkNumber << 24)};
257 if ((onlineID ==0) or (
data.linkNumber > 95)) {
260 ATH_MSG_DEBUG(
"Header: xxx Link number out of range (skipping following data)"
261 << std::dec <<
data.linkNumber);
267 if (
hash.is_valid()) {
271 std::stringstream
msg;
272 msg <<std::hex << onlineID;
273 ATH_MSG_WARNING(
"Rob fragment (rob=" << robID <<
") with invalid onlineID " <<
msg.str() <<
" -> " <<
hash <<
".");
277 if ((inData >> 7) & 0
x1) {
282 if (inData & 0x800) {
289 if (inData & 0x1000) {
296 if (inData & 0x400) {
303 if (inData & 0x200) {
310 if ((inData & 0xF) > 11) {
316 if (!hasError and not
hash.is_valid()) {
317 std::stringstream
msg;
318 msg <<std::hex << onlineID;
319 ATH_MSG_WARNING(
"Rob fragment (rob=" << robID <<
") with invalid onlineID " <<
msg.str() <<
" -> " <<
hash <<
".");
323 data.condensedMode =
static_cast<bool>(inData & 0x100);
◆ processRawData()
Process raw data word.
- Parameters
-
| inData | input 16 bit data word for header |
| robID | ROB ID |
| data | Struct to hold data shared in methods used in fillCollection method |
| errs | SCT_RodDecoderErrorsHelper to fill IDCInDetBSErrContainer |
| hasError | false means no error, true means at least one error |
Definition at line 328 of file ITkStripsRodDecoder.cxx.
336 if (not
data.foundHeader) {
337 ATH_MSG_WARNING(
" Missing link header in ROD " << std::hex << robID << std::dec);
338 data.foundMissingLinkHeaderError =
true;
344 ATH_MSG_DEBUG(
" xxx Raw Data Mode " << std::hex << inData << std::dec <<
": Config Data Mode ");
◆ m_cabling
Initial value:{this,
"ITkStripCablingTool",
"ITkStripCablingTool",
"Tool to retrieve ITkStrip Cabling"}
Providing mappings of online and offline identifiers and also serial numbers.
Definition at line 317 of file ITkStripsRodDecoder.h.
◆ m_chipNumberError
| std::atomic_uint ITkStripsRodDecoder::m_chipNumberError {0} |
|
mutableprivate |
◆ m_condHit1Error
| std::atomic_uint ITkStripsRodDecoder::m_condHit1Error {0} |
|
mutableprivate |
◆ m_condHit2Error
| std::atomic_uint ITkStripsRodDecoder::m_condHit2Error {0} |
|
mutableprivate |
◆ m_configDataBit
| std::atomic_uint ITkStripsRodDecoder::m_configDataBit {0} |
|
mutableprivate |
◆ m_configTool
Initial value:{this,
"ConfigTool",
"SCT_ConfigurationConditionsTool/InDetSCT_ConfigurationConditionsTool",
"Tool to retrieve SCT Configuration Tool"}
Service that keeps track of configuration conditions.
Definition at line 323 of file ITkStripsRodDecoder.h.
◆ m_contextITk
◆ m_evenExpHitNumber
| std::atomic_uint ITkStripsRodDecoder::m_evenExpHitNumber {0} |
|
mutableprivate |
Total number of consecutive paired strips with hit decoded in expanded mode.
Definition at line 338 of file ITkStripsRodDecoder.h.
◆ m_firstExpHitNumber
| std::atomic_uint ITkStripsRodDecoder::m_firstExpHitNumber {0} |
|
mutableprivate |
◆ m_flagErrorBit
| std::atomic_uint ITkStripsRodDecoder::m_flagErrorBit {0} |
|
mutableprivate |
◆ m_headErrorBCID
| std::atomic_uint ITkStripsRodDecoder::m_headErrorBCID {0} |
|
mutableprivate |
◆ m_headErrorFormatter
| std::atomic_uint ITkStripsRodDecoder::m_headErrorFormatter {0} |
|
mutableprivate |
◆ m_headErrorLvl1ID
| std::atomic_uint ITkStripsRodDecoder::m_headErrorLvl1ID {0} |
|
mutableprivate |
◆ m_headErrorPreamble
| std::atomic_uint ITkStripsRodDecoder::m_headErrorPreamble {0} |
|
mutableprivate |
◆ m_headErrorTimeout
| std::atomic_uint ITkStripsRodDecoder::m_headErrorTimeout {0} |
|
mutableprivate |
◆ m_headNumber
| std::atomic_uint ITkStripsRodDecoder::m_headNumber {0} |
|
mutableprivate |
◆ m_itkStripsID
| const SCT_ID* ITkStripsRodDecoder::m_itkStripsID {nullptr} |
|
private |
◆ m_lastExpHitNumber
| std::atomic_uint ITkStripsRodDecoder::m_lastExpHitNumber {0} |
|
mutableprivate |
Total number of last consecutive strips with hit decoded in expanded mode.
Definition at line 341 of file ITkStripsRodDecoder.h.
◆ m_maskedLinkNumber
| std::atomic_uint ITkStripsRodDecoder::m_maskedLinkNumber {0} |
|
mutableprivate |
◆ m_maskedRODNumber
| std::atomic_uint ITkStripsRodDecoder::m_maskedRODNumber {0} |
|
mutableprivate |
◆ m_nHits
| std::atomic_uint ITkStripsRodDecoder::m_nHits {0} |
|
mutableprivate |
◆ m_nRDOs
| std::atomic_uint ITkStripsRodDecoder::m_nRDOs {0} |
|
mutableprivate |
◆ m_numMissingLinkHeader
| std::atomic_uint ITkStripsRodDecoder::m_numMissingLinkHeader {0} |
|
mutableprivate |
◆ m_pairedCondHitNumber
| std::atomic_uint ITkStripsRodDecoder::m_pairedCondHitNumber {0} |
|
mutableprivate |
◆ m_rodClockErrorNumber
| std::atomic_uint ITkStripsRodDecoder::m_rodClockErrorNumber {0} |
|
mutableprivate |
◆ m_singleCondHitNumber
| std::atomic_uint ITkStripsRodDecoder::m_singleCondHitNumber {0} |
|
mutableprivate |
◆ m_swapPhiReadoutDirection
| std::vector<bool> ITkStripsRodDecoder::m_swapPhiReadoutDirection {} |
|
private |
◆ m_trailerErrorBit
| std::atomic_uint ITkStripsRodDecoder::m_trailerErrorBit {0} |
|
mutableprivate |
◆ m_trailerErrorLimit
| std::atomic_uint ITkStripsRodDecoder::m_trailerErrorLimit {0} |
|
mutableprivate |
◆ m_trailerErrorOverflow
| std::atomic_uint ITkStripsRodDecoder::m_trailerErrorOverflow {0} |
|
mutableprivate |
◆ m_trailerNumber
| std::atomic_uint ITkStripsRodDecoder::m_trailerNumber {0} |
|
mutableprivate |
◆ m_truncatedRODNumber
| std::atomic_uint ITkStripsRodDecoder::m_truncatedRODNumber {0} |
|
mutableprivate |
◆ m_unknownDataFormat
| std::atomic_uint ITkStripsRodDecoder::m_unknownDataFormat {0} |
|
mutableprivate |
The documentation for this class was generated from the following files:
def retrieve(aClass, aKey=None)
std::atomic_uint m_headErrorFormatter
Total number of formatter errors in the header data.
char data[hepevt_bytes_allocation_ATLAS]
const DataType * PointerType
int makeRDO(const bool isOld, SharedData &data, CacheHelper &cache, DataPool< SCT3_RawData > *dataItemsPool) const
Builds RawData RDO and adds to RDO container.
StatusCode addSingleError(const IdentifierHash &hashID, SCT_ByteStreamErrors::ErrorType error, SCT_RodDecoderErrorsHelper &errs) const
Add single eror.
std::string find(const std::string &s)
return a remapped string
bool is_sct(Identifier id) const
std::atomic_uint m_headErrorLvl1ID
Total number of Lvl1ID errors in the header data.
#define ATH_MSG_VERBOSE(x)
IdContext m_contextITk
"Context" of an expanded identifier (ExpandedIdentifier) for compact or hash versions (Identifier32 o...
IdContext wafer_context() const
std::atomic_uint m_headErrorBCID
Total number of BCID errors in the header data.
std::atomic_uint m_nRDOs
Total number of SCT RDOs created.
const SCT_ID * m_itkStripsID
Identifier helper class for the SCT subdetector that creates compact Identifier objects and Identifie...
pointer nextElementPtr()
obtain the next available element in pool by pointer pool is resized if its limit has been reached On...
size_type wafer_hash_max() const
ToolHandle< IITkStripCablingTool > m_cabling
Providing mappings of online and offline identifiers and also serial numbers.
std::atomic_uint m_numMissingLinkHeader
Total number of missing link headers.
::StatusCode StatusCode
StatusCode definition for legacy code.
std::atomic_uint m_headNumber
Total number of decoded header data.
ToolHandle< ISCT_ConfigurationConditionsTool > m_configTool
Service that keeps track of configuration conditions.
std::string print_to_string(Identifier id, const IdContext *context=0) const
or provide the printout in string form
allows to accumulate errors in one fillColection call
std::atomic_uint m_headErrorPreamble
Total number of preamble errors in the header data.
std::atomic_uint m_configDataBit
Total number of configuration data for raw data.
#define ATH_MSG_WARNING(x)
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
std::atomic_uint m_headErrorTimeout
Total number of timeout errors in the header data.
Identifier strip_id(int barrel_ec, int layer_disk, int phi_module, int eta_module, int side, int strip) const
For an individual strip.
std::vector< bool > m_swapPhiReadoutDirection
Swap phi readout direction.