ATLAS Offline Software
TrigT1CTPDefs.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef TRIGT1INTERFACES_TRIGT1CTPDEFS_H
6 #define TRIGT1INTERFACES_TRIGT1CTPDEFS_H
7 
8 // std include(s):
9 #include <stdint.h>
10 
11 // STL include(s):
12 #include <string>
13 #include <vector>
14 #include <sstream>
15 #include <iomanip>
16 
17 namespace LVL1CTP {
18 
32  class TrigT1CTPDefs {
33 
34  public:
35 
36  // constants:
37 
38  };
39 
41  inline const std::string convertToHex(const uint32_t word)
42  {
43  std::ostringstream s;
44  s << " 0x" << std::hex << std::setw(8) << std::setfill( '0' ) << word;
45  // s << std::dec << std::setfill(' ');
46  return s.str();
47  }
48 
50  inline const std::string convertToHex(const std::vector<uint32_t>& words)
51  {
52  std::ostringstream s;
53 
54  // switch to hex format
55  s << std::hex << std::setfill( '0' );
56 
57  if (words.size() > 0)
58  s << " 0x" << std::setw(8) << words[0];
59  for (size_t i(1); i < words.size(); ++i)
60  s << ", 0x" << std::setw(8) << words[i];
61 
62  // switch back to normal format
63  s << std::dec << std::setfill(' ');
64 
65  return s.str();
66  }
67 
69  inline std::ostream& operator<<(std::ostream& os, std::vector<unsigned int> rhs)
70  {
71  for (std::vector<unsigned int>::const_iterator i(rhs.begin()); i != rhs.end(); ++i) {
72  os << " " << *i;
73  }
74 
75  return os;
76  }
77 
79  const std::string convertRawCTPData(const std::vector<uint32_t>& data, const bool longFormat = false, int ctpVersionNumber = 4);
80 
81 } // namespace LVL1CTP
82 
83 #endif // TRIGT1INTERFACES_TRIGT1CTPDEFS_H
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
LVL1CTP::operator<<
std::ostream & operator<<(std::ostream &os, std::vector< unsigned int > rhs)
operator to dump a vector of numbers
Definition: TrigT1CTPDefs.h:69
LVL1CTP::convertToHex
const std::string convertToHex(const uint32_t word)
helper function to dump a number in hex format
Definition: TrigT1CTPDefs.h:41
lumiFormat.i
int i
Definition: lumiFormat.py:92
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
LVL1CTP::convertRawCTPData
const std::string convertRawCTPData(const std::vector< uint32_t > &data, const bool longFormat, int ctpFormatVersionNumber)
helper function to dump raw CTP content
Definition: TrigT1CTPDefs.cxx:13
LVL1CTP::TrigT1CTPDefs
Class holding common constants for the CTP simulation.
Definition: TrigT1CTPDefs.h:32
LVL1CTP
Definition: Lvl1ResultAccessTool.h:20
checkFileSG.words
words
Definition: checkFileSG.py:76