#include "print.hpp"
#include <iostream>
#include <iomanip>
#include <sstream>
#include <cctype>
#include <DataFormats/infoword.hh>
#include "structs.hpp"
#include "datatypes.hpp"
 
Go to the source code of this file.
      
        
          | std::ostream& operator<<  | 
          ( | 
          std::ostream &  | 
          stream,  | 
        
        
           | 
           | 
          DOMID_h const &  | 
          domid  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Definition at line 24 of file print.cpp.
   31   std::ostringstream oss(
"0800", std::ostringstream::ate);
 
   32   oss << std::hex << domid.m_val;
 
   33   if (oss.tellp() != 12) {
 
   34     return stream << 
"undefined";
 
   37   std::string 
const no = oss.str();
 
   38   std::size_t 
const s = no.size();
 
   39   for (std::size_t i = 0; i < s; i += 2) {
 
   41       << char(std::toupper(no[i]))
 
   42       << char(std::toupper(no[i + 1]))
 
   43       << (i != s - 2 ? 
":" : 
"");
 
 
 
 
      
        
          | void print_header  | 
          ( | 
          CLBCommonHeader const &  | 
          header,  | 
        
        
           | 
           | 
          dom_map_type const &  | 
          name_map  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Definition at line 49 of file print.cpp.
   57   if (! name_map.empty()) {
 
   58     dom_map_type::const_iterator 
const it
 
   59         = name_map.find(header.domIdentifier());
 
   61     if (it != name_map.end()) {
 
   62       name = 
" - " + it->second;
 
   69       << 
"DataType:          " << header.dataType()           << 
'\n' 
   70       << 
"RunNumber:         " << header.runNumber()          << 
'\n' 
   71       << 
"UDPSequenceNumber: " << header.udpSequenceNumber()  << 
'\n' 
   74       << 
"          Seconds: " << header.timeStamp().sec()    << 
'\n' 
   75       << 
"          Tics:    " << header.timeStamp().tics()   << 
'\n' 
   76       << 
"          " << UTCTime_h(header.timeStamp(), valid) << 
'\n' 
   78       << 
"DOMIdentifier:     " << header.domIdentifier()
 
   79       <<  
" (MAC: " << 
DOMID_h(header.domIdentifier()) << 
name << 
')' << 
'\n' 
   80       << 
"DOMStatus 1:       " << header.domStatus(1) << 
'\n' 
   81       << 
"DOMStatus 2:       " << header.domStatus(2);
 
   83   if (trailer && header.dataType() == 
ttdc) {
 
   84     std::cout << 
" (trailer)\n";
 
   90       << 
"DOMStatus 3:       " << header.domStatus(3) << 
'\n' 
   91       << 
"DOMStatus 4:       " << header.domStatus(4) << std::endl;
 
then echo Enter input within $TIMEOUT_S seconds echo n User name
 
 
 
 
      
        
          | void print_optical_data  | 
          ( | 
          const char *const  | 
          buffer,  | 
        
        
           | 
           | 
          ssize_t  | 
          buffer_size,  | 
        
        
           | 
           | 
          int  | 
          max_col  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Definition at line 94 of file print.cpp.
   99   unsigned int const nhits =
 
  102   std::cout << 
"Number of hits: " << nhits << 
'\n';
 
  105     const int printing = 20 > nhits ? nhits : 20;
 
  106     const unsigned int n = max_col > 37 ? max_col / 37 : 1;
 
  108     for (
int i = 0; i < printing; ++i) {
 
  109       const hit_t* 
const hit = 
static_cast<const hit_t* const
>(
 
  110           static_cast<const void* const
>(buffer
 
  112             + i * 
sizeof(
hit_t)));
 
  116         << std::setfill(
'0') << std::setw(2)
 
  121       if ((i + 1) % n == 0) {
 
static const size_t buffer_size
 
alias put_queue eval echo n
 
 
 
 
      
        
          | void print_acoustic_data  | 
          ( | 
          const char *const  | 
          buffer,  | 
        
        
           | 
           | 
          ssize_t  | 
          buffer_size,  | 
        
        
           | 
           | 
          int  | 
          max_col  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Definition at line 132 of file print.cpp.
  138       static_cast<void const*
>(buffer));
 
  144     std::cout << 
"InfoWord: yes\n" 
  145               << *
static_cast<InfoWord const*
>(
static_cast<void const*
>(
 
  150     std::cout << 
"InfoWord: no\n";
 
bool is_infoword(const void *const data)
 
 
 
 
      
        
          | void print_monitoring_data  | 
          ( | 
          const char *const  | 
          buffer,  | 
        
        
           | 
           | 
          ssize_t  | 
          buffer_size,  | 
        
        
           | 
           | 
          int  | 
          max_col  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Definition at line 154 of file print.cpp.
  159   const unsigned int n = max_col > 14 ? max_col / 14 : 1;
 
  161   for (
int i = 0; i < 31; ++i) {
 
  162     uint32_t 
const* 
const field = 
static_cast<uint32_t const*
>(
 
  168       << std::setfill(
'0') << std::setw(2)
 
  170       << std::setfill(
' ') << std::setw(6)
 
  171       << htonl(*field) << 
"  ";
 
  173     if ((i + 1) % n == 0) {
 
  180   ssize_t 
const minimum_size = 
sizeof(
CLBCommonHeader) + 
sizeof(
int) * 31;
 
  184       << 
"SlowControl data:\n" 
  185       << *
static_cast<SCData const*
>(
static_cast<void const*
>(
 
  186              buffer + minimum_size
 
static const size_t buffer_size
 
alias put_queue eval echo n