Loading [MathJax]/extensions/tex2jax.js
 |
ATLAS Offline Software
|
Athena Algorithm Tool that provides conversion from ITkStrips RDO to ROD format Bytestream.
More...
#include <ITkStripsRodEncoder.h>
|
void | encodeData (const std::vector< uint16_t > &clusters, std::vector< uint8_t > &data_encode, int typ, uint8_t l0tag, uint8_t bc_count) const |
|
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. More...
|
|
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. More...
|
|
uint16_t | clusterFinder_sub (uint64_t &hits_high64, uint64_t &hits_low64, bool isSecondRow) const |
|
uint32_t | set32Bits (const unsigned short int *arr8Words, const unsigned short int *position, const unsigned short int &numWords) const |
|
bool | getBit_128b (uint8_t bit_addr, uint64_t data_high64, uint64_t data_low64) const |
|
void | setBit_128b (uint8_t bit_addr, bool value, uint64_t &data_high64, uint64_t &data_low64) const |
|
bool | getParity_8bits (uint8_t val) const |
|
int | getBarrelEC (const SCT_RDORawData *rdo) const |
| Get the barrel/endcape info from the RDO. More...
|
|
int | getDiskLayer (const SCT_RDORawData *rdo) const |
| Get disk/layer info from the RDO. More...
|
|
int | getPhiModule (const SCT_RDORawData *rdo) const |
| Get the phi value info from the RDO. More...
|
|
int | getEtaModule (const SCT_RDORawData *rdo) const |
| Get the eta value info from the RDO. More...
|
|
int | getStripMax (const SCT_RDORawData *rdo) const |
| Get the maxumum strip value info from the RDO. More...
|
|
int | side (const SCT_RDORawData *rdo) const |
| Get the side info from the RDO. More...
|
|
int | getTimeBin (const SCT_RDORawData *rdo) const |
| Get the time bin info from the RDO. More...
|
|
int | getStrip (const SCT_RDORawData *rdo) const |
| Get the strip number info from the RDO. More...
|
|
Identifier | offlineID (const SCT_RDORawData *rdo) const |
| Get the offline Identifier from the RDO. More...
|
|
uint32_t | onlineID (const SCT_RDORawData *rdo) const |
| Get the online Identifier from the RDO. More...
|
|
int | getRODLink (const SCT_RDORawData *rdo) const |
| Get the ROD link number info in the RDO header data. More...
|
|
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. More...
|
|
uint16_t | getHeaderUsingRDO (const SCT_RDORawData *rdo) const |
| Get the 16-bit word for a header for a hit. More...
|
|
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. More...
|
|
uint16_t | getTrailer (const int &errorWord) const |
| Get the 16-bit word for a trailer, with or without ByteStream errors. More...
|
|
Athena Algorithm Tool that provides conversion from ITkStrips RDO to ROD format Bytestream.
Definition at line 30 of file ITkStripsRodEncoder.h.
◆ ITkStripsRodEncoder()
ITkStripsRodEncoder::ITkStripsRodEncoder |
( |
const std::string & |
type, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
parent |
|
) |
| |
◆ ~ITkStripsRodEncoder()
virtual ITkStripsRodEncoder::~ITkStripsRodEncoder |
( |
| ) |
|
|
virtualdefault |
◆ clusterFinder()
std::vector< uint16_t > ITkStripsRodEncoder::clusterFinder |
( |
const std::bitset< 256 > & |
inputData, |
|
|
const uint8_t |
maxCluster = 63 |
|
) |
| const |
|
private |
@breif Method to set pairs of 8 bit words to a 32 bit word.
Function used by the packFragments(...) method.
- Parameters
-
arr8Words | Pointer to array containing a pair of 8 bit words. |
position | Pointer to an array that gives the 32 bit starting positions of the 8 bit words and corresponding to arr8Words. |
numWords | Number of word to be set to a 32 bit word. |
Definition at line 173 of file ITkStripsRodEncoder.cxx.
184 while (d0l or d0h or d1l or d1h){
185 if (
clusters.size() > maxCluster)
break;
188 if (cluster1 != 0x3ff)
191 if (
clusters.size() > maxCluster)
break;
194 if (cluster0 != 0x3ff)
◆ clusterFinder_sub()
uint16_t ITkStripsRodEncoder::clusterFinder_sub |
( |
uint64_t & |
hits_high64, |
|
|
uint64_t & |
hits_low64, |
|
|
bool |
isSecondRow |
|
) |
| const |
|
private |
Definition at line 226 of file ITkStripsRodEncoder.cxx.
231 hit_addr = __builtin_ctzll(hits_low64);
232 }
else if (hits_high64){
233 hit_addr = __builtin_ctzll(hits_high64) + 64;
236 hitpat_next3 =
getBit_128b(hit_addr+1, hits_high64, hits_low64) << 2
237 |
getBit_128b(hit_addr+2, hits_high64, hits_low64) << 1
238 |
getBit_128b(hit_addr+3, hits_high64, hits_low64);
240 for (
int i=0;
i<4; ++
i)
243 if (hit_addr == 128) {
246 hit_addr += isSecondRow<<7;
247 return hit_addr << 3 | hitpat_next3;
◆ encodeData()
void ITkStripsRodEncoder::encodeData |
( |
const std::vector< uint16_t > & |
clusters, |
|
|
std::vector< uint8_t > & |
data_encode, |
|
|
int |
typ, |
|
|
uint8_t |
l0tag, |
|
|
uint8_t |
bc_count |
|
) |
| const |
|
private |
code to be filled here
Definition at line 142 of file ITkStripsRodEncoder.cxx.
147 data_encode.push_back((
header>>8) & 0xff);
148 data_encode.push_back(
header & 0xff);
150 size_t cluster_count = 0;
152 if (cluster_count == 4){
158 data_encode.push_back((clusterbits>>8) & 0xff);
159 data_encode.push_back(clusterbits & 0xff);
163 while (cluster_count < 4) {
164 data_encode.push_back(0x7F);
165 data_encode.push_back(0xFF);
◆ fillROD()
void ITkStripsRodEncoder::fillROD |
( |
std::vector< uint32_t > & |
vec32Data, |
|
|
const uint32_t & |
robID, |
|
|
const std::vector< const SCT_RDORawData * > & |
vecRDOs |
|
) |
| const |
|
overridevirtual |
Main Convert method.
Converts SCT RDO to a vector of 32 bit words. Starts by retrieving and collecting errors, then loops through RDO's and decode them to 16 bit words, and then finally it packs the 16 bit word into 32 bit words vector.
- Parameters
-
vec32Data | Vector of 32 bit words to be filled with encoded RDOs from the SCT. |
robID | ID of the current readout buffer (ROB). |
vecRDOs | Vector containing the RDOs to be coverted to vector of 32 bit words. |
Definition at line 79 of file ITkStripsRodEncoder.cxx.
83 std::unordered_map<uint64_t, std::vector<std::bitset<256>>> allStripData;
85 for (
const auto& rdo : vecRDOs) {
98 eta_group =
static_cast<int>(std::floor((eta_mod+1) / 2));
100 eta_group =
static_cast<int>(std::floor(eta_mod / 2));
103 int chips_per_module = (strip_max + 1) / 128;
105 auto& StripData = allStripData[
key];
107 if (StripData.empty()) {
108 StripData.resize(chips_per_module);
113 int chip =
static_cast<int>(std::floor((
strip + 1) / 128));
114 int strip_position =
strip % 128;
115 int strip_logical_channel = 2*strip_position + (eta_mod & 1);
116 StripData[chip].set(strip_logical_channel);
119 std::vector<uint8_t> vec8Data;
120 vec8Data.reserve(10);
123 for (
const auto& [
key, StripData] : allStripData) {
125 for (
size_t i = 0;
i < StripData.size(); ++
i) {
126 if (StripData[
i].any()) {
127 std::bitset<256>
hits = StripData[
i];
◆ finalize()
StatusCode ITkStripsRodEncoder::finalize |
( |
| ) |
|
|
overridevirtual |
◆ getBarrelEC()
◆ getBit_128b()
bool ITkStripsRodEncoder::getBit_128b |
( |
uint8_t |
bit_addr, |
|
|
uint64_t |
data_high64, |
|
|
uint64_t |
data_low64 |
|
) |
| const |
|
inlineprivate |
Definition at line 208 of file ITkStripsRodEncoder.cxx.
209 if (bit_addr > 127)
return false;
211 return bit_addr<64 ? data_low64>>bit_addr & 1 : data_high64>>(bit_addr-64) & 1;
◆ getDiskLayer()
◆ getEtaModule()
◆ getHeaderPhysicsPacket()
uint16_t ITkStripsRodEncoder::getHeaderPhysicsPacket |
( |
int |
typ, |
|
|
uint8_t |
l0tag, |
|
|
uint8_t |
bc_count |
|
) |
| const |
|
private |
Get the 16-bit word for a header with Type (PR or LP), L0Tag event and BCID.
Definition at line 368 of file ITkStripsRodEncoder.cxx.
369 uint8_t bcid_low = bc_cout & 0x7;
372 const uint16_t Header{
static_cast<uint16_t>(((
uint8_t)typ << 12) | (0x1 << 11) | (l0tag & 0x7f) << 4 | (bcid_low) << 1 | bc_parity)};
◆ getHeaderUsingHash()
◆ getHeaderUsingRDO()
◆ getParity_8bits()
bool ITkStripsRodEncoder::getParity_8bits |
( |
uint8_t |
val | ) |
const |
|
private |
◆ getPhiModule()
◆ getRODLink()
◆ getStrip()
◆ getStripMax()
◆ getTimeBin()
Get the time bin info from the RDO.
◆ getTrailer()
uint16_t ITkStripsRodEncoder::getTrailer |
( |
const int & |
errorWord | ) |
const |
|
private |
◆ initialize()
StatusCode ITkStripsRodEncoder::initialize |
( |
| ) |
|
|
overridevirtual |
Initialize.
Definition at line 54 of file ITkStripsRodEncoder.cxx.
65 if (sctDetElement->swapPhiReadoutDirection()) {
70 return StatusCode::SUCCESS;
◆ offlineID()
◆ onlineID()
◆ packFragments()
void ITkStripsRodEncoder::packFragments |
( |
std::vector< uint8_t > & |
vec8Words, |
|
|
std::vector< uint32_t > & |
vec32Words |
|
) |
| const |
|
private |
Method to pack vector of 8 bit words intto a vector of 32 bit words.
Method us used by private method encodeData(...).
- Parameters
-
vec8Words | Vector containing 8 bit words. |
vec32Words | Vector for 32 bit words to be packed. |
Definition at line 252 of file ITkStripsRodEncoder.cxx.
253 int num8Words{
static_cast<int>(vec8Words.size())};
254 if (num8Words % 4 != 0) {
256 while (num8Words % 4 != 0) {
257 vec8Words.push_back(0x40);
262 const unsigned short int numWords{4};
263 const unsigned short int position[numWords]{0, 8, 16, 24};
264 unsigned short int arr8Words[numWords]{0, 0, 0, 0};
266 for (
int i{0};
i<num8Words;
i += numWords) {
267 for (
int j{0}; j<numWords; j++) {
268 arr8Words[j] = vec8Words[
i + j];
271 vec32Words.push_back(uint32Word);
◆ set32Bits()
uint32_t ITkStripsRodEncoder::set32Bits |
( |
const unsigned short int * |
arr8Words, |
|
|
const unsigned short int * |
position, |
|
|
const unsigned short int & |
numWords |
|
) |
| const |
|
private |
◆ setBit_128b()
void ITkStripsRodEncoder::setBit_128b |
( |
uint8_t |
bit_addr, |
|
|
bool |
value, |
|
|
uint64_t & |
data_high64, |
|
|
uint64_t & |
data_low64 |
|
) |
| const |
|
inlineprivate |
◆ side()
◆ m_bcid
std::atomic<uint8_t> ITkStripsRodEncoder::m_bcid = 0 |
|
mutableprivate |
Method to encode RDO data to vector of 16 bin words.
Methods used by main convert methods fillROD(...).
- Parameters
-
vecTimeBins | Vector of time bins for RDOs. |
vec16Words | Vector of 16 bit words to filled from encoded RDO data. |
rdo | RDO raw data object to be encoded. |
groupSize | Group size info from the RDO. |
strip | Strip number info from the RDO. |
Definition at line 75 of file ITkStripsRodEncoder.h.
◆ m_cabling
Initial value:{this,
"SCT_CablingTool",
"SCT_CablingTool",
"Tool to retrieve ITkStrips Cabling"}
Providing mappings of online and offline identifiers and also serial numbers.
Definition at line 157 of file ITkStripsRodEncoder.h.
◆ m_condensed
BooleanProperty ITkStripsRodEncoder::m_condensed {this, "CondensedMode", false, "Condensed mode (true) or Expanded mode (false)"} |
|
private |
Example Boolean used to determine decoding mode, maybe unused finally.
Definition at line 167 of file ITkStripsRodEncoder.h.
◆ m_itkStripsID
const SCT_ID* ITkStripsRodEncoder::m_itkStripsID {nullptr} |
|
private |
◆ m_l0tag
std::atomic<uint8_t> ITkStripsRodEncoder::m_l0tag = 0 |
|
mutableprivate |
◆ m_swapModuleID
std::set<Identifier> ITkStripsRodEncoder::m_swapModuleID {} |
|
private |
The documentation for this class was generated from the following files:
def retrieve(aClass, aKey=None)
int getDiskLayer(const SCT_RDORawData *rdo) const
Get disk/layer info from the RDO.
std::set< Identifier > m_swapModuleID
Swap Module identifier, set by SCTRawContByteStreamTool.
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.
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
int phi_module(const Identifier &id) const
uint32_t onlineID(const SCT_RDORawData *rdo) const
Get the online Identifier from the RDO.
uint16_t clusterFinder_sub(uint64_t &hits_high64, uint64_t &hits_low64, bool isSecondRow) const
int getPhiModule(const SCT_RDORawData *rdo) const
Get the phi value info from the RDO.
uint32_t set32Bits(const unsigned short int *arr8Words, const unsigned short int *position, const unsigned short int &numWords) const
int getStripMax(const SCT_RDORawData *rdo) const
Get the maxumum strip value info from the RDO.
BooleanProperty m_condensed
Example Boolean used to determine decoding mode, maybe unused finally.
int getRODLink(const SCT_RDORawData *rdo) const
Get the ROD link number info in the RDO header data.
Identifier offlineID(const SCT_RDORawData *rdo) const
Get the offline Identifier from the RDO.
IdentifierHash wafer_hash(const Identifier &wafer_id) const
wafer hash from id - optimized
bool getParity_8bits(uint8_t val) const
int getEtaModule(const SCT_RDORawData *rdo) const
Get the eta value info from the RDO.
std::atomic< uint8_t > m_bcid
Method to encode RDO data to vector of 16 bin words.
void setBit_128b(uint8_t bit_addr, bool value, uint64_t &data_high64, uint64_t &data_low64) const
std::atomic< uint8_t > m_l0tag
bool getBit_128b(uint8_t bit_addr, uint64_t data_high64, uint64_t data_low64) const
int layer_disk(const Identifier &id) const
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.
void encodeData(const std::vector< uint16_t > &clusters, std::vector< uint8_t > &data_encode, int typ, uint8_t l0tag, uint8_t bc_count) const
int getStrip(const SCT_RDORawData *rdo) const
Get the strip number info from the RDO.
int getBarrelEC(const SCT_RDORawData *rdo) const
Get the barrel/endcape info from the RDO.
int strip(const Identifier &id) const
int eta_module(const Identifier &id) const
int strip_max(const Identifier &id) const
int side(const Identifier &id) const
virtual Identifier identify() const override final
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_itkStripsID
Identifier helper class for the ITkStrips subdetector that creates compact Identifier objects and Ide...
ToolHandle< ISCT_CablingTool > m_cabling
Providing mappings of online and offline identifiers and also serial numbers.
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.