ATLAS Offline Software
Loading...
Searching...
No Matches
PadReadOut Class Reference

#include <PadReadOut.h>

Inheritance diagram for PadReadOut:
Collaboration diagram for PadReadOut:

Public Member Functions

 PadReadOut (ubit16 padID, MatrixReadOut *MROlist[8])
 ~PadReadOut ()
void reset ()
void makeFragment ()
void makeHeader ()
void makeFooter ()
void makeBody (bool debugPrint=false)
ubit16 readHeader ()
ubit16 readFooter ()
ubit16 readBody ()
void topPADBody ()
ubit16 readPADWord ()
ubit16 numberOfFragmentWords ()
ubit16 numberOfCMROFragments ()
void bytestream (std::ostream &stream)
void decodeBytestream ()
PadReadOutStructure getHeader ()
PadReadOutStructure getFooter ()
ObjectType tag () const
const std::string & name () const
virtual void Print (std::ostream &, bool) const

Private Attributes

ubit16 m_addressOfWordScanned
ubit16 m_numberOfCMFragments
ubit16 m_numberOfWordsInFragment
ubit16 m_newCMIndex
ubit16 m_newCMRO
ubit16 m_numberOfWordsRead
ubit16 m_numberOfWordsInCMRO
ubit16 m_endOfCMFragments
MatrixReadOutm_currentCMRO
PadReadOutStructure m_PROS
MatrixReadOutm_MROlist [8]
ubit16 m_padID
ubit16 m_Header
MatrixReadOutm_CMAFragment [8]
ubit16 m_Footer
ObjectType m_tag
std::string m_name

Detailed Description

Definition at line 15 of file PadReadOut.h.

Constructor & Destructor Documentation

◆ PadReadOut()

PadReadOut::PadReadOut ( ubit16 padID,
MatrixReadOut * MROlist[8] )

Definition at line 15 of file PadReadOut.cxx.

15 : BaseObject(Hardware, "PadReadOut") {
16 m_padID = padID;
17 //
18 // copy MROlist pointers to m_MROlist
19 //
20 for (ubit16 i = 0; i < 8; i++) { m_MROlist[i] = MROlist[i]; }
21 reset();
23 // cout<<" After makeFragment number of Words in PadID" << padID << " body =" << m_numberOfWordsInFragment<<endl;
24 topPADBody();
26 //
27} // end-of-PadReadOut::PadReadOut
@ Hardware
Definition BaseObject.h:11
unsigned short int ubit16
BaseObject(ObjectType, const std::string &)
Definition BaseObject.cxx:7
void topPADBody()
MatrixReadOut * m_MROlist[8]
Definition PadReadOut.h:52
void reset()
ubit16 m_padID
Definition PadReadOut.h:53
void decodeBytestream()
void makeFragment()

◆ ~PadReadOut()

PadReadOut::~PadReadOut ( )

Definition at line 29 of file PadReadOut.cxx.

29{} // end-of-PadReadOut::PadReadOut

Member Function Documentation

◆ bytestream()

void PadReadOut::bytestream ( std::ostream & stream)

Definition at line 167 of file PadReadOut.cxx.

167 {
168 stream << hex << m_Header << dec << endl; // header
169 for (ubit16 i = 0; i < m_numberOfCMFragments; i++) {
170 m_CMAFragment[i]->bytestream(stream); // body
171 } // end-of-for(ubit16 i
172 stream << hex << m_Footer << dec << endl; // footer
173} // end-of-MatrixReadOut::bytestream
MatrixReadOut * m_CMAFragment[8]
Definition PadReadOut.h:55
ubit16 m_Header
Definition PadReadOut.h:54
ubit16 m_Footer
Definition PadReadOut.h:56
ubit16 m_numberOfCMFragments
Definition PadReadOut.h:41

◆ decodeBytestream()

void PadReadOut::decodeBytestream ( )

Definition at line 175 of file PadReadOut.cxx.

