ATLAS Offline Software
Loading...
Searching...
No Matches
ROIB::CTPResult Class Reference

Class holding the LVL1 CTP result used by the RoIBuilder. More...

#include <CTPResult.h>

Collaboration diagram for ROIB::CTPResult:

Public Member Functions

 CTPResult ()
 default constructor: empty object
 CTPResult (unsigned int ctpVersion, Header &&, Trailer &&, std::vector< CTPRoI > &&)
 full constructor with CTP version, header, trailer and vector of data
 CTPResult (unsigned int ctpVersion, Header &&, Trailer &&, const std::vector< uint32_t > &)
 full constructor with CTP version, header, trailer and vector of data
bool isValid () const
 returns true if header and trailer exist, data can be empty
bool isComplete () const
 returns true if object isValid() and data has the expected length
const Headerheader () const
 return header
const Trailertrailer () const
 return trailer
const std::vector< CTPRoI > & roIVec () const
 return the RoI vector *‍/
const std::vector< CTPRoITBP () const
 get trigger result before prescale
const std::vector< CTPRoITAP () const
 get trigger result after prescale
const std::vector< CTPRoITAV () const
 get trigger result after veto
bool acceptBP () const
 get trigger accept before prescale
bool acceptAP () const
 get trigger accept after prescale
bool acceptAV () const
 get trigger accept after veto
bool accept () 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 format to string
void dumpData () const
 print object content to default message stream
void dumpData (MsgStream &) const
 print object content to given message stream

Private Member Functions

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

Private Attributes

Header m_CTPResultHeader
 header fragment in LVL1 eformat
Trailer m_CTPResultTrailer
 trailer fragment in LVL1 eformat
std::vector< CTPRoIm_CTPResultRoIVec
 raw data content (RoIs)
CTPdataformatVersion m_ctpDataformat
bool m_useRoIB
unsigned int m_l1aBunch

Detailed Description

Class holding the LVL1 CTP result used by the RoIBuilder.

   CTPResult holds the LVL1 CTP information (one bunch 
   crossing only)send from the CTP hardware to the RoIBuilder. 
   This is the trigger result for each item before prescale, 
   after prescale and after veto. 

   CTPResult is the CTP part of the L1 RDO (ROIB::RoIBResult).
See also
ROIB::Header
ROIB::Trailer
ROIB::CTPRoI
ROIB::RoIBResult
Author
Thomas Schoerner-Sadenius thoma.nosp@m.s.sc.nosp@m.hoern.nosp@m.er@c.nosp@m.ern.c.nosp@m.h
Wolfgang Ehrenfeld wolfg.nosp@m.ang..nosp@m.ehren.nosp@m.feld.nosp@m.@cern.nosp@m..ch
Version
$Id: CTPResult.h,v 1.12 2009-01-06 21:46:55 ssnyder Exp $

Definition at line 52 of file Trigger/TrigT1/TrigT1Result/TrigT1Result/CTPResult.h.

Constructor & Destructor Documentation

◆ CTPResult() [1/3]

ROIB::CTPResult::CTPResult ( )
inline

◆ CTPResult() [2/3]

ROIB::CTPResult::CTPResult ( unsigned int ctpVersion,
Header && head,
Trailer && trail,
std::vector< CTPRoI > && rois )

full constructor with CTP version, header, trailer and vector of data

Definition at line 27 of file CTPResult.cxx.

27 :
28 m_CTPResultHeader( std::move(head) ),
29 m_CTPResultTrailer( std::move(trail) ),
30 m_CTPResultRoIVec( std::move(rois) ),
31 //m_ctpVersionNumber( ctpVersion ),
32 m_ctpDataformat( ctpVersion ),
33 m_useRoIB(false),
34 m_l1aBunch(0)
35 {
36 m_useRoIB = (m_CTPResultHeader.sourceID() == 0x770001);
37 if (!m_useRoIB) m_l1aBunch = (m_CTPResultHeader.formatVersion() >> m_ctpDataformat.getL1APositionShift()) & m_ctpDataformat.getL1APositionMask();
38 }
Trailer m_CTPResultTrailer
trailer fragment in LVL1 eformat
std::vector< CTPRoI > m_CTPResultRoIVec
raw data content (RoIs)
Header m_CTPResultHeader
header fragment in LVL1 eformat
std::string head(std::string s, const std::string &pattern)
head of a string

◆ CTPResult() [3/3]

ROIB::CTPResult::CTPResult ( unsigned int ctpVersion,
Header && head,
Trailer && trail,
const std::vector< uint32_t > & v )

full constructor with CTP version, header, trailer and vector of data

Definition at line 41 of file CTPResult.cxx.

41 :
42 m_CTPResultHeader( std::move(head) ),
43 m_CTPResultTrailer( std::move(trail) ),
44 //m_ctpVersionNumber( ctpVersion ),
45 m_ctpDataformat( ctpVersion ),
46 m_useRoIB(false),
47 m_l1aBunch(0)
48 {
49 m_useRoIB = (m_CTPResultHeader.sourceID() == 0x770001);
50
51 std::copy(v.begin(), v.end(), back_inserter(m_CTPResultRoIVec));
52 if (!m_useRoIB) m_l1aBunch = (m_CTPResultHeader.formatVersion() >> m_ctpDataformat.getL1APositionShift()) & m_ctpDataformat.getL1APositionMask();
53 }

