ATLAS Offline Software
Macros | Functions
TileTBDump.cxx File Reference
#include "eformat/FullEventFragment.h"
#include "ByteStreamCnvSvcBase/ROBDataProviderSvc.h"
#include "AthenaKernel/errorcheck.h"
#include "TileIdentifier/TileTBFrag.h"
#include "TileConditions/TileCablingService.h"
#include "TileIdentifier/TileRawChannelUnit.h"
#include "TileTBRec/TileTBDump.h"
#include "TileByteStream/TileOFC.h"
#include "TileConditions/TileCondToolOfcCool.h"
#include "TileConditions/TileCondToolTiming.h"
#include "TileConditions/TileCondToolEmscale.h"
#include "boost/io/ios_state.hpp"
#include "boost/date_time/local_time/local_time.hpp"
#include "boost/date_time/posix_time/posix_time.hpp"
#include <iostream>
#include <sstream>
#include <iomanip>
#include <bitset>
#include <string>
#include <ctime>
#include <arpa/inet.h>

Go to the source code of this file.

Macros

#define code_ped4   TileRawChannel2Bytes5::code_ped4
 
#define code_ped5   TileRawChannel2Bytes5::code_ped5
 
#define code_amp5   TileRawChannel2Bytes5::code_amp5
 
#define code_amp6   TileRawChannel2Bytes5::code_amp6
 
#define code_raws   TileRawChannel2Bytes5::code_raws
 
#define code_rawf   TileRawChannel2Bytes5::code_rawf
 
#define code_full   TileRawChannel2Bytes5::code_full
 
#define code_dump   TileRawChannel2Bytes5::code_dump
 
#define code_null   TileRawChannel2Bytes5::code_null
 
#define CRC_ok   0
 
#define CRC_error_0   1
 
#define CRC_error_1   2
 
#define CRC_do_not_match   4
 
#define CRC_POLY   0x8005
 

Functions

std::string cern_local_time (time_t unix_time)
 
std::ostream & setup0x4 (std::ostream &stream)
 
std::ostream & setupMod (std::ostream &stream)
 
std::ostream & setup0 (std::ostream &stream)
 
std::ostream & setupDec (std::ostream &stream)
 
std::ostream & setupPr1 (std::ostream &stream)
 
std::ostream & setupPr2 (std::ostream &stream)
 
std::ostream & setupPr3 (std::ostream &stream)
 
std::ostream & setupPr4 (std::ostream &stream)
 
void dump_it (unsigned int nw, unsigned int *data)
 

Macro Definition Documentation

◆ code_amp5

#define code_amp5   TileRawChannel2Bytes5::code_amp5

◆ code_amp6

#define code_amp6   TileRawChannel2Bytes5::code_amp6

◆ code_dump

#define code_dump   TileRawChannel2Bytes5::code_dump

◆ code_full

#define code_full   TileRawChannel2Bytes5::code_full

◆ code_null

#define code_null   TileRawChannel2Bytes5::code_null

◆ code_ped4

#define code_ped4   TileRawChannel2Bytes5::code_ped4

◆ code_ped5

#define code_ped5   TileRawChannel2Bytes5::code_ped5

◆ code_rawf

#define code_rawf   TileRawChannel2Bytes5::code_rawf

◆ code_raws

#define code_raws   TileRawChannel2Bytes5::code_raws

◆ CRC_do_not_match

#define CRC_do_not_match   4

◆ CRC_error_0

#define CRC_error_0   1

◆ CRC_error_1

#define CRC_error_1   2

◆ CRC_ok

#define CRC_ok   0

◆ CRC_POLY

#define CRC_POLY   0x8005

Function Documentation

◆ cern_local_time()

std::string cern_local_time ( time_t  unix_time)

Definition at line 48 of file TileTBDump.cxx.

