ATLAS Offline Software
ITkStripsRodEncoder.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef ITkStripsRawDataByteStreamCnv_ITkStripsRodEncoder_h
6 #define ITkStripsRawDataByteStreamCnv_ITkStripsRodEncoder_h
7 
10 
13 #include "GaudiKernel/ToolHandle.h"
14 
15 #include <set>
16 
17 
18 class SCT_ID;
19 class SCT_RDORawData;
20 class Identifier;
21 class IdentifierHash;
22 
30 class
31 ITkStripsRodEncoder : public extends<AthAlgTool, IITkStripsRodEncoder>{
32  public:
33 
35  ITkStripsRodEncoder(const std::string& type, const std::string& name, const IInterface* parent);
36 
38  virtual ~ITkStripsRodEncoder() = default;
39 
41  virtual StatusCode initialize() override;
42 
44  virtual StatusCode finalize() override;
45 
57  virtual void fillROD(std::vector<uint32_t>& vec32Data, const uint32_t& robID,
58  const std::vector<const SCT_RDORawData*>& vecRDOs) const override;
59 
60  private:
61 
73  void encodeData(const std::vector<int>& vecTimeBins, std::vector<uint16_t>& vec16Words,
74  const SCT_RDORawData* rdo, const int& groupSize, const int& strip) const;
75 
84  void packFragments(std::vector<uint16_t>& vec16Words, std::vector<uint32_t>& vec32Words) const;
85 
95  uint32_t set32Bits(const unsigned short int* arr16Words,
96  const unsigned short int* position,
97  const unsigned short int& numWords) const;
98 
100  int side(const SCT_RDORawData* rdo) const;
101 
103  int getTimeBin(const SCT_RDORawData* rdo) const;
104 
106  int getStrip(const SCT_RDORawData* rdo) const;
107 
109  Identifier offlineID(const SCT_RDORawData* rdo) const;
110 
112  uint32_t onlineID(const SCT_RDORawData* rdo) const;
113 
115  int getRODLink(const SCT_RDORawData* rdo) const;
116 
118  uint16_t getHeaderUsingRDO(const SCT_RDORawData* rdo) const;
119 
121  uint16_t getHeaderUsingHash(const IdentifierHash& linkHash, const int& errorWord) const;
122 
124  uint16_t getTrailer(const int& errorWord) const;
125 
126 
127 
129  ToolHandle<ISCT_CablingTool> m_cabling{this,
130  "SCT_CablingTool",
131  "SCT_CablingTool",
132  "Tool to retrieve ITkStrips Cabling"};
133 
136  const SCT_ID* m_itkStripsID{nullptr};
137 
139  BooleanProperty m_condensed{this, "CondensedMode", false, "Condensed mode (true) or Expanded mode (false)"};
140 
142  std::set<Identifier> m_swapModuleID{};
143 };
144 
145 #endif // SCT_RAWDATABYTESTREAMCNV_SCT_RODENCODER_H
ITkStripsRodEncoder::initialize
virtual StatusCode initialize() override
Initialize.
Definition: ITkStripsRodEncoder.cxx:44
SiliconTech::strip
@ strip
ITkStripsRodEncoder::set32Bits
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.
Definition: ITkStripsRodEncoder.cxx:110
ITkStripsRodEncoder
Athena Algorithm Tool that provides conversion from ITkStrips RDO to ROD format Bytestream.
Definition: ITkStripsRodEncoder.h:31
ITkStripsRodEncoder::packFragments
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.
Definition: ITkStripsRodEncoder.cxx:84
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
ITkStripsRodEncoder::ITkStripsRodEncoder
ITkStripsRodEncoder(const std::string &type, const std::string &name, const IInterface *parent)
Constructor.
Definition: ITkStripsRodEncoder.cxx:35
ITkStripsRodEncoder::m_swapModuleID
std::set< Identifier > m_swapModuleID
Swap Module identifier, set by SCTRawContByteStreamTool.
Definition: ITkStripsRodEncoder.h:142
SCT_RDORawData
Definition: SCT_RDORawData.h:24
ITkStripsRodEncoder::finalize
virtual StatusCode finalize() override
Finalize.
Definition: ITkStripsRodEncoder.cxx:63
IITkStripsRodEncoder.h
ITkStripsRodEncoder::onlineID
uint32_t onlineID(const SCT_RDORawData *rdo) const
Get the online Identifier from the RDO.
Definition: ITkStripsRodEncoder.cxx:138
ITkStripsRodEncoder::getHeaderUsingHash
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.
Definition: ITkStripsRodEncoder.cxx:167
SCT_RDO_Container.h
ITkStripsRodEncoder::m_condensed
BooleanProperty m_condensed
Example Boolean used to determine decoding mode, maybe unused finally.
Definition: ITkStripsRodEncoder.h:139
ITkStripsRodEncoder::getRODLink
int getRODLink(const SCT_RDORawData *rdo) const
Get the ROD link number info in the RDO header data.
Definition: ITkStripsRodEncoder.cxx:145
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:88
ITkStripsRodEncoder::offlineID
Identifier offlineID(const SCT_RDORawData *rdo) const
Get the offline Identifier from the RDO.
Definition: ITkStripsRodEncoder.cxx:132
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthAlgTool.h
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ITkStripsRodEncoder::getHeaderUsingRDO
uint16_t getHeaderUsingRDO(const SCT_RDORawData *rdo) const
Get the 16-bit word for a header for a hit.
Definition: ITkStripsRodEncoder.cxx:160
ITkStripsRodEncoder::getTimeBin
int getTimeBin(const SCT_RDORawData *rdo) const
Get the time bin info from the RDO.
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
ITkStripsRodEncoder::fillROD
virtual void fillROD(std::vector< uint32_t > &vec32Data, const uint32_t &robID, const std::vector< const SCT_RDORawData * > &vecRDOs) const override
Main Convert method.
Definition: ITkStripsRodEncoder.cxx:68
ITkStripsRodEncoder::side
int side(const SCT_RDORawData *rdo) const
Get the side info from the RDO.
Definition: ITkStripsRodEncoder.cxx:150
ITkStripsRodEncoder::getStrip
int getStrip(const SCT_RDORawData *rdo) const
Get the strip number info from the RDO.
Definition: ITkStripsRodEncoder.cxx:126
ITkStripsRodEncoder::getTrailer
uint16_t getTrailer(const int &errorWord) const
Get the 16-bit word for a trailer, with or without ByteStream errors.
Definition: ITkStripsRodEncoder.cxx:174
SCT_ID
Definition: SCT_ID.h:68
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
ISCT_CablingTool.h
ITkStripsRodEncoder::encodeData
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.
Definition: ITkStripsRodEncoder.cxx:76
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
ITkStripsRodEncoder::m_itkStripsID
const SCT_ID * m_itkStripsID
Identifier helper class for the ITkStrips subdetector that creates compact Identifier objects and Ide...
Definition: ITkStripsRodEncoder.h:136
ITkStripsRodEncoder::m_cabling
ToolHandle< ISCT_CablingTool > m_cabling
Providing mappings of online and offline identifiers and also serial numbers.
Definition: ITkStripsRodEncoder.h:129
ITkStripsRodEncoder::~ITkStripsRodEncoder
virtual ~ITkStripsRodEncoder()=default
Destructor.
Identifier
Definition: IdentifierFieldParser.cxx:14