ATLAS Offline Software
Loading...
Searching...
No Matches
LVL1CTP::CTPSLink Class Reference

CTP RoI output. More...

#include <CTPSLink.h>

Collaboration diagram for LVL1CTP::CTPSLink:

Public Member Functions

 CTPSLink (const std::vector< uint32_t > &roiVec, unsigned int ctpVersionNumber)
 constructor initializing data content from given vector
 ~CTPSLink ()
 empty default destructor
 CTPSLink (CTPSLink const &)=delete
CTPSLinkoperator= (CTPSLink const &)=delete
unsigned int getHeaderSize () const
 number of words in header
unsigned int getTrailerSize () const
 number of words in trailer
unsigned int getDataElementSize () const
 number of words in data
unsigned int getSize () const
 toal number of words in object
unsigned int getCTPVersionNumber () const
 retrieve CTP version number
const std::vector< uint32_t > getHeader () const
 get raw header content
const std::vector< uint32_t > getTrailer () const
 get raw trailer content
const std::vector< uint32_t > getDataElements () const
 get raw data content
const std::vector< uint32_t > & getCTPToRoIBWords () const
 get full raw data content
const std::vector< uint32_t > getTBP () const
 get trigger result before prescale
const std::vector< uint32_t > getTAP () const
 get trigger result after prescale
const std::vector< uint32_t > getTAV () const
 get trigger result after veto
bool getAcceptBP () const
 get trigger accept before prescale
bool getAcceptAP () const
 get trigger accept after prescale
bool getAcceptAV () const
 get trigger accept after veto
bool getAccept () const
 get standard trigger accept
const std::string dump () const
 dump raw object content to string
const std::string print (const bool longFormat=false) const
 print object content in a human readable form to string
unsigned int getNumWordsPerCTPSLink () const

Private Member Functions

const std::string convert (const std::vector< uint32_t > &data, const bool longFormat=false) const
 convert data contetn into string (used by dump and print)

Private Attributes

const std::vector< uint32_t > m_CTPSLinkVector
 this vector contains the header, data elements and trailer
unsigned int m_ctpVersionNumber
CTPdataformatVersion * m_ctpVersion
unsigned int m_wordsPerHeader
 number of words per header
unsigned int m_wordsPerDataElement
 number of words per data element
unsigned int m_wordsPerTrailer
 number of words per trailer
unsigned int m_wordsPerCTPSLink
 number of words per CTPSLink

Detailed Description

CTP RoI output.

   Class used to send the RoI data from the CTP simulation to
   the RoIB simulation. It models the SLink connection.

   One vector is used to store the header, data elements and
   trailer.

   This class represents a cable connection between CTP and 
   RoIBuilder and is only used in the simulation!
See also
LVL1CTP::CTPSimulation
ROIB::RoIBuilder
Author
Thomas Schoerner-Sadenius thoma.nosp@m.s.sc.nosp@m.hoern.nosp@m.er@c.nosp@m.ern.c.nosp@m.h
Attila Krasznahorkay Attil.nosp@m.a.Kr.nosp@m.aszna.nosp@m.hork.nosp@m.ay@ce.nosp@m.rn.c.nosp@m.h
Revision
707787
Date
2015-11-13 16:09:29 +0100 (Fri, 13 Nov 2015)

Definition at line 42 of file CTPSLink.h.

Constructor & Destructor Documentation

◆ CTPSLink() [1/2]

LVL1CTP::CTPSLink::CTPSLink ( const std::vector< uint32_t > & roiVec,
unsigned int ctpVersionNumber )

constructor initializing data content from given vector

Definition at line 20 of file CTPSLink.cxx.

21 : m_CTPSLinkVector( roiVec ), m_ctpVersionNumber(ctpVersionNumber),
23 {
24 m_ctpVersion = new CTPdataformatVersion(m_ctpVersionNumber);
25 const uint32_t numExtraWords = (m_CTPSLinkVector[2] >> m_ctpVersion->getProgrammableExtraWordsShift()) & m_ctpVersion->getProgrammableExtraWordsMask();
26 m_wordsPerCTPSLink = m_ctpVersion->getNumberTimeWords() + m_ctpVersion->getDAQwordsPerBunch() + numExtraWords;
27
29 if (m_CTPSLinkVector.size() > (m_wordsPerHeader+3)) {
32 }
33
34 if (m_wordsPerHeader == 0 ||
35 m_wordsPerTrailer == 0 ||
37 std::cout << "Warning: CTPSLink inconsistency! " << std::endl;
38 }
39 }
setEventNumber uint32_t

