From 208a1da45a42646ced543db499ac9b613e9df47d Mon Sep 17 00:00:00 2001
From: Dave Casper <dcasper@uci.edu>
Date: Sat, 20 Jan 2024 17:04:08 -0800
Subject: [PATCH] NeutrinoRecAlgs working

---
 .../CMakeLists.txt                            | 18 ++++----
 .../FaserCaloSimEventTPCnv/CMakeLists.txt     | 11 ++---
 .../src/CaloHits/CaloHitCollectionCnv_p1.cxx  |  2 +-
 .../src/CaloHits/CaloHitCollectionCnv_p1a.cxx |  2 +-
 .../NeutrinoSimEventAthenaPool/CMakeLists.txt | 18 ++++----
 .../NeutrinoSimEventTPCnv/CMakeLists.txt      | 11 ++---
 .../NeutrinoHitCollectionCnv_p1.cxx           |  2 +-
 .../NeutrinoHitCollectionCnv_p1a.cxx          |  2 +-
 .../NeutrinoRecAlgs/src/NeutrinoRecAlgs.cxx   | 42 +++++++++++++------
 .../ScintSimEventAthenaPool/CMakeLists.txt    | 18 ++++----
 .../ScintSimEventTPCnv/CMakeLists.txt         | 10 ++---
 .../ScintHits/ScintHitCollectionCnv_p1.cxx    |  2 +-
 .../ScintHits/ScintHitCollectionCnv_p1a.cxx   |  2 +-
 .../TrackerSimEventAthenaPool/CMakeLists.txt  | 18 ++++----
 .../TrackerSimEventTPCnv/CMakeLists.txt       | 10 ++---
 .../FaserSiHitCollectionCnv_p3.cxx            |  2 +-
 .../FaserSiHitCollectionCnv_p3a.cxx           |  2 +-
 package_filters.txt                           | 10 +++++
 18 files changed, 91 insertions(+), 91 deletions(-)

diff --git a/Calorimeter/CaloEventCnv/FaserCaloSimEventAthenaPool/CMakeLists.txt b/Calorimeter/CaloEventCnv/FaserCaloSimEventAthenaPool/CMakeLists.txt
index 5f2e90339..22603da54 100644
--- a/Calorimeter/CaloEventCnv/FaserCaloSimEventAthenaPool/CMakeLists.txt
+++ b/Calorimeter/CaloEventCnv/FaserCaloSimEventAthenaPool/CMakeLists.txt
@@ -5,21 +5,17 @@
 # Declare the package name:
 atlas_subdir( FaserCaloSimEventAthenaPool )
 
-# External dependencies:
-find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread )
-
 # Component(s) in the package:
 atlas_add_poolcnv_library( FaserCaloSimEventAthenaPoolPoolCnv
-                           src/*.cxx
+                           src/*.h src/*.cxx
                            FILES FaserCaloSimEvent/CaloHitCollection.h 
-                           INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                           LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaPoolCnvSvcLib AthenaPoolUtilities AtlasSealCLHEP GaudiKernel FaserCaloSimEventTPCnv FaserCaloSimEvent )
+                           LINK_LIBRARIES AthenaPoolCnvSvcLib AthenaPoolUtilities GaudiKernel FaserCaloSimEventTPCnv FaserCaloSimEvent )
 
-atlas_add_dictionary( FaserCaloSimEventAthenaPoolCnvDict
-                      FaserCaloSimEventAthenaPool/CaloSimEventAthenaPoolCnvDict.h
-                      FaserCaloSimEventAthenaPool/selection.xml
-                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaPoolCnvSvcLib AthenaPoolUtilities AtlasSealCLHEP GaudiKernel FaserCaloSimEventTPCnv FaserCaloSimEvent )
+# atlas_add_dictionary( FaserCaloSimEventAthenaPoolCnvDict
+#                       FaserCaloSimEventAthenaPool/CaloSimEventAthenaPoolCnvDict.h
+#                       FaserCaloSimEventAthenaPool/selection.xml
+#                       INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
+#                       LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaPoolCnvSvcLib AthenaPoolUtilities AtlasSealCLHEP GaudiKernel FaserCaloSimEventTPCnv FaserCaloSimEvent )
 
 # Install files from the package:
 # atlas_install_headers( FaserCaloSimEventAthenaPool )
diff --git a/Calorimeter/CaloEventCnv/FaserCaloSimEventTPCnv/CMakeLists.txt b/Calorimeter/CaloEventCnv/FaserCaloSimEventTPCnv/CMakeLists.txt
index ef770c2b5..663cd620a 100644
--- a/Calorimeter/CaloEventCnv/FaserCaloSimEventTPCnv/CMakeLists.txt
+++ b/Calorimeter/CaloEventCnv/FaserCaloSimEventTPCnv/CMakeLists.txt
@@ -7,20 +7,17 @@ atlas_subdir( FaserCaloSimEventTPCnv )
 
 # External dependencies:
 find_package( CLHEP )
-find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread )
 
 # Component(s) in the package:
 atlas_add_library( FaserCaloSimEventTPCnv
                    src/CaloHits/*.cxx
                    PUBLIC_HEADERS FaserCaloSimEventTPCnv
-                   PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}
+                   PRIVATE_INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS}
                    PRIVATE_DEFINITIONS ${CLHEP_DEFINITIONS}
-                   LINK_LIBRARIES GaudiKernel GeneratorObjectsTPCnv FaserCaloSimEvent AthenaPoolCnvSvcLib StoreGateLib SGtests
-                   PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} TestTools Identifier )
+                   LINK_LIBRARIES GeneratorObjectsTPCnv FaserCaloSimEvent AthenaPoolCnvSvcLib
+                   PRIVATE_LINK_LIBRARIES ${CLHEP_LIBRARIES} AthenaKernel GaudiKernel GeneratorObjects Identifier StoreGateLib)
 
 atlas_add_dictionary( FaserCaloSimEventTPCnvDict
                       FaserCaloSimEventTPCnv/CaloSimEventTPCnvDict.h
                       FaserCaloSimEventTPCnv/selection.xml
-                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AthenaPoolCnvSvcLib GaudiKernel GeneratorObjectsTPCnv FaserCaloSimEvent TestTools StoreGateLib SGtests Identifier FaserCaloSimEventTPCnv AthenaKernel)
-
+                      LINK_LIBRARIES FaserCaloSimEventTPCnv)
diff --git a/Calorimeter/CaloEventCnv/FaserCaloSimEventTPCnv/src/CaloHits/CaloHitCollectionCnv_p1.cxx b/Calorimeter/CaloEventCnv/FaserCaloSimEventTPCnv/src/CaloHits/CaloHitCollectionCnv_p1.cxx
index 0568ff080..1acbe7d6a 100644
--- a/Calorimeter/CaloEventCnv/FaserCaloSimEventTPCnv/src/CaloHits/CaloHitCollectionCnv_p1.cxx
+++ b/Calorimeter/CaloEventCnv/FaserCaloSimEventTPCnv/src/CaloHits/CaloHitCollectionCnv_p1.cxx
@@ -329,7 +329,7 @@ void CaloHitCollectionCnv_p1::persToTrans(const CaloHitCollection_p1* persCont,
 
         HepGeom::Point3D<double> endThis( endLast + r );
 
-        HepMcParticleLink::PositionFlag flag = HepMcParticleLink::IS_INDEX;
+        HepMcParticleLink::PositionFlag flag = HepMcParticleLink::IS_EVENTNUM;
         if (persCont->m_mcEvtIndex[idxBC] == 0) {
           flag = HepMcParticleLink::IS_POSITION;
         }
diff --git a/Calorimeter/CaloEventCnv/FaserCaloSimEventTPCnv/src/CaloHits/CaloHitCollectionCnv_p1a.cxx b/Calorimeter/CaloEventCnv/FaserCaloSimEventTPCnv/src/CaloHits/CaloHitCollectionCnv_p1a.cxx
index d1d6ec53b..ca6d5cfca 100644
--- a/Calorimeter/CaloEventCnv/FaserCaloSimEventTPCnv/src/CaloHits/CaloHitCollectionCnv_p1a.cxx
+++ b/Calorimeter/CaloEventCnv/FaserCaloSimEventTPCnv/src/CaloHits/CaloHitCollectionCnv_p1a.cxx
@@ -321,7 +321,7 @@ void CaloHitCollectionCnv_p1a::persToTrans(const CaloHitCollection_p1a* persCont
 
         HepGeom::Point3D<double> endThis( endLast + r );
 
-        HepMcParticleLink::PositionFlag flag = HepMcParticleLink::IS_INDEX;
+        HepMcParticleLink::PositionFlag flag = HepMcParticleLink::IS_EVENTNUM;
         if (persCont->m_mcEvtIndex[idxBC] == 0) {
           flag = HepMcParticleLink::IS_POSITION;
         }
diff --git a/Neutrino/NeutrinoEventCnv/NeutrinoSimEventAthenaPool/CMakeLists.txt b/Neutrino/NeutrinoEventCnv/NeutrinoSimEventAthenaPool/CMakeLists.txt
index 87cd41fea..a4c055fcc 100644
--- a/Neutrino/NeutrinoEventCnv/NeutrinoSimEventAthenaPool/CMakeLists.txt
+++ b/Neutrino/NeutrinoEventCnv/NeutrinoSimEventAthenaPool/CMakeLists.txt
@@ -5,21 +5,17 @@
 # Declare the package name:
 atlas_subdir( NeutrinoSimEventAthenaPool )
 
-# External dependencies:
-find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread )
-
 # Component(s) in the package:
 atlas_add_poolcnv_library( NeutrinoSimEventAthenaPoolPoolCnv
-                           src/*.cxx
+                           src/*.h src/*.cxx
                            FILES NeutrinoSimEvent/NeutrinoHitCollection.h 
-                           INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                           LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaPoolCnvSvcLib AthenaPoolUtilities AtlasSealCLHEP GaudiKernel NeutrinoSimEventTPCnv NeutrinoSimEvent )
+                           LINK_LIBRARIES AthenaPoolCnvSvcLib AthenaPoolUtilities GaudiKernel NeutrinoSimEventTPCnv NeutrinoSimEvent )
 
-atlas_add_dictionary( NeutrinoSimEventAthenaPoolCnvDict
-                      NeutrinoSimEventAthenaPool/NeutrinoSimEventAthenaPoolCnvDict.h
-                      NeutrinoSimEventAthenaPool/selection.xml
-                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaPoolCnvSvcLib AthenaPoolUtilities AtlasSealCLHEP GaudiKernel NeutrinoSimEventTPCnv NeutrinoSimEvent )
+# atlas_add_dictionary( NeutrinoSimEventAthenaPoolCnvDict
+#                       NeutrinoSimEventAthenaPool/NeutrinoSimEventAthenaPoolCnvDict.h
+#                       NeutrinoSimEventAthenaPool/selection.xml
+#                       INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
+#                       LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaPoolCnvSvcLib AthenaPoolUtilities AtlasSealCLHEP GaudiKernel NeutrinoSimEventTPCnv NeutrinoSimEvent )
 
 # Install files from the package:
 # atlas_install_headers( NeutrinoSimEventAthenaPool )
diff --git a/Neutrino/NeutrinoEventCnv/NeutrinoSimEventTPCnv/CMakeLists.txt b/Neutrino/NeutrinoEventCnv/NeutrinoSimEventTPCnv/CMakeLists.txt
index 332a16c77..045b7f571 100644
--- a/Neutrino/NeutrinoEventCnv/NeutrinoSimEventTPCnv/CMakeLists.txt
+++ b/Neutrino/NeutrinoEventCnv/NeutrinoSimEventTPCnv/CMakeLists.txt
@@ -7,20 +7,17 @@ atlas_subdir( NeutrinoSimEventTPCnv )
 
 # External dependencies:
 find_package( CLHEP )
-find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread )
 
 # Component(s) in the package:
 atlas_add_library( NeutrinoSimEventTPCnv
                    src/NeutrinoHits/*.cxx
                    PUBLIC_HEADERS NeutrinoSimEventTPCnv
-                   PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}
+                   PRIVATE_INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS}
                    PRIVATE_DEFINITIONS ${CLHEP_DEFINITIONS}
-                   LINK_LIBRARIES GaudiKernel GeneratorObjectsTPCnv NeutrinoSimEvent AthenaPoolCnvSvcLib StoreGateLib SGtests
-                   PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} TestTools Identifier )
+                   LINK_LIBRARIES GeneratorObjectsTPCnv NeutrinoSimEvent AthenaPoolCnvSvcLib
+                   PRIVATE_LINK_LIBRARIES ${CLHEP_LIBRARIES} AthenaKernel GaudiKernel GeneratorObjects Identifier StoreGateLib)
 
 atlas_add_dictionary( NeutrinoSimEventTPCnvDict
                       NeutrinoSimEventTPCnv/NeutrinoSimEventTPCnvDict.h
                       NeutrinoSimEventTPCnv/selection.xml
-                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AthenaPoolCnvSvcLib GaudiKernel GeneratorObjectsTPCnv NeutrinoSimEvent TestTools StoreGateLib SGtests Identifier NeutrinoSimEventTPCnv AthenaKernel )
-
+                      LINK_LIBRARIES NeutrinoSimEventTPCnv)
diff --git a/Neutrino/NeutrinoEventCnv/NeutrinoSimEventTPCnv/src/NeutrinoHits/NeutrinoHitCollectionCnv_p1.cxx b/Neutrino/NeutrinoEventCnv/NeutrinoSimEventTPCnv/src/NeutrinoHits/NeutrinoHitCollectionCnv_p1.cxx
index 444ad4177..ce71dae6c 100644
--- a/Neutrino/NeutrinoEventCnv/NeutrinoSimEventTPCnv/src/NeutrinoHits/NeutrinoHitCollectionCnv_p1.cxx
+++ b/Neutrino/NeutrinoEventCnv/NeutrinoSimEventTPCnv/src/NeutrinoHits/NeutrinoHitCollectionCnv_p1.cxx
@@ -317,7 +317,7 @@ void NeutrinoHitCollectionCnv_p1::persToTrans(const NeutrinoHitCollection_p1* pe
 
         HepGeom::Point3D<double> endThis( endLast + r );
 
-        HepMcParticleLink::PositionFlag flag = HepMcParticleLink::IS_INDEX;
+        HepMcParticleLink::PositionFlag flag = HepMcParticleLink::IS_EVENTNUM;
         if (persCont->m_mcEvtIndex[idxBC] == 0) {
           flag = HepMcParticleLink::IS_POSITION;
         }
diff --git a/Neutrino/NeutrinoEventCnv/NeutrinoSimEventTPCnv/src/NeutrinoHits/NeutrinoHitCollectionCnv_p1a.cxx b/Neutrino/NeutrinoEventCnv/NeutrinoSimEventTPCnv/src/NeutrinoHits/NeutrinoHitCollectionCnv_p1a.cxx
index 6ef0bb107..221122655 100644
--- a/Neutrino/NeutrinoEventCnv/NeutrinoSimEventTPCnv/src/NeutrinoHits/NeutrinoHitCollectionCnv_p1a.cxx
+++ b/Neutrino/NeutrinoEventCnv/NeutrinoSimEventTPCnv/src/NeutrinoHits/NeutrinoHitCollectionCnv_p1a.cxx
@@ -317,7 +317,7 @@ void NeutrinoHitCollectionCnv_p1a::persToTrans(const NeutrinoHitCollection_p1a*
 
         HepGeom::Point3D<double> endThis( endLast + r );
 
-        HepMcParticleLink::PositionFlag flag = HepMcParticleLink::IS_INDEX;
+        HepMcParticleLink::PositionFlag flag = HepMcParticleLink::IS_EVENTNUM;
         if (persCont->m_mcEvtIndex[idxBC] == 0) {
           flag = HepMcParticleLink::IS_POSITION;
         }
diff --git a/Neutrino/NeutrinoRecAlgs/src/NeutrinoRecAlgs.cxx b/Neutrino/NeutrinoRecAlgs/src/NeutrinoRecAlgs.cxx
index 1b7dbeaa1..e4058e2d9 100644
--- a/Neutrino/NeutrinoRecAlgs/src/NeutrinoRecAlgs.cxx
+++ b/Neutrino/NeutrinoRecAlgs/src/NeutrinoRecAlgs.cxx
@@ -221,8 +221,6 @@ StatusCode NeutrinoRecAlgs::execute()
         event->print();
 #endif
 
-        int count_prod = 0;
-        int count_decay = 0;
         m_num_in_particle = 0;
         m_num_out_particle = 0;
 #ifdef HEPMC3
@@ -233,15 +231,16 @@ StatusCode NeutrinoRecAlgs::execute()
             const HepMC::FourVector& momentum = particle->momentum();
 #ifdef HEPMC3
             m_track_id = particle->id();
+            m_pdg_id = particle->pid();
 #else
             m_track_id = particle->barcode();
+            m_pdg_id = particle->pdg_id();
 #endif
             m_px = momentum.x();
             m_py = momentum.y();
             m_pz = momentum.z();
             m_energy = momentum.t();
             m_mass = particle->generated_mass();
-            m_pdg_id = particle->pdg_id();
             m_kinetic_energy = m_energy - m_mass;      
 
             m_event_id_MC = m_event_id;
@@ -319,19 +318,30 @@ StatusCode NeutrinoRecAlgs::execute()
             m_num_out_particle = particle->end_vertex()->particles_out_size();
             int out_count=0;
             std::cout<<"number of vertex going out : "<<m_num_out_particle<<std::endl;
-            // for(HepMC::GenVertex::particles_out_const_iterator partout = particle->end_vertex()->particles_out_const_begin();partout != particle->end_vertex()->particles_out_const_end();partout++){
+#ifdef HEPMC3
+            for (HepMC3::ConstGenParticlePtr outpart : particle->end_vertex()->particles_out())
+            {
+#else
             for ( HepMC::GenVertex::particle_iterator partout= particle->end_vertex()->particles_begin(HepMC::children);
                 partout != particle->end_vertex()->particles_end(HepMC::children);
                 ++partout ){
-
-                if ( (*partout) ) {
-                    m_pdg_out_particle.emplace_back((*partout)->pdg_id());
-                    m_trackid_out_particle.emplace_back((*partout)->barcode()); 
-                    (*partout)->print();
+                const HepMC::GenParticle* outpart = *partout;
+#endif
+                if ( outpart ) {
+#ifdef HEPMC3                    
+                    int outId = outpart->id();
+                    m_pdg_out_particle.emplace_back(outpart->pid());
+                    HepMC3::Print::line(outpart);
+#else
+                    int outId = outpart->barcode();
+                    m_pdg_out_particle.emplace_back(outpart->pdg_id());
+                    outpart->print();
+#endif
+                    m_trackid_out_particle.emplace_back(outId); 
                     out_count++;
-                    std::cout<<"Particles : "<<particle->barcode()<<std::endl;
+                    std::cout<<"Particles : "<<m_track_id<<std::endl;
                     std::cout<<"Outgoing particles : "<<out_count<<std::endl;
-                    std::cout<<"barcode : "<<(*partout)->barcode()<<std::endl;
+                    std::cout<<"barcode : "<<outId<<std::endl;
                     raw_num++;
 
                 }//if ( !(*partout)->end_vertex() )
@@ -403,10 +413,15 @@ StatusCode NeutrinoRecAlgs::execute()
         if (!hit.particleLink().isValid())
             continue;
         HepMcParticleLink partLink = hit.particleLink();
+#ifdef HEPMC3
+        HepMC3::ConstGenParticlePtr truthParticle = partLink.cptr();
+        m_pdg_MC = truthParticle->pid();
+        m_track_id_MC = truthParticle->id();
+#else
 	    const HepMC::GenParticle * truthParticle = partLink.cptr();
         m_pdg_MC = truthParticle->pdg_id();
         m_track_id_MC = truthParticle->barcode();
-
+#endif
         m_px_MC = truthParticle->momentum().x();
         m_py_MC = truthParticle->momentum().y();
         m_pz_MC = truthParticle->momentum().z();
@@ -460,7 +475,8 @@ StatusCode NeutrinoRecAlgs::execute()
         }        
     }
 
-    m_NuHit_tree->Write();    
+    // Not useful
+    // m_NuHit_tree->Write();    
 
     // The hit container might be empty because particles missed the wafers
     //if (h_siHits->size() == 0) return StatusCode::SUCCESS;
diff --git a/Scintillator/ScintEventCnv/ScintSimEventAthenaPool/CMakeLists.txt b/Scintillator/ScintEventCnv/ScintSimEventAthenaPool/CMakeLists.txt
index 707291c9c..323effb56 100644
--- a/Scintillator/ScintEventCnv/ScintSimEventAthenaPool/CMakeLists.txt
+++ b/Scintillator/ScintEventCnv/ScintSimEventAthenaPool/CMakeLists.txt
@@ -5,21 +5,17 @@
 # Declare the package name:
 atlas_subdir( ScintSimEventAthenaPool )
 
-# External dependencies:
-find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread )
-
 # Component(s) in the package:
 atlas_add_poolcnv_library( ScintSimEventAthenaPoolPoolCnv
-                           src/*.cxx
+                           src/*.h src/*.cxx
                            FILES ScintSimEvent/ScintHitCollection.h 
-                           INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                           LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaPoolCnvSvcLib AthenaPoolUtilities AtlasSealCLHEP GaudiKernel ScintSimEventTPCnv ScintSimEvent )
+                           LINK_LIBRARIES AthenaPoolCnvSvcLib AthenaPoolUtilities GaudiKernel ScintSimEventTPCnv ScintSimEvent )
 
-atlas_add_dictionary( ScintSimEventAthenaPoolCnvDict
-                      ScintSimEventAthenaPool/ScintSimEventAthenaPoolCnvDict.h
-                      ScintSimEventAthenaPool/selection.xml
-                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaPoolCnvSvcLib AthenaPoolUtilities AtlasSealCLHEP GaudiKernel ScintSimEventTPCnv ScintSimEvent )
+# atlas_add_dictionary( ScintSimEventAthenaPoolCnvDict
+#                       ScintSimEventAthenaPool/ScintSimEventAthenaPoolCnvDict.h
+#                       ScintSimEventAthenaPool/selection.xml
+#                       INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
+#                       LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaPoolCnvSvcLib AthenaPoolUtilities AtlasSealCLHEP GaudiKernel ScintSimEventTPCnv ScintSimEvent )
 
 # Install files from the package:
 # atlas_install_headers( ScintSimEventAthenaPool )
diff --git a/Scintillator/ScintEventCnv/ScintSimEventTPCnv/CMakeLists.txt b/Scintillator/ScintEventCnv/ScintSimEventTPCnv/CMakeLists.txt
index 04ca202da..4e644e4af 100644
--- a/Scintillator/ScintEventCnv/ScintSimEventTPCnv/CMakeLists.txt
+++ b/Scintillator/ScintEventCnv/ScintSimEventTPCnv/CMakeLists.txt
@@ -7,20 +7,18 @@ atlas_subdir( ScintSimEventTPCnv )
 
 # External dependencies:
 find_package( CLHEP )
-find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread )
 
 # Component(s) in the package:
 atlas_add_library( ScintSimEventTPCnv
                    src/ScintHits/*.cxx
                    PUBLIC_HEADERS ScintSimEventTPCnv
-                   PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}
+                   PRIVATE_INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS}
                    PRIVATE_DEFINITIONS ${CLHEP_DEFINITIONS}
-                   LINK_LIBRARIES GaudiKernel GeneratorObjectsTPCnv ScintSimEvent AthenaPoolCnvSvcLib StoreGateLib SGtests
-                   PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} TestTools Identifier )
+                   LINK_LIBRARIES GeneratorObjectsTPCnv ScintSimEvent AthenaPoolCnvSvcLib
+                   PRIVATE_LINK_LIBRARIES ${CLHEP_LIBRARIES} AthenaKernel GaudiKernel GeneratorObjects Identifier StoreGateLib)
 
 atlas_add_dictionary( ScintSimEventTPCnvDict
                       ScintSimEventTPCnv/ScintSimEventTPCnvDict.h
                       ScintSimEventTPCnv/selection.xml
-                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AthenaPoolCnvSvcLib GaudiKernel GeneratorObjectsTPCnv ScintSimEvent TestTools StoreGateLib SGtests Identifier ScintSimEventTPCnv AthenaKernel )
+                      LINK_LIBRARIES ScintSimEventTPCnv)
 
diff --git a/Scintillator/ScintEventCnv/ScintSimEventTPCnv/src/ScintHits/ScintHitCollectionCnv_p1.cxx b/Scintillator/ScintEventCnv/ScintSimEventTPCnv/src/ScintHits/ScintHitCollectionCnv_p1.cxx
index 42b4160a2..b1dd7f913 100644
--- a/Scintillator/ScintEventCnv/ScintSimEventTPCnv/src/ScintHits/ScintHitCollectionCnv_p1.cxx
+++ b/Scintillator/ScintEventCnv/ScintSimEventTPCnv/src/ScintHits/ScintHitCollectionCnv_p1.cxx
@@ -317,7 +317,7 @@ void ScintHitCollectionCnv_p1::persToTrans(const ScintHitCollection_p1* persCont
 
         HepGeom::Point3D<double> endThis( endLast + r );
 
-        HepMcParticleLink::PositionFlag flag = HepMcParticleLink::IS_INDEX;
+        HepMcParticleLink::PositionFlag flag = HepMcParticleLink::IS_EVENTNUM;
         if (persCont->m_mcEvtIndex[idxBC] == 0) {
           flag = HepMcParticleLink::IS_POSITION;
         }
diff --git a/Scintillator/ScintEventCnv/ScintSimEventTPCnv/src/ScintHits/ScintHitCollectionCnv_p1a.cxx b/Scintillator/ScintEventCnv/ScintSimEventTPCnv/src/ScintHits/ScintHitCollectionCnv_p1a.cxx
index cd162d1ad..71987d071 100644
--- a/Scintillator/ScintEventCnv/ScintSimEventTPCnv/src/ScintHits/ScintHitCollectionCnv_p1a.cxx
+++ b/Scintillator/ScintEventCnv/ScintSimEventTPCnv/src/ScintHits/ScintHitCollectionCnv_p1a.cxx
@@ -317,7 +317,7 @@ void ScintHitCollectionCnv_p1a::persToTrans(const ScintHitCollection_p1a* persCo
 
         HepGeom::Point3D<double> endThis( endLast + r );
 
-        HepMcParticleLink::PositionFlag flag = HepMcParticleLink::IS_INDEX;
+        HepMcParticleLink::PositionFlag flag = HepMcParticleLink::IS_EVENTNUM;
         if (persCont->m_mcEvtIndex[idxBC] == 0) {
           flag = HepMcParticleLink::IS_POSITION;
         }
diff --git a/Tracker/TrackerEventCnv/TrackerSimEventAthenaPool/CMakeLists.txt b/Tracker/TrackerEventCnv/TrackerSimEventAthenaPool/CMakeLists.txt
index 5b9019ea4..5a62d952e 100644
--- a/Tracker/TrackerEventCnv/TrackerSimEventAthenaPool/CMakeLists.txt
+++ b/Tracker/TrackerEventCnv/TrackerSimEventAthenaPool/CMakeLists.txt
@@ -5,21 +5,17 @@
 # Declare the package name:
 atlas_subdir( TrackerSimEventAthenaPool )
 
-# External dependencies:
-find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread )
-
 # Component(s) in the package:
 atlas_add_poolcnv_library( TrackerSimEventAthenaPoolPoolCnv
-                           src/*.cxx
+                           src/*.h src/*.cxx
                            FILES TrackerSimEvent/FaserSiHitCollection.h 
-                           INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                           LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaPoolCnvSvcLib AthenaPoolUtilities AtlasSealCLHEP GaudiKernel TrackerSimEventTPCnv TrackerSimEvent )
+                           LINK_LIBRARIES AthenaPoolCnvSvcLib AthenaPoolUtilities GaudiKernel TrackerSimEventTPCnv TrackerSimEvent )
 
-atlas_add_dictionary( TrackerSimEventAthenaPoolCnvDict
-                      TrackerSimEventAthenaPool/TrackerSimEventAthenaPoolCnvDict.h
-                      TrackerSimEventAthenaPool/selection.xml
-                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaPoolCnvSvcLib AthenaPoolUtilities AtlasSealCLHEP GaudiKernel TrackerSimEventTPCnv TrackerSimEvent )
+# atlas_add_dictionary( TrackerSimEventAthenaPoolCnvDict
+#                       TrackerSimEventAthenaPool/TrackerSimEventAthenaPoolCnvDict.h
+#                       TrackerSimEventAthenaPool/selection.xml
+#                       INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
+#                       LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaPoolCnvSvcLib AthenaPoolUtilities AtlasSealCLHEP GaudiKernel TrackerSimEventTPCnv TrackerSimEvent )
 
 # Install files from the package:
 # atlas_install_headers( TrackerSimEventAthenaPool )
diff --git a/Tracker/TrackerEventCnv/TrackerSimEventTPCnv/CMakeLists.txt b/Tracker/TrackerEventCnv/TrackerSimEventTPCnv/CMakeLists.txt
index 7e51dca0f..c784c8bfe 100644
--- a/Tracker/TrackerEventCnv/TrackerSimEventTPCnv/CMakeLists.txt
+++ b/Tracker/TrackerEventCnv/TrackerSimEventTPCnv/CMakeLists.txt
@@ -7,20 +7,18 @@ atlas_subdir( TrackerSimEventTPCnv )
 
 # External dependencies:
 find_package( CLHEP )
-find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread )
 
 # Component(s) in the package:
 atlas_add_library( TrackerSimEventTPCnv
                    src/TrackerHits/*.cxx
                    PUBLIC_HEADERS TrackerSimEventTPCnv
-                   PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}
+                   PRIVATE_INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS}
                    PRIVATE_DEFINITIONS ${CLHEP_DEFINITIONS}
-                   LINK_LIBRARIES GaudiKernel GeneratorObjectsTPCnv TrackerSimEvent AthenaPoolCnvSvcLib StoreGateLib SGtests
-                   PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} TestTools Identifier )
+                   LINK_LIBRARIES GeneratorObjectsTPCnv TrackerSimEvent AthenaPoolCnvSvcLib
+                   PRIVATE_LINK_LIBRARIES ${CLHEP_LIBRARIES} AthenaKernel GaudiKernel GeneratorObjects Identifier StoreGateLib)
 
 atlas_add_dictionary( TrackerSimEventTPCnvDict
                       TrackerSimEventTPCnv/TrackerSimEventTPCnvDict.h
                       TrackerSimEventTPCnv/selection.xml
-                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AthenaPoolCnvSvcLib GaudiKernel GeneratorObjectsTPCnv TrackerSimEvent TestTools StoreGateLib SGtests Identifier TrackerSimEventTPCnv AthenaKernel )
+                      LINK_LIBRARIES TrackerSimEventTPCnv)
 
diff --git a/Tracker/TrackerEventCnv/TrackerSimEventTPCnv/src/TrackerHits/FaserSiHitCollectionCnv_p3.cxx b/Tracker/TrackerEventCnv/TrackerSimEventTPCnv/src/TrackerHits/FaserSiHitCollectionCnv_p3.cxx
index ee4b293a8..02ff2e69b 100644
--- a/Tracker/TrackerEventCnv/TrackerSimEventTPCnv/src/TrackerHits/FaserSiHitCollectionCnv_p3.cxx
+++ b/Tracker/TrackerEventCnv/TrackerSimEventTPCnv/src/TrackerHits/FaserSiHitCollectionCnv_p3.cxx
@@ -318,7 +318,7 @@ void FaserSiHitCollectionCnv_p3::persToTrans(const FaserSiHitCollection_p3* pers
 
         HepGeom::Point3D<double> endThis( endLast + r );
 
-        HepMcParticleLink::PositionFlag flag = HepMcParticleLink::IS_INDEX;
+        HepMcParticleLink::PositionFlag flag = HepMcParticleLink::IS_EVENTNUM;
         if (persCont->m_mcEvtIndex[idxBC] == 0) {
           flag = HepMcParticleLink::IS_POSITION;
         }
diff --git a/Tracker/TrackerEventCnv/TrackerSimEventTPCnv/src/TrackerHits/FaserSiHitCollectionCnv_p3a.cxx b/Tracker/TrackerEventCnv/TrackerSimEventTPCnv/src/TrackerHits/FaserSiHitCollectionCnv_p3a.cxx
index 0aebca47d..8bf5def29 100644
--- a/Tracker/TrackerEventCnv/TrackerSimEventTPCnv/src/TrackerHits/FaserSiHitCollectionCnv_p3a.cxx
+++ b/Tracker/TrackerEventCnv/TrackerSimEventTPCnv/src/TrackerHits/FaserSiHitCollectionCnv_p3a.cxx
@@ -331,7 +331,7 @@ void FaserSiHitCollectionCnv_p3a::persToTrans(const FaserSiHitCollection_p3a* pe
 
         HepGeom::Point3D<double> endThis( endLast + r );
 
-        HepMcParticleLink::PositionFlag flag = HepMcParticleLink::IS_INDEX;
+        HepMcParticleLink::PositionFlag flag = HepMcParticleLink::IS_EVENTNUM;
         if (persCont->m_mcEvtIndex[idxBC] == 0) {
           flag = HepMcParticleLink::IS_POSITION;
         }
diff --git a/package_filters.txt b/package_filters.txt
index 4ca95b457..b776ceb48 100644
--- a/package_filters.txt
+++ b/package_filters.txt
@@ -5,6 +5,8 @@
 +Calorimeter/CaloDetDescr/EcalGeoModel
 +Calorimeter/CaloDetDescrCnv/CaloIdCnv
 +Calorimeter/CaloDigiAlgs
++Calorimeter/CaloEventCnv/FaserCaloSimEventAthenaPool
++Calorimeter/CaloEventCnv/FaserCaloSimEventTPCnv
 ##+Calorimeter/CaloG4/EcalG4_SD
 +Calorimeter/CaloRecAlgs
 +Calorimeter/CaloRecTools
@@ -13,6 +15,7 @@
 +Control/CalypsoConfiguration
 +Control/CalypsoExample/GenEventExample
 +Control/CalypsoExample/GeoModelTest
+#+Control/CalypsoExample/SimHitExample
 +Control/CalypsoExample/TriggerDataAccessExample
 +Control/CalypsoExample/WaveformAnalysisExample
 -Control/.*
@@ -49,6 +52,8 @@
 +Neutrino/NeutrinoDetDescr/NeutrinoIdentifier
 +Neutrino/NeutrinoDetDescr/NeutrinoReadoutGeometry
 +Neutrino/NeutrinoDetDescrCnv/NeutrinoIdCnv
++Neutrino/NeutrinoEventCnv/NeutrinoSimEventAthenaPool
++Neutrino/NeutrinoEventCnv/NeutrinoSimEventTPCnv
 +Neutrino/NeutrinoRecAlgs
 +Neutrino/NeutrinoSimEvent
 -Neutrino/.*
@@ -62,6 +67,9 @@
 +Scintillator/ScintDetDescr/VetoGeoModel
 +Scintillator/ScintDetDescr/VetoNuGeoModel
 +Scintillator/ScintDetDescrCnv/ScintIdCnv
++Scintillator/ScintDigiAlgs
++Scintillator/ScintEventCnv/ScintSimEventAthenaPool
++Scintillator/ScintEventCnv/ScintSimEventTPCnv
 +Scintillator/ScintSimEvent
 -Scintillator/.*
 ##+Simulation/G4Extensions/Pythia8Decayer
@@ -89,6 +97,8 @@
 +Tracker/TrackerDetDescr/TrackerReadoutGeometry
 +Tracker/TrackerDetDescrCnv/TrackerIdCnv
 +Tracker/TrackerDigitization/FaserSiDigitization
++Tracker/TrackerEventCnv/TrackerSimEventAthenaPool
++Tracker/TrackerEventCnv/TrackerSimEventTPCnv
 +Tracker/TrackerRawEvent/TrackerRawData
 +Tracker/TrackerRawEvent/TrackerSimData
 #+Tracker/TrackerRecTools/FaserSiClusterizationTool
-- 
GitLab