Member Function Documentation

◆ accept()

bool ROIB::CTPResult::accept ( ) const
inline

get standard trigger accept

Definition at line 102 of file Trigger/TrigT1/TrigT1Result/TrigT1Result/CTPResult.h.

102{ return acceptAV(); }
bool acceptAV() const
get trigger accept after veto

◆ acceptAP()

bool ROIB::CTPResult::acceptAP ( ) const

get trigger accept after prescale

◆ acceptAV()

bool ROIB::CTPResult::acceptAV ( ) const

get trigger accept after veto

◆ acceptBP()

bool ROIB::CTPResult::acceptBP ( ) const

get trigger accept before prescale

◆ convert()

const std::string ROIB::CTPResult::convert ( const std::vector< CTPRoI > & data,
const bool longFormat = false ) const
private

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

Definition at line 84 of file CTPResult.cxx.

85 {
86 std::ostringstream s;
87
88 // time
89 for (size_t i(0); (i < m_ctpDataformat.getNumberTimeWords()) && (i < data.size()); ++i) {
90 if (longFormat) s << "\n";
91 if (i == 0 || longFormat) s << " Time";
92 if (longFormat) s << std::setw(1) << i;
93 s << " " << std::setw(8) << data[i].roIWord();
94 if (longFormat) s << std::endl;
95 }
96
97 // TIP
98 for (size_t i(0), p((m_useRoIB) ? m_ctpDataformat.getTIPpos():m_l1aBunch*m_ctpDataformat.getDAQwordsPerBunch()+m_ctpDataformat.getTIPpos());
99 (i < ((m_useRoIB) ? m_ctpDataformat.getRoIBTIPwords():m_ctpDataformat.getTIPwords())) && (p < data.size());
100 ++i, ++p) {
101 if (longFormat) s << "\n";
102 if (i == 0 || longFormat) s << " TIP";
103 if (longFormat) s << std::setw(1) << i;
104 s << LVL1CTP::convertToHex(data[p].roIWord());
105 if (longFormat) s << std::endl;
106 }
107
108 // FPI
109 // for (size_t i(0), p(m_ctpDataformat.getFPIpos());
110 // (i < m_ctpDataformat.getFPIwords()) && (p < data.size());
111 // ++i, ++p) {
112 // if (longFormat) s << "\n";
113 // if (i == 0 || longFormat) s << " FPI";
114 // if (longFormat) s << std::setw(1) << i;
115 // s << LVL1CTP::convertToHex(data[p].roIWord());
116 // if (longFormat) s << std::endl;
117 // }
118
119 // TBP
120 for (size_t i(0), p(((m_useRoIB) ? m_ctpDataformat.getRoIBTBPpos():m_l1aBunch*m_ctpDataformat.getDAQwordsPerBunch()+m_ctpDataformat.getTBPpos()));
121 (i < m_ctpDataformat.getTBPwords()) && (p < data.size());
122 ++i, ++p) {
123 if (longFormat) s << "\n";
124 if (i == 0 || longFormat) s << " TBP";
125 if (longFormat) s << std::setw(1) << i;
126 s << LVL1CTP::convertToHex(data[p].roIWord());
127 if (longFormat) s << std::endl;
128 }
129
130 // TAP
131 for (size_t i(0), p((m_useRoIB) ? m_ctpDataformat.getTAPpos():m_l1aBunch*m_ctpDataformat.getDAQwordsPerBunch()+m_ctpDataformat.getTAPpos());
132 (i < ((m_useRoIB) ? m_ctpDataformat.getRoIBTAPwords():m_ctpDataformat.getTAPwords())) && (p < data.size());
133 ++i, ++p) {
134 if (longFormat) s << "\n";
135 if (i == 0 || longFormat) s << " TAP";
136 if (longFormat) s << std::setw(1) << i;
137 s << LVL1CTP::convertToHex(data[p].roIWord());
138 if (longFormat) s << std::endl;
139 }
140
141 // TAV
142 for (size_t i(0), p(((m_useRoIB) ? m_ctpDataformat.getRoIBTAVpos():m_l1aBunch*m_ctpDataformat.getDAQwordsPerBunch()+m_ctpDataformat.getTAVpos()));
143 (i < m_ctpDataformat.getTAVwords()) && (p < data.size());
144 ++i, ++p) {
145 if (longFormat) s << "\n";
146 if (i == 0 || longFormat) s << " TAV";
147 if (longFormat) s << std::setw(1) << i;
148 s << LVL1CTP::convertToHex(data[p].roIWord());
149 if (longFormat) s << std::endl;
150 }
151
152 return s.str();
153 }
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
const std::string convertToHex(const uint32_t word)
helper function to dump a number in hex format

◆ dump()

const std::string ROIB::CTPResult::dump ( ) const

dump raw object content to string

method used for read/write testing and T/P separation

Definition at line 56 of file CTPResult.cxx.