◆ ~CTPSLink()

LVL1CTP::CTPSLink::~CTPSLink ( )

empty default destructor

Definition at line 41 of file CTPSLink.cxx.

41 {
42 if(m_ctpVersion) delete m_ctpVersion;
43 m_ctpVersion = NULL;
44
45 }

◆ CTPSLink() [2/2]

LVL1CTP::CTPSLink::CTPSLink ( CTPSLink const & )
delete

Member Function Documentation

◆ convert()

const std::string LVL1CTP::CTPSLink::convert ( const std::vector< uint32_t > & data,
const bool longFormat = false ) const
private

convert data contetn into string (used by dump and print)

Definition at line 215 of file CTPSLink.cxx.

216 {
217 std::ostringstream s;
218
219 // time
220 for (size_t i(0); (i < m_ctpVersion->getNumberTimeWords()) && (i < data.size()); ++i) {
221 if (i == 0 || longFormat) s << "\nTime";
222 if (longFormat) s << std::setw(1) << i;
223 s << " " << std::setw(8) << data[i];
224 if (longFormat) s << std::endl;
225 }
226
227 // TIP
228 for (size_t i(0), p(m_ctpVersion->getTIPpos());
229 (i < m_ctpVersion->getTIPwords()) && (p < data.size());
230 ++i, ++p) {
231 if (i == 0 || longFormat) s << "\nTIP";
232 if (longFormat) s << std::setw(1) << i;
233 s << " 0x" << std::hex << std::setw(8) << std::setfill( '0' ) << data[p] << std::dec << std::setfill(' ');
234 if (longFormat) s << std::endl;
235 }
236
237 // FPI
238 //for (size_t i(0), p(m_ctpVersion->getFPIpos());
239// (i < m_ctpVersion->getFPIwords()) && (p < data.size());
240// ++i, ++p) {
241// if (i == 0 || longFormat) s << "\nFPI";
242// if (longFormat) s << std::setw(1) << i;
243// s << " 0x" << std::hex << std::setw(8) << std::setfill( '0' ) << data[p] << std::dec << std::setfill(' ');
244// if (longFormat) s << std::endl;
245// }
246
247 // TBP
248 for (size_t i(0), p(m_ctpVersion->getTBPpos());
249 (i < m_ctpVersion->getTBPwords()) && (p < data.size());
250 ++i, ++p) {
251 if (i == 0 || longFormat) s << "\nTBP";
252 if (longFormat) s << std::setw(1) << i;
253 s << " 0x" << std::hex << std::setw(8) << std::setfill( '0' ) << data[p] << std::dec << std::setfill(' ');
254 if (longFormat) s << std::endl;
255 }
256
257 // TAP
258 for (size_t i(0), p(m_ctpVersion->getTAPpos());
259 (i < m_ctpVersion->getTAPwords()) && (p < data.size());
260 ++i, ++p) {
261 if (i == 0 || longFormat) s << "\nTAP";
262 if (longFormat) s << std::setw(1) << i;
263 s << " 0x" << std::hex << std::setw(8) << std::setfill( '0' ) << data[p] << std::dec << std::setfill(' ');
264 if (longFormat) s << std::endl;
265 }
266
267 // TAV
268 for (size_t i(0), p(m_ctpVersion->getTAVpos());
269 (i < m_ctpVersion->getTAVwords()) && (p < data.size());
270 ++i, ++p) {
271 if (i == 0 || longFormat) s << "\nTAV";
272 if (longFormat) s << std::setw(1) << i;
273 s << " 0x" << std::hex << std::setw(8) << std::setfill( '0' ) << data[p] << std::dec << std::setfill(' ');
274 if (longFormat) s << std::endl;
275 }
276
277 return s.str();
278 }
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11

◆ dump()

const std::string LVL1CTP::CTPSLink::dump ( ) const

dump raw object content to string

Definition at line 192 of file CTPSLink.cxx.

193 {
194 std::ostringstream s;
195
196
197 s << "CTPSLink: header [" << LVL1CTP::convertToHex(this->getHeader()) << "]" << std::endl;
198 s << "CTPSLink: data [" << LVL1CTP::convertToHex(this->getDataElements()) << "]" << std::endl;
199 s << "CTPSLink: trailer [" << LVL1CTP::convertToHex(this->getTrailer()) << "]";
200
201 return s.str();
202 }
const std::string convertToHex(const uint32_t word)
helper function to dump a number in hex format

