Skip to content

Commit

Permalink
Do not use GaudiAlg, use Gaudi::Algorithm instead
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcarcell committed Jul 29, 2024
1 parent 02a602e commit 9242ad7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
1 change: 0 additions & 1 deletion framework/k4SimDelphes/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ gaudi_add_module(k4SimDelphesPlugins
LINK k4FWCore::k4FWCore
k4FWCore::k4Interface
DelphesEDM4HepConverter
Gaudi::GaudiAlgLib
Gaudi::GaudiKernel
EDM4HEP::edm4hep
ROOT::Core
Expand Down
2 changes: 1 addition & 1 deletion framework/k4SimDelphes/src/k4SimDelphesAlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ StatusCode k4SimDelphesAlg::initialize() {
return StatusCode::SUCCESS;
}

StatusCode k4SimDelphesAlg::execute() {
StatusCode k4SimDelphesAlg::execute(const EventContext&) {
verbose() << "Execute k4SimDelphesAlg... " << endmsg;
m_allParticleOutputArray->Clear();
m_stableParticleOutputArray->Clear();
Expand Down
20 changes: 10 additions & 10 deletions framework/k4SimDelphes/src/k4SimDelphesAlg.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "k4FWCore/DataWrapper.h"
#include "k4FWCore/PodioDataSvc.h"

#include "GaudiAlg/GaudiAlgorithm.h"
#include "Gaudi/Algorithm.h"

#include "modules/Delphes.h"

Expand All @@ -26,19 +26,19 @@ namespace edm4hep {
* Main Algorithm to run Delphes, getting MCParticle input, producing
* ReconstructedParticle output.
*/
class k4SimDelphesAlg : public GaudiAlgorithm {
class k4SimDelphesAlg : public Gaudi::Algorithm {
public:
k4SimDelphesAlg(const std::string& name, ISvcLocator* svcLoc);

virtual StatusCode initialize();
virtual StatusCode execute();
virtual StatusCode execute(const EventContext&);
virtual StatusCode finalize();

private:
/// Input from Generator
DataHandle<edm4hep::MCParticleCollection> m_InputMCParticles{"GenParticles", Gaudi::DataHandle::Reader, this};
mutable DataHandle<edm4hep::MCParticleCollection> m_InputMCParticles{"GenParticles", Gaudi::DataHandle::Reader, this};
/// Output from Delphes
DataHandle<edm4hep::ReconstructedParticleCollection> m_OutputRecParticles{"RecParticlesDelphes",
mutable DataHandle<edm4hep::ReconstructedParticleCollection> m_OutputRecParticles{"RecParticlesDelphes",
Gaudi::DataHandle::Writer, this};

// Delphes detector card to be read in
Expand All @@ -51,17 +51,17 @@ class k4SimDelphesAlg : public GaudiAlgorithm {
std::unique_ptr<Delphes> m_Delphes{nullptr};
std::unique_ptr<ExRootConfReader> m_confReader{nullptr};
std::unique_ptr<k4SimDelphes::DelphesEDM4HepConverter> m_edm4hepConverter{nullptr};
TObjArray* m_allParticleOutputArray{nullptr};
TObjArray* m_stableParticleOutputArray{nullptr};
TObjArray* m_partonOutputArray{nullptr};
mutable TObjArray* m_allParticleOutputArray{nullptr};
mutable TObjArray* m_stableParticleOutputArray{nullptr};
mutable TObjArray* m_partonOutputArray{nullptr};

ExRootTreeWriter* m_treeWriter{nullptr};
mutable ExRootTreeWriter* m_treeWriter{nullptr};
TTree* m_converterTree{nullptr};

// since branch names are taken from delphes config
// and not declared as data handles,
// need podiodatasvc directly
PodioDataSvc* m_podioDataSvc;
mutable PodioDataSvc* m_podioDataSvc;
ServiceHandle<IDataProviderSvc> m_eventDataSvc;
};

Expand Down

0 comments on commit 9242ad7

Please sign in to comment.