 |
ATLAS Offline Software
|
Go to the documentation of this file.
5 #ifndef ITKRAWDATABYTESTREAM_ITK_STRIPS_RODDECODER_H
6 #define ITKRAWDATABYTESTREAM_ITK_STRIPS_RODDECODER_H
19 #include "GaudiKernel/ToolHandle.h"
24 #include <unordered_map>
25 #include <unordered_set>
78 const std::vector<IdentifierHash>*
vecHash;
83 using base_class::base_class;
106 const EventContext& ctx,
107 const std::vector<IdentifierHash>* vecHash =
nullptr)
const override;
142 std::array<bool, N_STRIPS_PER_SIDE*N_SIDES>
saved{};
150 std::unordered_map<IdentifierHash, std::unique_ptr<SCT_RDO_Collection>,
Hasher>
rdoCollMap;
151 std::unordered_map<IdentifierHash, SCT_RDO_Container::IDC_WriteHandle, Hasher>
writeHandleMap;
216 std::unique_ptr<SCT_RDO_Collection> rdoColl{std::make_unique<SCT_RDO_Collection>(
linkIDHash)};
217 rdoColl->setIdentifier(
collID);
258 const std::unordered_set<IdentifierHash>* foundHashes=
nullptr)
const;
291 const EventContext& ctx)
const;
306 bool& hasError)
const;
318 "ITkStripCablingTool",
319 "ITkStripCablingTool",
320 "Tool to retrieve ITkStrip Cabling"};
325 "SCT_ConfigurationConditionsTool/InDetSCT_ConfigurationConditionsTool",
326 "Tool to retrieve SCT Configuration Tool"};
416 #endif //ITKSTRIP_RAWDATABYTESTREAM_ITKSTRIP_RODDECODER_H
std::atomic_uint m_condHit2Error
Total number second hit data errors.
std::atomic_uint m_headErrorFormatter
Total number of formatter errors in the header data.
char data[hepevt_bytes_allocation_ATLAS]
std::atomic_uint m_flagErrorBit
Total number of flag error data.
int makeRDO(const bool isOld, SharedData &data, CacheHelper &cache, DataPool< SCT3_RawData > *dataItemsPool) const
Builds RawData RDO and adds to RDO container.
Temp object to help with trigger caching.
This is an Identifier helper class for the SCT subdetector. This class is a factory for creating comp...
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.
StatusCode addSingleError(const IdentifierHash &hashID, SCT_ByteStreamErrors::ErrorType error, SCT_RodDecoderErrorsHelper &errs) const
Add single eror.
~SCT_RodDecoderErrorsHelper()
void addError(IDCInDetBSErrContainer::ErrorCode &errWord, ErrorType errType)
IDC_WriteHandle getWriteHandle(IdentifierHash hash)
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
std::atomic_uint m_truncatedRODNumber
Total number of truncated ROBFragments.
void add(const IdentifierHash id, SCT_ByteStreamErrors::ErrorType etype)
std::atomic_uint m_nHits
Total number of SCT hits in ByteStream.
void setSaved(const bool isOld, const int code)
IDC like storage for BS errors, TODO, customise implementation further so that we store int rather th...
std::atomic_uint m_chipNumberError
Total number of chip number errors.
std::atomic_uint m_trailerNumber
Total number of decoded trailer data.
bool isSaved(const bool isOld)
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.
std::atomic_uint m_condHit1Error
Total number of first hit data errors.
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.
std::atomic_uint m_headErrorLvl1ID
Total number of Lvl1ID errors in the header data.
std::atomic_uint m_trailerErrorBit
Total number of trailer bit errors.
bool foundMissingLinkHeaderError
IdContext m_contextITk
"Context" of an expanded identifier (ExpandedIdentifier) for compact or hash versions (Identifier32 o...
std::vector< int > errorHit
std::atomic_uint m_maskedLinkNumber
Total number of masked links in the header data.
std::atomic_uint m_firstExpHitNumber
Total number of first strips with hit decoded in expanded mode.
virtual ~ITkStripsRodDecoder()=default
Destructor.
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...
std::atomic_uint m_singleCondHitNumber
Total number of single strips with hit decoded in condensed mode.
std::atomic_uint m_rodClockErrorNumber
Total number of ROD clock errors.
std::array< bool, N_STRIPS_PER_SIDE *N_SIDES > saved
ITk_DecoderNumbers
Define frequently used magic numbers.
SCT_RodDecoderErrorsHelper(IDCInDetBSErrContainer &idcContainer)
static constexpr int INVALID_STRIP
ToolHandle< IITkStripCablingTool > m_cabling
Providing mappings of online and offline identifiers and also serial numbers.
Struct to hold data shared in methods used in fillCollection method.
std::atomic_uint m_numMissingLinkHeader
Total number of missing link headers.
::StatusCode StatusCode
StatusCode definition for legacy code.
std::atomic_uint m_maskedRODNumber
Total number of masked RDOs.
std::atomic_uint m_headNumber
Total number of decoded header data.
std::atomic_uint m_pairedCondHitNumber
Total number of paired strips with hit decoded in condensed mode.
bool isStripValid() const
const std::vector< IdentifierHash > * vecHash
std::map< IdentifierHash, IDCInDetBSErrContainer::ErrorCode > accumulatedErrors
std::atomic_uint m_lastExpHitNumber
Total number of last consecutive strips with hit decoded in expanded mode.
void removeIfEmpty(const IdentifierHash id)
bool setOrDrop(size_t i, const T &value)
Set the value for the given hash.
IDCInDetBSErrContainer & errorsIDC
ToolHandle< ISCT_ConfigurationConditionsTool > m_configTool
Service that keeps track of configuration conditions.
std::unordered_map< IdentifierHash, std::unique_ptr< SCT_RDO_Collection >, Hasher > rdoCollMap
IdentifierHash linkIDHash
ErrorType
SCT byte stream error type enums used in SCT_RodDecoder, SCT_ByteStreamErrorsTool,...
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.
std::atomic_uint m_unknownDataFormat
Total number of unknown data formats.
std::unordered_map< IdentifierHash, SCT_RDO_Container::IDC_WriteHandle, Hasher > writeHandleMap
bool isOldStripValid() const
void setCollection(const SCT_ID *sctID, const IdentifierHash &waferHash, SCT_RDO_Container &rdoIDCont, DataPool< SCT3_RawData > *dataItemsPool, SCT_RodDecoderErrorsHelper &errs)
std::size_t operator()(const IdentifierHash &hash) const
a typed memory pool that saves time spent allocation small object. This is typically used by containe...
std::atomic_uint m_trailerErrorOverflow
Total number of overflow errors in the trailer data.
std::unordered_set< IdentifierHash > foundHashes
virtual StatusCode initialize() override
Initialize.
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...
std::atomic_uint m_trailerErrorLimit
Total number of header trailer limit errors in the trailer data.
This class saves the "context" of an expanded identifier (ExpandedIdentifier) for compact or hash ver...
std::atomic_uint m_evenExpHitNumber
Total number of consecutive paired strips with hit decoded in expanded mode.
Define SCT byte stream errors and utility methods.
void noerror(const IdentifierHash id)
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_headErrorTimeout
Total number of timeout errors in the header data.
std::vector< bool > m_swapPhiReadoutDirection
Swap phi readout direction.