ATLAS Offline Software
Loading...
Searching...
No Matches
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
11namespace {
12
13// This should have been defined in eformat itself but it's not
14const uint16_t MAJOR_V50_VERSION = 0x0500;
15
16}
17
18namespace offline_eformat {
19namespace old {
20
21uint32_t convert_to_40(const uint32_t* src, uint32_t* dest, uint32_t max,
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
#define max(a, b)
Definition cfImp.cxx:41
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
uint32_t convert_to_40(const uint32_t *src, uint32_t *dest, uint32_t max, eformat::CheckSum, eformat::CheckSum)
Definition v40_util.cxx:13
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
setWord1 uint16_t
Declarations of methods for working with old eformat versions.