ATLAS Offline Software
Trailer.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 
6 // this header file
7 #include "TrigT1Result/Trailer.h"
8 
9 // gaudi includes
10 #include "GaudiKernel/Bootstrap.h"
11 #include "GaudiKernel/ISvcLocator.h"
12 #include "GaudiKernel/IMessageSvc.h"
13 #include "GaudiKernel/MsgStream.h"
14 
15 // STL includes
16 #include <sstream>
17 #include <iomanip>
18 
19 // Local include(s):
21 
22 namespace ROIB {
23 
24  Trailer::Trailer( const uint32_t i1, const uint32_t i2 ) {
25 
26  m_trailer.push_back( i2 ); // status element: error
27  m_trailer.push_back( 0 ); // status element: info
28  m_trailer.push_back( 2 ); // number of status words
29  m_trailer.push_back( i1 ); // number of data words
30  m_trailer.push_back( 1 ); // status block position
31 
32  }
33 
35 
36  m_trailer.push_back( 0 ); // status element: error
37  m_trailer.push_back( 0 ); // status element: info
38  m_trailer.push_back( 2 ); // number of status words
39  m_trailer.push_back( i ); // number of data words
40  m_trailer.push_back( 1 ); // status block position
41 
42  }
43 
44 
45  const std::string Trailer::dump() const
46  {
47  std::ostringstream s;
48 
49  for (size_t i(0); i < m_trailer.size(); ++i) {
51  }
52 
53  return s.str();
54  }
55 
56  const std::string Trailer::print(const bool longFormat) const
57  {
58  std::ostringstream s;
59 
60  if (longFormat) {
61  s << "Size: " << size() << std::endl;
62  s << std::setw(2) << 0 << "ErrorStatus:" << errorStatus() << std::endl;
63  s << std::setw(2) << 1 << "SatusInfo:" << statusInfo() << std::endl;
64  s << std::setw(2) << 2 << "nStatusWords:" << numStatusWords() << std::endl;
65  s << std::setw(2) << 3 << "nDataWords:" << numDataWords() << std::endl;
66  s << std::setw(2) << 4 << "StatusPosition:" << statusPosition();
67  } else {
68  for (size_t i(0); i < m_trailer.size(); ++i) {
70  }
71  }
72 
73  return s.str();
74  }
75 
76  void Trailer::dumpData() const
77  {
78  SmartIF<IMessageSvc> msgSvc{Gaudi::svcLocator()->service("MessageSvc")};
79  if ( !msgSvc ) {
80  return;
81  }
82  MsgStream log(msgSvc, "ROIB::Header");
83  dumpData(log);
84  }
85 
86  void Trailer::dumpData(MsgStream& log) const
87  {
88  log << MSG::DEBUG << "*BEGIN* ROIB::Trailer" << endmsg;
89  log << MSG::DEBUG << "Trailer size : " << size() << endmsg;
90  log << MSG::DEBUG << "Error status : " << errorStatus() << endmsg;
91  log << MSG::DEBUG << "Status info : " << statusInfo() << endmsg;
92  log << MSG::DEBUG << "No data words : " << numDataWords() << endmsg;
93  log << MSG::DEBUG << "*END* ROIB::Trailer" << endmsg;
94  }
95 } // namespace ROIB
ROIB::Trailer::dumpData
void dumpData() const
print object content to default message stream
Definition: Trailer.cxx:76
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
Trailer.h
ROIB::Trailer::statusInfo
uint32_t statusInfo() const
get info status word (LVL1 trailer assumes only on word)
ROIB::Trailer::errorStatus
uint32_t errorStatus() const
get error status word (LVL1 trailer assumes only on word)
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
ROIB::Trailer::size
int size() const
get trailer/data size (should always return 5)
ROIB::Trailer::numDataWords
uint32_t numDataWords() const
get number of data words
ROIB::Trailer::m_trailer
std::vector< uint32_t > m_trailer
vector of unsigned ints - the only data member - hopefully 5
Definition: Trailer.h:105
ROIB::Trailer::Trailer
Trailer()
default constructor: empty object
Definition: Trailer.h:46
ROIB
Namespace of the LVL1 RoIB simulation.
Definition: ILvl1ResultAccessTool.h:19
LVL1CTP::convertToHex
const std::string convertToHex(const uint32_t word)
helper function to dump a number in hex format
Definition: TrigT1CTPDefs.h:41
ROIB::Trailer::numStatusWords
uint32_t numStatusWords() const
get number of status words in trailer
StdJOSetup.msgSvc
msgSvc
Provide convenience handles for various services.
Definition: StdJOSetup.py:36
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:85
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
ROIB::Trailer::dump
const std::string dump() const
dump raw object content to string
Definition: Trailer.cxx:45
ROIB::Trailer::statusPosition
uint32_t statusPosition() const
get position of status information in ROD (LVL1 assumes 1)
DEBUG
#define DEBUG
Definition: page_access.h:11
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
TrigT1CTPDefs.h