175 {
176 PadReadOutStructure PROS;
177 char field;
178 ubit16 inputData;
179 //
180 ubit16 padHeaderfound = 0;
181 //
182 topPADBody();
183 for (ubit16 i = 0; i < m_numberOfWordsInFragment; i++) {
184 inputData = readPADWord();
185 // cout<<" bytestream: current word is "<<hex<<inputData<<dec<<endl;
186
187 if (!padHeaderfound) {
188 PROS.decodeFragment(inputData, field);
189 if (PROS.isHeader()) {
190 padHeaderfound += 1;
191 // cout<<" decodeBytestream: PAD Header Found"<<endl;
192 }
193 } else {
194 }
195
196 } // end-of-for(i
197} // end-of-decodeBytestream
ubit16 decodeFragment(ubit16 inputWord, char &field)
ubit16 m_numberOfWordsInFragment
Definition PadReadOut.h:42
ubit16 readPADWord()

◆ getFooter()

PadReadOutStructure PadReadOut::getFooter ( )

Definition at line 204 of file PadReadOut.cxx.

204 {
205 PadReadOutStructure theStruct(m_Footer);
206 return theStruct;
207} // end-of-PadReadOut::getFooter

◆ getHeader()

PadReadOutStructure PadReadOut::getHeader ( )

Definition at line 199 of file PadReadOut.cxx.

199 {
200 PadReadOutStructure theStruct(m_Header);
201 return theStruct;
202} // end-of-PadReadOut::getHeader

◆ makeBody()

void PadReadOut::makeBody ( bool debugPrint = false)

Definition at line 74 of file PadReadOut.cxx.

74 {
75 MatrixReadOut *CMAFragment[8] = {0};
76 MatrixReadOutStructure MROS;
77 ubit16 numberOfCMBodyWords = 0;
78 ubit16 i;
79 if (debugPrint) cout << " makeBody " << endl;
80
81 for (i = 0; i < 8; i++) {
82 if (m_MROlist[i]) {
83 if (debugPrint) cout << m_MROlist[i] << endl;
84 MROS = m_MROlist[i]->getHeader();
85 numberOfCMBodyWords = m_MROlist[i]->numberOfBodyWords();
86 ubit16 cmid = MROS.cmid();
87 if (debugPrint)
88 cout << " Identificatore di questa Matrice e': " << cmid << endl
89 << " il numnero di Body words = " << numberOfCMBodyWords << endl;
90 if (cmid < 8) {
91 if (!CMAFragment[cmid]) {
92 CMAFragment[cmid] = m_MROlist[i];
93 } else {
94 if (debugPrint) cout << " PadReadOut::makeBody: more than one CMA with address " << cmid << endl;
95 }
96 if (debugPrint) cout << " Matrix: " << hex << m_MROlist[i]->readHeader() << dec << endl;
97 } else {
98 if (debugPrint) cout << " PadReadOut::makeBody: cmid address " << cmid << " is bad " << endl;
99 } // end-of-if(cmid<8
100 } // end-of-if(m_MROlist
101 } // end-of-while
102 //
103 // copy CMAFragment to the array data member m_CMAFragment
104 //
105 ubit16 j = 0;
106 for (i = 0; i < 8; i++) {
107 if (CMAFragment[i]) {
108 m_CMAFragment[j] = CMAFragment[i];
109 if (debugPrint) cout << " makeBody; number of CM WOrds=" << m_CMAFragment[j]->numberOfFragmentWords() << endl;
110 m_numberOfWordsInFragment += m_CMAFragment[j]->numberOfFragmentWords();
111 j++;
112 } // end-of-if(
113 } // end-of-for(i
115 if (debugPrint) cout << " Number of CMA Fragments= " << m_numberOfCMFragments << endl;
116} // end-of-PadReadOut::makeBody

◆ makeFooter()

void PadReadOut::makeFooter ( )