49 {
50  using namespace boost::local_time;
51  using namespace boost::posix_time;
52 
53  char dateTime[32];
54 
55 /*
56  // just an example how to read file with time zones
57  tz_database tz_db;
58  try {
59  tz_db.load_from_file("../data/date_time_zonespec.csv");
60  time_zone_ptr gva_tz = tz_db.time_zone_from_region("Europe/Zurich");
61  }catch(data_not_accessible dna) {
62  std::cerr << "Error with time zone data file: " << dna.what() << std::endl;
63  //exit(EXIT_FAILURE);
64  }catch(bad_field_count bfc) {
65  std::cerr << "Error with time zone data file: " << bfc.what() << std::endl;
66  //exit(EXIT_FAILURE);
67  }
68 */
69  //"Europe/Zurich","CET","CET","CEST","CEST","+01:00:00","+01:00:00","-1;0;3","+02:00:00","-1;0;10","+03:00:00"
70  static const time_zone_ptr gva_tz(new posix_time_zone((std::string)"CET+01CEST01:00:00,M3.5.0/02:00:00,M10.5.0/03:00:00"));
71  local_date_time gva_time(from_time_t(unix_time),gva_tz);
72 
73  //std::ostringstream otime;
74  //otime << gva_time; // time in the format YYYY-MMM-DD HH:MM:SS TZ
75  //strncpy(dateTime,otime.str().c_str(),31);
76 
77  //time_duration hms(gva_time.time_of_day()); - will give time of the day in GMT
78  //int HHMMSS = hms.hours()*10000+hms.minutes()*100+hms.seconds();
79 
80  struct tm gva_tm(to_tm(gva_time));
81  strftime(dateTime, 32, "%Y-%b-%d %H:%M:%S %Z", &gva_tm);
82  //HHMMSS = gva_tm.tm_hour*10000+gva_tm.tm_min*100+gva_tm.tm_sec;
83 
84  // the code below is only valid when running at CERN (in Geneva time zone)
85  //struct tm *time = localtime((time_t*)(&m_evTime));
86  //HHMMSS = time->tm_hour*10000+time->tm_min*100+time->tm_sec;
87  //strftime(dateTime, 32, "%Y-%m-%d %H:%M:%S %Z", time);
88 
89  return dateTime;
90 }

◆ dump_it()

void dump_it ( unsigned int  nw,
unsigned int *  data 
)

Definition at line 2018 of file TileTBDump.cxx.

2018  {
2019 
2020  unsigned int i;
2021 
2022  std::cout << "size of data block: " << nw << std::endl;
2023  for (i = 0; i < nw; i++, data++) {
2024  std::cout << std::setw(4) << i << ": 0x" << std::hex << std::setw(8) << *data << "\t" << std::dec << std::setw(10) << *data << std::endl;
2025  }
2026 }

◆ setup0()

std::ostream& setup0 ( std::ostream &  stream)

Definition at line 467 of file TileTBDump.cxx.

467  {
468  stream << std::hex << std::setfill('0') << std::setw(8);
469  return stream;
470 }

◆ setup0x4()

std::ostream& setup0x4 ( std::ostream &  stream)

Definition at line 459 of file TileTBDump.cxx.

459  {
460  stream << "0x" << std::setw(4);
461  return stream;
462 }

◆ setupDec()

std::ostream& setupDec ( std::ostream &  stream)

Definition at line 471 of file TileTBDump.cxx.

471  {
472  stream << std::setfill(' ') << std::dec;
473  return stream;
474 }

◆ setupMod()

std::ostream& setupMod ( std::ostream &  stream)

Definition at line 463 of file TileTBDump.cxx.

463  {
464  stream << "\n mod" << std::setw(2);
465  return stream;
466 }

◆ setupPr1()

std::ostream& setupPr1 ( std::ostream &  stream)

Definition at line 475 of file TileTBDump.cxx.

475  {
476  stream << std::setw(5) << std::setprecision(1);
477  return stream;
478 }

◆ setupPr2()

std::ostream& setupPr2 ( std::ostream &  stream)

Definition at line 479 of file TileTBDump.cxx.

479  {
480  stream << std::setw(5) << std::setprecision(2);
481  return stream;
482 }

◆ setupPr3()

std::ostream& setupPr3 ( std::ostream &  stream)

Definition at line 483 of file TileTBDump.cxx.

483  {
484  stream << std::setw(4) << std::setprecision(1);
485  return stream;
486 }

◆ setupPr4()

std::ostream& setupPr4 ( std::ostream &  stream)

Definition at line 487 of file TileTBDump.cxx.

487  {
488  stream << std::setw(4) << std::setprecision(1);
489  return stream;
490 }
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
AthenaPoolTestWrite.stream
string stream
Definition: AthenaPoolTestWrite.py:12
lumiFormat.i
int i
Definition: lumiFormat.py:92
SCT_Cabling::dateTime
std::string dateTime()
Definition: SCT_CablingXmlTags.h:55