ATLAS Offline Software
PhysicsAnalysis
AnalysisCommon
HDF5Utils
HDF5Utils
CompressedTypes.h
Go to the documentation of this file.
1
// this is -*- C++ -*-
2
/*
3
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
4
*/
5
6
#ifndef COMPRESSED_TYPES_H
7
#define COMPRESSED_TYPES_H
8
9
#include "
CompressionEnums.h
"
10
#include "
H5Traits.h
"
11
12
#include "H5Cpp.h"
13
14
#include <stdexcept>
15
16
namespace
H5Utils
{
17
18
namespace
internal {
19
20
H5::DataType
halfPrecisionFloat
(
int
ebias = 15);
21
22
template
<
typename
T>
23
H5::DataType
getCompressedType
(
Compression
comp
) {
24
if
constexpr (
std::is_floating_point<T>::value
) {
25
switch
(
comp
) {
26
case
Compression::STANDARD
:
return
H5Traits<T>::type
;
27
case
Compression::HALF_PRECISION
:
return
halfPrecisionFloat
();
28
case
Compression::HALF_PRECISION_LARGE
:
return
halfPrecisionFloat
(5);
29
default
:
throw
std::logic_error(
"unknown float compression"
);
30
}
31
}
32
if
(
comp
!=
Compression::STANDARD
) {
33
throw
std::logic_error(
"compression not supported for this type"
);
34
}
35
return
H5Traits<T>::type
;
36
}
37
38
}
// end internal
39
}
// end H5Utils
40
41
#endif
plotting.yearwise_luminosity_vs_mu.comp
comp
Definition:
yearwise_luminosity_vs_mu.py:24
H5Utils::internal::H5Traits
We have lots of code to get around HDF5's rather weak typing.
Definition:
H5Traits.h:54
H5Utils::Compression::STANDARD
@ STANDARD
DataType
OFFLINE_FRAGMENTS_NAMESPACE::PointerType DataType
Definition:
RoIBResultByteStreamTool.cxx:25
athena.value
value
Definition:
athena.py:122
CompressionEnums.h
H5Traits.h
H5Utils::internal::getCompressedType
H5::DataType getCompressedType(Compression comp)
Definition:
CompressedTypes.h:23
H5Utils::Compression::HALF_PRECISION
@ HALF_PRECISION
H5Utils::Compression
Compression
Definition:
CompressionEnums.h:11
H5Utils::internal::halfPrecisionFloat
H5::DataType halfPrecisionFloat(int ebias=15)
Definition:
CompressedTypes.cxx:14
H5Utils
HDF5 Tuple Writer.
Definition:
common.h:20
H5Utils::Compression::HALF_PRECISION_LARGE
@ HALF_PRECISION_LARGE
Generated on Tue Jul 2 2024 21:12:31 for ATLAS Offline Software by
1.8.18