◆ getAccept()

bool LVL1CTP::CTPSLink::getAccept ( ) const
inline

get standard trigger accept

Definition at line 97 of file CTPSLink.h.

97{ return getAcceptAV(); }

◆ getAcceptAP()

bool LVL1CTP::CTPSLink::getAcceptAP ( ) const

get trigger accept after prescale

Definition at line 169 of file CTPSLink.cxx.

170 {
171 const std::vector<uint32_t> result(this->getTAP());
172
173 for (size_t i(0); i < result.size(); ++i) {
174 if (result[i] > 0) return true;
175 }
176
177 return false;
178 }

◆ getAcceptAV()

bool LVL1CTP::CTPSLink::getAcceptAV ( ) const

get trigger accept after veto

Definition at line 180 of file CTPSLink.cxx.

181 {
182 const std::vector<uint32_t> result(this->getTAV());
183
184 for (size_t i(0); i < result.size(); ++i) {
185 if (result[i] > 0) return true;
186 }
187
188 return false;
189 }

◆ getAcceptBP()

bool LVL1CTP::CTPSLink::getAcceptBP ( ) const

get trigger accept before prescale

Definition at line 158 of file CTPSLink.cxx.

159 {
160 const std::vector<uint32_t> result(this->getTBP());
161
162 for (size_t i(0); i < result.size(); ++i) {
163 if (result[i] > 0) return true;
164 }
165
166 return false;
167 }

◆ getCTPToRoIBWords()

const std::vector< uint32_t > & LVL1CTP::CTPSLink::getCTPToRoIBWords ( ) const

get full raw data content

Definition at line 95 of file CTPSLink.cxx.

95 {
96
97 return m_CTPSLinkVector;
98
99 }

◆ getCTPVersionNumber()

unsigned int LVL1CTP::CTPSLink::getCTPVersionNumber ( ) const
inline

retrieve CTP version number

Definition at line 69 of file CTPSLink.h.

69{ return m_ctpVersionNumber;}

◆ getDataElements()

const std::vector< uint32_t > LVL1CTP::CTPSLink::getDataElements ( ) const

get raw data content

Definition at line 101 of file CTPSLink.cxx.

102 {
103 // strip of header and trailer
104 std::vector<uint32_t> dataElements;
105
106 unsigned int start(getHeaderSize());
107 unsigned int end(getSize() - getTrailerSize());
108
109 for (size_t i(start); i < end; ++i) {
110 dataElements.push_back(m_CTPSLinkVector[i]);
111 }
112
113 return dataElements;
114 }

◆ getDataElementSize()

unsigned int LVL1CTP::CTPSLink::getDataElementSize ( ) const

number of words in data

Definition at line 57 of file CTPSLink.cxx.

58 {
60 }

◆ getHeader()

const std::vector< uint32_t > LVL1CTP::CTPSLink::getHeader ( ) const

get raw header content

Definition at line 67 of file CTPSLink.cxx.

68 {
69 std::vector<uint32_t> result;
70
71 unsigned int start(0);
72 unsigned int end(getHeaderSize());
73
74 for (size_t i(start); i < end; ++i) {
75 result.push_back(m_CTPSLinkVector[i]);
76 }
77
78 return result;
79 }

◆ getHeaderSize()

unsigned int LVL1CTP::CTPSLink::getHeaderSize ( ) const

number of words in header

Definition at line 52 of file CTPSLink.cxx.

53 {
54 return m_wordsPerHeader;
55 }

◆ getNumWordsPerCTPSLink()

unsigned int LVL1CTP::CTPSLink::getNumWordsPerCTPSLink ( ) const
inline

Definition at line 108 of file CTPSLink.h.

108{ return m_wordsPerCTPSLink; }

◆ getSize()

unsigned int LVL1CTP::CTPSLink::getSize ( ) const

toal number of words in object

Definition at line 47 of file CTPSLink.cxx.

48 {
49 return m_CTPSLinkVector.size();
50 }

◆ getTAP()

const std::vector< uint32_t > LVL1CTP::CTPSLink::getTAP ( ) const

get trigger result after prescale

Definition at line 130 of file CTPSLink.cxx.

131 {
132 std::vector<uint32_t> result;
133
134 unsigned int start(getHeaderSize()+m_ctpVersion->getTAPpos());
135 unsigned int end(start+m_ctpVersion->getTAPwords());
136
137 for (size_t i(start); i < end; ++i) {
138 result.push_back(m_CTPSLinkVector[i]);
139 }
140
141 return result;
142 }

◆ getTAV()

const std::vector< uint32_t > LVL1CTP::CTPSLink::getTAV ( ) const

get trigger result after veto

Definition at line 144 of file CTPSLink.cxx.

145 {
146 std::vector<uint32_t> result;
147
148 unsigned int start(getHeaderSize()+m_ctpVersion->getTAVpos());
149 unsigned int end(start+m_ctpVersion->getTAVwords());
150
151 for (size_t i(start); i < end; ++i) {
152 result.push_back(m_CTPSLinkVector[i]);
153 }
154
155 return result;
156 }

◆ getTBP()

const std::vector< uint32_t > LVL1CTP::CTPSLink::getTBP ( ) const

get trigger result before prescale

Definition at line 116 of file CTPSLink.cxx.

117 {
118 std::vector<uint32_t> result;
119
120 unsigned int start(getHeaderSize()+m_ctpVersion->getTBPpos());
121 unsigned int end(start+m_ctpVersion->getTBPwords());
122
123 for (size_t i(start); i < end; ++i) {
124 result.push_back(m_CTPSLinkVector[i]);
125 }
126
127 return result;
128 }

◆ getTrailer()

const std::vector< uint32_t > LVL1CTP::CTPSLink::getTrailer ( ) const

get raw trailer content

Definition at line 81 of file CTPSLink.cxx.

82 {
83 std::vector<uint32_t> result;
84
85 unsigned int start(getSize() - getTrailerSize());
86 unsigned int end(getSize());
87
88 for (size_t i(start); i < end; ++i) {
89 result.push_back(m_CTPSLinkVector[i]);
90 }
91
92 return result;
93 }

◆ getTrailerSize()

unsigned int LVL1CTP::CTPSLink::getTrailerSize ( ) const

number of words in trailer

Definition at line 62 of file CTPSLink.cxx.

63 {
64 return m_wordsPerTrailer;
65 }

◆ operator=()

CTPSLink & LVL1CTP::CTPSLink::operator= ( CTPSLink const & )
delete

◆ print()

const std::string LVL1CTP::CTPSLink::print ( const bool longFormat = false) const

print object content in a human readable form to string

Definition at line 204 of file CTPSLink.cxx.

205 {
206 std::ostringstream s;
207
208 s << "CTPSLink: header [" << LVL1CTP::convertToHex(this->getHeader()) << "]" << std::endl;
209 s << "CTPSLink: data content" << convert(this->getDataElements(), longFormat) << std::endl;
210 s << "CTPSLink: trailer: [" << LVL1CTP::convertToHex(this->getTrailer()) << "]";
211
212 return s.str();
213 }

Member Data Documentation

◆ m_CTPSLinkVector

const std::vector<uint32_t> LVL1CTP::CTPSLink::m_CTPSLinkVector
private

this vector contains the header, data elements and trailer

vector of words

Definition at line 113 of file CTPSLink.h.

◆ m_ctpVersion

CTPdataformatVersion* LVL1CTP::CTPSLink::m_ctpVersion
private

Definition at line 116 of file CTPSLink.h.

◆ m_ctpVersionNumber

unsigned int LVL1CTP::CTPSLink::m_ctpVersionNumber
private

Definition at line 115 of file CTPSLink.h.

◆ m_wordsPerCTPSLink

unsigned int LVL1CTP::CTPSLink::m_wordsPerCTPSLink
private

number of words per CTPSLink

Definition at line 121 of file CTPSLink.h.

◆ m_wordsPerDataElement

unsigned int LVL1CTP::CTPSLink::m_wordsPerDataElement
private

number of words per data element

Definition at line 119 of file CTPSLink.h.

◆ m_wordsPerHeader

unsigned int LVL1CTP::CTPSLink::m_wordsPerHeader
private

number of words per header

Definition at line 118 of file CTPSLink.h.

◆ m_wordsPerTrailer

unsigned int LVL1CTP::CTPSLink::m_wordsPerTrailer
private

number of words per trailer

Definition at line 120 of file CTPSLink.h.


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