Definition at line 67 of file PadReadOut.cxx.

67 {
68 ubit16 errorCodes[6] = {0, 0, 0, 0, 0, 0};
69 // m_Footer = m_PROS.makeFooter(0);
70 m_Footer = m_PROS.makeFooter(errorCodes);
72} // end-of-PadReadOut::makeFooter()
PadReadOutStructure m_PROS
Definition PadReadOut.h:51

◆ makeFragment()

void PadReadOut::makeFragment ( )

Definition at line 51 of file PadReadOut.cxx.

51 {
52 makeHeader();
53 makeBody();
54 makeFooter();
55} // end-of-PadReadOut::makeFragment
void makeFooter()
void makeHeader()
void makeBody(bool debugPrint=false)

◆ makeHeader()

void PadReadOut::makeHeader ( )

Definition at line 57 of file PadReadOut.cxx.

57 {
58 ubit16 headerval[3];
59 headerval[0] = 0;
60 headerval[1] = m_padID;
61 headerval[2] = 0; // Status bits (to be defined yet)
62 m_Header = m_PROS.makeHeader(headerval);
64 // cout<<" Header: "<<hex<<m_Header<<dec<<endl;
65} // end-of-PadReadOut::makeHeader()

◆ name()

const std::string & BaseObject::name ( ) const
inlineinherited

Definition at line 23 of file BaseObject.h.

23{ return m_name; }
std::string m_name
Definition BaseObject.h:16

◆ numberOfCMROFragments()

ubit16 PadReadOut::numberOfCMROFragments ( )
inline

Definition at line 30 of file PadReadOut.h.

30{ return m_numberOfCMFragments; };

◆ numberOfFragmentWords()

ubit16 PadReadOut::numberOfFragmentWords ( )
inline

Definition at line 29 of file PadReadOut.h.

◆ Print()

◆ readBody()

ubit16 PadReadOut::readBody ( )

Definition at line 122 of file PadReadOut.cxx.

122 {
123 ubit16 output = 0xffff;
124
125 // cout<<" m_newCMIndex "<<m_newCMIndex
126 // <<" m_newCMRO "<<m_newCMRO
127 // <<" m_numberOfWordsInCMRO "<<m_numberOfWordsInCMRO
128 // <<" m_numberOfWordsRead "<<m_numberOfWordsRead
129 // <<" m_endOfCMFragments "<<m_endOfCMFragments<<endl;
130
131 if (m_newCMRO) {
132 if (m_newCMIndex < 8) {
135 m_currentCMRO->topCMABody();
136 m_numberOfWordsInCMRO = m_currentCMRO->numberOfFragmentWords();
138 m_newCMRO = 0;
139 } // end
140 m_newCMIndex++;
141 } else {
143 } // end
144
145 } // end-of-if(m_newCMRO
146 //
147 if (!m_endOfCMFragments) {
148 output = m_currentCMRO->readCMAWord();
151 } // end-of-if(!m_endOfCMFragments
152 return output;
153} // end-of-PadReadOut::readBody()
ubit16 m_newCMIndex
Definition PadReadOut.h:43
MatrixReadOut * m_currentCMRO
Definition PadReadOut.h:48
ubit16 m_newCMRO
Definition PadReadOut.h:44
ubit16 m_numberOfWordsRead
Definition PadReadOut.h:45
ubit16 m_endOfCMFragments
Definition PadReadOut.h:47
ubit16 m_numberOfWordsInCMRO
Definition PadReadOut.h:46
output
Definition merge.py:16

◆ readFooter()

ubit16 PadReadOut::readFooter ( )

Definition at line 120 of file PadReadOut.cxx.

120{ return m_Footer; } // end-of-PadReadOut::readFooter()

◆ readHeader()

ubit16 PadReadOut::readHeader ( )

Definition at line 118 of file PadReadOut.cxx.

118{ return m_Header; } // end-of-PadReadOut::readHeader()

