The Gaudi Framework
v41r0 (bdbe7744)
Toggle main menu visibility
Loading...
Searching...
No Matches
RootCompressionSettings.cpp
Go to the documentation of this file.
1
/***********************************************************************************\
2
* (c) Copyright 1998-2025 CERN for the benefit of the LHCb and ATLAS collaborations *
3
* *
4
* This software is distributed under the terms of the Apache version 2 licence, *
5
* copied verbatim in the file "LICENSE". *
6
* *
7
* In applying this licence, CERN does not waive the privileges and immunities *
8
* granted to it by virtue of its status as an Intergovernmental Organization *
9
* or submit itself to any jurisdiction. *
10
\***********************************************************************************/
11
// STD
12
#include <stdexcept>
13
14
// local
15
#include "
RootCompressionSettings.h
"
16
17
// ROOT
18
#include <Compression.h>
19
20
//-----------------------------------------------------------------------------
21
// Implementation file for class : RootCompressionSettings
22
//
23
// 2013-10-24 : Chris Jones
24
//-----------------------------------------------------------------------------
25
26
//=============================================================================
27
// Standard constructor, initializes variables
28
//=============================================================================
29
RootHistCnv::RootCompressionSettings::RootCompressionSettings
(
const
std::string& settings )
30
:
m_level
(
ROOT
::CompressionSettings(
ROOT
::RCompressionSetting::EAlgorithm::kZLIB, 1 ) ) {
31
const
std::string::size_type idx = settings.find(
':'
);
32
if
( idx != std::string::npos ) {
33
// Get compression algorithm type
34
const
std::string alg = settings.substr( 0, idx );
35
ROOT::RCompressionSetting::EAlgorithm::EValues alg_code = ROOT::RCompressionSetting::EAlgorithm::kUseGlobal;
36
if
( alg ==
"ZLIB"
) {
37
alg_code = ROOT::RCompressionSetting::EAlgorithm::kZLIB;
38
}
else
if
( alg ==
"LZMA"
) {
39
alg_code = ROOT::RCompressionSetting::EAlgorithm::kLZMA;
40
}
else
if
( alg ==
"LZ4"
) {
41
alg_code = ROOT::RCompressionSetting::EAlgorithm::kLZ4;
42
}
else
if
( alg ==
"ZSTD"
) {
43
alg_code = ROOT::RCompressionSetting::EAlgorithm::kZSTD;
44
}
else
{
45
throw
std::runtime_error(
"ERROR: Unknown ROOT compression algorithm:"
+ alg );
46
}
47
48
// get compression level
49
const
std::string slev = settings.substr( idx + 1 );
50
const
int
ilev = std::stoi( slev );
51
52
// set the level
53
m_level
= ROOT::CompressionSettings( alg_code, ilev );
54
}
55
}
56
57
//=============================================================================
RootCompressionSettings.h
RootHistCnv::RootCompressionSettings::RootCompressionSettings
RootCompressionSettings(const std::string &settings)
Standard constructor.
Definition
RootCompressionSettings.cpp:29
RootHistCnv::RootCompressionSettings::m_level
int m_level
The cached ROOT compression level int.
Definition
RootCompressionSettings.h:30
ROOT
Definition
IMagneticFieldSvc.h:16
RootHistCnv
src
RootCompressionSettings.cpp
Generated on
for The Gaudi Framework by
1.17.0