From ef49fb7bbae83a0e554d3771c61344170ee9e56e Mon Sep 17 00:00:00 2001
From: Markus Frank <Markus.Frank@cern.ch>
Date: Thu, 23 Mar 2023 10:21:16 +0100
Subject: [PATCH] Problems with ROOT persistency

---
 DDG4/include/DDG4/DDG4Dict.h   | 1 -
 DDG4/include/DDG4/Geant4Data.h | 4 ++--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/DDG4/include/DDG4/DDG4Dict.h b/DDG4/include/DDG4/DDG4Dict.h
index cb52beefd..463ef1a65 100644
--- a/DDG4/include/DDG4/DDG4Dict.h
+++ b/DDG4/include/DDG4/DDG4Dict.h
@@ -64,7 +64,6 @@ namespace { class DDG4Dict {};   }
 
 /// Dictionaires for Geant4 particles
 #pragma link C++ class dd4hep::sim::ParticleExtension+;
-#pragma link C++ class std::unique_ptr<dd4hep::sim::ParticleExtension>+;
 
 /// Auto-pointers related. ROOT cannot handle I/O!
 #pragma link C++ class dd4hep::dd4hep_ptr<dd4hep::sim::DataExtension>;
diff --git a/DDG4/include/DDG4/Geant4Data.h b/DDG4/include/DDG4/Geant4Data.h
index 24e69275e..38757cf12 100644
--- a/DDG4/include/DDG4/Geant4Data.h
+++ b/DDG4/include/DDG4/Geant4Data.h
@@ -15,12 +15,12 @@
 #define DDG4_GEANT4DATA_H
 
 // Framework include files
-#include <DD4hep/Memory.h>
 #include <Math/Vector3D.h>
 
 // C/C++ include files
 #include <set>
 #include <vector>
+#include <memory>
 
 // Forward declarations
 class G4Step;
@@ -127,7 +127,7 @@ namespace dd4hep {
       /// Original Geant 4 track identifier of the creating track (debugging)
       long g4ID = -1;
       /// User data extension if required
-      dd4hep_ptr<DataExtension> extension;   //! not persisten. ROOT cannot handle
+      std::unique_ptr<DataExtension> extension;
 
       /// Utility class describing the monte carlo contribution of a given particle to a hit.
       /**
-- 
GitLab