ATLAS Offline Software
MatrixReadOut.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 TrigT1RPChardware_MatrixReadOut_H
6 #define TrigT1RPChardware_MatrixReadOut_H
7 
8 #include <iostream>
9 
14 #include "TrigT1RPChardware/crc8.h"
15 
16 class ReadOutManager;
17 
18 class MatrixReadOut : public BaseObject {
19 public:
21 
23  MatrixReadOut(ubit16 FEevent = 0, uint NOBXS=8, DataVersion = MatrixReadOut::Atlas);
25  MatrixReadOut(const MatrixReadOut &MROOrig); // copy constructor
26  MatrixReadOut &operator=(const MatrixReadOut &MROOrig) = delete;
32  void deleteCMABody();
33  void reset(uint NOBXS);
34  //***********************************************//
35  // following methods are used by Lvl1RpcTrig //
36  //***********************************************//
37 
38  void writeHeader(ubit16 CMcode);
39  void writeSubHeader();
40  void writeCMABody(ubit16 _BC, ubit16 _TIME, ubit16 IJK, ubit16 _STRIP);
41  void writeFooter();
42  void writeRecord(ubit16 thisRecord, bool last);
43  void overwriteHeader(ubit16 thisRecord) { m_Header = thisRecord; }; // new method
44  void overwriteSubHeader(ubit16 thisRecord) { m_SubHeader = thisRecord; }; // new method
45  void reComputeFooter() {
46  writeFooter();
48  }; // new method
51  //**************************************************//
52  // general user methods to read back ReadOut stream //
53  //**************************************************//
57  void readCMABody(ubit16 *Body);
60  ubit16 checkCRC8(ubit16 foot);
61  void topCMABody();
62  //*********************************************************//
63  // general user methods to display/print ReadOut stream //
64  //*********************************************************//
65  void display(std::ostream &stream);
66  void displayHeader(std::ostream &stream);
67  void displaySubHeader(std::ostream &stream);
68  void displayBody(std::ostream &stream);
69  void displayFooter(std::ostream &stream);
70  void bytestream(std::ostream &stream);
71  //*********************************************************//
72  // general user methods to check ReadOut stream structure //
73  //*********************************************************//
74  ubit16 checkBodyOrder(bool debugPrint = false);
76  //*********************************************************//
77  // overload of "inseritore" operator //
78  //*********************************************************//
79  friend std::ostream &operator<<(std::ostream &stream, MatrixReadOut *p) {
80  p->display(stream);
81  return stream;
82  }
83  friend std::ostream &operator<<(std::ostream &stream, MatrixReadOut &p) {
84  p.display(stream);
85  return stream;
86  }
87  //*********************************************************//
88  void doMatrix(Matrix *CMpointer);
89  void makeTestPattern(ubit16 mode, ubit16 ktimes, int eventNum);
90 
91 private:
92  // fp
93 
94  friend class ReadOutManager;
96  void setManager(ReadOutManager *boss);
97  void makeFragment();
98 
100 
111  Matrix *m_CM{}; // pointer to the CM
112  ubit16 *m_BS{}; // pointer to Fragment
113  //**************************************//
114  // //
115  // Matrix ReadOut structure //
116  // //
117  //**************************************//
118  struct CMROData {
121  };
122  ubit16 m_Header{}; // Header record
123  ubit16 m_Footer{}; // Footer record
124  ubit16 m_SubHeader{}; // Subheader record
125  CMROData *m_Body{}; // Body structure record
126  //**********************************************************//
128  CMROData *m_BodyLast{}; // pointer to the last hit recorded
129  CMROData *m_BodyCurr{}; // pointer to the current hit scanned
130  //**********************************************************//
142  //************************//
143  void initialize(uint NOBXS);
144  void makeHeader();
145  void makeSubHeader();
146  void makeCMABody();
147  void makeFooter();
150  void makeNewHit(ubit16 newHit);
151  void makeNewHit(ubit16 newHit, CMROData *previous, CMROData *next);
152  void sortAndMakeNewHit(ubit16 newHit);
153  ubit16 computeCR();
154 };
155 #endif
Matrix
Definition: Trigger/TrigT1/TrigT1RPChardware/TrigT1RPChardware/Matrix.h:15
MatrixReadOut::readFooter
ubit16 readFooter()
Definition: MatrixReadOut.cxx:661
MatrixReadOut::reset
void reset(uint NOBXS)
Definition: MatrixReadOut.cxx:240
MatrixReadOut::overwriteHeader
void overwriteHeader(ubit16 thisRecord)
Definition: MatrixReadOut.h:43
MatrixReadOut::m_SubHeader
ubit16 m_SubHeader
Definition: MatrixReadOut.h:124
MatrixReadOut::initialize
void initialize(uint NOBXS)
Definition: MatrixReadOut.cxx:203
MatrixReadOut::m_checkUnkown
ubit16 m_checkUnkown
Definition: MatrixReadOut.h:141
MatrixReadOut::m_checkSubHeaderNum
ubit16 m_checkSubHeaderNum
Definition: MatrixReadOut.h:137
MatrixReadOut::CMROData::next
CMROData * next
Definition: MatrixReadOut.h:120
MatrixReadOut::~MatrixReadOut
~MatrixReadOut()
Definition: MatrixReadOut.cxx:175
MatrixReadOut::ReadOutManager
friend class ReadOutManager
Definition: MatrixReadOut.h:94
MatrixReadOut::m_Footer
ubit16 m_Footer
Definition: MatrixReadOut.h:123
MatrixReadOut::m_data_version
MatrixReadOut::DataVersion m_data_version
Definition: MatrixReadOut.h:99
MatrixReadOut::m_checkHeaderNum
ubit16 m_checkHeaderNum
Definition: MatrixReadOut.h:135
MatrixReadOut::numberOfFragmentWords
ubit16 numberOfFragmentWords()
Definition: MatrixReadOut.h:50
MatrixReadOut::readSubHeader
ubit16 readSubHeader()
Definition: MatrixReadOut.cxx:659
MatrixReadOut::display
void display(std::ostream &stream)
Definition: MatrixReadOut.cxx:723
MatrixReadOut::operator<<
friend std::ostream & operator<<(std::ostream &stream, MatrixReadOut &p)
Definition: MatrixReadOut.h:83
MatrixReadOut::makeSubHeader
void makeSubHeader()
Definition: MatrixReadOut.cxx:291
index
Definition: index.py:1
MatrixReadOut::CMROData
Definition: MatrixReadOut.h:118
crc8.h
MatrixReadOut::m_first8bitsON
ubit16 m_first8bitsON
Definition: MatrixReadOut.h:131
MatrixReadOut::m_checkCR
ubit16 m_checkCR
Definition: MatrixReadOut.h:140
MatrixReadOut::m_ROOffset
ubit16 m_ROOffset
Definition: MatrixReadOut.h:105
MatrixReadOut::getHeader
MatrixReadOutStructure getHeader()
Definition: MatrixReadOut.cxx:948
MatrixReadOut::CMROData::hit
ubit16 hit
Definition: MatrixReadOut.h:119
MatrixReadOut::readCMAWord
ubit16 readCMAWord()
Definition: MatrixReadOut.cxx:685
MatrixReadOut::DataVersion
DataVersion
Definition: MatrixReadOut.h:20
MatrixReadOut::m_checkFooterPos
ubit16 m_checkFooterPos
Definition: MatrixReadOut.h:138
MatrixReadOut::readHeader
ubit16 readHeader()
Definition: MatrixReadOut.cxx:657
MatrixReadOut::displaySubHeader
void displaySubHeader(std::ostream &stream)
Definition: MatrixReadOut.cxx:744
MatrixReadOut::m_CM
Matrix * m_CM
Definition: MatrixReadOut.h:111
MatrixReadOut::MatrixReadOut
MatrixReadOut(Matrix *p, ubit16 FEevent, uint NOBXS, DataVersion=MatrixReadOut::Atlas)
Definition: MatrixReadOut.cxx:15
MatrixReadOut::getSubHeader
MatrixReadOutStructure getSubHeader()
Definition: MatrixReadOut.cxx:953
MatrixReadOut::checkFragment
ubit16 checkFragment()
Definition: MatrixReadOut.cxx:807
MatrixReadOut::m_BunchFrom
ubit16 m_BunchFrom
Definition: MatrixReadOut.h:102
MatrixReadOut::operator<<
friend std::ostream & operator<<(std::ostream &stream, MatrixReadOut *p)
Definition: MatrixReadOut.h:79
MatrixReadOut::m_BunchTo
ubit16 m_BunchTo
Definition: MatrixReadOut.h:103
MatrixReadOut::m_checkFooterNum
ubit16 m_checkFooterNum
Definition: MatrixReadOut.h:139
BaseObject.h
Matrix.h
AthenaPoolTestWrite.stream
string stream
Definition: AthenaPoolTestWrite.py:12
MatrixReadOut::m_addressOfWordScanned
ubit16 m_addressOfWordScanned
Definition: MatrixReadOut.h:127
MatrixReadOut::makeFragment
void makeFragment()
Definition: MatrixReadOut.cxx:262
MatrixReadOut::m_NBunch
ubit16 m_NBunch
Definition: MatrixReadOut.h:107
MatrixReadOut::m_BodyCurr
CMROData * m_BodyCurr
Definition: MatrixReadOut.h:129
MatrixReadOut::m_Header
ubit16 m_Header
Definition: MatrixReadOut.h:122
MatrixReadOut::getFooter
MatrixReadOutStructure getFooter()
Definition: MatrixReadOut.cxx:958
MatrixReadOut::writeSubHeader
void writeSubHeader()
Definition: MatrixReadOut.cxx:539
MatrixReadOut::m_numberOfWordsInFrag
ubit16 m_numberOfWordsInFrag
Definition: MatrixReadOut.h:132
MatrixReadOut::m_checkSubHeaderPos
ubit16 m_checkSubHeaderPos
Definition: MatrixReadOut.h:136
MatrixReadOut
Definition: MatrixReadOut.h:18
MatrixReadOut::displayFooter
void displayFooter(std::ostream &stream)
Definition: MatrixReadOut.cxx:782
uint
unsigned int uint
Definition: LArOFPhaseFill.cxx:20
MatrixReadOut::checkBodyOrder
ubit16 checkBodyOrder(bool debugPrint=false)
Definition: MatrixReadOut.cxx:837
MatrixReadOut::writeFooter
void writeFooter()
Definition: MatrixReadOut.cxx:556
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
MatrixReadOut::m_BodyLast
CMROData * m_BodyLast
Definition: MatrixReadOut.h:128
fillPileUpNoiseLumi.next
next
Definition: fillPileUpNoiseLumi.py:52
MatrixReadOut::makeHeader
void makeHeader()
Definition: MatrixReadOut.cxx:274
MatrixReadOut::m_numberOfWordsInBody
ubit16 m_numberOfWordsInBody
Definition: MatrixReadOut.h:133
MatrixReadOut::overwriteSubHeader
void overwriteSubHeader(ubit16 thisRecord)
Definition: MatrixReadOut.h:44
Lvl1Def.h
MatrixReadOut::operator=
MatrixReadOut & operator=(const MatrixReadOut &MROOrig)=delete
MatrixReadOut::m_nclock
ubit16 m_nclock
Definition: MatrixReadOut.h:108
MatrixReadOut::topCMABody
void topCMABody()
Definition: MatrixReadOut.cxx:718
Preparation.mode
mode
Definition: Preparation.py:94
MatrixReadOut::m_FEL1ID
ubit16 m_FEL1ID
Definition: MatrixReadOut.h:104
MatrixReadOut::m_Body
CMROData * m_Body
Definition: MatrixReadOut.h:125
MatrixReadOut::displayHeader
void displayHeader(std::ostream &stream)
Definition: MatrixReadOut.cxx:730
MatrixReadOut::makeTestPattern
void makeTestPattern(ubit16 mode, ubit16 ktimes, int eventNum)
Definition: MatrixReadOut.cxx:1037
MatrixReadOut::readCMABodyCurrent
ubit16 readCMABodyCurrent()
Definition: MatrixReadOut.cxx:663
MatrixReadOut::m_BS
ubit16 * m_BS
Definition: MatrixReadOut.h:112
MatrixReadOut::m_timeSeparation
ubit16 m_timeSeparation
Definition: MatrixReadOut.h:110
MatrixReadOut::makeFooter
void makeFooter()
Definition: MatrixReadOut.cxx:309
MatrixReadOut::m_nchan
ubit16 m_nchan[2]
Definition: MatrixReadOut.h:109
MatrixReadOut::displayBody
void displayBody(std::ostream &stream)
Definition: MatrixReadOut.cxx:756
MatrixReadOut::readCMABody
void readCMABody(ubit16 *Body)
Definition: MatrixReadOut.cxx:673
MatrixReadOut::getCMAHit
MatrixReadOutStructure getCMAHit(int index)
Definition: MatrixReadOut.cxx:699
BaseObject
Definition: BaseObject.h:13
MatrixReadOutStructure
Definition: MatrixReadOutStructure.h:13
MatrixReadOut::makeCMABody
void makeCMABody()
Definition: MatrixReadOut.cxx:299
MatrixReadOut::numberOfBodyWords
ubit16 numberOfBodyWords()
Definition: MatrixReadOut.h:49
MatrixReadOut::m_checkHeaderPos
ubit16 m_checkHeaderPos
Definition: MatrixReadOut.h:134
MatrixReadOut::makeCMABodyHit
ubit16 makeCMABodyHit()
Definition: MatrixReadOut.cxx:336
MatrixReadOut::setManager
void setManager(ReadOutManager *boss)
Definition: MatrixReadOut.cxx:943
MatrixReadOut::makeCMABodyTrg
ubit16 makeCMABodyTrg()
Definition: MatrixReadOut.cxx:447
python.PyAthena.v
v
Definition: PyAthena.py:154
MatrixReadOut::deleteCMABody
void deleteCMABody()
Definition: MatrixReadOut.cxx:246
MatrixReadOut::reComputeFooter
void reComputeFooter()
Definition: MatrixReadOut.h:45
MatrixReadOut::bytestream
void bytestream(std::ostream &stream)
Definition: MatrixReadOut.cxx:795
MatrixReadOut::sortAndMakeNewHit
void sortAndMakeNewHit(ubit16 newHit)
Definition: MatrixReadOut.cxx:591
MatrixReadOut::writeHeader
void writeHeader(ubit16 CMcode)
Definition: MatrixReadOut.cxx:529
MatrixReadOut::Atlas
@ Atlas
Definition: MatrixReadOut.h:20
MatrixReadOutStructure.h
MatrixReadOut::computeCR
ubit16 computeCR()
Definition: MatrixReadOut.cxx:317
MatrixReadOut::Simulation
@ Simulation
Definition: MatrixReadOut.h:20
MatrixReadOut::writeRecord
void writeRecord(ubit16 thisRecord, bool last)
Definition: MatrixReadOut.cxx:183
MatrixReadOut::makeNewHit
void makeNewHit(ubit16 newHit)
Definition: MatrixReadOut.cxx:565
MatrixReadOut::m_MROS
MatrixReadOutStructure m_MROS
Definition: MatrixReadOut.h:101
MatrixReadOut::writeCMABody
void writeCMABody(ubit16 _BC, ubit16 _TIME, ubit16 IJK, ubit16 _STRIP)
Definition: MatrixReadOut.cxx:546
ubit16
unsigned short int ubit16
Definition: RpcByteStreamEncoder.h:20
Overlay::debugPrint
std::string debugPrint(const IDC_Container *container, unsigned numprint=25)
Diagnostic output of Identifiable Containers.
MatrixReadOut::doMatrix
void doMatrix(Matrix *CMpointer)
Definition: MatrixReadOut.cxx:963
MatrixReadOut::m_NDLLCYC
ubit16 m_NDLLCYC
Definition: MatrixReadOut.h:106
MatrixReadOut::checkCRC8
ubit16 checkCRC8(ubit16 foot)
Definition: MatrixReadOut.cxx:831
MatrixReadOut::m_myBoss
ReadOutManager * m_myBoss
Definition: MatrixReadOut.h:95
Trk::previous
@ previous
Definition: BinningData.h:32
Atlas
Definition: ExtendedEventContext.h:21