57 {
58 std::ostringstream s;
59
60 s << " [" << this->header().dump() << "] ";
61 s << " [";
62 for (std::vector<CTPRoI>::size_type i(0); i < roIVec().size(); ++i) {
63 s << LVL1CTP::convertToHex(roIVec()[i].roIWord());
64 }
65 s << "] ";
66 s << " [" << this->trailer().dump() << "] ";
67
68 return s.str();
69 }
const Header & header() const
return header
const std::vector< CTPRoI > & roIVec() const
return the RoI vector *‍/
const Trailer & trailer() const
return trailer
const std::string dump() const
dump raw object content to string
const std::string dump() const
dump raw object content to string
Definition Trailer.cxx:45

◆ dumpData() [1/2]

void ROIB::CTPResult::dumpData ( ) const

print object content to default message stream

Definition at line 156 of file CTPResult.cxx.

157 {
158 SmartIF<IMessageSvc> msgSvc{Gaudi::svcLocator()->service("MessageSvc")};
159 if ( !msgSvc ) {
160 return;
161 }
162 MsgStream log(msgSvc, "CTPResult");
163 dumpData(log);
164 }
void dumpData() const
print object content to default message stream
msgSvc
Provide convenience handles for various services.
Definition StdJOSetup.py:36

◆ dumpData() [2/2]

void ROIB::CTPResult::dumpData ( MsgStream & log) const

print object content to given message stream

Definition at line 166 of file CTPResult.cxx.

167 {
168 log << MSG::DEBUG << "*BEGIN* CTPResult" << endmsg;
169 m_CTPResultHeader.dumpData(log);
170 int counter = 0;
171 std::vector< CTPRoI >::const_iterator it = m_CTPResultRoIVec.begin();
172 for(; it != m_CTPResultRoIVec.end(); ++it,++counter) {
173 log << MSG::DEBUG << "RoI word[" << counter << "] : 0x"
174 << MSG::hex << it->roIWord() << MSG::dec << endmsg;
175 }
176 m_CTPResultTrailer.dumpData(log);
177 log << MSG::DEBUG << "*END* CTPResult" << endmsg;
178 }
#define endmsg

◆ header()

const Header & ROIB::CTPResult::header ( ) const

return header

◆ isComplete()

bool ROIB::CTPResult::isComplete ( ) const

returns true if object isValid() and data has the expected length

◆ isValid()

bool ROIB::CTPResult::isValid ( ) const

returns true if header and trailer exist, data can be empty

◆ print()

const std::string ROIB::CTPResult::print ( const bool longFormat = false) const

print object content in a human readable format to string

Definition at line 71 of file CTPResult.cxx.

72 {
73 std::ostringstream s;
74
75 s << "header [" << this->header().print(longFormat) << "] ";
76 if (longFormat) s << std::endl;
77 s << "data [" << convert(this->roIVec(), longFormat) << "] ";
78 if (longFormat) s << std::endl;
79 s << "trailer [" << this->trailer().print(longFormat) << "] ";
80
81 return s.str();
82 }
const std::string convert(const std::vector< CTPRoI > &data, const bool longFormat=false) const
convert data content into string (used by dump and print)
Definition CTPResult.cxx:84
const std::string print(const bool longFormat=false) const
print object content in a human readable format to string
const std::string print(const bool longFormat=false) const
print object content in a human readable format to string
Definition Trailer.cxx:56

◆ roIVec()

const std::vector< CTPRoI > & ROIB::CTPResult::roIVec ( ) const

return the RoI vector *‍/

◆ TAP()

const std::vector< CTPRoI > ROIB::CTPResult::TAP ( ) const

get trigger result after prescale

◆ TAV()

const std::vector< CTPRoI > ROIB::CTPResult::TAV ( ) const

get trigger result after veto

◆ TBP()

const std::vector< CTPRoI > ROIB::CTPResult::TBP ( ) const

get trigger result before prescale

◆ trailer()

const Trailer & ROIB::CTPResult::trailer ( ) const

return trailer

Member Data Documentation

◆ m_ctpDataformat

CTPdataformatVersion ROIB::CTPResult::m_ctpDataformat
private

◆ m_CTPResultHeader

Header ROIB::CTPResult::m_CTPResultHeader
private

header fragment in LVL1 eformat

Definition at line 120 of file Trigger/TrigT1/TrigT1Result/TrigT1Result/CTPResult.h.

◆ m_CTPResultRoIVec

std::vector<CTPRoI> ROIB::CTPResult::m_CTPResultRoIVec
private

raw data content (RoIs)

Definition at line 122 of file Trigger/TrigT1/TrigT1Result/TrigT1Result/CTPResult.h.

◆ m_CTPResultTrailer

Trailer ROIB::CTPResult::m_CTPResultTrailer
private

trailer fragment in LVL1 eformat

Definition at line 121 of file Trigger/TrigT1/TrigT1Result/TrigT1Result/CTPResult.h.

◆ m_l1aBunch

unsigned int ROIB::CTPResult::m_l1aBunch
private

◆ m_useRoIB

bool ROIB::CTPResult::m_useRoIB
private

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