ATLAS Offline Software
SectorLogicReadOut.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef TrigT1RPChardware_SectorLogicReadOut_H
6 #define TrigT1RPChardware_SectorLogicReadOut_H
7 
8 #include <iostream>
9 
13 #include "TrigT1RPChardware/Pad.h"
15 #include "TrigT1RPChardware/crc8.h"
16 
18 public:
20  SectorLogicReadOut(const SectorLogicReadOut &SLROOrig);
22  void initialize();
23  void reset();
24  void overwriteHeader(ubit16 thisRecord) { m_Header = thisRecord; };
25  void overwriteFooter(ubit16 thisRecord) { m_Footer = thisRecord; };
26  void writeRecord(ubit16 newHit, bool last);
31  void topSLBody() { m_BodyCurr = m_Body; };
36  float padTriggerRate(ubit16 padAddress);
37  //
38  ubit16 cmadd(ubit16 indexLink, ubit16 indexGate);
39  ubit16 ptid(ubit16 indexLink, ubit16 indexGate);
40  ubit16 opl(ubit16 indexLink, ubit16 indexGate);
41  ubit16 ovphi(ubit16 indexLink, ubit16 indexGate);
42  ubit16 oveta(ubit16 indexLink, ubit16 indexGate);
43  ubit16 res(ubit16 indexLink, ubit16 indexGate);
44  ubit16 bcid(ubit16 indexLink, ubit16 indexGate);
45  void display(std::ostream &stream);
46  bool checkFragment();
47  //
48  //*********************************************************//
49  // overload of "inseritore" operator //
50  //*********************************************************//
51  friend std::ostream &operator<<(std::ostream &stream, SectorLogicReadOut *p) {
52  p->display(stream);
53  return stream;
54  }
55  friend std::ostream &operator<<(std::ostream &stream, SectorLogicReadOut &p) {
56  p.display(stream);
57  return stream;
58  }
59  //*********************************************************//
60 
61 private:
62  void deleteSLBody();
63  void doHit();
64  void doCounter32();
65  void makeNewHit(ubit16 newHit);
66 
67  struct SLROData {
70  };
71 
72  //*******************************************************//
73  SLROData *m_BodyLast{nullptr}; // pointer to the last hit recorded
74  SLROData *m_BodyCurr{nullptr}; // pointer to the current hit scanned
75  //*******************************************************//
76  static constexpr ubit16 s_nGates = 7;
77  static constexpr ubit16 s_nLinks = 8;
78 
80 
81  static const ubit16 s_numberOfDataCounters = 21;
83  std::array<ubit16, s_numberOfDataCounters> m_counter16{0};
84  std::array<RODword, s_numberOfDecodedCounters> m_counter32{0};
85 
86  bool m_counter32ok{false};
87  bool m_hitok{false};
90  SLROData *m_Body{nullptr};
91  SLROData *m_BodyCounter{nullptr}; // pointer to the SL Counters
96  //
97  // 14+21 words
98  // first 14 words
99  // nella finestra di lettura SL si da nei 12 bit meno significativi
100  // la mappa sotto riportatata
101  // word tower BCID
102  // 1 0 0
103  // 2 1 0
104  // 3 0 1
105  // .. .. ..
106  // 14 1 6
107  //
108  // map of counter32
109  //
110  // counter32[ 0] ----> pad 0 trigger data enable=0 counter
111  // counter32[ 1] ----> pad 0 trigger data enable=1 counter
112  // counter32[ 2] ----> pad 1 trigger data enable=0 counter
113  // counter32[ 3] ----> pad 1 trigger data enable=1 counter
114  // ...
115  // counter32[n-3] ----> sector logic valid trigger counter
116  // counter32[n-2] ----> selected lvl1a counter
117  // counter32[n-1] ----> lost lvl1a counter
118  //
119  //
120  // map of the hit section of the SectorLogic Body
121  //
122  // bit from 0 to 1 --> cmadd
123  // bit from 2 to 4 --> ptcode
124  // bit from 5 to 5 --> outer plane flag
125  // bit from 6 to 6 --> overlap-in-phi flag
126  // bit from 7 to 7 --> overlap-in-eta flag
127  // bit from 8 to 8 --> (reserved)
128  // bit from 9 to 11 --> bcid
129  //
130 };
131 #endif
SectorLogicReadOut::numberOfBodyWords
ubit16 numberOfBodyWords()
Definition: SectorLogicReadOut.h:28
SectorLogicReadOut::s_nLinks
static constexpr ubit16 s_nLinks
Definition: SectorLogicReadOut.h:77
SectorLogicReadOut::m_Footer
ubit16 m_Footer
Definition: SectorLogicReadOut.h:89
SectorLogicReadOut::readSLHitCurrent
ubit16 readSLHitCurrent()
Definition: SectorLogicReadOut.cxx:129
SectorLogicReadOut::numberOfHitWords
ubit16 numberOfHitWords()
Definition: SectorLogicReadOut.h:29
SectorLogicReadOut::m_Body
SLROData * m_Body
Definition: SectorLogicReadOut.h:90
SectorLogicReadOut::SLROData::next
SLROData * next
Definition: SectorLogicReadOut.h:69
index
Definition: index.py:1
SectorLogicReadOut
Definition: SectorLogicReadOut.h:17
SectorLogicReadOut::m_numberOfWordsInBody
ubit16 m_numberOfWordsInBody
Definition: SectorLogicReadOut.h:93
RODword
uint32_t RODword
Definition: Lvl1Def.h:18
crc8.h
SectorLogicReadOut::display
void display(std::ostream &stream)
Definition: SectorLogicReadOut.cxx:265
SectorLogicReadOut::doCounter32
void doCounter32()
Definition: SectorLogicReadOut.cxx:158
SectorLogicReadOut::padTriggerRate
float padTriggerRate(ubit16 padAddress)
Definition: SectorLogicReadOut.cxx:182
SectorLogicReadOut::numberOfCounterWords
ubit16 numberOfCounterWords()
Definition: SectorLogicReadOut.h:30
SectorLogicReadOut::m_numberOfWordsInFrag
ubit16 m_numberOfWordsInFrag
Definition: SectorLogicReadOut.h:92
SectorLogicReadOut::topSLBody
void topSLBody()
Definition: SectorLogicReadOut.h:31
SectorLogicReadOut::m_BodyCurr
SLROData * m_BodyCurr
Definition: SectorLogicReadOut.h:74
SectorLogicReadOut::topSLBodyCounters
void topSLBodyCounters()
Definition: SectorLogicReadOut.h:32
BaseObject.h
SectorLogicReadOut::initialize
void initialize()
Definition: SectorLogicReadOut.cxx:83
AthenaPoolTestWrite.stream
string stream
Definition: AthenaPoolTestWrite.py:12
SectorLogicReadOut::s_nGates
static constexpr ubit16 s_nGates
Definition: SectorLogicReadOut.h:76
SectorLogicReadOut::m_BodyLast
SLROData * m_BodyLast
Definition: SectorLogicReadOut.h:73
SectorLogicReadOut::overwriteFooter
void overwriteFooter(ubit16 thisRecord)
Definition: SectorLogicReadOut.h:25
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
SectorLogicReadOut::m_hit
ubit16 m_hit[s_nLinks][s_nGates]
Definition: SectorLogicReadOut.h:79
SectorLogicReadOut::readSLCounterCurrent
ubit16 readSLCounterCurrent()
Definition: SectorLogicReadOut.cxx:139
Lvl1Def.h
SectorLogicReadOut::opl
ubit16 opl(ubit16 indexLink, ubit16 indexGate)
Definition: SectorLogicReadOut.cxx:220
SectorLogicReadOut::makeNewHit
void makeNewHit(ubit16 newHit)
Definition: SectorLogicReadOut.cxx:113
SectorLogicReadOutStructure.h
SectorLogicReadOut::overwriteHeader
void overwriteHeader(ubit16 thisRecord)
Definition: SectorLogicReadOut.h:24
SectorLogicReadOut::operator<<
friend std::ostream & operator<<(std::ostream &stream, SectorLogicReadOut *p)
Definition: SectorLogicReadOut.h:51
SectorLogicReadOut::m_BodyCounter
SLROData * m_BodyCounter
Definition: SectorLogicReadOut.h:91
SectorLogicReadOut::getCounter32
RODword getCounter32(ubit16 index)
Definition: SectorLogicReadOut.cxx:169
SectorLogicReadOut::writeRecord
void writeRecord(ubit16 newHit, bool last)
Definition: SectorLogicReadOut.cxx:102
SectorLogicReadOut::m_numberOfWordsInCounters
ubit16 m_numberOfWordsInCounters
Definition: SectorLogicReadOut.h:94
SectorLogicReadOut::checkFragment
bool checkFragment()
Definition: SectorLogicReadOut.cxx:285
SectorLogicReadOut::m_Header
ubit16 m_Header
Definition: SectorLogicReadOut.h:88
BaseObject
Definition: BaseObject.h:13
SectorLogicReadOut::SectorLogicReadOut
SectorLogicReadOut()
Definition: SectorLogicReadOut.cxx:18
SectorLogicReadOut::oveta
ubit16 oveta(ubit16 indexLink, ubit16 indexGate)
Definition: SectorLogicReadOut.cxx:238
SectorLogicReadOut::s_numberOfDecodedCounters
static const ubit16 s_numberOfDecodedCounters
Definition: SectorLogicReadOut.h:82
SectorLogicReadOut::doHit
void doHit()
Definition: SectorLogicReadOut.cxx:195
SectorLogicReadOut::reset
void reset()
Definition: SectorLogicReadOut.cxx:93
SectorLogicReadOut::ovphi
ubit16 ovphi(ubit16 indexLink, ubit16 indexGate)
Definition: SectorLogicReadOut.cxx:229
Pad.h
SectorLogicReadOut::m_counter32
std::array< RODword, s_numberOfDecodedCounters > m_counter32
Definition: SectorLogicReadOut.h:84
SectorLogicReadOut::bcid
ubit16 bcid(ubit16 indexLink, ubit16 indexGate)
Definition: SectorLogicReadOut.cxx:256
SectorLogicReadOut::cmadd
ubit16 cmadd(ubit16 indexLink, ubit16 indexGate)
Definition: SectorLogicReadOut.cxx:202
SectorLogicReadOut::m_hitok
bool m_hitok
Definition: SectorLogicReadOut.h:87
SectorLogicReadOut::deleteSLBody
void deleteSLBody()
Definition: SectorLogicReadOut.cxx:68
SectorLogicReadOut::res
ubit16 res(ubit16 indexLink, ubit16 indexGate)
Definition: SectorLogicReadOut.cxx:247
SectorLogicReadOut::~SectorLogicReadOut
~SectorLogicReadOut()
Definition: SectorLogicReadOut.cxx:60
SectorLogicReadOut::SLROData
Definition: SectorLogicReadOut.h:67
SectorLogicReadOut::numberOfFragmentWords
ubit16 numberOfFragmentWords()
Definition: SectorLogicReadOut.h:27
SectorLogicReadOut::m_counter32ok
bool m_counter32ok
Definition: SectorLogicReadOut.h:86
SectorLogicReadOut::s_numberOfDataCounters
static const ubit16 s_numberOfDataCounters
Definition: SectorLogicReadOut.h:81
ubit16
unsigned short int ubit16
Definition: RpcByteStreamEncoder.h:20
MatrixReadOut.h
SectorLogicReadOut::SLROData::hit
ubit16 hit
Definition: SectorLogicReadOut.h:68
SectorLogicReadOut::m_counter16
std::array< ubit16, s_numberOfDataCounters > m_counter16
Definition: SectorLogicReadOut.h:83
SectorLogicReadOut::operator<<
friend std::ostream & operator<<(std::ostream &stream, SectorLogicReadOut &p)
Definition: SectorLogicReadOut.h:55
SectorLogicReadOut::m_numberOfWordsInSLHits
ubit16 m_numberOfWordsInSLHits
Definition: SectorLogicReadOut.h:95
SectorLogicReadOut::ptid
ubit16 ptid(ubit16 indexLink, ubit16 indexGate)
Definition: SectorLogicReadOut.cxx:211