ATLAS Offline Software
Loading...
Searching...
No Matches
SCT_RodEncoder.h
Go to the documentation of this file.
1// -*- C++ -*-
2
3/*
4 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
5*/
6
7#ifndef SCT_RAWDATABYTESTREAMCNV_SCT_RODENCODER_H
8#define SCT_RAWDATABYTESTREAMCNV_SCT_RODENCODER_H
9
12
15
16#include "GaudiKernel/ToolHandle.h"
17
18#include <set>
19
21class SCT_ID;
22class SCT_RDORawData;
23class Identifier;
24class IdentifierHash;
25
40class SCT_RodEncoder : public extends<AthAlgTool, ISCT_RodEncoder>
41{
42 public:
43
45 SCT_RodEncoder(const std::string& type, const std::string& name, const IInterface* parent);
46
48 virtual ~SCT_RodEncoder() = default;
49
51 virtual StatusCode initialize() override;
52
54 virtual StatusCode finalize() override;
55
67 virtual void fillROD(std::vector<uint32_t>& vec32Data, const uint32_t& robID,
68 const std::vector<const SCT_RDORawData*>& vecRDOs) const override;
69
70 private:
71
85
97 void encodeData(const std::vector<int>& vecTimeBins, std::vector<uint16_t>& vec16Words,
98 const SCT_RDORawData* rdo, const int& groupSize, const int& strip) const;
99
108 void packFragments(std::vector<uint16_t>& vec16Words, std::vector<uint32_t>& vec32Words) const;
109
119 uint32_t set32Bits(const unsigned short int* arr16Words,
120 const unsigned short int* position,
121 const unsigned short int& numWords) const;
122
124 int side(const SCT_RDORawData* rdo) const;
125
127 int getTimeBin(const SCT_RDORawData* rdo) const;
128
130 int getStrip(const SCT_RDORawData* rdo) const;
131
133 Identifier offlineID(const SCT_RDORawData* rdo) const;
134
136 uint32_t onlineID(const SCT_RDORawData* rdo) const;
137
139 int getRODLink(const SCT_RDORawData* rdo) const;
140
142 uint16_t getHeaderUsingRDO(const SCT_RDORawData* rdo) const;
143
145 uint16_t getHeaderUsingHash(const IdentifierHash& linkHash, const int& errorWord) const;
146
148 uint16_t getTrailer(const int& errorWord) const;
149
151 void addHeadersWithErrors(const uint32_t& robID, const std::set<IdentifierHash>* errors,
152 const ErrorWords& errType, std::vector<uint16_t>& vec16Data) const;
153
155 void addTrailersWithErrors(const uint32_t& robID, const std::set<IdentifierHash>* errors,
156 const ErrorWords& errType, std::vector<uint16_t>& vec16Data) const;
157
159 void addSpecificErrors(const uint32_t& robID, const std::set<IdentifierHash>* errors,
160 const ErrorWords& errType, std::vector<uint16_t>& vec16Data) const;
161
163 ToolHandle<ISCT_ByteStreamErrorsTool> m_bsErrTool{this,
164 "SCT_ByteStreamErrorsTool",
165 "SCT_ByteStreamErrorsTool",
166 "Tool to retrieve SCT ByteStream Errors"};
167
169 ToolHandle<ISCT_CablingTool> m_cabling{this,
170 "SCT_CablingTool",
171 "SCT_CablingTool",
172 "Tool to retrieve SCT Cabling"};
173
176 const SCT_ID* m_sctID{nullptr};
177
179 BooleanProperty m_condensed{this,
180 "CondensedMode",
181 false,
182 "Condensed mode (true) or Expanded mode (false)"};
183
185 std::set<Identifier> m_swapModuleID{};
186};
187
188#endif // SCT_RAWDATABYTESTREAMCNV_SCT_RODENCODER_H
interface file for tool that keeps track of errors in the bytestream.
Client interface to the cabling, providing conversions between online and offline identifiers.
This is a "hash" representation of an Identifier.
This is an Identifier helper class for the SCT subdetector.
Definition SCT_ID.h:68
virtual StatusCode finalize() override
Finalize.
void encodeData(const std::vector< int > &vecTimeBins, std::vector< uint16_t > &vec16Words, const SCT_RDORawData *rdo, const int &groupSize, const int &strip) const
Method to encode RDO data to vector of 16 bin words.
uint16_t getTrailer(const int &errorWord) const
Get the 16-bit word for a trailer, with or without ByteStream errors.
ErrorWords
Definitions of enum error words to be retrieved from SCT_ByteStreamErrorSvc in fillROD(....
ToolHandle< ISCT_ByteStreamErrorsTool > m_bsErrTool
Tool that keeps track of modules that give rise to errors in the bytestream.
SCT_RodEncoder(const std::string &type, const std::string &name, const IInterface *parent)
Constructor.
void addTrailersWithErrors(const uint32_t &robID, const std::set< IdentifierHash > *errors, const ErrorWords &errType, std::vector< uint16_t > &vec16Data) const
Add trailers with errors for ROB to the vector of 16 bit words.
virtual void fillROD(std::vector< uint32_t > &vec32Data, const uint32_t &robID, const std::vector< const SCT_RDORawData * > &vecRDOs) const override
Main Convert method.
const SCT_ID * m_sctID
Identifier helper class for the SCT subdetector that creates compact Identifier objects and Identifie...
uint32_t set32Bits(const unsigned short int *arr16Words, const unsigned short int *position, const unsigned short int &numWords) const
@breif Method to set pairs of 16 bit words to a 32 bit word.
void packFragments(std::vector< uint16_t > &vec16Words, std::vector< uint32_t > &vec32Words) const
Method to pack vector of 16 bit words intto a vector of 32 bit words.
ToolHandle< ISCT_CablingTool > m_cabling
Providing mappings of online and offline identifiers and also serial numbers.
BooleanProperty m_condensed
Boolean used to determine if fillROD(...) should use Condensed or Expanded mode when decoding.
std::set< Identifier > m_swapModuleID
Swap Module identifier, set by SCTRawContByteStreamTool.
int getRODLink(const SCT_RDORawData *rdo) const
Get the ROD link number info in the RDO header data.
virtual ~SCT_RodEncoder()=default
Destructor.
int side(const SCT_RDORawData *rdo) const
Get the side info from the RDO.
virtual StatusCode initialize() override
Initialize.
uint16_t getHeaderUsingHash(const IdentifierHash &linkHash, const int &errorWord) const
Get the 16-bit word for a header for a link with a ByteStream error.
uint32_t onlineID(const SCT_RDORawData *rdo) const
Get the online Identifier from the RDO.
uint16_t getHeaderUsingRDO(const SCT_RDORawData *rdo) const
Get the 16-bit word for a header for a hit.
void addSpecificErrors(const uint32_t &robID, const std::set< IdentifierHash > *errors, const ErrorWords &errType, std::vector< uint16_t > &vec16Data) const
Add specific errors for ROB to the vector of 16 bit words.
void addHeadersWithErrors(const uint32_t &robID, const std::set< IdentifierHash > *errors, const ErrorWords &errType, std::vector< uint16_t > &vec16Data) const
Add header with errors for ROB to the vector of 16 bit words.
int getStrip(const SCT_RDORawData *rdo) const
Get the strip number info from the RDO.
int getTimeBin(const SCT_RDORawData *rdo) const
Get the time bin info from the RDO.
Identifier offlineID(const SCT_RDORawData *rdo) const
Get the offline Identifier from the RDO.