|
ATLAS Offline Software
|
Go to the documentation of this file.
7 #ifndef INDETRAWDATABYTESTREAM_SCT_RODDECODER_H
8 #define INDETRAWDATABYTESTREAM_SCT_RODDECODER_H
21 #include "GaudiKernel/ToolHandle.h"
26 #include <unordered_map>
27 #include <unordered_set>
81 const std::vector<IdentifierHash>*
vecHash;
113 const EventContext& ctx,
114 const std::vector<IdentifierHash>* vecHash =
nullptr)
const override;
149 std::array<bool, N_STRIPS_PER_SIDE*N_SIDES>
saved{};
157 std::unordered_map<IdentifierHash, std::unique_ptr<SCT_RDO_Collection>,
Hasher>
rdoCollMap;
158 std::unordered_map<IdentifierHash, SCT_RDO_Container::IDC_WriteHandle, Hasher>
writeHandleMap;
223 std::unique_ptr<SCT_RDO_Collection> rdoColl{std::make_unique<SCT_RDO_Collection>(
linkIDHash)};
224 rdoColl->setIdentifier(
collID);
265 const std::unordered_set<IdentifierHash>* foundHashes=
nullptr)
const;
285 unsigned int firstTempMaskedChip,
309 const EventContext& ctx)
const;
330 const EventContext& ctx)
const;
351 const EventContext& ctx)
const;
372 const EventContext& ctx)
const;
387 bool& hasError)
const;
402 bool& hasError)
const;
417 bool& hasError)
const;
431 "Tool to retrieve SCT Cabling"};
436 "SCT_ConfigurationConditionsTool/InDetSCT_ConfigurationConditionsTool",
437 "Tool to retrieve SCT Configuration Tool"};
527 #endif //SCT_RAWDATABYTESTREAM_SCT_RODDECODER_H
StatusCode processRawData(const uint16_t inData, const uint32_t robID, SharedData &data, SCT_RodDecoderErrorsHelper &errs, bool &hasError) const
Process raw data word.
std::atomic_uint m_headErrorPreamble
Total number of preamble errors in the header data.
char data[hepevt_bytes_allocation_ATLAS]
std::atomic_uint m_nHits
Total number of SCT hits in ByteStream.
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.
This is an Identifier helper class for the SCT subdetector. This class is a factory for creating comp...
std::atomic_uint m_condHit2Error
Total number second hit data errors.
static constexpr int INVALID_STRIP
~SCT_RodDecoderErrorsHelper()
void addError(IDCInDetBSErrContainer::ErrorCode &errWord, ErrorType errType)
IDC_WriteHandle getWriteHandle(IdentifierHash hash)
std::atomic_uint m_maskedLinkNumber
Total number of masked links in the header data.
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
std::atomic_uint m_trailerErrorLimit
Total number of header trailer limit errors in the trailer data.
void add(const IdentifierHash id, SCT_ByteStreamErrors::ErrorType etype)
std::unordered_set< IdentifierHash > foundHashes
std::atomic_uint m_trailerErrorOverflow
Total number of overflow errors in the trailer data.
IDC like storage for BS errors, TODO, customise implementation further so that we store int rather th...
std::atomic_uint m_maskedRODNumber
Total number of masked RDOs.
std::atomic_uint m_pairedCondHitNumber
Total number of paired strips with hit decoded in condensed mode.
IdentifierHash linkIDHash
std::atomic_uint m_flagErrorBit
Total number of flag error data.
std::atomic_uint m_headErrorTimeout
Total number of timeout errors in the header data.
IdContext m_contextSCT
"Context" of an expanded identifier (ExpandedIdentifier) for compact or hash versions (Identifier32 o...
StatusCode processExpandedHit(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, const EventContext &ctx) const
Process hit word in Expanded mode.
SCT_RodDecoder(const std::string &type, const std::string &name, const IInterface *parent)
Constructor.
std::atomic_uint m_unknownDataFormat
Total number of unknown data formats.
StatusCode processTrailer(const uint16_t inData, const uint32_t robID, SharedData &data, SCT_RodDecoderErrorsHelper &errs, bool &hasError) const
Process trailer word.
Struct to hold data shared in methods used in fillCollection method.
std::array< bool, N_STRIPS_PER_SIDE *N_SIDES > saved
std::atomic_uint m_headErrorFormatter
Total number of formatter errors in the header data.
std::atomic_uint m_firstExpHitNumber
Total number of first strips with hit decoded in expanded mode.
std::atomic_uint m_truncatedRODNumber
Total number of truncated ROBFragments.
StatusCode setFirstTempMaskedChip(const IdentifierHash &hashID, unsigned int firstTempMaskedChip, SCT_RodDecoderErrorsHelper &errs) const
Set first temporarily masked chip information from byte stream trailer.
void setCollection(const SCT_ID *sctID, const IdentifierHash &waferHash, SCT_RDO_Container &rdoIDCont, DataPool< SCT3_RawData > *dataItemsPool, SCT_RodDecoderErrorsHelper &errs)
bool isOldStripValid() const
SCT_RodDecoderErrorsHelper(IDCInDetBSErrContainer &idcContainer)
std::atomic_uint m_condHit1Error
Total number of first hit data errors.
std::atomic_uint m_trailerNumber
Total number of decoded trailer data.
StatusCode processABCDError(const uint16_t inData, const uint32_t robID, SharedData &data, SCT_RodDecoderErrorsHelper &errs, bool &hasError) const
Process ABCD error.
std::map< IdentifierHash, IDCInDetBSErrContainer::ErrorCode > accumulatedErrors
::StatusCode StatusCode
StatusCode definition for legacy code.
std::unordered_map< IdentifierHash, std::unique_ptr< SCT_RDO_Collection >, Hasher > rdoCollMap
std::atomic_uint m_singleCondHitNumber
Total number of single strips with hit decoded in condensed mode.
bool isStripValid() const
std::atomic_uint m_rodClockErrorNumber
Total number of ROD clock errors.
ToolHandle< ISCT_CablingTool > m_cabling
Providing mappings of online and offline identifiers and also serial numbers.
ToolHandle< ISCT_ConfigurationConditionsTool > m_configTool
Service that keeps track of configuration conditions.
std::atomic_uint m_configDataBit
Total number of configuration data for raw data.
void removeIfEmpty(const IdentifierHash id)
Temp object to help with trigger caching.
bool setOrDrop(size_t i, const T &value)
Set the value for the given hash.
SCT_DecoderNumbers
Define frequently used magic numbers.
bool foundMissingLinkHeaderError
virtual ~SCT_RodDecoder()=default
Destructor.
Athena Algorithm Tool to decode the SCT binary format to create RDOs and inserts them to the collecti...
std::atomic_uint m_headNumber
Total number of decoded header data.
std::atomic_uint m_evenExpHitNumber
Total number of consecutive paired strips with hit decoded in expanded mode.
ErrorType
SCT byte stream error type enums used in SCT_RodDecoder, SCT_ByteStreamErrorsTool,...
virtual StatusCode finalize() override
Finalize.
const std::vector< IdentifierHash > * vecHash
allows to accumulate errors in one fillColection call
std::size_t operator()(const IdentifierHash &hash) const
std::atomic_uint m_numMissingLinkHeader
Total number of missing link headers.
void setSaved(const bool isOld, const int code)
std::atomic_uint m_headErrorLvl1ID
Total number of Lvl1ID errors in the header data.
std::atomic_uint m_headErrorBCID
Total number of BCID errors in the header data.
std::vector< bool > m_swapPhiReadoutDirection
Swap phi readout direction.
std::atomic_uint m_trailerErrorBit
Total number of trailer bit errors.
std::atomic_uint m_lastExpHitNumber
Total number of last consecutive strips with hit decoded in expanded mode.
virtual StatusCode fillCollection(const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment &robFrag, SCT_RDO_Container &rdoIDCont, IDCInDetBSErrContainer &errs, DataPool< SCT3_RawData > *dataItemsPool, const EventContext &ctx, const std::vector< IdentifierHash > *vecHash=nullptr) const override
Fill SCT RDO Collection with decoded ROB data.
std::vector< int > errorHit
a typed memory pool that saves time spent allocation small object. This is typically used by containe...
IDCInDetBSErrContainer & errorsIDC
StatusCode processSuperCondensedHit(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, const EventContext &ctx) const
Process hit word in Super-Condensed mode.
bool isSaved(const bool isOld)
StatusCode addSingleError(const IdentifierHash &hashID, SCT_ByteStreamErrors::ErrorType error, SCT_RodDecoderErrorsHelper &errs) const
Add single eror.
std::atomic_uint m_chipNumberError
Total number of chip number errors.
Identifier wafer_id(int barrel_ec, int layer_disk, int phi_module, int eta_module, int side) const
For a single side of module.
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
const SCT_ID * m_sctID
Identifier helper class for the SCT subdetector that creates compact Identifier objects and Identifie...
std::unordered_map< IdentifierHash, SCT_RDO_Container::IDC_WriteHandle, Hasher > writeHandleMap
int makeRDO(const bool isOld, SharedData &data, CacheHelper &cache, DataPool< SCT3_RawData > *dataItemsPool) const
Builds RawData RDO and adds to RDO container.
This class saves the "context" of an expanded identifier (ExpandedIdentifier) for compact or hash ver...
Define SCT byte stream errors and utility methods.
StatusCode processCondensedHit(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, const EventContext &ctx) const
Process hit word in Condensed mode.
void noerror(const IdentifierHash id)
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.
virtual StatusCode initialize() override
Initialize.
std::atomic_uint m_nRDOs
Total number of SCT RDOs created.