ATLAS Offline Software
Trailer.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2018 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  IMessageSvc* msgSvc;
79  ISvcLocator* svcLoc = Gaudi::svcLocator( );
80  StatusCode sc = svcLoc->service( "MessageSvc", msgSvc );
81  if ( sc.isFailure() ) {
82  return;
83  }
84  MsgStream log(msgSvc, "ROIB::Header");
85  dumpData(log);
86  }
87 
88  void Trailer::dumpData(MsgStream& log) const
89  {
90  log << MSG::DEBUG << "*BEGIN* ROIB::Trailer" << endmsg;
91  log << MSG::DEBUG << "Trailer size : " << size() << endmsg;
92  log << MSG::DEBUG << "Error status : " << errorStatus() << endmsg;
93  log << MSG::DEBUG << "Status info : " << statusInfo() << endmsg;
94  log << MSG::DEBUG << "No data words : " << numDataWords() << endmsg;
95  log << MSG::DEBUG << "*END* ROIB::Trailer" << endmsg;
96  }
97 } // 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
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
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: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::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