ATLAS Offline Software
Loading...
Searching...
No Matches
SectorLogicRXReadOut.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7#include <cstring>
8#include <fstream>
9#include <iomanip>
10#include <iostream>
11
13
14using namespace std;
15
16//----------------------------------------------------------------------------//
17SectorLogicRXReadOut::SectorLogicRXReadOut() : BaseObject(Hardware, "SectorLogicRXReadOut") { initialize(); } // end-of-SectorLogicRXReadOut
18
19//----------------------------------------------------------------------------//
21 //
22 // delete the SLRXROData dynamic structure used to describe Body part
23 // of the event fragment.
24 //
26}
27//----------------------------------------------------------------------------//
29 SLRXROData *p, *q;
30 p = m_BodyFirst;
31 while (p) {
32 q = p;
33 p = p->next;
34 delete q;
35 } // end-of-while
36 p = 0;
37 q = 0;
38 m_BodyFirst = 0;
39 m_BodyLast = 0;
40 m_BodyCurr = 0;
42} // end-of-deleteSLBody
43
44//----------------------------------------------------------------------------//
46 //
47 // initialize data members
48 //
49 m_Header = 0;
50 m_SubHeader = 0;
51 m_Footer = 0;
52 //
53 // initialize pointers
54 //
55 m_BodyFirst = 0;
56 m_BodyLast = 0;
57 m_BodyCurr = 0;
58 //
59 // initialize check flags
60 //
63} // end-of-initialize
64//----------------------------------------------------------------------------//
65
67 //
68 // reset the data structure to host a new fragment;
69 // first delete the dinamyc structure...
71 // then initialize the data members.
72 initialize();
73} // end-of-SectorLogicRXReadOut::reset()
74
75//----------------------------------------------------------------------------//
76void SectorLogicRXReadOut::writeRecord(ubit16 thisRecord, bool last) {
77 if (m_numberOfWordsInFrag == 0) {
78 m_Header = thisRecord;
79 } else if (m_numberOfWordsInFrag == 1) {
80 m_SubHeader = thisRecord;
81 } else if (m_numberOfWordsInFrag && !last) {
82 makeNewHit(thisRecord);
83 } else {
84 m_Footer = thisRecord;
85 }
87} // end-of-void SectorLogicRXReadOut
88
89//----------------------------------------------------------------------------//
91 SLRXROData *p;
92 p = new SLRXROData;
93 p->hit = newHit;
94 p->next = 0;
95 if (!m_BodyFirst) {
96 m_BodyFirst = p;
97 } else {
98 m_BodyLast->next = p;
99 } // end-of-if
100 m_BodyLast = p;
101
104
105} // end-of-SectorLogicRXReadOut::makeNewHit
106//----------------------------------------------------------------------------//
108 if (m_BodyCurr) {
109 ubit16 hit = m_BodyCurr->hit;
110 m_BodyCurr = m_BodyCurr->next;
111 return hit;
112 } else {
113 return 0xefac;
114 }
115} // end-of-SectorLogicRXReadOut::readSLHitCurrent
116
117//----------------------------------------------------------------------------//
118void SectorLogicRXReadOut::display(std::ostream &stream) {
119 stream << " **** Sector Logic ReadOut Fragment ****" << std::endl;
120 stream << " SectorLogic: Header " << std::hex << m_Header << std::dec << std::endl;
121 stream << " SectorLogic: SubHeader " << std::hex << m_SubHeader << std::dec << std::endl;
122 for (ubit16 i = 0; i < m_numberOfInputWords; i++) {
123 stream << " SectorLogic: hit " << (i + 1) << " ==> " << std::hex << readSLHitCurrent() << std::dec << std::endl;
124 }
125 stream << " SectorLogic: Footer " << std::hex << m_Footer << std::dec << std::endl;
126} // end-of-void SectorLogicRXReadOut::display
@ Hardware
Definition BaseObject.h:11
unsigned short int ubit16
BaseObject(ObjectType, const std::string &)
Definition BaseObject.cxx:7
void writeRecord(ubit16 thisRecord, bool last)
void display(std::ostream &stream)
void makeNewHit(ubit16 newHit)
STL namespace.