From 07d92185456970bf85965a35d5c3bacc1f040e06 Mon Sep 17 00:00:00 2001
From: Markus Frank <Markus.Frank@cern.ch>
Date: Fri, 16 Jun 2023 14:45:36 +0200
Subject: [PATCH] Fix compile error on MacOS

---
 DDG4/edm4hep/Geant4Output2EDM4hep.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/DDG4/edm4hep/Geant4Output2EDM4hep.cpp b/DDG4/edm4hep/Geant4Output2EDM4hep.cpp
index 02ca17daa..8d80de675 100644
--- a/DDG4/edm4hep/Geant4Output2EDM4hep.cpp
+++ b/DDG4/edm4hep/Geant4Output2EDM4hep.cpp
@@ -442,7 +442,7 @@ void Geant4Output2EDM4hep::saveCollection(OutputContext<G4Event>& /*ctxt*/, G4VH
   //-------------------------------------------------------------------
   if( typeid( Geant4Tracker::Hit ) == coll->type().type()  ){
     // Create the hit container even if there are no entries!
-    auto& hits = m_trackerHits[colName] = {};
+    auto& hits = m_trackerHits[colName] = edm4hep::SimTrackerHitCollection();
     for(unsigned i=0 ; i < nhits ; ++i){
       auto sth = hits->create();
       const Geant4Tracker::Hit* hit = coll->hit(i);
@@ -473,7 +473,8 @@ void Geant4Output2EDM4hep::saveCollection(OutputContext<G4Event>& /*ctxt*/, G4VH
     Geant4Sensitive* sd = coll->sensitive();
     int hit_creation_mode = sd->hitCreationMode();
     // Create the hit container even if there are no entries!
-    auto& hits = m_calorimeterHits[colName] = {};
+    auto& hits = m_calorimeterHits[colName] =
+      std::make_pair(edm4hep::SimCalorimeterHitCollection(), edm4hep::CaloHitContributionCollection());
     for(unsigned i=0 ; i < nhits ; ++i){
       auto sch = hits.first->create();
       const Geant4Calorimeter::Hit* hit = coll->hit(i);
-- 
GitLab