ATLAS Offline Software
ITkPixEncoder.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 /*
6 * Author: Ondra Kovanda, ondrej.kovanda at cern.ch
7 * Date: 03/2024
8 * Description: ITkPix* encoding base class
9 */
10 
11 #ifndef ITKPIXENCODER_H
12 #define ITKPIXENCODER_H
13 
14 
15 #include "ITkPixLayout.h"
16 #include <vector>
17 #include <cstdint>
18 
20  public:
22 
23  ITkPixEncoder(const unsigned nCol = 400, const unsigned nRow = 384,
24  const unsigned nColInCCol = 8, const unsigned nRowInQRow = 2,
25  const unsigned nEventsPerStream = 16, const bool plainHitMap = false,
26  const bool dropToT = false);
27 
28  std::vector<uint32_t>& getWords(){return m_words;}
29 
30  void addBits64(const uint64_t value, const uint8_t length);
31 
32  void pushWords32();
33 
34  void encodeQCore(const unsigned nCCol, const unsigned nQRow);
35 
36  void encodeEvent();
37 
38  void streamTag(const uint8_t nStream);
39 
40  void intTag(const uint16_t nEvt);
41 
42  void scanHitMap();
43 
44  bool hitInQCore(const unsigned CCol, const unsigned QRow);
45 
46  void setHitMap(const HitMap& hitMap){m_hitMap = hitMap;}
47 
48  void setEventsPerStream(const unsigned nEventsPerStream = 16){m_nEventsPerStream = nEventsPerStream;}
49 
50  protected:
51  // Chip geometry
52  unsigned m_nCol{400}, m_nRow{384}, m_nCCol{50}, m_nQRow{192}, m_nColInCCol{8}, m_nRowInQRow{2};
53 
54  // Output
55  std::vector<uint32_t> m_words;
56  unsigned m_nEventsPerStream{}, m_currCCol{}, m_currQRow{}, m_currEvent{};//, m_lastQRow;
58 
59  // Encoding machinery
62  std::vector<std::vector<bool>> m_hitQCores;
63  std::vector<unsigned> m_lastQRow;
64 
65  //Globals - could be replace with compile-time conditioning instead of run-time if performance is critical
67 
68  // Input
70 
71 
72 };
73 
74 
75 #endif
ITkPixEncoder::streamTag
void streamTag(const uint8_t nStream)
Definition: ITkPixEncoder.cxx:188
ITkPixEncoder::m_nRow
unsigned m_nRow
Definition: ITkPixEncoder.h:52
ITkPixEncoder::m_lastQRow
std::vector< unsigned > m_lastQRow
Definition: ITkPixEncoder.h:63
ITkPixEncoder::m_currStream
uint8_t m_currStream
Definition: ITkPixEncoder.h:57
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:557
ITkPixEncoder::m_nCol
unsigned m_nCol
Definition: ITkPixEncoder.h:52
ITkPixLayout.h
ITkPixEncoder::m_hitMap
HitMap m_hitMap
Definition: ITkPixEncoder.h:69
ITkPixEncoder::getWords
std::vector< uint32_t > & getWords()
Definition: ITkPixEncoder.h:28
ITkPixEncoder::HitMap
ITkPixLayout< uint16_t > HitMap
Definition: ITkPixEncoder.h:21
athena.value
value
Definition: athena.py:124
ITkPixEncoder::m_hitQCores
std::vector< std::vector< bool > > m_hitQCores
Definition: ITkPixEncoder.h:62
ITkPixEncoder::m_dropToT
bool m_dropToT
Definition: ITkPixEncoder.h:66
ITkPixEncoder::m_nRowInQRow
unsigned m_nRowInQRow
Definition: ITkPixEncoder.h:52
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:88
ITkPixEncoder::m_words
std::vector< uint32_t > m_words
Definition: ITkPixEncoder.h:55
ITkPixEncoder::m_nEventsPerStream
unsigned m_nEventsPerStream
Definition: ITkPixEncoder.h:56
ITkPixEncoder::m_nColInCCol
unsigned m_nColInCCol
Definition: ITkPixEncoder.h:52
ITkPixEncoder::hitInQCore
bool hitInQCore(const unsigned CCol, const unsigned QRow)
Definition: ITkPixEncoder.cxx:116
ITkPixEncoder::m_currQRow
unsigned m_currQRow
Definition: ITkPixEncoder.h:56
ITkPixEncoder::intTag
void intTag(const uint16_t nEvt)
Definition: ITkPixEncoder.cxx:193
ITkPixEncoder::m_currEvent
unsigned m_currEvent
Definition: ITkPixEncoder.h:56
xAOD::uint64_t
uint64_t
Definition: EventInfo_v1.cxx:123
ITkPixEncoder::m_plainHitMap
bool m_plainHitMap
Definition: ITkPixEncoder.h:66
ITkPixEncoder::m_currBit
uint8_t m_currBit
Definition: ITkPixEncoder.h:61
ITkPixEncoder::ITkPixEncoder
ITkPixEncoder(const unsigned nCol=400, const unsigned nRow=384, const unsigned nColInCCol=8, const unsigned nRowInQRow=2, const unsigned nEventsPerStream=16, const bool plainHitMap=false, const bool dropToT=false)
Definition: ITkPixEncoder.cxx:15
ITkPixEncoder::setHitMap
void setHitMap(const HitMap &hitMap)
Definition: ITkPixEncoder.h:46
ITkPixEncoder::m_nCCol
unsigned m_nCCol
Definition: ITkPixEncoder.h:52
ITkPixEncoder::pushWords32
void pushWords32()
Definition: ITkPixEncoder.cxx:66
ITkPixEncoder::m_currBlock
uint64_t m_currBlock
Definition: ITkPixEncoder.h:60
ITkPixEncoder
Definition: ITkPixEncoder.h:19
ITkPixEncoder::encodeQCore
void encodeQCore(const unsigned nCCol, const unsigned nQRow)
Definition: ITkPixEncoder.cxx:78
ITkPixEncoder::m_currCCol
unsigned m_currCCol
Definition: ITkPixEncoder.h:56
ITkPixEncoder::addBits64
void addBits64(const uint64_t value, const uint8_t length)
Definition: ITkPixEncoder.cxx:23
ITkPixLayout< uint16_t >
ITkPixEncoder::setEventsPerStream
void setEventsPerStream(const unsigned nEventsPerStream=16)
Definition: ITkPixEncoder.h:48
ITkPixEncoder::encodeEvent
void encodeEvent()
Definition: ITkPixEncoder.cxx:151
ITkPixEncoder::m_nQRow
unsigned m_nQRow
Definition: ITkPixEncoder.h:52
length
double length(const pvec &v)
Definition: FPGATrackSimLLPDoubletHoughTransformTool.cxx:26
ITkPixEncoder::scanHitMap
void scanHitMap()
Definition: ITkPixEncoder.cxx:131