5#ifndef ITkStripsRawDataByteStreamCnv_ITkStripsRodEncoder_h
6#define ITkStripsRawDataByteStreamCnv_ITkStripsRodEncoder_h
12#include "GaudiKernel/ToolHandle.h"
35 using base_class::base_class;
54 virtual void fillROD(std::vector<uint32_t>& vec32Data,
const uint32_t& robID,
55 const std::vector<const SCT_RDORawData*>& vecRDOs)
const override;
72 mutable std::atomic<uint8_t>
m_bcid = 0;
75 void encodeData(
const std::vector<uint16_t>& clusters,
const uint16_t ichannel, std::vector<uint8_t>& data_encode,
76 int typ, uint8_t l0tag, uint8_t bc_count, uint32_t hccKey, uint16_t&
size)
const;
86 void packFragments(std::vector<uint8_t>& vec8Words, std::vector<uint32_t>& vec32Words)
const;
98 std::vector<uint16_t>
clusterFinder(
const std::bitset<256>& inputData,
const uint8_t maxCluster=63)
const;
99 uint16_t
clusterFinder_sub(uint64_t& hits_high64, uint64_t& hits_low64,
bool isSecondRow)
const;
101 uint32_t
set32Bits(
const unsigned short int* arr8Words,
102 const unsigned short int* position,
103 const unsigned short int& numWords)
const;
105 bool getBit_128b(uint8_t bit_addr, uint64_t data_high64, uint64_t data_low64)
const;
106 void setBit_128b(uint8_t bit_addr,
bool value, uint64_t& data_high64, uint64_t& data_low64)
const;
152 uint16_t
getTrailer(
const int& errorWord)
const;
156 "ITkStripCablingTool",
157 "ITkStripCablingTool",
158 "Tool to retrieve ITkStrips Cabling"};
160 ToolHandle<ITkStripDataRateMonTool>
m_dataRateMonTool{
this,
"DataRateMonitoringTool",
"",
"Monitoring tool for data rate evaluation"};
167 BooleanProperty
m_condensed{
this,
"CondensedMode",
false,
"Condensed mode (true) or Expanded mode (false)"};
size_t size() const
Number of registered mappings.
Athena Algorithm Tool that provides conversion from ITkStrips RDO to ROD format Bytestream.
const SCT_ID * m_itkStripsID
Identifier helper class for the ITkStrips subdetector that creates compact Identifier objects and Ide...
uint16_t getStripMax(const SCT_RDORawData *rdo) const
Get the maxumum strip value info from the RDO.
uint32_t onlineID(const SCT_RDORawData *rdo) const
Get the online Identifier from the RDO.
ToolHandle< IITkStripCablingTool > m_cabling
Providing mappings of online and offline identifiers and also serial numbers.
Identifier offlineID(const SCT_RDORawData *rdo) const
Get the offline Identifier from the RDO.
uint16_t getHeaderPhysicsPacket(int typ, uint8_t l0tag, uint8_t bc_count) const
Get the 16-bit word for a header with Type (PR or LP), L0Tag event and BCID.
BooleanProperty m_condensed
Example Boolean used to determine decoding mode, maybe unused finally.
int getBarrelEC(const SCT_RDORawData *rdo) const
Get the barrel/endcape info from the RDO.
virtual void fillROD(std::vector< uint32_t > &vec32Data, const uint32_t &robID, const std::vector< const SCT_RDORawData * > &vecRDOs) const override
Main Convert method.
void setBit_128b(uint8_t bit_addr, bool value, uint64_t &data_high64, uint64_t &data_low64) const
uint16_t clusterFinder_sub(uint64_t &hits_high64, uint64_t &hits_low64, bool isSecondRow) const
bool getBit_128b(uint8_t bit_addr, uint64_t data_high64, uint64_t data_low64) const
int getRODLink(const SCT_RDORawData *rdo) const
Get the ROD link number info in the RDO header data.
std::atomic< uint8_t > m_l0tag
uint16_t getHeaderUsingRDO(const SCT_RDORawData *rdo) const
Get the 16-bit word for a header for a hit.
int getEtaModule(const SCT_RDORawData *rdo) const
Get the eta value info from the RDO.
uint16_t getTrailer(const int &errorWord) const
Get the 16-bit word for a trailer, with or without ByteStream errors.
int getSide(const SCT_RDORawData *rdo) const
Get the side info from the RDO.
virtual ~ITkStripsRodEncoder()=default
Destructor.
int getStrip(const SCT_RDORawData *rdo) const
Get the strip number info from the RDO.
std::vector< uint16_t > clusterFinder(const std::bitset< 256 > &inputData, const uint8_t maxCluster=63) const
@breif Method to set pairs of 8 bit words to a 32 bit word.
uint8_t getPhiModule(const SCT_RDORawData *rdo) const
Get the phi value info from the RDO.
uint8_t getDiskLayer(const SCT_RDORawData *rdo) const
Get disk/layer info from the RDO.
uint32_t set32Bits(const unsigned short int *arr8Words, const unsigned short int *position, const unsigned short int &numWords) const
int getTimeBin(const SCT_RDORawData *rdo) const
Get the time bin info from the RDO.
void encodeData(const std::vector< uint16_t > &clusters, const uint16_t ichannel, std::vector< uint8_t > &data_encode, int typ, uint8_t l0tag, uint8_t bc_count, uint32_t hccKey, uint16_t &size) const
ToolHandle< ITkStripDataRateMonTool > m_dataRateMonTool
virtual StatusCode initialize() override
Initialize.
std::set< Identifier > m_swapModuleID
Swap Module identifier, set by SCTRawContByteStreamTool.
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.
void packFragments(std::vector< uint8_t > &vec8Words, std::vector< uint32_t > &vec32Words) const
Method to pack vector of 8 bit words intto a vector of 32 bit words.
bool getParity_8bits(uint8_t val) const
std::atomic< uint8_t > m_bcid
Method to encode RDO data to vector of 16 bin words.
This is a "hash" representation of an Identifier.
This is an Identifier helper class for the SCT subdetector.