From 9486a64b85cbf18c6b0cf84c7994add518c50124 Mon Sep 17 00:00:00 2001 From: Matti Kortelainen Date: Wed, 10 Dec 2025 15:54:49 +0100 Subject: [PATCH 1/2] Fix LHEEventProduct auto_ptr read rule to cover all previous versions --- SimDataFormats/GeneratorProducts/src/classes_def.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SimDataFormats/GeneratorProducts/src/classes_def.xml b/SimDataFormats/GeneratorProducts/src/classes_def.xml index f2e9d93f012f6..77750c2578b82 100644 --- a/SimDataFormats/GeneratorProducts/src/classes_def.xml +++ b/SimDataFormats/GeneratorProducts/src/classes_def.xml @@ -241,7 +241,7 @@ - + From 54bdaa5b9dbbceaa3b815b2b86ca5b619dc593e8 Mon Sep 17 00:00:00 2001 From: Matti Kortelainen Date: Wed, 10 Dec 2025 16:16:25 +0100 Subject: [PATCH 2/2] Evolve auto_ptr-to-unique_ptr read rules to avoid std::auto_ptr std::auto_ptr was removed in C++17, and while kept in libstd++, presently generates deprecation warnings in our builds. This pattern, tested in IOPool/Input schema evoluytion tests allows the schema evolution from auto_ptr in input file to unique_ptr in memory (and output file) without using std::auto_ptr. The read rule depends on ROOT 6.36. --- SimDataFormats/GeneratorProducts/src/classes.h | 16 ++++++++++++++++ .../GeneratorProducts/src/classes_def.xml | 11 ++++++----- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/SimDataFormats/GeneratorProducts/src/classes.h b/SimDataFormats/GeneratorProducts/src/classes.h index 63a8fcc3b0af5..1d39debbf6ea8 100644 --- a/SimDataFormats/GeneratorProducts/src/classes.h +++ b/SimDataFormats/GeneratorProducts/src/classes.h @@ -39,3 +39,19 @@ namespace hepmc_rootio { } } } // namespace hepmc_rootio + +// needed for backwards compatibility for auto_ptr +namespace pdfinfo_autoptr_rootio { + // Following the pattern in DataFormats/TestObjects/src/classes.h + template + struct deprecated_auto_ptr { + // We use compat_auto_ptr only to assign the wrapped raw pointer + // to a unique pointer in an I/O customization rule. + // Therefore, we don't delete on destruction (because ownership + // gets transferred to the unique pointer). + + // ~deprecated_auto_ptr() { delete _M_ptr; } + + T* _M_ptr = nullptr; + }; +} // namespace pdfinfo_autoptr_rootio diff --git a/SimDataFormats/GeneratorProducts/src/classes_def.xml b/SimDataFormats/GeneratorProducts/src/classes_def.xml index 77750c2578b82..80dce92c1be88 100644 --- a/SimDataFormats/GeneratorProducts/src/classes_def.xml +++ b/SimDataFormats/GeneratorProducts/src/classes_def.xml @@ -121,7 +121,8 @@ - + + @@ -193,8 +194,8 @@ - - + + @@ -241,8 +242,8 @@ - - + +