ATLAS Offline Software
util.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 #include "eformat/util.h"
7 #include "eformat/Version.h"
8 #include "v40_util.h"
9 #include "v50_util.h"
10 
11 namespace {
12 
13 // This should have been defined in eformat itself but it's not
14 const uint16_t MAJOR_V50_VERSION = 0x0500;
15 
16 }
17 
18 namespace offline_eformat {
19 namespace old {
20 
22  eformat::CheckSum event_checksum,
23  eformat::CheckSum rob_checksum)
24 {
25  switch (eformat::peek_type(src)) {
26  case eformat::FULL_EVENT:
27  switch (eformat::peek_major_version(src)) {
28  case ::MAJOR_V50_VERSION:
29  return offline_eformat::v50::convert_to_40(src, dest, max, event_checksum, rob_checksum);
30  case eformat::MAJOR_V40_VERSION:
31  // 40 -> to 40 works (makes a byte-level copy and ignores checksum flags)
32  return offline_eformat::v40::convert_to_40(src, dest, max, event_checksum, rob_checksum);
33  default:
34  throw EFORMAT_BAD_VERSION(eformat::peek_major_version(src), ::MAJOR_V50_VERSION);
35  }
36  default:
37  throw EFORMAT_UNSUPPORTED_OPERATION("convert to v40 format", src[0]);
38  }
39  return 0; //this cannot not happen...
40 }
41 
42 }} // namespace offline_eformat::old
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
WriteCellNoiseToCool.src
src
Definition: WriteCellNoiseToCool.py:513
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
offline_eformat
Definition: util.h:19
perfmonmt-printer.dest
dest
Definition: perfmonmt-printer.py:189
v40_util.h
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:93
offline_eformat::old::convert_to_40
uint32_t convert_to_40(const uint32_t *src, uint32_t *dest, uint32_t max, eformat::CheckSum event_checksum=eformat::NO_CHECKSUM, eformat::CheckSum rob_checksum=eformat::NO_CHECKSUM)
Converts a full event fragment or a ROS fragment, from some format to v4.0 format,...
Definition: util.cxx:21
offline_eformat::v40::convert_to_40
uint32_t convert_to_40(const uint32_t *src, uint32_t *dest, uint32_t max, eformat::CheckSum, eformat::CheckSum)
Definition: v40_util.cxx:13
offline_eformat::v50::convert_to_40
uint32_t convert_to_40(const uint32_t *src, uint32_t *dest, uint32_t max, eformat::CheckSum event_checksum, eformat::CheckSum rob_checksum)
Definition: v50_util.cxx:42
v50_util.h
CSV_InDetExporter.old
old
Definition: CSV_InDetExporter.py:145
util.h
Declarations of methods for working with old eformat versions.