CbmRoot
Loading...
Searching...
No Matches
CbmFormatMsHeaderPrintout.cxx
Go to the documentation of this file.
1/* Copyright (C) 2019 Facility for Antiproton and Ion Research in Europe, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Pierre-Alain Loizeau [committer] */
4
6
7std::string FormatMsHeaderPrintout(const fles::MicrosliceDescriptor& msDescriptor)
8{
9 std::stringstream ss;
10 ss << "hi hv eqid flag si sv idx/start crc size offset"
11 << "\n"
12 << std::hex << std::setfill('0') << std::setw(2) << static_cast<unsigned int>(msDescriptor.hdr_id) << " "
13 << std::setw(2) << static_cast<unsigned int>(msDescriptor.hdr_ver) << " " << std::setw(4) << msDescriptor.eq_id
14 << " " << std::setw(4) << msDescriptor.flags << " " << std::setw(2)
15 << static_cast<unsigned int>(msDescriptor.sys_id) << " " << std::setw(2)
16 << static_cast<unsigned int>(msDescriptor.sys_ver) << " " << std::setw(16) << msDescriptor.idx << " "
17 << std::setw(8) << msDescriptor.crc << " " << std::setw(8) << msDescriptor.size << " " << std::setw(16)
18 << msDescriptor.offset;
19 return ss.str();
20}
21
22std::string FormatMsHeaderHelp()
23{
24 std::stringstream ss;
25 ss << " Description of the microslice header format:\n"
26 << "==> hdr_id = Header format identifier (0xDD) \n"
27 << "| ==> hdr_ver = Header format version (0x01) \n"
28 << "| | ==> eq_id = Equipment identifier \n"
29 << "| | | ==> flags = Status and error flags \n"
30 << "| | | | ==> sys_id = Subsystem identifier \n"
31 << "| | | | | ==> sys_ver = Subsystem format/version \n"
32 << "| | | | | | ==> idx = Microslice index / start time \n"
33 << "| | | | | | | \n"
34 << "hi hv eqid flag si sv idx/start crc size offset \n"
35 << "dd 01 3001 0000 30 03 180c1f234b1b6000 00000000 00000008 0000000000000080\n"
36 << " | | | \n"
37 << " crc = CRC-32C of data content <== | | \n"
38 << " (Castagnoli polynomial) | | \n"
39 << " size = Content size (bytes) <== | \n"
40 << " offset = Offset in event buffer (bytes) <== \n";
41 return ss.str();
42}
43
44std::ostream& operator<<(std::ostream& os, const fles::MicrosliceDescriptor& msDescriptor)
45{
46 return os << FormatMsHeaderPrintout(msDescriptor);
47}
std::ostream & operator<<(std::ostream &os, const fles::MicrosliceDescriptor &msDescriptor)
std::string FormatMsHeaderHelp()
std::string FormatMsHeaderPrintout(const fles::MicrosliceDescriptor &msDescriptor)