ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | List of all members
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 More...
 
 CTPResult (unsigned int ctpVersion, Header &&, Trailer &&, std::vector< CTPRoI > &&)
 full constructor with CTP version, header, trailer and vector of data More...
 
 CTPResult (unsigned int ctpVersion, Header &&, Trailer &&, const std::vector< uint32_t > &)
 full constructor with CTP version, header, trailer and vector of data More...
 
bool isValid () const
 returns true if header and trailer exist, data can be empty More...
 
bool isComplete () const
 returns true if object isValid() and data has the expected length More...
 
const Headerheader () const
 return header More...
 
const Trailertrailer () const
 return trailer More...
 
const std::vector< CTPRoI > & roIVec () const
 return the RoI vector *‍/ More...
 
const std::vector< CTPRoITBP () const
 get trigger result before prescale More...
 
const std::vector< CTPRoITAP () const
 get trigger result after prescale More...
 
const std::vector< CTPRoITAV () const
 get trigger result after veto More...
 
bool acceptBP () const
 get trigger accept before prescale More...
 
bool acceptAP () const
 get trigger accept after prescale More...
 
bool acceptAV () const
 get trigger accept after veto More...
 
bool accept () const
 get standard trigger accept More...
 
const std::string dump () const
 dump raw object content to string More...
 
const std::string print (const bool longFormat=false) const
 print object content in a human readable format to string More...
 
void dumpData () const
 print object content to default message stream More...
 
void dumpData (MsgStream &) const
 print object content to given message stream More...
 

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) More...
 

Private Attributes

Header m_CTPResultHeader
 header fragment in LVL1 eformat More...
 
Trailer m_CTPResultTrailer
 trailer fragment in LVL1 eformat More...
 
std::vector< CTPRoIm_CTPResultRoIVec
 raw data content (RoIs) More...
 
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 CTPResult.h.

Constructor & Destructor Documentation

◆ CTPResult() [1/3]

ROIB::CTPResult::CTPResult ( )
inline

default constructor: empty object

Definition at line 56 of file CTPResult.h.

56  : m_ctpDataformat(0),
57  m_useRoIB(false),
58  m_l1aBunch(0) {}

◆ 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  }

◆ 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 CTPResult.h.

102 { return acceptAV(); }

◆ 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  }

◆ 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  }

◆ 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  IMessageSvc* msgSvc;
159  ISvcLocator* svcLoc = Gaudi::svcLocator( );
160  StatusCode sc = svcLoc->service( "MessageSvc", msgSvc );
161  if ( sc.isFailure() ) {
162  return;
163  }
164  MsgStream log(msgSvc, "CTPResult");
165  dumpData(log);
166  }

◆ dumpData() [2/2]

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

print object content to given message stream

Definition at line 168 of file CTPResult.cxx.

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

◆ 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  }

◆ 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

Definition at line 126 of file CTPResult.h.

◆ m_CTPResultHeader

Header ROIB::CTPResult::m_CTPResultHeader
private

header fragment in LVL1 eformat

Definition at line 120 of file CTPResult.h.

◆ m_CTPResultRoIVec

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

raw data content (RoIs)

Definition at line 122 of file CTPResult.h.

◆ m_CTPResultTrailer

Trailer ROIB::CTPResult::m_CTPResultTrailer
private

trailer fragment in LVL1 eformat

Definition at line 121 of file CTPResult.h.

◆ m_l1aBunch

unsigned int ROIB::CTPResult::m_l1aBunch
private

Definition at line 135 of file CTPResult.h.

◆ m_useRoIB

bool ROIB::CTPResult::m_useRoIB
private

Definition at line 132 of file CTPResult.h.


The documentation for this class was generated from the following files:
ROIB::Trailer::dumpData
void dumpData() const
print object content to default message stream
Definition: Trailer.cxx:76
ROIB::Header::sourceID
uint32_t sourceID() const
get sub detector source ID
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
ROIB::Header::formatVersion
uint32_t formatVersion() const
get version of header format
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
ROIB::Header::print
const std::string print(const bool longFormat=false) const
print object content in a human readable format to string
Definition: TrigT1Result/src/Header.cxx:80
ROIB::CTPResult::convert
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
ROIB::CTPResult::trailer
const Trailer & trailer() const
return trailer
ROIB::CTPResult::header
const Header & header() const
return header
skel.it
it
Definition: skel.GENtoEVGEN.py:423
ROIB::CTPResult::m_CTPResultRoIVec
std::vector< CTPRoI > m_CTPResultRoIVec
raw data content (RoIs)
Definition: CTPResult.h:122
LVL1CTP::convertToHex
const std::string convertToHex(const uint32_t word)
helper function to dump a number in hex format
Definition: TrigT1CTPDefs.h:41
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
ROIB::CTPResult::m_CTPResultTrailer
Trailer m_CTPResultTrailer
trailer fragment in LVL1 eformat
Definition: CTPResult.h:121
StdJOSetup.msgSvc
msgSvc
Provide convenience handles for various services.
Definition: StdJOSetup.py:36
ROIB::CTPResult::m_l1aBunch
unsigned int m_l1aBunch
Definition: CTPResult.h:135
ROIB::Trailer::print
const std::string print(const bool longFormat=false) const
print object content in a human readable format to string
Definition: Trailer.cxx:56
lumiFormat.i
int i
Definition: lumiFormat.py:92
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ROIB::Header::dump
const std::string dump() const
dump raw object content to string
Definition: TrigT1Result/src/Header.cxx:69
ROIB::CTPResult::m_useRoIB
bool m_useRoIB
Definition: CTPResult.h:132
ROIB::Trailer::dump
const std::string dump() const
dump raw object content to string
Definition: Trailer.cxx:45
ROIB::CTPResult::m_CTPResultHeader
Header m_CTPResultHeader
header fragment in LVL1 eformat
Definition: CTPResult.h:120
head
std::string head(std::string s, const std::string &pattern)
head of a string
Definition: computils.cxx:310
ROIB::CTPResult::acceptAV
bool acceptAV() const
get trigger accept after veto
python.PyAthena.v
v
Definition: PyAthena.py:157
ROIB::CTPResult::m_ctpDataformat
CTPdataformatVersion m_ctpDataformat
Definition: CTPResult.h:126
ROIB::CTPResult::dumpData
void dumpData() const
print object content to default message stream
Definition: CTPResult.cxx:156
ROIB::CTPResult::roIVec
const std::vector< CTPRoI > & roIVec() const
return the RoI vector *‍/
ROIB::Header::dumpData
void dumpData() const
print object content to default message stream
Definition: TrigT1Result/src/Header.cxx:103
DEBUG
#define DEBUG
Definition: page_access.h:11
TriggerTest.rois
rois
Definition: TriggerTest.py:23
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
calibdata.copy
bool copy
Definition: calibdata.py:27
test_pyathena.counter
counter
Definition: test_pyathena.py:15