From 24532213dc722642ecba5e7174d39ef08b1d8168 Mon Sep 17 00:00:00 2001 From: Ivan Razumov Date: Fri, 8 Nov 2024 13:41:39 +0100 Subject: [PATCH 1/2] Replace deprecated constants for compression level --- IOPool/Output/src/RootOutputFile.cc | 8 ++++---- PhysicsTools/NanoAOD/plugins/NanoAODOutputModule.cc | 8 ++++---- .../NanoAOD/plugins/rntuple/NanoAODRNTupleOutputModule.cc | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/IOPool/Output/src/RootOutputFile.cc b/IOPool/Output/src/RootOutputFile.cc index 9e0aa59304927..6451aa6e4daa2 100644 --- a/IOPool/Output/src/RootOutputFile.cc +++ b/IOPool/Output/src/RootOutputFile.cc @@ -125,13 +125,13 @@ namespace edm { } if (om_->compressionAlgorithm() == std::string("ZLIB")) { - filePtr_->SetCompressionAlgorithm(ROOT::kZLIB); + filePtr_->SetCompressionAlgorithm(ROOT::RCompressionSetting::EAlgorithm::kZLIB); } else if (om_->compressionAlgorithm() == std::string("LZMA")) { - filePtr_->SetCompressionAlgorithm(ROOT::kLZMA); + filePtr_->SetCompressionAlgorithm(ROOT::RCompressionSetting::EAlgorithm::kLZMA); } else if (om_->compressionAlgorithm() == std::string("ZSTD")) { - filePtr_->SetCompressionAlgorithm(ROOT::kZSTD); + filePtr_->SetCompressionAlgorithm(ROOT::RCompressionSetting::EAlgorithm::kZSTD); } else if (om_->compressionAlgorithm() == std::string("LZ4")) { - filePtr_->SetCompressionAlgorithm(ROOT::kLZ4); + filePtr_->SetCompressionAlgorithm(ROOT::RCompressionSetting::EAlgorithm::kLZ4); } else { throw Exception(errors::Configuration) << "PoolOutputModule configured with unknown compression algorithm '" << om_->compressionAlgorithm() << "'\n" diff --git a/PhysicsTools/NanoAOD/plugins/NanoAODOutputModule.cc b/PhysicsTools/NanoAOD/plugins/NanoAODOutputModule.cc index 7e9c622f86df8..08519ecfc3f00 100644 --- a/PhysicsTools/NanoAOD/plugins/NanoAODOutputModule.cc +++ b/PhysicsTools/NanoAOD/plugins/NanoAODOutputModule.cc @@ -299,13 +299,13 @@ void NanoAODOutputModule::openFile(edm::FileBlock const&) { std::vector()); if (m_compressionAlgorithm == std::string("ZLIB")) { - m_file->SetCompressionAlgorithm(ROOT::kZLIB); + m_file->SetCompressionAlgorithm(ROOT::RCompressionSetting::EAlgorithm::kZLIB); } else if (m_compressionAlgorithm == std::string("LZMA")) { - m_file->SetCompressionAlgorithm(ROOT::kLZMA); + m_file->SetCompressionAlgorithm(ROOT::RCompressionSetting::EAlgorithm::kLZMA); } else if (m_compressionAlgorithm == std::string("ZSTD")) { - m_file->SetCompressionAlgorithm(ROOT::kZSTD); + m_file->SetCompressionAlgorithm(ROOT::RCompressionSetting::EAlgorithm::kZSTD); } else if (m_compressionAlgorithm == std::string("LZ4")) { - m_file->SetCompressionAlgorithm(ROOT::kLZ4); + m_file->SetCompressionAlgorithm(ROOT::RCompressionSetting::EAlgorithm::kLZ4); } else { throw cms::Exception("Configuration") << "NanoAODOutputModule configured with unknown compression algorithm '" << m_compressionAlgorithm << "'\n" diff --git a/PhysicsTools/NanoAOD/plugins/rntuple/NanoAODRNTupleOutputModule.cc b/PhysicsTools/NanoAOD/plugins/rntuple/NanoAODRNTupleOutputModule.cc index ea56c81c17d64..ca293cbe9e552 100644 --- a/PhysicsTools/NanoAOD/plugins/rntuple/NanoAODRNTupleOutputModule.cc +++ b/PhysicsTools/NanoAOD/plugins/rntuple/NanoAODRNTupleOutputModule.cc @@ -161,9 +161,9 @@ void NanoAODRNTupleOutputModule::openFile(edm::FileBlock const&) { std::vector()); if (m_compressionAlgorithm == "ZLIB") { - m_file->SetCompressionAlgorithm(ROOT::kZLIB); + m_file->SetCompressionAlgorithm(ROOT::RCompressionSetting::EAlgorithm::kZLIB); } else if (m_compressionAlgorithm == "LZMA") { - m_file->SetCompressionAlgorithm(ROOT::kLZMA); + m_file->SetCompressionAlgorithm(ROOT::RCompressionSetting::EAlgorithm::kLZMA); } else { throw cms::Exception("Configuration") << "NanoAODOutputModule configured with unknown compression algorithm '" << m_compressionAlgorithm << "'\n" From c0970db3c7e1d56fc4e88737877e95f6ad1e9c8e Mon Sep 17 00:00:00 2001 From: iarspider Date: Sun, 10 Nov 2024 02:10:12 -0800 Subject: [PATCH 2/2] Update postprocessor.py --- .../python/postprocessing/framework/postprocessor.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PhysicsTools/NanoAODTools/python/postprocessing/framework/postprocessor.py b/PhysicsTools/NanoAODTools/python/postprocessing/framework/postprocessor.py index 3fd0c0a55bd43..cd731e6812cce 100755 --- a/PhysicsTools/NanoAODTools/python/postprocessing/framework/postprocessor.py +++ b/PhysicsTools/NanoAODTools/python/postprocessing/framework/postprocessor.py @@ -105,11 +105,11 @@ def run(self): (algo, level) = self.compression.split(":") compressionLevel = int(level) if algo == "LZMA": - compressionAlgo = ROOT.ROOT.kLZMA + compressionAlgo = ROOT.RCompressionSetting.EAlgorithm.kLZMA elif algo == "ZLIB": - compressionAlgo = ROOT.ROOT.kZLIB + compressionAlgo = ROOT.RCompressionSetting.EAlgorithm.kZLIB elif algo == "LZ4": - compressionAlgo = ROOT.ROOT.kLZ4 + compressionAlgo = ROOT.RCompressionSetting.EAlgorithm.kLZ4 else: raise RuntimeError("Unsupported compression %s" % algo) else: