From e63b73237ec4fbdfc899add43c021197cad7eddd Mon Sep 17 00:00:00 2001
From: Wouter Deconinck <wdconinc@gmail.com>
Date: Wed, 23 Feb 2022 18:11:43 +0000
Subject: [PATCH] edm4hep updates in scripts

---
 .../b0_tracker/analysis/b0_tracker_hits.cxx   |   2 +-
 benchmarks/b0_tracker/forward_protons.sh      |   5 +-
 benchmarks/barrel_ecal/config.yml             |  12 +--
 .../barrel_ecal/run_emcal_barrel_electrons.sh |   5 +-
 .../run_emcal_barrel_energy_scan.sh           |   2 +-
 .../barrel_ecal/run_emcal_barrel_particles.sh |   5 +-
 .../barrel_ecal/run_emcal_barrel_pi0.sh       |   5 +-
 .../run_emcal_barrel_pion_rejection.sh        |   5 +-
 .../barrel_ecal/run_emcal_barrel_pions.sh     |   5 +-
 .../emcal_barrel_energy_scan_analysis.cxx     |  22 ++--
 .../emcal_barrel_particles_analysis.cxx       |  18 ++--
 .../scripts/emcal_barrel_pi0_analysis.cxx     |  30 +++---
 .../emcal_barrel_pion_rejection_analysis.cxx  | 102 +++++++++---------
 .../scripts/emcal_barrel_pions_analysis.cxx   |  26 ++---
 benchmarks/barrel_hcal/config.yml             |  18 ++--
 .../run_hcal_barrel_energy_scan.sh            |   2 +-
 .../barrel_hcal/run_hcal_barrel_particles.sh  |   5 +-
 .../hcal_barrel_energy_scan_analysis.cxx      |  18 ++--
 .../hcal_barrel_particles_analysis.cxx        |  18 ++--
 benchmarks/crystal_calorimeter/config.yml     |   4 +-
 .../crystal_calorimeter/makeplot_pion.C       |   2 +-
 .../run_simulation_crystal.sh                 |   2 +-
 .../run_simulation_crystal_pion.sh            |   5 +-
 .../simple_checking_crystal.cxx               |   2 +-
 benchmarks/pid/config.yml                     |   6 +-
 benchmarks/pid/scripts/mrich_analysis.cxx     |   2 +-
 benchmarks/roman_pots/roman_pot_hit_eta.cxx   |   4 +-
 benchmarks/roman_pots/roman_pot_simu.sh       |   3 +-
 benchmarks/roman_pots/simple_tracking.cxx     |   4 +-
 benchmarks/timing/run_timing.sh               |   9 +-
 benchmarks/trackers/roman_pot_hit_eta.cxx     |  13 ++-
 benchmarks/trackers/roman_pot_simu.sh         |   2 +-
 benchmarks/trackers/simple_tracking.cxx       |   8 +-
 .../{scripts => analysis}/sim_track_hits.cxx  |  32 +++---
 benchmarks/tracking_detectors/config.yml      |   1 +
 benchmarks/tracking_detectors/track_hits.sh   |   7 +-
 benchmarks/zdc/run_simulation_zdc.sh          |   2 +-
 benchmarks/zdc/run_zdc_neutrons.sh            |   5 +-
 .../zdc/scripts/zdc_neutrons_analysis.cxx     |  18 ++--
 benchmarks/zdc/simple_checking.cxx            |   4 +-
 .../zdc/simple_info_plot_histograms.cxx       |   6 +-
 41 files changed, 233 insertions(+), 213 deletions(-)
 rename benchmarks/tracking_detectors/{scripts => analysis}/sim_track_hits.cxx (86%)

diff --git a/benchmarks/b0_tracker/analysis/b0_tracker_hits.cxx b/benchmarks/b0_tracker/analysis/b0_tracker_hits.cxx
index b4984ada..721445ba 100644
--- a/benchmarks/b0_tracker/analysis/b0_tracker_hits.cxx
+++ b/benchmarks/b0_tracker/analysis/b0_tracker_hits.cxx
@@ -26,7 +26,7 @@ R__LOAD_LIBRARY(libfmt.so)
 
 #include "dd4pod/TrackerHitCollection.h"
 
-void b0_tracker_hits(const char* fname = "./sim_output/sim_forward_protons.root"){
+void b0_tracker_hits(const char* fname = "./sim_output/sim_forward_protons.edm4hep.root"){
 
   ROOT::EnableImplicitMT(); // Tell ROOT you want to go parallel
   double degree = TMath::Pi()/180.0;
diff --git a/benchmarks/b0_tracker/forward_protons.sh b/benchmarks/b0_tracker/forward_protons.sh
index f0a6be99..1471658e 100755
--- a/benchmarks/b0_tracker/forward_protons.sh
+++ b/benchmarks/b0_tracker/forward_protons.sh
@@ -10,7 +10,7 @@ fi
 
 export FILE_NAME_TAG="forward_protons"
 export JUGGLER_GEN_FILE="${LOCAL_DATA_PATH}/${FILE_NAME_TAG}.hepmc"
-export JUGGLER_SIM_FILE="${LOCAL_DATA_PATH}/sim_${FILE_NAME_TAG}.root"
+export JUGGLER_SIM_FILE="${LOCAL_DATA_PATH}/sim_${FILE_NAME_TAG}.edm4hep.root"
 
 echo "JUGGLER_N_EVENTS = ${JUGGLER_N_EVENTS}"
 echo "JUGGLER_DETECTOR = ${JUGGLER_DETECTOR}"
@@ -23,9 +23,10 @@ if [[ "$?" -ne "0" ]] ; then
 fi
 
 # Run geant4 simulations
-npsim --runType batch \
+ddsim --runType batch \
       -v WARNING \
       --part.minimalKineticEnergy 0.5*GeV  \
+      --filter.tracker edep0 \
       --numberOfEvents ${JUGGLER_N_EVENTS} \
       --compactFile ${DETECTOR_PATH}/${JUGGLER_DETECTOR}.xml \
       --inputFiles ${FILE_NAME_TAG}.hepmc \
diff --git a/benchmarks/barrel_ecal/config.yml b/benchmarks/barrel_ecal/config.yml
index dcf41f27..100037cc 100644
--- a/benchmarks/barrel_ecal/config.yml
+++ b/benchmarks/barrel_ecal/config.yml
@@ -40,9 +40,9 @@ calib:emcal_barrel_electrons:
     - ["sim:emcal_barrel_electrons"]
   script:
     - ls -lhtR sim_output/
-    - rootls -t sim_output/sim_emcal_barrel_electron.root
+    - rootls -t sim_output/sim_emcal_barrel_electron.edm4hep.root
     - root -b -q 'benchmarks/barrel_ecal/scripts/emcal_barrel_particles_analysis.cxx+("electron", true)'
-    - mv sim_output/sim_emcal_barrel_electron.root results/.
+    - mv sim_output/sim_emcal_barrel_electron.edm4hep.root results/.
     - echo "JSON file(s) from analysis:" ; cat results/*.json
 
 bench:emcal_barrel_pions:
@@ -77,9 +77,9 @@ bench:emcal_barrel_photons:
     - ["sim:emcal_barrel_photons"]
   script:
     - ls -lhtR sim_output/
-    - rootls -t sim_output/sim_emcal_barrel_photon.root
+    - rootls -t sim_output/sim_emcal_barrel_photon.edm4hep.root
     - root -b -q 'benchmarks/barrel_ecal/scripts/emcal_barrel_particles_analysis.cxx+("photon", false)'
-    - mv sim_output/sim_emcal_barrel_photon.root results/.
+    - mv sim_output/sim_emcal_barrel_photon.edm4hep.root results/.
     - if [[ "$RUN_EXTENDED_BENCHMARK" == "true" ]] ; then root -b -q 'benchmarks/barrel_ecal/scripts/emcal_barrel_energy_scan_analysis.cxx+("photon")' ; fi
 
 bench:emcal_barrel_pion_rejection:
@@ -89,8 +89,8 @@ bench:emcal_barrel_pion_rejection:
     - ["sim:emcal_barrel_pion_rejection"]
   script:
     - ls -lhtR sim_output/
-    - rootls -t sim_output/sim_emcal_barrel_piRej_piminus.root
-    - rootls -t sim_output/sim_emcal_barrel_piRej_electron.root
+    - rootls -t sim_output/sim_emcal_barrel_piRej_piminus.edm4hep.root
+    - rootls -t sim_output/sim_emcal_barrel_piRej_electron.edm4hep.root
     - root -b -q benchmarks/barrel_ecal/scripts/emcal_barrel_pion_rejection_analysis.cxx+
 
 collect_results:barrel_ecal:
diff --git a/benchmarks/barrel_ecal/run_emcal_barrel_electrons.sh b/benchmarks/barrel_ecal/run_emcal_barrel_electrons.sh
index 7b03df11..df97c7b2 100755
--- a/benchmarks/barrel_ecal/run_emcal_barrel_electrons.sh
+++ b/benchmarks/barrel_ecal/run_emcal_barrel_electrons.sh
@@ -18,7 +18,7 @@ fi
 export JUGGLER_FILE_NAME_TAG="emcal_barrel_uniform_electrons"
 export JUGGLER_GEN_FILE="${JUGGLER_FILE_NAME_TAG}.hepmc"
 
-export JUGGLER_SIM_FILE="sim_${JUGGLER_FILE_NAME_TAG}.root"
+export JUGGLER_SIM_FILE="sim_${JUGGLER_FILE_NAME_TAG}.edm4hep.root"
 export JUGGLER_REC_FILE="rec_${JUGGLER_FILE_NAME_TAG}.root"
 
 echo "JUGGLER_N_EVENTS = ${JUGGLER_N_EVENTS}"
@@ -38,9 +38,10 @@ if [[ "$?" -ne "0" ]] ; then
 fi
 
 # Run geant4 simulations
-npsim --runType batch \
+ddsim --runType batch \
       -v WARNING \
       --part.minimalKineticEnergy 0.5*GeV  \
+      --filter.tracker edep0 \
       --numberOfEvents ${JUGGLER_N_EVENTS} \
       --compactFile ${DETECTOR_PATH}/${JUGGLER_DETECTOR}.xml \
       --inputFiles ${JUGGLER_FILE_NAME_TAG}.hepmc \
diff --git a/benchmarks/barrel_ecal/run_emcal_barrel_energy_scan.sh b/benchmarks/barrel_ecal/run_emcal_barrel_energy_scan.sh
index ad6e73f3..4492ddcf 100755
--- a/benchmarks/barrel_ecal/run_emcal_barrel_energy_scan.sh
+++ b/benchmarks/barrel_ecal/run_emcal_barrel_energy_scan.sh
@@ -20,7 +20,7 @@ do
    mkdir -p "$path_rootfiles"
    mkdir -p "$path_plots"
    ls -lthaR sim_output/
-   mv "sim_output/sim_emcal_barrel_${PARTICLE}.root" "$path_rootfiles"
+   mv "sim_output/sim_emcal_barrel_${PARTICLE}.edm4hep.root" "$path_rootfiles"
 done
 
 export JUGGLER_N_EVENTS=$ORIGINAL_JUGGLER_N_EVENTS
diff --git a/benchmarks/barrel_ecal/run_emcal_barrel_particles.sh b/benchmarks/barrel_ecal/run_emcal_barrel_particles.sh
index 71977b28..7d463d7f 100755
--- a/benchmarks/barrel_ecal/run_emcal_barrel_particles.sh
+++ b/benchmarks/barrel_ecal/run_emcal_barrel_particles.sh
@@ -24,7 +24,7 @@ fi
 export JUGGLER_FILE_NAME_TAG="emcal_barrel_${PARTICLE}"
 export JUGGLER_GEN_FILE="${JUGGLER_FILE_NAME_TAG}.hepmc"
 
-export JUGGLER_SIM_FILE="sim_${JUGGLER_FILE_NAME_TAG}.root"
+export JUGGLER_SIM_FILE="sim_${JUGGLER_FILE_NAME_TAG}.edm4hep.root"
 export JUGGLER_REC_FILE="rec_${JUGGLER_FILE_NAME_TAG}.root"
 
 echo "JUGGLER_N_EVENTS = ${JUGGLER_N_EVENTS}"
@@ -45,9 +45,10 @@ fi
 
 ls -ltRhL
 
-npsim --runType batch \
+ddsim --runType batch \
       -v WARNING \
       --part.minimalKineticEnergy 0.5*GeV  \
+      --filter.tracker edep0 \
       --numberOfEvents ${JUGGLER_N_EVENTS} \
       --compactFile ${DETECTOR_PATH}/${JUGGLER_DETECTOR}.xml \
       --inputFiles data/${JUGGLER_FILE_NAME_TAG}.hepmc \
diff --git a/benchmarks/barrel_ecal/run_emcal_barrel_pi0.sh b/benchmarks/barrel_ecal/run_emcal_barrel_pi0.sh
index 62384d07..cdcc583a 100755
--- a/benchmarks/barrel_ecal/run_emcal_barrel_pi0.sh
+++ b/benchmarks/barrel_ecal/run_emcal_barrel_pi0.sh
@@ -23,7 +23,7 @@ fi
 export JUGGLER_FILE_NAME_TAG="emcal_barrel_uniform_pi0"
 export JUGGLER_GEN_FILE="${JUGGLER_FILE_NAME_TAG}.hepmc"
 
-export JUGGLER_SIM_FILE="sim_${JUGGLER_FILE_NAME_TAG}.root"
+export JUGGLER_SIM_FILE="sim_${JUGGLER_FILE_NAME_TAG}.edm4hep.root"
 export JUGGLER_REC_FILE="rec_${JUGGLER_FILE_NAME_TAG}.root"
 
 echo "JUGGLER_N_EVENTS = ${JUGGLER_N_EVENTS}"
@@ -43,9 +43,10 @@ if [[ "$?" -ne "0" ]] ; then
 fi
 
 # Run geant4 simulations
-npsim --runType batch \
+ddsim --runType batch \
       -v WARNING \
       --part.minimalKineticEnergy 0.5*GeV  \
+      --filter.tracker edep0 \
       --numberOfEvents ${JUGGLER_N_EVENTS} \
       --compactFile ${DETECTOR_PATH}/${JUGGLER_DETECTOR}.xml \
       --inputFiles ${JUGGLER_FILE_NAME_TAG}.hepmc \
diff --git a/benchmarks/barrel_ecal/run_emcal_barrel_pion_rejection.sh b/benchmarks/barrel_ecal/run_emcal_barrel_pion_rejection.sh
index 34482d31..5e394a6f 100644
--- a/benchmarks/barrel_ecal/run_emcal_barrel_pion_rejection.sh
+++ b/benchmarks/barrel_ecal/run_emcal_barrel_pion_rejection.sh
@@ -24,7 +24,7 @@ fi
 export JUGGLER_FILE_NAME_TAG="emcal_barrel_piRej_${PARTICLE}"
 export JUGGLER_GEN_FILE="${JUGGLER_FILE_NAME_TAG}.hepmc"
 
-export JUGGLER_SIM_FILE="sim_${JUGGLER_FILE_NAME_TAG}.root"
+export JUGGLER_SIM_FILE="sim_${JUGGLER_FILE_NAME_TAG}.edm4hep.root"
 export JUGGLER_REC_FILE="rec_${JUGGLER_FILE_NAME_TAG}.root"
 
 echo "JUGGLER_N_EVENTS = ${JUGGLER_N_EVENTS}"
@@ -45,9 +45,10 @@ fi
 
 ls -ltRhL
 
-npsim --runType batch \
+ddsim --runType batch \
       -v WARNING \
       --part.minimalKineticEnergy 0.5*GeV  \
+      --filter.tracker edep0 \
       --numberOfEvents ${JUGGLER_N_EVENTS} \
       --compactFile ${DETECTOR_PATH}/${JUGGLER_DETECTOR}.xml \
       --inputFiles data/${JUGGLER_FILE_NAME_TAG}.hepmc \
diff --git a/benchmarks/barrel_ecal/run_emcal_barrel_pions.sh b/benchmarks/barrel_ecal/run_emcal_barrel_pions.sh
index 755a589d..a42b7aed 100755
--- a/benchmarks/barrel_ecal/run_emcal_barrel_pions.sh
+++ b/benchmarks/barrel_ecal/run_emcal_barrel_pions.sh
@@ -23,7 +23,7 @@ fi
 export JUGGLER_FILE_NAME_TAG="emcal_barrel_uniform_pions"
 export JUGGLER_GEN_FILE="${JUGGLER_FILE_NAME_TAG}.hepmc"
 
-export JUGGLER_SIM_FILE="sim_${JUGGLER_FILE_NAME_TAG}.root"
+export JUGGLER_SIM_FILE="sim_${JUGGLER_FILE_NAME_TAG}.edm4hep.root"
 export JUGGLER_REC_FILE="rec_${JUGGLER_FILE_NAME_TAG}.root"
 
 echo "JUGGLER_N_EVENTS = ${JUGGLER_N_EVENTS}"
@@ -43,9 +43,10 @@ if [[ "$?" -ne "0" ]] ; then
 fi
 
 # Run geant4 simulations
-npsim --runType batch \
+ddsim --runType batch \
       -v WARNING \
       --part.minimalKineticEnergy 0.5*GeV  \
+      --filter.tracker edep0 \
       --numberOfEvents ${JUGGLER_N_EVENTS} \
       --compactFile ${DETECTOR_PATH}/${JUGGLER_DETECTOR}.xml \
       --inputFiles ${JUGGLER_FILE_NAME_TAG}.hepmc \
diff --git a/benchmarks/barrel_ecal/scripts/emcal_barrel_energy_scan_analysis.cxx b/benchmarks/barrel_ecal/scripts/emcal_barrel_energy_scan_analysis.cxx
index 91e35341..b145f3c4 100644
--- a/benchmarks/barrel_ecal/scripts/emcal_barrel_energy_scan_analysis.cxx
+++ b/benchmarks/barrel_ecal/scripts/emcal_barrel_energy_scan_analysis.cxx
@@ -8,8 +8,8 @@
 #include <iostream>
 #include <fmt/core.h>
 
-#include "dd4pod/Geant4ParticleCollection.h"
-#include "dd4pod/CalorimeterHitCollection.h"
+#include "edm4hep/MCParticleCollection.h"
+#include "edm4hep/SimCalorimeterHitCollection.h"
 
 #include "TCanvas.h"
 #include "TStyle.h"
@@ -50,25 +50,25 @@ void save_canvas(TCanvas* c, std::string var_label, std::string E_label, std::st
 
 std::tuple <double, double, double, double> extract_sampling_fraction_parameters(std::string particle_label, std::string E_label, dd4hep::Detector& detector)
 {
-  std::string input_fname = fmt::format("sim_output/energy_scan/{}/sim_emcal_barrel_{}.root", E_label, particle_label);
+  std::string input_fname = fmt::format("sim_output/energy_scan/{}/sim_emcal_barrel_{}.edm4hep.root", E_label, particle_label);
   ROOT::EnableImplicitMT();
   ROOT::RDataFrame d0("events", input_fname);
 
   // Thrown Energy [GeV]
-  auto Ethr = [](std::vector<dd4pod::Geant4ParticleData> const& input) {
+  auto Ethr = [](std::vector<edm4hep::MCParticleData> const& input) {
     auto p = input[2];
-    auto energy = TMath::Sqrt(p.ps.x * p.ps.x + p.ps.y * p.ps.y + p.ps.z * p.ps.z + p.mass * p.mass);
+    auto energy = TMath::Sqrt(p.momentum.x * p.momentum.x + p.momentum.y * p.momentum.y + p.momentum.z * p.momentum.z + p.mass * p.mass);
     return energy;
   };
 
   // Number of hits
-  auto nhits = [] (const std::vector<dd4pod::CalorimeterHitData>& evt) {return (int) evt.size(); };
+  auto nhits = [] (const std::vector<edm4hep::SimCalorimeterHitData>& evt) {return (int) evt.size(); };
 
   // Energy deposition [GeV]
-  auto Esim = [](const std::vector<dd4pod::CalorimeterHitData>& evt) {
+  auto Esim = [](const std::vector<edm4hep::SimCalorimeterHitData>& evt) {
     auto total_edep = 0.0;
     for (const auto& i: evt)
-      total_edep += i.energyDeposit;
+      total_edep += i.energy;
     return total_edep;
   };
 
@@ -84,7 +84,7 @@ std::tuple <double, double, double, double> extract_sampling_fraction_parameters
   fmt::print(" layer index is {}.\n", layer_index);
 
   // Define variables
-  auto d1 = d0.Define("Ethr", Ethr, {"mcparticles"})
+  auto d1 = d0.Define("Ethr", Ethr, {"MCParticles"})
                 .Define("nhits", nhits, {"EcalBarrelHits"})
                 .Define("EsimImg", Esim, {"EcalBarrelHits"})
                 .Define("EsimScFi", Esim, {"EcalBarrelScFiHits"})
@@ -117,11 +117,11 @@ std::tuple <double, double, double, double> extract_sampling_fraction_parameters
   clayer->Divide(4,5);
 
   for(int layer=1; layer<nlayers+1; layer++) {
-    auto Esim_layer = [=](const std::vector<dd4pod::CalorimeterHitData>& evt) {
+    auto Esim_layer = [=](const std::vector<edm4hep::SimCalorimeterHitData>& evt) {
       auto layer_edep = 0.0;
       for (const auto& i: evt) {
         if (decoder->get(i.cellID, layer_index) == layer) {
-          layer_edep += i.energyDeposit;
+          layer_edep += i.energy;
         }
       }
       return layer_edep;
diff --git a/benchmarks/barrel_ecal/scripts/emcal_barrel_particles_analysis.cxx b/benchmarks/barrel_ecal/scripts/emcal_barrel_particles_analysis.cxx
index a9613072..ca589efe 100644
--- a/benchmarks/barrel_ecal/scripts/emcal_barrel_particles_analysis.cxx
+++ b/benchmarks/barrel_ecal/scripts/emcal_barrel_particles_analysis.cxx
@@ -8,8 +8,8 @@
 #include <fstream>
 #include <fmt/core.h>
 
-#include "dd4pod/Geant4ParticleCollection.h"
-#include "dd4pod/CalorimeterHitCollection.h"
+#include "edm4hep/MCParticleCollection.h"
+#include "edm4hep/SimCalorimeterHitCollection.h"
 
 #include "TCanvas.h"
 #include "TStyle.h"
@@ -61,7 +61,7 @@ void emcal_barrel_particles_analysis(std::string particle_name = "electron", boo
   double fSam_scfi_mean_err;
 
   ROOT::EnableImplicitMT();
-  std::string input_fname = fmt::format("sim_output/sim_emcal_barrel_{}.root", particle_name);
+  std::string input_fname = fmt::format("sim_output/sim_emcal_barrel_{}.edm4hep.root", particle_name);
   ROOT::RDataFrame d0("events", input_fname);
 
   // Environment Variables
@@ -75,20 +75,20 @@ void emcal_barrel_particles_analysis(std::string particle_name = "electron", boo
   }
 
   // Thrown Energy [GeV]
-  auto Ethr = [](std::vector<dd4pod::Geant4ParticleData> const& input) {
+  auto Ethr = [](std::vector<edm4hep::MCParticleData> const& input) {
     auto p = input[2];
-    auto energy = TMath::Sqrt(p.ps.x * p.ps.x + p.ps.y * p.ps.y + p.ps.z * p.ps.z + p.mass * p.mass);
+    auto energy = TMath::Sqrt(p.momentum.x * p.momentum.x + p.momentum.y * p.momentum.y + p.momentum.z * p.momentum.z + p.mass * p.mass);
     return energy;
   };
 
   // Number of hits
-  auto nhits = [] (const std::vector<dd4pod::CalorimeterHitData>& evt) {return (int) evt.size(); };
+  auto nhits = [] (const std::vector<edm4hep::SimCalorimeterHitData>& evt) {return (int) evt.size(); };
 
   // Energy deposition [GeV]
-  auto Esim = [](const std::vector<dd4pod::CalorimeterHitData>& evt) {
+  auto Esim = [](const std::vector<edm4hep::SimCalorimeterHitData>& evt) {
     auto total_edep = 0.0;
     for (const auto& i: evt)
-      total_edep += i.energyDeposit;
+      total_edep += i.energy;
     return total_edep;
   };
 
@@ -98,7 +98,7 @@ void emcal_barrel_particles_analysis(std::string particle_name = "electron", boo
   };
 
   // Define variables
-  auto d1 = d0.Define("Ethr", Ethr, {"mcparticles"})
+  auto d1 = d0.Define("Ethr", Ethr, {"MCParticles"})
                 .Define("nhits", nhits, {"EcalBarrelHits"})
                 .Define("EsimImg", Esim, {"EcalBarrelHits"})
                 .Define("EsimScFi", Esim, {"EcalBarrelScFiHits"})
diff --git a/benchmarks/barrel_ecal/scripts/emcal_barrel_pi0_analysis.cxx b/benchmarks/barrel_ecal/scripts/emcal_barrel_pi0_analysis.cxx
index 062e9346..c0ed9ae3 100644
--- a/benchmarks/barrel_ecal/scripts/emcal_barrel_pi0_analysis.cxx
+++ b/benchmarks/barrel_ecal/scripts/emcal_barrel_pi0_analysis.cxx
@@ -6,8 +6,8 @@
 #include "ROOT/RDataFrame.hxx"
 #include <iostream>
 
-#include "dd4pod/Geant4ParticleCollection.h"
-#include "dd4pod/CalorimeterHitCollection.h"
+#include "edm4hep/MCParticleCollection.h"
+#include "edm4hep/SimCalorimeterHitCollection.h"
 
 #include "common_bench/benchmark.h"
 #include "common_bench/mt.h"
@@ -30,8 +30,8 @@ using namespace ROOT::VecOps;
 using json = nlohmann::json;
 
 void emcal_barrel_pi0_analysis(
-                                const char* input_fname = "sim_output/sim_emcal_barrel_pi0.root"
-                                //const char* input_fname = "../sim_output/sim_emcal_barrel_uniform_pi0.root"
+                                const char* input_fname = "sim_output/sim_emcal_barrel_pi0.edm4hep.root"
+                                //const char* input_fname = "../sim_output/sim_emcal_barrel_uniform_pi0.edm4hep.root"
                                 )
 {
   // Setting for graphs
@@ -56,18 +56,18 @@ void emcal_barrel_pi0_analysis(
   double samp_frac = j["electron"]["sampling_fraction"];
 
   // Thrown Energy [GeV]
-  auto Ethr = [](std::vector<dd4pod::Geant4ParticleData> const& input) {
-    return TMath::Sqrt(input[2].ps.x*input[2].ps.x + input[2].ps.y*input[2].ps.y + input[2].ps.z*input[2].ps.z + input[2].mass*input[2].mass);
+  auto Ethr = [](std::vector<edm4hep::MCParticleData> const& input) {
+    return TMath::Sqrt(input[2].momentum.x*input[2].momentum.x + input[2].momentum.y*input[2].momentum.y + input[2].momentum.z*input[2].momentum.z + input[2].mass*input[2].mass);
   };
 
   // Number of hits
-  auto nhits = [] (const std::vector<dd4pod::CalorimeterHitData>& evt) {return (int) evt.size(); };
+  auto nhits = [] (const std::vector<edm4hep::SimCalorimeterHitData>& evt) {return (int) evt.size(); };
 
   // Energy deposition [GeV]
-  auto Esim = [](const std::vector<dd4pod::CalorimeterHitData>& evt) {
+  auto Esim = [](const std::vector<edm4hep::SimCalorimeterHitData>& evt) {
     auto total_edep = 0.0;
     for (const auto& i: evt){
-      total_edep += i.energyDeposit;
+      total_edep += i.energy;
     }
     return total_edep;
   };
@@ -88,24 +88,24 @@ void emcal_barrel_pi0_analysis(
   };
 
   // Returns the pdgID of the particle
-  auto getpid = [](std::vector<dd4pod::Geant4ParticleData> const& input) {
-    return input[2].pdgID;
+  auto getpid = [](std::vector<edm4hep::MCParticleData> const& input) {
+    return input[2].PDG;
   };
 
   // Returns number of particle daughters
-  auto getdau = [](std::vector<dd4pod::Geant4ParticleData> const& input) {
+  auto getdau = [](std::vector<edm4hep::MCParticleData> const& input) {
     return input[2].daughters_begin;
   };
 
   // Define variables
-  auto d1 = d0.Define("Ethr",       Ethr,          {"mcparticles"})
+  auto d1 = d0.Define("Ethr",       Ethr,          {"MCParticles"})
               .Define("nhits",      nhits,         {"EcalBarrelHits"})
               .Define("EsimImg",    Esim,          {"EcalBarrelHits"})
               .Define("EsimScFi",   Esim,          {"EcalBarrelScFiHits"})
               .Define("Esim",                      "EsimImg+EsimScFi")
               .Define("fsam",       fsam,          {"Esim","Ethr"})
-              .Define("pid",        getpid,        {"mcparticles"})
-              .Define("dau",        getdau,        {"mcparticles"})
+              .Define("pid",        getpid,        {"MCParticles"})
+              .Define("dau",        getdau,        {"MCParticles"})
               .Define("dE",         eResol,        {"Esim","Ethr"})
               .Define("dE_rel",     eResol_rel,    {"Esim","Ethr"})
               ;
diff --git a/benchmarks/barrel_ecal/scripts/emcal_barrel_pion_rejection_analysis.cxx b/benchmarks/barrel_ecal/scripts/emcal_barrel_pion_rejection_analysis.cxx
index 2e0d41cd..89156923 100644
--- a/benchmarks/barrel_ecal/scripts/emcal_barrel_pion_rejection_analysis.cxx
+++ b/benchmarks/barrel_ecal/scripts/emcal_barrel_pion_rejection_analysis.cxx
@@ -8,8 +8,8 @@
 #include <algorithm>
 #include <string>
 
-#include "dd4pod/Geant4ParticleCollection.h"
-#include "dd4pod/CalorimeterHitCollection.h"
+#include "edm4hep/MCParticleCollection.h"
+#include "edm4hep/SimCalorimeterHitCollection.h"
 
 #include "common_bench/benchmark.h"
 #include "common_bench/mt.h"
@@ -48,8 +48,8 @@ using ROOT::RDataFrame;
 using namespace ROOT::VecOps;
 
 void emcal_barrel_pion_rejection_analysis(
-                                          const char* input_fname1 = "sim_output/sim_emcal_barrel_piRej_electron.root",
-                                          const char* input_fname2 = "sim_output/sim_emcal_barrel_piRej_piminus.root"
+                                          const char* input_fname1 = "sim_output/sim_emcal_barrel_piRej_electron.edm4hep.root",
+                                          const char* input_fname2 = "sim_output/sim_emcal_barrel_piRej_piminus.edm4hep.root"
                                           )
 {
   // Error Ignore Level Set
@@ -105,44 +105,44 @@ void emcal_barrel_pion_rejection_analysis(
   auto layer_indexScFi = decoderScFi->index("layer");
 
   // Thrown Energy [GeV]
-  auto Ethr = [](std::vector<dd4pod::Geant4ParticleData> const& input) {
-    return TMath::Sqrt(input[2].ps.x*input[2].ps.x + input[2].ps.y*input[2].ps.y + input[2].ps.z*input[2].ps.z + input[2].mass*input[2].mass);
+  auto Ethr = [](std::vector<edm4hep::MCParticleData> const& input) {
+    return TMath::Sqrt(input[2].momentum.x*input[2].momentum.x + input[2].momentum.y*input[2].momentum.y + input[2].momentum.z*input[2].momentum.z + input[2].mass*input[2].mass);
   };
 
   // Thrown Momentum [GeV]
-  auto Pthr = [](std::vector<dd4pod::Geant4ParticleData> const& input) {
-    return TMath::Sqrt(input[2].ps.x*input[2].ps.x + input[2].ps.y*input[2].ps.y + input[2].ps.z*input[2].ps.z);
+  auto Pthr = [](std::vector<edm4hep::MCParticleData> const& input) {
+    return TMath::Sqrt(input[2].momentum.x*input[2].momentum.x + input[2].momentum.y*input[2].momentum.y + input[2].momentum.z*input[2].momentum.z);
   };
 
   // Thrown Eta 
-  auto Eta = [](std::vector<dd4pod::Geant4ParticleData> const& input) {
-    double E  = TMath::Sqrt(input[2].ps.x*input[2].ps.x + input[2].ps.y*input[2].ps.y + input[2].ps.z*input[2].ps.z + input[2].mass*input[2].mass);
-    return 0.5*TMath::Log((E + input[2].ps.z) / (E - input[2].ps.z));
+  auto Eta = [](std::vector<edm4hep::MCParticleData> const& input) {
+    double E  = TMath::Sqrt(input[2].momentum.x*input[2].momentum.x + input[2].momentum.y*input[2].momentum.y + input[2].momentum.z*input[2].momentum.z + input[2].mass*input[2].mass);
+    return 0.5*TMath::Log((E + input[2].momentum.z) / (E - input[2].momentum.z));
   };
 
   // Thrown pT [GeV]
-  auto pT = [](std::vector<dd4pod::Geant4ParticleData> const& input) {
-    return TMath::Sqrt(input[2].ps.x*input[2].ps.x + input[2].ps.y*input[2].ps.y);
+  auto pT = [](std::vector<edm4hep::MCParticleData> const& input) {
+    return TMath::Sqrt(input[2].momentum.x*input[2].momentum.x + input[2].momentum.y*input[2].momentum.y);
   };
 
   // Number of hits
-  auto nhits = [] (const std::vector<dd4pod::CalorimeterHitData>& evt) {return (int) evt.size(); };
+  auto nhits = [] (const std::vector<edm4hep::SimCalorimeterHitData>& evt) {return (int) evt.size(); };
 
   // Energy deposition [GeV]
-  auto Esim = [](const std::vector<dd4pod::CalorimeterHitData>& evt) {
+  auto Esim = [](const std::vector<edm4hep::SimCalorimeterHitData>& evt) {
     double total_edep = 0.0;
     for (const auto& i: evt){
-      total_edep += i.energyDeposit;
+      total_edep += i.energy;
     }
     return total_edep;
   };
 
   // Energy deposititon [GeV] in the first 2 layers
-  auto Esim_dep2 = [=](const std::vector<dd4pod::CalorimeterHitData>& evt) {
+  auto Esim_dep2 = [=](const std::vector<edm4hep::SimCalorimeterHitData>& evt) {
     auto total_edep = 0.0;
     for (const auto& i: evt) {
       if( decoder->get(i.cellID, layer_index) < 3 ){
-        total_edep += i.energyDeposit;
+        total_edep += i.energy;
       }
     }
     return total_edep;
@@ -150,87 +150,87 @@ void emcal_barrel_pion_rejection_analysis(
 
   // Energy deposititon [GeV] in the first 3 layers
   // Same as Esim_front from previous codes
-  auto Esim_dep3 = [=](const std::vector<dd4pod::CalorimeterHitData>& evt) {
+  auto Esim_dep3 = [=](const std::vector<edm4hep::SimCalorimeterHitData>& evt) {
     auto total_edep = 0.0;
     for (const auto& i: evt) {
       if( decoder->get(i.cellID, layer_index) < 4 ){
-        total_edep += i.energyDeposit;
+        total_edep += i.energy;
       }
     }
     return total_edep;
   };
 
   // Energy deposititon [GeV] in the first 4 layers
-  auto Esim_dep4 = [=](const std::vector<dd4pod::CalorimeterHitData>& evt) {
+  auto Esim_dep4 = [=](const std::vector<edm4hep::SimCalorimeterHitData>& evt) {
     auto total_edep = 0.0;
     for (const auto& i: evt) {
       if( decoder->get(i.cellID, layer_index) < 5 ){
-        total_edep += i.energyDeposit;
+        total_edep += i.energy;
       }
     }
     return total_edep;
   };
 
   // Energy deposititon [GeV] in the first 5 layers
-  auto Esim_dep5 = [=](const std::vector<dd4pod::CalorimeterHitData>& evt) {
+  auto Esim_dep5 = [=](const std::vector<edm4hep::SimCalorimeterHitData>& evt) {
     auto total_edep = 0.0;
     for (const auto& i: evt) {
       if( decoder->get(i.cellID, layer_index) < 6 ){
-        total_edep += i.energyDeposit;
+        total_edep += i.energy;
       }
     }
     return total_edep;
   };
 
   // Energy deposititon [GeV] in the first 6 layers
-  auto Esim_dep6 = [=](const std::vector<dd4pod::CalorimeterHitData>& evt) {
+  auto Esim_dep6 = [=](const std::vector<edm4hep::SimCalorimeterHitData>& evt) {
     auto total_edep = 0.0;
     for (const auto& i: evt) {
       if( decoder->get(i.cellID, layer_index) < 7 ){
-        total_edep += i.energyDeposit;
+        total_edep += i.energy;
       }
     }
     return total_edep;
   };
 
   // Energy deposititon [GeV] in the first 6 layers
-  auto Esim_dep6_ScFi = [=](const std::vector<dd4pod::CalorimeterHitData>& evt) {
+  auto Esim_dep6_ScFi = [=](const std::vector<edm4hep::SimCalorimeterHitData>& evt) {
     auto total_edep = 0.0;
     for (const auto& i: evt) {
       if( decoderScFi->get(i.cellID, layer_indexScFi) < 7 ){
-        total_edep += i.energyDeposit;
+        total_edep += i.energy;
       } 
     }
     return total_edep;
   };
 
   // Energy deposititon [GeV] in the first 7 layers
-  auto Esim_dep7 = [=](const std::vector<dd4pod::CalorimeterHitData>& evt) {
+  auto Esim_dep7 = [=](const std::vector<edm4hep::SimCalorimeterHitData>& evt) {
     auto total_edep = 0.0;
     for (const auto& i: evt) {
       if( decoder->get(i.cellID, layer_index) < 8 ){
-        total_edep += i.energyDeposit;
+        total_edep += i.energy;
       }
     }
     return total_edep;
   };
     // Energy deposititon [GeV] in the first 8 layers
-  auto Esim_dep8 = [=](const std::vector<dd4pod::CalorimeterHitData>& evt) {
+  auto Esim_dep8 = [=](const std::vector<edm4hep::SimCalorimeterHitData>& evt) {
     auto total_edep = 0.0;
     for (const auto& i: evt) {
       if( decoder->get(i.cellID, layer_index) < 9 ){
-        total_edep += i.energyDeposit;
+        total_edep += i.energy;
       }
     }
     return total_edep;
   };
 
   // Energy deposititon [GeV] in the first 9 layers
-  auto Esim_dep9 = [=](const std::vector<dd4pod::CalorimeterHitData>& evt) {
+  auto Esim_dep9 = [=](const std::vector<edm4hep::SimCalorimeterHitData>& evt) {
     auto total_edep = 0.0;
     for (const auto& i: evt) {
       if( decoder->get(i.cellID, layer_index) < 10 ){
-        total_edep += i.energyDeposit;
+        total_edep += i.energy;
       }
     }
     return total_edep;
@@ -238,10 +238,10 @@ void emcal_barrel_pion_rejection_analysis(
 
   // Energy deposititon [GeV], returns array
   // Note Layer_index = 0 does not exist at the wrting of this code
-  auto Esim_dep = [=](const std::vector<dd4pod::CalorimeterHitData>& evt) {
+  auto Esim_dep = [=](const std::vector<edm4hep::SimCalorimeterHitData>& evt) {
     std::vector<double>res(20);
     for (const auto& i: evt) {
-      res[decoder->get(i.cellID, layer_index)] += i.energyDeposit;
+      res[decoder->get(i.cellID, layer_index)] += i.energy;
     }
     return res;
   };
@@ -271,24 +271,24 @@ void emcal_barrel_pion_rejection_analysis(
     return E_front / mom;
   };
 
-  // Returns the pdgID of the particle
-  auto getpid = [](std::vector<dd4pod::Geant4ParticleData> const& input) {
-    return input[2].pdgID;
+  // Returns the PDG of the particle
+  auto getpid = [](std::vector<edm4hep::MCParticleData> const& input) {
+    return input[2].PDG;
   };
 
   // Returns number of particle daughters
-  auto getdau = [](std::vector<dd4pod::Geant4ParticleData> const& input){
+  auto getdau = [](std::vector<edm4hep::MCParticleData> const& input){
     return input[2].daughters_begin;
   };
 
   // Filter function to get electrons
-  auto is_electron = [](std::vector<dd4pod::Geant4ParticleData> const& input){
-    return (input[2].pdgID == 11 ? true : false);
+  auto is_electron = [](std::vector<edm4hep::MCParticleData> const& input){
+    return (input[2].PDG == 11 ? true : false);
   };
 
   // Filter function to get just negative pions
-  auto is_piMinus = [](std::vector<dd4pod::Geant4ParticleData> const& input){
-    return (input[2].pdgID == -211 ? true : false);
+  auto is_piMinus = [](std::vector<edm4hep::MCParticleData> const& input){
+    return (input[2].PDG == -211 ? true : false);
   };
 
   // Filter function Edeposit
@@ -302,8 +302,8 @@ void emcal_barrel_pion_rejection_analysis(
 
 
   // Define variables
-  auto d1 = d0.Define("Ethr",            Ethr,                  {"mcparticles"})
-              .Define("Pthr",            Pthr,                  {"mcparticles"})
+  auto d1 = d0.Define("Ethr",            Ethr,                  {"MCParticles"})
+              .Define("Pthr",            Pthr,                  {"MCParticles"})
               .Define("nhits",           nhits,                 {"EcalBarrelHits"})
               .Define("Esim",            Esim,                  {"EcalBarrelHits"})
               .Define("EsimScFi",        Esim,                  {"EcalBarrelScFiHits"})
@@ -312,7 +312,7 @@ void emcal_barrel_pion_rejection_analysis(
               .Define("EsimTot",                                "EsimScFi+Esim")
               .Define("EsimTotOverP",    fEp,                   {"EsimTot", "Pthr"})
               .Define("fsam",            fsam,                  {"Esim","Ethr"})
-              .Define("pid",             getpid,                {"mcparticles"})
+              .Define("pid",             getpid,                {"MCParticles"})
               .Define("EDep",            Esim_dep,              {"EcalBarrelHits"})
               .Define("EDepSum",         Esim_dep_sum,          {"EDep"})
               .Define("EDepN",           Esim_depN,             {"EDep"})
@@ -323,8 +323,8 @@ void emcal_barrel_pion_rejection_analysis(
               .Define("EDep6",           Esim_dep6,             {"EcalBarrelHits"})
               .Define("EDep6OverP",      fEp,                   {"EDep6", "Pthr"})
               .Define("EOverP",          fEp,                   {"EDep3", "Pthr"})
-              .Define("Eta",             Eta,                   {"mcparticles"})
-              .Define("pT",              pT,                    {"mcparticles"})
+              .Define("Eta",             Eta,                   {"MCParticles"})
+              .Define("pT",              pT,                    {"MCParticles"})
               .Define("EDepOverP",       fEp,                   {"EDepN", "Pthr"})
               .Define("EDepOverPT",      fEp,                   {"EDepN", "pT"})
               .Define("EDepSumOverP",    fEp,                   {"EDepSum", "Pthr"})
@@ -335,8 +335,8 @@ void emcal_barrel_pion_rejection_analysis(
   // Particle Filters
   dep_min = 1;
   dep_max = 6;
-  auto d_ele = d1.Filter(is_electron, {"mcparticles"});
-  auto d_pim = d1.Filter(is_piMinus,  {"mcparticles"});
+  auto d_ele = d1.Filter(is_electron, {"MCParticles"});
+  auto d_pim = d1.Filter(is_piMinus,  {"MCParticles"});
 
   // Cut Filter
   std::string currentCut = "(EDep6OverP>2.5e-3)&&(EDep6>5e-3)";// Good athena cut, that is changed by cutEE later
diff --git a/benchmarks/barrel_ecal/scripts/emcal_barrel_pions_analysis.cxx b/benchmarks/barrel_ecal/scripts/emcal_barrel_pions_analysis.cxx
index 24eaafdc..3e61c8e1 100644
--- a/benchmarks/barrel_ecal/scripts/emcal_barrel_pions_analysis.cxx
+++ b/benchmarks/barrel_ecal/scripts/emcal_barrel_pions_analysis.cxx
@@ -6,8 +6,8 @@
 #include "ROOT/RDataFrame.hxx"
 #include <iostream>
 
-#include "dd4pod/Geant4ParticleCollection.h"
-#include "dd4pod/CalorimeterHitCollection.h"
+#include "edm4hep/MCParticleCollection.h"
+#include "edm4hep/SimCalorimeterHitCollection.h"
 
 #include "common_bench/benchmark.h"
 #include "common_bench/mt.h"
@@ -24,7 +24,7 @@
 using ROOT::RDataFrame;
 using namespace ROOT::VecOps;
 
-void emcal_barrel_pions_analysis(const char* input_fname = "sim_output/sim_emcal_barrel_piplus.root")
+void emcal_barrel_pions_analysis(const char* input_fname = "sim_output/sim_emcal_barrel_piplus.edm4hep.root")
 {
   // Setting for graphs
   gROOT->SetStyle("Plain");
@@ -44,20 +44,20 @@ void emcal_barrel_pions_analysis(const char* input_fname = "sim_output/sim_emcal
   double samp_frac = 0.0136;
 
   // Thrown Energy [GeV]
-  auto Ethr = [](std::vector<dd4pod::Geant4ParticleData> const& input) {
+  auto Ethr = [](std::vector<edm4hep::MCParticleData> const& input) {
     auto p = input[2];
-    auto energy = TMath::Sqrt(p.ps.x * p.ps.x + p.ps.y * p.ps.y + p.ps.z * p.ps.z + p.mass * p.mass);
+    auto energy = TMath::Sqrt(p.momentum.x * p.momentum.x + p.momentum.y * p.momentum.y + p.momentum.z * p.momentum.z + p.mass * p.mass);
     return energy;
   };
 
   // Number of hits
-  auto nhits = [] (const std::vector<dd4pod::CalorimeterHitData>& evt) {return (int) evt.size(); };
+  auto nhits = [] (const std::vector<edm4hep::SimCalorimeterHitData>& evt) {return (int) evt.size(); };
 
   // Energy deposition [GeV]
-  auto Esim = [](const std::vector<dd4pod::CalorimeterHitData>& evt) {
+  auto Esim = [](const std::vector<edm4hep::SimCalorimeterHitData>& evt) {
     auto total_edep = 0.0;
     for (const auto& i: evt)
-      total_edep += i.energyDeposit;
+      total_edep += i.energy;
     return total_edep;
   };
 
@@ -77,23 +77,23 @@ void emcal_barrel_pions_analysis(const char* input_fname = "sim_output/sim_emcal
   };
 
   // Returns the pdgID of the particle
-  auto getpid = [](std::vector<dd4pod::Geant4ParticleData> const& input) {
-    return input[2].pdgID;
+  auto getpid = [](std::vector<edm4hep::MCParticleData> const& input) {
+    return input[2].PDG;
   };
 
   // Returns number of particle daughters
-  auto getdau = [](std::vector<dd4pod::Geant4ParticleData> const& input) {
+  auto getdau = [](std::vector<edm4hep::MCParticleData> const& input) {
     return input[2].daughters_begin;
   };
 
   // Define variables
-  auto d1 = d0.Define("Ethr", Ethr, {"mcparticles"})
+  auto d1 = d0.Define("Ethr", Ethr, {"MCParticles"})
                 .Define("nhits", nhits, {"EcalBarrelHits"})
                 .Define("EsimImg", Esim, {"EcalBarrelHits"})
                 .Define("EsimScFi", Esim, {"EcalBarrelScFiHits"})
                 .Define("Esim", "EsimImg+EsimScFi")
                 .Define("fsam", fsam, {"Esim", "Ethr"})
-                .Define("pid",    getpid,     {"mcparticles"});
+                .Define("pid",    getpid,     {"MCParticles"});
 
   // Define Histograms
   auto hEthr  = d1.Histo1D({"hEthr",  "Thrown Energy; Thrown Energy [GeV]; Events",        100,  0.0,    7.5}, "Ethr");
diff --git a/benchmarks/barrel_hcal/config.yml b/benchmarks/barrel_hcal/config.yml
index d47f63da..1674c8e8 100644
--- a/benchmarks/barrel_hcal/config.yml
+++ b/benchmarks/barrel_hcal/config.yml
@@ -42,7 +42,7 @@ bench:hcal_barrel_protons:
     - ["sim:hcal_barrel_protons"]
   script:
     - ls -lhtR sim_output/
-    - rootls -t sim_output/sim_hcal_barrel_proton.root
+    - rootls -t sim_output/sim_hcal_barrel_proton.edm4hep.root
     - root -b -q 'benchmarks/barrel_hcal/scripts/hcal_barrel_particles_analysis.cxx+("proton")'
     - root -b -q 'benchmarks/barrel_hcal/scripts/hcal_barrel_energy_scan_analysis.cxx+("proton")'
 
@@ -53,7 +53,7 @@ bench:hcal_barrel_muons:
     - ["sim:hcal_barrel_muons"]
   script:
     - ls -lhtR sim_output/
-    - rootls -t sim_output/sim_hcal_barrel_muon.root
+    - rootls -t sim_output/sim_hcal_barrel_muon.edm4hep.root
     - root -b -q 'benchmarks/barrel_hcal/scripts/hcal_barrel_particles_analysis.cxx+("muon")'
     - root -b -q 'benchmarks/barrel_hcal/scripts/hcal_barrel_energy_scan_analysis.cxx+("muon")'
 
@@ -64,7 +64,7 @@ bench:hcal_barrel_antimuons:
     - ["sim:hcal_barrel_antimuons"]
   script:
     - ls -lhtR sim_output/
-    - rootls -t sim_output/sim_hcal_barrel_antimuon.root
+    - rootls -t sim_output/sim_hcal_barrel_antimuon.edm4hep.root
     - root -b -q 'benchmarks/barrel_hcal/scripts/hcal_barrel_particles_analysis.cxx+("antimuon")'
     - root -b -q 'benchmarks/barrel_hcal/scripts/hcal_barrel_energy_scan_analysis.cxx+("antimuon")'
 
@@ -75,13 +75,13 @@ bench:hcal_barrel_kaons:
     - ["sim:hcal_barrel_kaons"]
   script:
     - ls -lhtR sim_output/
-    - rootls -t sim_output/sim_hcal_barrel_kplus.root
+    - rootls -t sim_output/sim_hcal_barrel_kplus.edm4hep.root
     - root -b -q 'benchmarks/barrel_hcal/scripts/hcal_barrel_particles_analysis.cxx+("kplus")'
-    - rootls -t sim_output/sim_hcal_barrel_kminus.root
+    - rootls -t sim_output/sim_hcal_barrel_kminus.edm4hep.root
     - root -b -q 'benchmarks/barrel_hcal/scripts/hcal_barrel_particles_analysis.cxx+("kminus")'
-    - rootls -t sim_output/sim_hcal_barrel_kshort.root
+    - rootls -t sim_output/sim_hcal_barrel_kshort.edm4hep.root
     - root -b -q 'benchmarks/barrel_hcal/scripts/hcal_barrel_particles_analysis.cxx+("kshort")'
-    - rootls -t sim_output/sim_hcal_barrel_klong.root
+    - rootls -t sim_output/sim_hcal_barrel_klong.edm4hep.root
     - root -b -q 'benchmarks/barrel_hcal/scripts/hcal_barrel_particles_analysis.cxx+("klong")'
 
 bench:hcal_barrel_pions:
@@ -91,9 +91,9 @@ bench:hcal_barrel_pions:
     - ["sim:hcal_barrel_pions"]
   script:
     - ls -lhtR sim_output/
-    - rootls -t sim_output/sim_hcal_barrel_piplus.root
+    - rootls -t sim_output/sim_hcal_barrel_piplus.edm4hep.root
     - root -b -q 'benchmarks/barrel_hcal/scripts/hcal_barrel_particles_analysis.cxx+("piplus")'
-    - rootls -t sim_output/sim_hcal_barrel_piminus.root
+    - rootls -t sim_output/sim_hcal_barrel_piminus.edm4hep.root
     - root -b -q 'benchmarks/barrel_hcal/scripts/hcal_barrel_particles_analysis.cxx+("piminus")'
 
 collect_results:barrel_hcal:
diff --git a/benchmarks/barrel_hcal/run_hcal_barrel_energy_scan.sh b/benchmarks/barrel_hcal/run_hcal_barrel_energy_scan.sh
index 79433389..92388286 100755
--- a/benchmarks/barrel_hcal/run_hcal_barrel_energy_scan.sh
+++ b/benchmarks/barrel_hcal/run_hcal_barrel_energy_scan.sh
@@ -15,7 +15,7 @@ do
    mkdir -p "$path_rootfiles"
    mkdir -p "$path_plots"
    ls -lthaR sim_output/
-   mv "sim_output/sim_hcal_barrel_${PARTICLE}.root" "$path_rootfiles"
+   mv "sim_output/sim_hcal_barrel_${PARTICLE}.edm4hep.root" "$path_rootfiles"
 done
 
 ls -lthaR sim_output
diff --git a/benchmarks/barrel_hcal/run_hcal_barrel_particles.sh b/benchmarks/barrel_hcal/run_hcal_barrel_particles.sh
index edeaba1e..bbd7b728 100755
--- a/benchmarks/barrel_hcal/run_hcal_barrel_particles.sh
+++ b/benchmarks/barrel_hcal/run_hcal_barrel_particles.sh
@@ -24,7 +24,7 @@ fi
 export JUGGLER_FILE_NAME_TAG="hcal_barrel_${PARTICLE}"
 export JUGGLER_GEN_FILE="${JUGGLER_FILE_NAME_TAG}.hepmc"
 
-export JUGGLER_SIM_FILE="sim_${JUGGLER_FILE_NAME_TAG}.root"
+export JUGGLER_SIM_FILE="sim_${JUGGLER_FILE_NAME_TAG}.edm4hep.root"
 export JUGGLER_REC_FILE="rec_${JUGGLER_FILE_NAME_TAG}.root"
 
 echo "JUGGLER_N_EVENTS = ${JUGGLER_N_EVENTS}"
@@ -45,9 +45,10 @@ fi
 
 ls -ltRhL
 
-npsim --runType batch \
+ddsim --runType batch \
       -v WARNING \
       --part.minimalKineticEnergy 0.5*GeV  \
+      --filter.tracker edep0 \
       --numberOfEvents ${JUGGLER_N_EVENTS} \
       --compactFile ${DETECTOR_PATH}/${JUGGLER_DETECTOR}.xml \
       --inputFiles data/${JUGGLER_FILE_NAME_TAG}.hepmc \
diff --git a/benchmarks/barrel_hcal/scripts/hcal_barrel_energy_scan_analysis.cxx b/benchmarks/barrel_hcal/scripts/hcal_barrel_energy_scan_analysis.cxx
index 1d66a981..8446d0c1 100644
--- a/benchmarks/barrel_hcal/scripts/hcal_barrel_energy_scan_analysis.cxx
+++ b/benchmarks/barrel_hcal/scripts/hcal_barrel_energy_scan_analysis.cxx
@@ -8,8 +8,8 @@
 #include <fstream>
 #include <fmt/core.h>
 
-#include "dd4pod/Geant4ParticleCollection.h"
-#include "dd4pod/CalorimeterHitCollection.h"
+#include "edm4hep/MCParticleCollection.h"
+#include "edm4hep/SimCalorimeterHitCollection.h"
 
 #include "TCanvas.h"
 #include "TStyle.h"
@@ -47,25 +47,25 @@ void save_canvas(TCanvas* c, std::string var_label, std::string E_label, std::st
 
 std::tuple <double, double, double, double> extract_sampling_fraction_parameters(std::string particle_label, std::string E_label)
 {
-  std::string input_fname = fmt::format("sim_output/energy_scan/{}/sim_hcal_barrel_{}.root", E_label, particle_label);
+  std::string input_fname = fmt::format("sim_output/energy_scan/{}/sim_hcal_barrel_{}.edm4hep.root", E_label, particle_label);
   ROOT::EnableImplicitMT();
   ROOT::RDataFrame d0("events", input_fname);
 
   // Thrown Energy [GeV]
-  auto Ethr = [](std::vector<dd4pod::Geant4ParticleData> const& input) {
+  auto Ethr = [](std::vector<edm4hep::MCParticleData> const& input) {
     auto p = input[2];
-    auto energy = TMath::Sqrt(p.ps.x * p.ps.x + p.ps.y * p.ps.y + p.ps.z * p.ps.z + p.mass * p.mass);
+    auto energy = TMath::Sqrt(p.momentum.x * p.momentum.x + p.momentum.y * p.momentum.y + p.momentum.z * p.momentum.z + p.mass * p.mass);
     return energy;
   };
 
   // Number of hits
-  auto nhits = [] (const std::vector<dd4pod::CalorimeterHitData>& evt) {return (int) evt.size(); };
+  auto nhits = [] (const std::vector<edm4hep::SimCalorimeterHitData>& evt) {return (int) evt.size(); };
 
   // Energy deposition [GeV]
-  auto Esim = [](const std::vector<dd4pod::CalorimeterHitData>& evt) {
+  auto Esim = [](const std::vector<edm4hep::SimCalorimeterHitData>& evt) {
     auto total_edep = 0.0;
     for (const auto& i: evt)
-      total_edep += i.energyDeposit;
+      total_edep += i.energy;
     return total_edep;
   };
 
@@ -75,7 +75,7 @@ std::tuple <double, double, double, double> extract_sampling_fraction_parameters
   };
 
   // Define variables
-  auto d1 = d0.Define("Ethr", Ethr, {"mcparticles"})
+  auto d1 = d0.Define("Ethr", Ethr, {"MCParticles"})
                 .Define("nhits", nhits, {"EcalBarrelHits"})
                 .Define("Esim", Esim, {"EcalBarrelHits"})
                 .Define("fsam", fsam, {"Esim", "Ethr"});
diff --git a/benchmarks/barrel_hcal/scripts/hcal_barrel_particles_analysis.cxx b/benchmarks/barrel_hcal/scripts/hcal_barrel_particles_analysis.cxx
index fbe72c2a..424802d3 100644
--- a/benchmarks/barrel_hcal/scripts/hcal_barrel_particles_analysis.cxx
+++ b/benchmarks/barrel_hcal/scripts/hcal_barrel_particles_analysis.cxx
@@ -8,8 +8,8 @@
 #include <fstream>
 #include <fmt/core.h>
 
-#include "dd4pod/Geant4ParticleCollection.h"
-#include "dd4pod/CalorimeterHitCollection.h"
+#include "edm4hep/MCParticleCollection.h"
+#include "edm4hep/SimCalorimeterHitCollection.h"
 
 #include "TCanvas.h"
 #include "TStyle.h"
@@ -49,24 +49,24 @@ void hcal_barrel_particles_analysis(std::string particle_name = "electron")
   gStyle->SetPadRightMargin(0.14);
 
   ROOT::EnableImplicitMT();
-  std::string input_fname = fmt::format("sim_output/sim_hcal_barrel_{}.root", particle_name);
+  std::string input_fname = fmt::format("sim_output/sim_hcal_barrel_{}.edm4hep.root", particle_name);
   ROOT::RDataFrame d0("events", input_fname);
 
   // Thrown Energy [GeV]
-  auto Ethr = [](std::vector<dd4pod::Geant4ParticleData> const& input) {
+  auto Ethr = [](std::vector<edm4hep::MCParticleData> const& input) {
     auto p = input[2];
-    auto energy = TMath::Sqrt(p.ps.x * p.ps.x + p.ps.y * p.ps.y + p.ps.z * p.ps.z + p.mass * p.mass);
+    auto energy = TMath::Sqrt(p.momentum.x * p.momentum.x + p.momentum.y * p.momentum.y + p.momentum.z * p.momentum.z + p.mass * p.mass);
     return energy;
   };
 
   // Number of hits
-  auto nhits = [] (const std::vector<dd4pod::CalorimeterHitData>& evt) {return (int) evt.size(); };
+  auto nhits = [] (const std::vector<edm4hep::SimCalorimeterHitData>& evt) {return (int) evt.size(); };
 
   // Energy deposition [GeV]
-  auto Esim = [](const std::vector<dd4pod::CalorimeterHitData>& evt) {
+  auto Esim = [](const std::vector<edm4hep::SimCalorimeterHitData>& evt) {
     auto total_edep = 0.0;
     for (const auto& i: evt)
-      total_edep += i.energyDeposit;
+      total_edep += i.energy;
     return total_edep;
   };
 
@@ -76,7 +76,7 @@ void hcal_barrel_particles_analysis(std::string particle_name = "electron")
   };
 
   // Define variables
-  auto d1 = d0.Define("Ethr", Ethr, {"mcparticles"})
+  auto d1 = d0.Define("Ethr", Ethr, {"MCParticles"})
                 .Define("nhits", nhits, {"HcalBarrelHits"})
                 .Define("Esim", Esim, {"HcalBarrelHits"})
                 .Define("fsam", fsam, {"Esim", "Ethr"});
diff --git a/benchmarks/crystal_calorimeter/config.yml b/benchmarks/crystal_calorimeter/config.yml
index f13c18bc..96b1accd 100644
--- a/benchmarks/crystal_calorimeter/config.yml
+++ b/benchmarks/crystal_calorimeter/config.yml
@@ -8,7 +8,7 @@ cal_sim:crystal_pion:
   extends: .det_benchmark
   stage: simulate
   script:
-    - npsim --runType batch --numberOfEvents 100 --compactFile ${DETECTOR_PATH}/${JUGGLER_DETECTOR}.xml --inputFiles  data/emcal_electrons.hepmc  --outputFile  sim_output/output_emcal_electrons.root
+    - ddsim --runType batch --numberOfEvents 100 --filter.tracker edep0 --compactFile ${DETECTOR_PATH}/${JUGGLER_DETECTOR}.xml --inputFiles  data/emcal_electrons.hepmc  --outputFile  sim_output/output_emcal_electrons.edm4hep.root
 
 cal_bench:crystal_benchmark:
   extends: .det_benchmark
@@ -16,7 +16,7 @@ cal_bench:crystal_benchmark:
   needs:
     - ["cal_sim:crystal_emcal"]
   script:
-    #- rootls -t sim_output/output_emcal_electrons.root
+    #- rootls -t sim_output/output_emcal_electrons.edm4hep.root
     - echo " Not yet complete"
       #- root -b -q benchmarks/cryxtal_calorimeter/simple_checking_crystal.cxx+
       #
diff --git a/benchmarks/crystal_calorimeter/makeplot_pion.C b/benchmarks/crystal_calorimeter/makeplot_pion.C
index 9c1b4093..d590d963 100644
--- a/benchmarks/crystal_calorimeter/makeplot_pion.C
+++ b/benchmarks/crystal_calorimeter/makeplot_pion.C
@@ -15,7 +15,7 @@ int makeplot_pion(void)
   gStyle->SetPadLeftMargin(0.14);
 
   // Input ROOT file
-  TFile *f = new TFile("sim_output/rec_crystal_pion_output.root","read");
+  TFile *f = new TFile("sim_output/rec_crystal_pion_output.edm4hep.root","read");
   TTree *t = (TTree *)f->Get("events");
 
   // Set Branch status and addressed
diff --git a/benchmarks/crystal_calorimeter/run_simulation_crystal.sh b/benchmarks/crystal_calorimeter/run_simulation_crystal.sh
index 8a44a4b3..9a1dbb0f 100755
--- a/benchmarks/crystal_calorimeter/run_simulation_crystal.sh
+++ b/benchmarks/crystal_calorimeter/run_simulation_crystal.sh
@@ -3,4 +3,4 @@
 ddsim --runType batch --numberOfEvents 100 \
       --compactFile benchmarks/crystal_calorimeter/Crystal_example.xml \
       --inputFiles  ./data/emcal_electrons.hepmc \
-      --outputFile  ./sim_output/output_emcal_electrons.root
+      --outputFile  ./sim_output/output_emcal_electrons.edm4hep.root
diff --git a/benchmarks/crystal_calorimeter/run_simulation_crystal_pion.sh b/benchmarks/crystal_calorimeter/run_simulation_crystal_pion.sh
index f8eb44f9..a728fa10 100755
--- a/benchmarks/crystal_calorimeter/run_simulation_crystal_pion.sh
+++ b/benchmarks/crystal_calorimeter/run_simulation_crystal_pion.sh
@@ -1,6 +1,7 @@
 #!/bin/bash
 
-npsim --runType batch --numberOfEvents 10000 \
+ddsim --runType batch --numberOfEvents 10000 \
+      --filter.tracker edep0 \
       --compactFile benchmarks/calorimeters/topside.xml \
       --inputFiles  ./data/emcal_pions_upto1GeV_10kevents.hepmc \
-      --outputFile  ./sim_output/sim_crystal_pion_input.root
+      --outputFile  ./sim_output/sim_crystal_pion_input.edm4hep.root
diff --git a/benchmarks/crystal_calorimeter/simple_checking_crystal.cxx b/benchmarks/crystal_calorimeter/simple_checking_crystal.cxx
index d60c2d6c..e99add75 100644
--- a/benchmarks/crystal_calorimeter/simple_checking_crystal.cxx
+++ b/benchmarks/crystal_calorimeter/simple_checking_crystal.cxx
@@ -5,7 +5,7 @@ R__LOAD_LIBRARY(libDDG4IO.so)
 #include "TChain.h"
 #include <random>
 
-void simple_checking_crystal(const char* fname = "sim_output/output_emcal_electrons.root"){
+void simple_checking_crystal(const char* fname = "sim_output/output_emcal_electrons.edm4hep.root"){
   ROOT::EnableImplicitMT(); // Tell ROOT you want to go parallel
   double degree = TMath::Pi()/180.0;
 
diff --git a/benchmarks/pid/config.yml b/benchmarks/pid/config.yml
index 112d1b59..6d93582e 100644
--- a/benchmarks/pid/config.yml
+++ b/benchmarks/pid/config.yml
@@ -2,8 +2,8 @@ sim:backward:
   extends: .det_benchmark
   stage: simulate
   script:
-    - npsim --runType batch --numberOfEvents 100 --compactFile ${DETECTOR_PATH}/${JUGGLER_DETECTOR}.xml --enableGun --gun.energy "5*GeV" --gun.particle "${PARTICLE}" --gun.thetaMin 130*deg --gun.thetaMax 177*deg --gun.distribution "cos(theta)" --outputFile sim_output/sim_pid_backward_${PARTICLE}_5GeV.root
-    - rootls -t sim_output/sim_pid_backward_${PARTICLE}_5GeV.root
+    - ddsim --runType batch --numberOfEvents 100 --filter.tracker edep0 --compactFile ${DETECTOR_PATH}/${JUGGLER_DETECTOR}.xml --enableGun --gun.energy "5*GeV" --gun.particle "${PARTICLE}" --gun.thetaMin 130*deg --gun.thetaMax 177*deg --gun.distribution "cos(theta)" --outputFile sim_output/sim_pid_backward_${PARTICLE}_5GeV.edm4hep.root
+    - rootls -t sim_output/sim_pid_backward_${PARTICLE}_5GeV.edm4hep.root
   parallel:
     matrix:
       - PARTICLE: ["e-", "pi+", "proton"]
@@ -17,7 +17,7 @@ bench:mrich:
       if [[ ${JUGGLER_DETECTOR_VERSION} =~ acadia ]]; then
         echo "Performing MRICH benchmarks for acadia"
         mkdir -p results/pid/backward/mrich/
-        root -t -x -q -b "benchmarks/pid/scripts/mrich_analysis.cxx+(\"sim_output/sim_pid_backward_${PARTICLE}_5GeV.root\", \"${PARTICLE}\")"
+        root -t -x -q -b "benchmarks/pid/scripts/mrich_analysis.cxx+(\"sim_output/sim_pid_backward_${PARTICLE}_5GeV.edm4hep.root\", \"${PARTICLE}\")"
       else
         echo "Skipping MRICH Benchmarks for non-acadia detector version ${JUGGLER_DETECTOR_VERSION}"
       fi
diff --git a/benchmarks/pid/scripts/mrich_analysis.cxx b/benchmarks/pid/scripts/mrich_analysis.cxx
index f8ca59f4..fd4484af 100644
--- a/benchmarks/pid/scripts/mrich_analysis.cxx
+++ b/benchmarks/pid/scripts/mrich_analysis.cxx
@@ -20,7 +20,7 @@
 using ROOT::RDataFrame;
 using namespace ROOT::VecOps;
 
-void mrich_analysis(const char* input_fname = "sim_output/sim_pid_backward_e-_5GeV.root", const char* input_pname = "e-")
+void mrich_analysis(const char* input_fname = "sim_output/sim_pid_backward_e-_5GeV.edm4hep.root", const char* input_pname = "e-")
 {
   // Setting for graphs
   gROOT->SetStyle("Plain");
diff --git a/benchmarks/roman_pots/roman_pot_hit_eta.cxx b/benchmarks/roman_pots/roman_pot_hit_eta.cxx
index ebe3b06c..4e6574b9 100644
--- a/benchmarks/roman_pots/roman_pot_hit_eta.cxx
+++ b/benchmarks/roman_pots/roman_pot_hit_eta.cxx
@@ -29,12 +29,12 @@ R__LOAD_LIBRARY(libDDG4IO.so)
 //#include "lcio2/TrackerRawDataData.h"
 //#include "lcio2/TrackerRawData.h"
 
-void roman_pot_hit_eta(const char* fname = "./sim_output/roman_pot_out.root"){
+void roman_pot_hit_eta(const char* fname = "./sim_output/roman_pot_out.edm4hep.root"){
 
   ROOT::EnableImplicitMT(); // Tell ROOT you want to go parallel
   double degree = TMath::Pi()/180.0;
 
-  TChain* t = new TChain("EVENT");
+  TChain* t = new TChain("events");
   t->Add(fname);
 
   ROOT::RDataFrame d0(*t);
diff --git a/benchmarks/roman_pots/roman_pot_simu.sh b/benchmarks/roman_pots/roman_pot_simu.sh
index ca29f180..a5809796 100755
--- a/benchmarks/roman_pots/roman_pot_simu.sh
+++ b/benchmarks/roman_pots/roman_pot_simu.sh
@@ -10,9 +10,10 @@ fi
 
 ddsim --runType batch -N 300 \
 
-npsim --runType batch \
+ddsim --runType batch \
       -v WARNING \
       --part.minimalKineticEnergy 0.5*GeV  \
+      --filter.tracker edep0 \
       --numberOfEvents ${JUGGLER_N_EVENTS} \
       --compactFile ${DETECTOR_PATH}/${JUGGLER_DETECTOR}.xml \
 	--inputFiles ./data/forward_ions.hepmc \
diff --git a/benchmarks/roman_pots/simple_tracking.cxx b/benchmarks/roman_pots/simple_tracking.cxx
index 0afe2a11..94ac1ed4 100644
--- a/benchmarks/roman_pots/simple_tracking.cxx
+++ b/benchmarks/roman_pots/simple_tracking.cxx
@@ -29,13 +29,13 @@ R__LOAD_LIBRARY(libDDG4IO.so)
 //#include "lcio2/TrackerRawDataData.h"
 //#include "lcio2/TrackerRawData.h"
 
-void simple_tracking(const char* fname = "./sim_output/roman_pot_out.root"){
+void simple_tracking(const char* fname = "./sim_output/roman_pot_out.edm4hep.root"){
 
   ROOT::EnableImplicitMT(); // Tell ROOT you want to go parallel
   //using namespace lcio2;
   double degree = TMath::Pi()/180.0;
 
-  TChain* t = new TChain("EVENT");
+  TChain* t = new TChain("events");
   t->Add(fname);
 
   ROOT::RDataFrame d0(*t);//, {"GEMTrackerHintits","MCParticles"});
diff --git a/benchmarks/timing/run_timing.sh b/benchmarks/timing/run_timing.sh
index cc158bf5..e0aba39f 100755
--- a/benchmarks/timing/run_timing.sh
+++ b/benchmarks/timing/run_timing.sh
@@ -75,15 +75,16 @@ echo "JUGGLER_DETECTOR = ${JUGGLER_DETECTOR}"
 
 # Run geant4 simulations
 output_dir="data/timing/${particle}/${energy/\*/}"
-output_file="sim_${nevents}.root"
+output_file="sim_${nevents}.edm4hep.root"
 mkdir -p ${output_dir}
 timing_dir="results/timing/${particle}/${energy/\*/}"
 timing_file="time_${nevents}events.log"
-npsim_file="npsim_${nevents}events.log"
+ddsim_file="npsim_${nevents}events.log"
 mkdir -p ${timing_dir}
 /usr/bin/time -v -o ${timing_dir}/time_${nevents}events.log \
-  npsim --runType batch \
+  ddsim --runType batch \
       --printLevel WARNING \
+      --filter.tracker edep0 \
       --numberOfEvents ${nevents} \
       --enableGun \
       --gun.energy "${energy}" \
@@ -94,7 +95,7 @@ mkdir -p ${timing_dir}
       --part.minimalKineticEnergy "1*TeV" \
       --compactFile ${compact_path} \
       --outputFile ${output_dir}/${output_file} \
-    2>&1 > ${timing_dir}/${npsim_file}
+    2>&1 > ${timing_dir}/${ddsim_file}
 echo "For ${nevents} events:"
 cat ${timing_dir}/${timing_file}
 
diff --git a/benchmarks/trackers/roman_pot_hit_eta.cxx b/benchmarks/trackers/roman_pot_hit_eta.cxx
index ebe3b06c..b203ec96 100644
--- a/benchmarks/trackers/roman_pot_hit_eta.cxx
+++ b/benchmarks/trackers/roman_pot_hit_eta.cxx
@@ -29,19 +29,24 @@ R__LOAD_LIBRARY(libDDG4IO.so)
 //#include "lcio2/TrackerRawDataData.h"
 //#include "lcio2/TrackerRawData.h"
 
-void roman_pot_hit_eta(const char* fname = "./sim_output/roman_pot_out.root"){
+#include "edm4hep/SimTrackerHitData.h"
+
+void roman_pot_hit_eta(const char* fname = "./sim_output/roman_pot_out.edm4hep.root"){
 
   ROOT::EnableImplicitMT(); // Tell ROOT you want to go parallel
   double degree = TMath::Pi()/180.0;
 
-  TChain* t = new TChain("EVENT");
+  TChain* t = new TChain("events");
   t->Add(fname);
 
   ROOT::RDataFrame d0(*t);
-  auto hits_eta = [&](const std::vector<dd4hep::sim::Geant4Tracker::Hit*>& hits){
+  auto hits_eta = [&](const std::vector<edm4hep::SimTrackerHitData>& hits){
 	  std::vector<double> result;
 	  for (const auto& h: hits){
-		  result.push_back(h->momentum.eta());
+		  auto p = h.momentum;
+		  auto theta = std::atan2(std::hypot(p.x, p.y), p.z);
+		  auto eta = -std::log(std::tan(theta/2));
+		  result.push_back(eta);
 	  }
 	  return result;
   };
diff --git a/benchmarks/trackers/roman_pot_simu.sh b/benchmarks/trackers/roman_pot_simu.sh
index 4520c52d..1c5d1f31 100755
--- a/benchmarks/trackers/roman_pot_simu.sh
+++ b/benchmarks/trackers/roman_pot_simu.sh
@@ -3,4 +3,4 @@
 ddsim --runType batch -N 300 \
 	--inputFiles ./data/forward_ions.hepmc \
 	--compactFile benchmarks/trackers/roman_pot.xml \
-	--outputFile ./sim_output/roman_pot_out.root
+	--outputFile ./sim_output/roman_pot_out.edm4hep.root
diff --git a/benchmarks/trackers/simple_tracking.cxx b/benchmarks/trackers/simple_tracking.cxx
index 0afe2a11..e1f2b54c 100644
--- a/benchmarks/trackers/simple_tracking.cxx
+++ b/benchmarks/trackers/simple_tracking.cxx
@@ -29,13 +29,15 @@ R__LOAD_LIBRARY(libDDG4IO.so)
 //#include "lcio2/TrackerRawDataData.h"
 //#include "lcio2/TrackerRawData.h"
 
-void simple_tracking(const char* fname = "./sim_output/roman_pot_out.root"){
+#include "edm4hep/SimTrackerHitData.h"
+
+void simple_tracking(const char* fname = "./sim_output/roman_pot_out.edm4hep.root"){
 
   ROOT::EnableImplicitMT(); // Tell ROOT you want to go parallel
   //using namespace lcio2;
   double degree = TMath::Pi()/180.0;
 
-  TChain* t = new TChain("EVENT");
+  TChain* t = new TChain("events");
   t->Add(fname);
 
   ROOT::RDataFrame d0(*t);//, {"GEMTrackerHintits","MCParticles"});
@@ -56,7 +58,7 @@ void simple_tracking(const char* fname = "./sim_output/roman_pot_out.root"){
   //dd4hep::rec::SurfaceManager& surfMan = *detector.extension<dd4hep::rec::SurfaceManager>() ;
   //auto surfMap = surfMan.map( "world" ) ;
   
-  auto nhits = [] (std::vector<dd4hep::sim::Geant4Tracker::Hit*>& hits){ return (int) hits.size(); };
+  auto nhits = [] (std::vector<edm4hep::SimTrackerHitData>& hits){ return (int) hits.size(); };
   //auto hit_position = [&](const std::vector<dd4hep::sim::Geant4Tracker::Hit*>& hits){
   //for(const auto& h: hits){
   //  //std::cout << (h->position/10.0) << std::endl;
diff --git a/benchmarks/tracking_detectors/scripts/sim_track_hits.cxx b/benchmarks/tracking_detectors/analysis/sim_track_hits.cxx
similarity index 86%
rename from benchmarks/tracking_detectors/scripts/sim_track_hits.cxx
rename to benchmarks/tracking_detectors/analysis/sim_track_hits.cxx
index 010f87a5..40b310bc 100644
--- a/benchmarks/tracking_detectors/scripts/sim_track_hits.cxx
+++ b/benchmarks/tracking_detectors/analysis/sim_track_hits.cxx
@@ -3,6 +3,8 @@
 #include "TH1D.h"
 #include "TLegend.h"
 #include "TProfile.h"
+#include "THStack.h"
+#include "Math/Vector4D.h"
 
 #include <cstdlib>
 #include <iostream>
@@ -12,11 +14,9 @@ R__LOAD_LIBRARY(libDD4pod.so)
 
 #include <fmt/format.h>
 
-#include "dd4pod/Geant4ParticleCollection.h"
-#include "dd4pod/TrackerHitCollection.h"
-#include "dd4pod/TrackerHitData.h"
+#include "edm4hep/MCParticleCollection.h"
+#include "edm4hep/SimTrackerHitCollection.h"
 #include "eicd/ClusterCollection.h"
-#include "eicd/ClusterData.h"
 #include "eicd/TrackParametersCollection.h"
 #include "eicd/TrackerHitCollection.h"
 
@@ -31,10 +31,10 @@ auto p_track = [](std::vector<eic::TrackParametersData> const& in) {
   return result;
 };
 
-std::vector<float> pt(std::vector<dd4pod::Geant4ParticleData> const& in) {
+std::vector<float> pt(std::vector<edm4hep::MCParticleData> const& in) {
   std::vector<float> result;
   for (size_t i = 0; i < in.size(); ++i) {
-    result.push_back(std::sqrt(in[i].ps.x * in[i].ps.x + in[i].ps.y * in[i].ps.y));
+    result.push_back(std::sqrt(in[i].momentum.x * in[i].momentum.x + in[i].momentum.y * in[i].momentum.y));
   }
   return result;
 }
@@ -53,11 +53,11 @@ auto theta = [](std::vector<ROOT::Math::PxPyPzMVector> const& in) {
   }
   return result;
 };
-auto fourvec = [](ROOT::VecOps::RVec<dd4pod::Geant4ParticleData> const& in) {
+auto fourvec = [](ROOT::VecOps::RVec<edm4hep::MCParticleData> const& in) {
   std::vector<ROOT::Math::PxPyPzMVector> result;
   ROOT::Math::PxPyPzMVector lv;
   for (size_t i = 0; i < in.size(); ++i) {
-    lv.SetCoordinates(in[i].ps.x, in[i].ps.y, in[i].ps.z, in[i].mass);
+    lv.SetCoordinates(in[i].momentum.x, in[i].momentum.y, in[i].momentum.z, in[i].mass);
     result.push_back(lv);
   }
   return result;
@@ -90,12 +90,12 @@ ROOT::RDF::RNode add_subsystems(ROOT::RDF::RNode df, std::vector<std::pair<std::
   }
   const auto [name, collection] = hitcols.back();
   std::cout << " --> registering subsystem " << collection << "\n";
-  auto df2 = df.Define("N_" + name, [](std::vector<dd4pod::TrackerHitData> hits) { return hits.size(); }, {collection});
+  auto df2 = df.Define("N_" + name, [](std::vector<edm4hep::SimTrackerHitData> hits) { return hits.size(); }, {collection});
   hitcols.pop_back();
   return add_subsystems(df2, hitcols);
 };
 
-int sim_track_hits(const char* fname = "sim_track_hits.root") {
+int sim_track_hits(const char* fname = "sim_track_hits.edm4hep.root") {
 
   ROOT::EnableImplicitMT();
   ROOT::RDataFrame df("events", fname);
@@ -114,18 +114,18 @@ int sim_track_hits(const char* fname = "sim_track_hits.root") {
   // minimal hit collection setup
   std::vector<std::pair<std::string, std::string>> hitCollections{{"vtx_barrel", "VertexBarrelHits"},
                                                                   {"trk_barrel", "TrackerBarrelHits"},
-                                                                  {"trk_endcap", "TrackerEndcapHits"},
-                                                                  {"gem_endcap", "GEMTrackerEndcapHits"}};
+                                                                  {"trk_endcap", "TrackerEndcapHits1"},
+                                                                  {"gem_endcap", "GEMTrackerEndcapHits1"}};
 
   // append extra hit collections based on detector setup
   if (detector == "acadia") {
-    hitCollections.push_back({"vtx_endcap", "VertexEndcapHits"});
+    hitCollections.push_back({"vtx_endcap", "VertexEndcapHits1"});
   } else if (detector == "canyonlands" || detector == "default") {
-    hitCollections.push_back({"mm_barrel", "MPGDTrackerBarrelHits"});
+    hitCollections.push_back({"mm_barrel", "MPGDTrackerBarrelHits1"});
   }
 
-  auto df0 = df.Define("isThrown", "mcparticles.genStatus == 1")
-                 .Define("thrownParticles", "mcparticles[isThrown]")
+  auto df0 = df.Define("isThrown", "MCParticles.generatorStatus == 1")
+                 .Define("thrownParticles", "MCParticles[isThrown]")
                  .Define("thrownP", fourvec, {"thrownParticles"})
                  .Define("p_thrown", momentum, {"thrownP"})
                  .Define("theta_thrown", theta, {"thrownP"})
diff --git a/benchmarks/tracking_detectors/config.yml b/benchmarks/tracking_detectors/config.yml
index 031cc850..2aebdc1b 100644
--- a/benchmarks/tracking_detectors/config.yml
+++ b/benchmarks/tracking_detectors/config.yml
@@ -2,6 +2,7 @@ tracking_detectors:sim_track_hits:
   extends: .det_benchmark
   stage: simulate
   script:
+    - compile_analyses.py tracking_detectors
     - bash benchmarks/tracking_detectors/track_hits.sh --sim-only
 
 tracking_detectors:plot_hits:
diff --git a/benchmarks/tracking_detectors/track_hits.sh b/benchmarks/tracking_detectors/track_hits.sh
index a7a54e2e..cc883487 100644
--- a/benchmarks/tracking_detectors/track_hits.sh
+++ b/benchmarks/tracking_detectors/track_hits.sh
@@ -60,7 +60,7 @@ fi
 export JUGGLER_FILE_NAME_TAG="track_hits"
 export JUGGLER_GEN_FILE="${LOCAL_DATA_PATH}/${JUGGLER_FILE_NAME_TAG}.hepmc"
 
-export JUGGLER_SIM_FILE="${LOCAL_DATA_PATH}/sim_${JUGGLER_FILE_NAME_TAG}.root"
+export JUGGLER_SIM_FILE="${LOCAL_DATA_PATH}/sim_${JUGGLER_FILE_NAME_TAG}.edm4hep.root"
 
 echo "JUGGLER_N_EVENTS = ${JUGGLER_N_EVENTS}"
 echo "JUGGLER_DETECTOR = ${JUGGLER_DETECTOR}"
@@ -78,8 +78,9 @@ if [ -z "${ANALYSIS_ONLY}" ] ; then
 
   echo "Running geant4 simulation"
   ## run geant4 simulations
-  npsim --runType batch \
+  ddsim --runType batch \
     --part.minimalKineticEnergy 1000*GeV  \
+    --filter.tracker edep0 \
     -v WARNING \
     --numberOfEvents ${JUGGLER_N_EVENTS} \
     --compactFile ${DETECTOR_PATH}/${JUGGLER_DETECTOR}.xml \
@@ -99,7 +100,7 @@ if [ -z "${SIM_ONLY}" ] ; then
 
   mkdir -p results/tracking_detectors
   rootls -t ${JUGGLER_SIM_FILE}
-  root -b -q "benchmarks/tracking_detectors/scripts/sim_track_hits.cxx(\"${JUGGLER_SIM_FILE}\")"
+  root -b -q "benchmarks/tracking_detectors/analysis/sim_track_hits.cxx+(\"${JUGGLER_SIM_FILE}\")"
   if [[ "$?" -ne "0" ]] ; then
     echo "ERROR running root script"
     exit 1
diff --git a/benchmarks/zdc/run_simulation_zdc.sh b/benchmarks/zdc/run_simulation_zdc.sh
index ddacc755..6e71f647 100755
--- a/benchmarks/zdc/run_simulation_zdc.sh
+++ b/benchmarks/zdc/run_simulation_zdc.sh
@@ -3,4 +3,4 @@
 ddsim --runType batch --numberOfEvents 10 \
       --compactFile benchmarks/zdc/ZDC_example.xml \
       --inputFiles  ./data/zdc_photons.hepmc \
-      --outputFile  ./sim_output/output_zdc_photons.root
+      --outputFile  ./sim_output/output_zdc_photons.edm4hep.root
diff --git a/benchmarks/zdc/run_zdc_neutrons.sh b/benchmarks/zdc/run_zdc_neutrons.sh
index 981056e8..049c1bd8 100755
--- a/benchmarks/zdc/run_zdc_neutrons.sh
+++ b/benchmarks/zdc/run_zdc_neutrons.sh
@@ -20,7 +20,7 @@ fi
 export JUGGLER_FILE_NAME_TAG="zdc_uniform_neutrons"
 export JUGGLER_GEN_FILE="${JUGGLER_FILE_NAME_TAG}.hepmc"
 
-export JUGGLER_SIM_FILE="sim_${JUGGLER_FILE_NAME_TAG}.root"
+export JUGGLER_SIM_FILE="sim_${JUGGLER_FILE_NAME_TAG}.edm4hep.root"
 export JUGGLER_REC_FILE="rec_${JUGGLER_FILE_NAME_TAG}.root"
 
 echo "JUGGLER_N_EVENTS = ${JUGGLER_N_EVENTS}"
@@ -34,9 +34,10 @@ if [[ "$?" -ne "0" ]] ; then
 fi
 
 # Run geant4 simulations
-npsim --runType batch \
+ddsim --runType batch \
       -v WARNING \
       --part.minimalKineticEnergy 0.5*GeV  \
+      --filter.tracker edep0 \
       --numberOfEvents ${JUGGLER_N_EVENTS} \
       --compactFile ${DETECTOR_PATH}/${JUGGLER_DETECTOR}.xml \
       --inputFiles ${JUGGLER_FILE_NAME_TAG}.hepmc \
diff --git a/benchmarks/zdc/scripts/zdc_neutrons_analysis.cxx b/benchmarks/zdc/scripts/zdc_neutrons_analysis.cxx
index 3c8bcd63..742a1974 100644
--- a/benchmarks/zdc/scripts/zdc_neutrons_analysis.cxx
+++ b/benchmarks/zdc/scripts/zdc_neutrons_analysis.cxx
@@ -6,8 +6,8 @@
 #include "ROOT/RDataFrame.hxx"
 #include <iostream>
 
-#include "dd4pod/Geant4ParticleCollection.h"
-#include "dd4pod/CalorimeterHitCollection.h"
+#include "edm4hep/MCParticleCollection.h"
+#include "edm4hep/SimCalorimeterHitCollection.h"
 
 #include "TCanvas.h"
 #include "TStyle.h"
@@ -19,7 +19,7 @@
 using ROOT::RDataFrame;
 using namespace ROOT::VecOps;
 
-void zdc_neutrons_analysis(const char* input_fname = "sim_output/sim_zdc_uniform_neutrons.root")
+void zdc_neutrons_analysis(const char* input_fname = "sim_output/sim_zdc_uniform_neutrons.edm4hep.root")
 {
   // Setting for graphs
   gROOT->SetStyle("Plain");
@@ -36,20 +36,20 @@ void zdc_neutrons_analysis(const char* input_fname = "sim_output/sim_zdc_uniform
   ROOT::RDataFrame d0("events", input_fname);
 
   // Thrown Energy [GeV]
-  auto Ethr = [](std::vector<dd4pod::Geant4ParticleData> const& input) {
+  auto Ethr = [](std::vector<edm4hep::MCParticleData> const& input) {
     auto p = input[2];
-    auto energy = TMath::Sqrt(p.ps.x * p.ps.x + p.ps.y * p.ps.y + p.ps.z * p.ps.z + p.mass * p.mass);
+    auto energy = TMath::Sqrt(p.momentum.x * p.momentum.x + p.momentum.y * p.momentum.y + p.momentum.z * p.momentum.z + p.mass * p.mass);
     return energy;
   };
 
   // Number of hits
-  auto nhits = [] (const std::vector<dd4pod::CalorimeterHitData>& evt) {return (int) evt.size(); };
+  auto nhits = [] (const std::vector<edm4hep::SimCalorimeterHitData>& evt) {return (int) evt.size(); };
 
   // Energy deposition [GeV]
-  auto Esim = [](const std::vector<dd4pod::CalorimeterHitData>& evt) {
+  auto Esim = [](const std::vector<edm4hep::SimCalorimeterHitData>& evt) {
     auto total_edep = 0.0;
     for (const auto& i: evt)
-      total_edep += i.energyDeposit;
+      total_edep += i.energy;
     return total_edep;
   };
 
@@ -59,7 +59,7 @@ void zdc_neutrons_analysis(const char* input_fname = "sim_output/sim_zdc_uniform
   };
 
   // Define variables
-  auto d1 = d0.Define("Ethr", Ethr, {"mcparticles"})
+  auto d1 = d0.Define("Ethr", Ethr, {"MCParticles"})
                 .Define("nhits", nhits, {"EcalBarrelHits"})
                 .Define("Esim", Esim, {"EcalBarrelHits"})
                 .Define("fsam", fsam, {"Esim", "Ethr"});
diff --git a/benchmarks/zdc/simple_checking.cxx b/benchmarks/zdc/simple_checking.cxx
index 158f4f78..25db8c11 100644
--- a/benchmarks/zdc/simple_checking.cxx
+++ b/benchmarks/zdc/simple_checking.cxx
@@ -29,13 +29,13 @@ R__LOAD_LIBRARY(libDDG4IO.so)
 //#include "lcio2/TrackerRawDataData.h"
 //#include "lcio2/TrackerRawData.h"
 
-void simple_checking(const char* fname = "sim_output/output_zdc_photons.root"){
+void simple_checking(const char* fname = "sim_output/output_zdc_photons.edm4hep.root"){
 std::cout << "testing 1\n";
   ROOT::EnableImplicitMT(); // Tell ROOT you want to go parallel
   //using namespace lcio2;
   double degree = TMath::Pi()/180.0;
 
-  TChain* t = new TChain("EVENT");
+  TChain* t = new TChain("events");
   t->Add(fname);
 
   ROOT::RDataFrame d0(*t);//, {"GEMTrackerHintits","MCParticles"});
diff --git a/benchmarks/zdc/simple_info_plot_histograms.cxx b/benchmarks/zdc/simple_info_plot_histograms.cxx
index 07ec554a..85960e2e 100644
--- a/benchmarks/zdc/simple_info_plot_histograms.cxx
+++ b/benchmarks/zdc/simple_info_plot_histograms.cxx
@@ -35,7 +35,7 @@ R__LOAD_LIBRARY(libDDG4IO.so)
 #include <iostream>
 #include "TStyle.h"
 
-void simple_info_plot_histograms(const char* fname = "sim_output/output_zdc_photons.root"){
+void simple_info_plot_histograms(const char* fname = "sim_output/output_zdc_photons.edm4hep.root"){
 
   // Setting for graphs
   gROOT->SetStyle("Plain");
@@ -47,7 +47,7 @@ void simple_info_plot_histograms(const char* fname = "sim_output/output_zdc_phot
   gStyle->SetPadGridY(1);
   gStyle->SetPadLeftMargin(0.14);
 
-  TChain* t = new TChain("EVENT");
+  TChain* t = new TChain("events");
   t->Add(fname);
 
   ROOT::RDataFrame d0(*t);//, {"ZDCHits","MCParticles"});
@@ -152,7 +152,7 @@ void simple_info_plot_histograms(const char* fname = "sim_output/output_zdc_phot
 
   auto n0 = d1.Filter([](int n){ return (n>0); },{"nhits"}).Count();
 
-  d1.Snapshot("info_EVENT","sim_output/info_zdc_photons.root");
+  d1.Snapshot("info_EVENT","sim_output/info_zdc_photons.edm4hep.root");
   std::cout << *n0 << " events with nonzero hits\n";
 
   TCanvas *c1 = new TCanvas("c1","c1",800,600);
-- 
GitLab