◆ readPADWord()

ubit16 PadReadOut::readPADWord ( )

Definition at line 155 of file PadReadOut.cxx.

155 {
156 ubit16 output = 0xffff;
157 if (m_addressOfWordScanned == 0)
158 output = readHeader();
160 output = readFooter();
161 else
162 output = readBody();
164 return output;
165} // end-of-PadReadOut::readPADWord
ubit16 m_addressOfWordScanned
Definition PadReadOut.h:40
ubit16 readFooter()
ubit16 readHeader()
ubit16 readBody()

◆ reset()

void PadReadOut::reset ( )

Definition at line 31 of file PadReadOut.cxx.

31 {
32 m_Header = 0x0000;
33 m_Footer = 0x0000;
34 for (ubit16 i = 0; i < 8; i++) { m_CMAFragment[i] = 0; }
37 //
38 topPADBody();
39} // end-of-PadReadOut::reset

◆ tag()

ObjectType BaseObject::tag ( ) const
inlineinherited

Definition at line 22 of file BaseObject.h.

22{ return m_tag; }
ObjectType m_tag
Definition BaseObject.h:15

◆ topPADBody()

void PadReadOut::topPADBody ( )

Definition at line 41 of file PadReadOut.cxx.

41 {
43 m_newCMIndex = 0;
44 m_newCMRO = 1;
48 m_currentCMRO = 0;
49} // end-of-PadReadOut::topPADBody

Member Data Documentation

◆ m_addressOfWordScanned

ubit16 PadReadOut::m_addressOfWordScanned
private

Definition at line 40 of file PadReadOut.h.

◆ m_CMAFragment

MatrixReadOut* PadReadOut::m_CMAFragment[8]
private

Definition at line 55 of file PadReadOut.h.

◆ m_currentCMRO

MatrixReadOut* PadReadOut::m_currentCMRO
private

Definition at line 48 of file PadReadOut.h.

◆ m_endOfCMFragments

ubit16 PadReadOut::m_endOfCMFragments
private

Definition at line 47 of file PadReadOut.h.

◆ m_Footer

ubit16 PadReadOut::m_Footer
private

Definition at line 56 of file PadReadOut.h.

◆ m_Header

ubit16 PadReadOut::m_Header
private

Definition at line 54 of file PadReadOut.h.

◆ m_MROlist

MatrixReadOut* PadReadOut::m_MROlist[8]
private

Definition at line 52 of file PadReadOut.h.

◆ m_name

std::string BaseObject::m_name
privateinherited

Definition at line 16 of file BaseObject.h.

◆ m_newCMIndex

ubit16 PadReadOut::m_newCMIndex
private

Definition at line 43 of file PadReadOut.h.

◆ m_newCMRO

ubit16 PadReadOut::m_newCMRO
private

Definition at line 44 of file PadReadOut.h.

◆ m_numberOfCMFragments

ubit16 PadReadOut::m_numberOfCMFragments
private

Definition at line 41 of file PadReadOut.h.

◆ m_numberOfWordsInCMRO

ubit16 PadReadOut::m_numberOfWordsInCMRO
private

Definition at line 46 of file PadReadOut.h.

◆ m_numberOfWordsInFragment

ubit16 PadReadOut::m_numberOfWordsInFragment
private

Definition at line 42 of file PadReadOut.h.

◆ m_numberOfWordsRead

ubit16 PadReadOut::m_numberOfWordsRead
private

Definition at line 45 of file PadReadOut.h.

◆ m_padID

ubit16 PadReadOut::m_padID
private

Definition at line 53 of file PadReadOut.h.

◆ m_PROS

PadReadOutStructure PadReadOut::m_PROS
private

Definition at line 51 of file PadReadOut.h.

◆ m_tag

ObjectType BaseObject::m_tag
privateinherited

Definition at line 15 of file BaseObject.h.


The documentation for this class was generated from the following files: