From 0eb6d8205366c14116b4e89c14a134dc03f93db5 Mon Sep 17 00:00:00 2001 From: Valentin Volkl Date: Sun, 17 Jul 2022 22:09:37 +0200 Subject: [PATCH] Propagate upstream changes: Geant4Hits header removed in dd4hep The classes defined in this header are not used in any case, the include can just be replaced with another one that provides dd4hep::Segmentation. Includes some fixes for compiler warnings --- SimG4Components/src/InspectHitsCollectionsTool.cpp | 3 ++- SimG4Components/src/SimG4GeantinoDeposits.h | 2 +- SimG4Components/src/SimG4SaveCalHits.cpp | 3 ++- SimG4Components/src/SimG4SaveSmearedParticles.cpp | 2 +- SimG4Components/src/SimG4SmearGenParticles.cpp | 6 +++--- .../include/SimG4Interface/ISimG4MagneticFieldTool.h | 2 +- 6 files changed, 10 insertions(+), 8 deletions(-) diff --git a/SimG4Components/src/InspectHitsCollectionsTool.cpp b/SimG4Components/src/InspectHitsCollectionsTool.cpp index dfc7c6a..f81a9f9 100644 --- a/SimG4Components/src/InspectHitsCollectionsTool.cpp +++ b/SimG4Components/src/InspectHitsCollectionsTool.cpp @@ -9,7 +9,8 @@ #include "G4Event.hh" // DD4hep -#include "DDG4/Geant4Hits.h" +#include "DD4hep/Detector.h" +#include "DD4hep/Segmentations.h" DECLARE_COMPONENT(InspectHitsCollectionsTool) diff --git a/SimG4Components/src/SimG4GeantinoDeposits.h b/SimG4Components/src/SimG4GeantinoDeposits.h index 05a8a36..0714bbd 100644 --- a/SimG4Components/src/SimG4GeantinoDeposits.h +++ b/SimG4Components/src/SimG4GeantinoDeposits.h @@ -26,7 +26,7 @@ class SimG4GeantinoDeposits: public AlgTool, virtual public ISimG4PhysicsList { /** Get the physics list. * @return pointer to G4VModularPhysicsList (ownership is transferred to the caller) */ - virtual G4VModularPhysicsList* physicsList(); + virtual G4VModularPhysicsList* physicsList() override final; }; diff --git a/SimG4Components/src/SimG4SaveCalHits.cpp b/SimG4Components/src/SimG4SaveCalHits.cpp index 334fed9..26bfd47 100644 --- a/SimG4Components/src/SimG4SaveCalHits.cpp +++ b/SimG4Components/src/SimG4SaveCalHits.cpp @@ -12,7 +12,8 @@ #include "edm4hep/SimCalorimeterHitCollection.h" // DD4hep -#include "DDG4/Geant4Hits.h" +#include "DD4hep/Detector.h" +#include "DD4hep/Segmentations.h" DECLARE_COMPONENT(SimG4SaveCalHits) diff --git a/SimG4Components/src/SimG4SaveSmearedParticles.cpp b/SimG4Components/src/SimG4SaveSmearedParticles.cpp index 9483c5c..2afbde4 100644 --- a/SimG4Components/src/SimG4SaveSmearedParticles.cpp +++ b/SimG4Components/src/SimG4SaveSmearedParticles.cpp @@ -12,7 +12,7 @@ #include "edm4hep/MCRecoParticleAssociationCollection.h" // DD4hep -#include "DDG4/Geant4Hits.h" +#include "DD4hep/Segmentations.h" DECLARE_COMPONENT(SimG4SaveSmearedParticles) diff --git a/SimG4Components/src/SimG4SmearGenParticles.cpp b/SimG4Components/src/SimG4SmearGenParticles.cpp index 4c20be7..eea02a6 100644 --- a/SimG4Components/src/SimG4SmearGenParticles.cpp +++ b/SimG4Components/src/SimG4SmearGenParticles.cpp @@ -11,7 +11,7 @@ #include "edm4hep/MCParticleCollection.h" // DD4hep -#include "DDG4/Geant4Hits.h" +#include "DD4hep/Segmentations.h" DECLARE_COMPONENT(SimG4SmearGenParticles) @@ -26,10 +26,10 @@ StatusCode SimG4SmearGenParticles::initialize() { StatusCode sc = GaudiAlgorithm::initialize(); // Use smearing tool if (!m_smearTool.retrieve()) { - info() << "Generated particels will not be smeared!!!" << endmsg; + info() << "Generated particles will not be smeared!!!" << endmsg; return StatusCode::SUCCESS; } - return StatusCode::SUCCESS; + return sc; } StatusCode SimG4SmearGenParticles::execute() { diff --git a/SimG4Interface/include/SimG4Interface/ISimG4MagneticFieldTool.h b/SimG4Interface/include/SimG4Interface/ISimG4MagneticFieldTool.h index 96f3854..0237a5f 100644 --- a/SimG4Interface/include/SimG4Interface/ISimG4MagneticFieldTool.h +++ b/SimG4Interface/include/SimG4Interface/ISimG4MagneticFieldTool.h @@ -1,5 +1,5 @@ #ifndef SIMG4INTERFACE_ISIMG4MAGNETICFIELDTOOL_H -#define SIMG4INTERFACE_ISIM4MAGNETICFIELDTOOL_H +#define SIMG4INTERFACE_ISIMG4MAGNETICFIELDTOOL_H // from Gaudi #include "GaudiKernel/IAlgTool.h"