-
Notifications
You must be signed in to change notification settings - Fork 494
Expand file tree
/
Copy pathDigitFileFormat.h
More file actions
53 lines (42 loc) · 1.53 KB
/
DigitFileFormat.h
File metadata and controls
53 lines (42 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
#ifndef O2_MCH_DEVIO_DIGITS_DIGIT_FILE_FORMAT_H
#define O2_MCH_DEVIO_DIGITS_DIGIT_FILE_FORMAT_H
#include <cstdint>
#include <iosfwd>
#include <array>
namespace o2::mch::io
{
constexpr uint64_t TAG_DIGITS = 0x3F2F; // = 016175 = 0.1.6.1.7.5 = D.I.G.I.T.S
struct DigitFileFormat {
union {
uint64_t format = TAG_DIGITS;
struct {
uint64_t tag : 16;
uint64_t fileVersion : 8;
uint64_t reserved : 4;
uint64_t digitVersion : 8;
uint64_t digitSize : 8;
uint64_t rofVersion : 8;
uint64_t rofSize : 8;
uint64_t hasRof : 1;
uint64_t run2ids : 1;
};
};
};
extern std::array<DigitFileFormat, 5> digitFileFormats;
std::ostream& operator<<(std::ostream&, const DigitFileFormat&);
bool operator==(const DigitFileFormat& dff1, const DigitFileFormat& dff2);
bool operator!=(const DigitFileFormat& dff1, const DigitFileFormat& dff2);
DigitFileFormat readDigitFileFormat(std::istream& in);
bool isValid(DigitFileFormat dff);
} // namespace o2::mch::io
#endif