Skip to content

Commit

Permalink
Don't use GaudiAlg
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcarcell committed Jan 23, 2024
1 parent 24084df commit c771881
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 26 deletions.
8 changes: 4 additions & 4 deletions k4MarlinWrapper/k4MarlinWrapper/LcioEventAlgo.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,24 @@
#include <iostream>
#include <memory>

#include <GaudiAlg/GaudiAlgorithm.h>
#include <Gaudi/Algorithm.h>
#include <GaudiKernel/IEventProcessor.h>

#include <EVENT/LCIO.h>
#include <MT/LCReader.h>

#include "k4MarlinWrapper/LCEventWrapper.h"

class LcioEvent : public GaudiAlgorithm {
class LcioEvent : Gaudi::Algorithm {
public:
explicit LcioEvent(const std::string& name, ISvcLocator* pSL);
virtual ~LcioEvent() = default;
virtual StatusCode initialize() override final;
virtual StatusCode execute() override final;
virtual StatusCode execute(const EventContext&) const override;

private:
Gaudi::Property<std::vector<std::string>> m_fileNames{this, "Files", {}};
MT::LCReader* m_reader = nullptr;
};

#endif
#endif
8 changes: 4 additions & 4 deletions k4MarlinWrapper/k4MarlinWrapper/LcioEventOutput.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#include <iostream>

#include <GaudiAlg/GaudiAlgorithm.h>
#include <Gaudi/Algorithm.h>

#include <EVENT/LCIO.h>
#include <IMPL/LCCollectionVec.h>
Expand All @@ -36,12 +36,12 @@

#include "k4MarlinWrapper/LCEventWrapper.h"

class LcioEventOutput : public GaudiAlgorithm {
class LcioEventOutput : Gaudi::Algorithm {
public:
explicit LcioEventOutput(const std::string& name, ISvcLocator* pSL);
virtual ~LcioEventOutput() = default;
virtual StatusCode initialize() override final;
virtual StatusCode execute() override final;
virtual StatusCode execute(const EventContext&) override final;
virtual StatusCode finalize() override final;

private:
Expand All @@ -59,4 +59,4 @@ class LcioEventOutput : public GaudiAlgorithm {
void revertSubsets(const std::vector<lcio::LCCollectionVec*>& subsets);
};

#endif
#endif
6 changes: 3 additions & 3 deletions k4MarlinWrapper/k4MarlinWrapper/MarlinProcessorWrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include <string>

// Gaudi
#include <GaudiAlg/GaudiAlgorithm.h>
#include <Gaudi/Algorithm.h>
#include <GaudiKernel/IEventProcessor.h>
#include <GaudiKernel/IRndmEngine.h>
#include <GaudiKernel/MsgStream.h>
Expand Down Expand Up @@ -56,11 +56,11 @@ namespace marlin {
class StringParameters;
} // namespace marlin

class MarlinProcessorWrapper : public GaudiAlgorithm {
class MarlinProcessorWrapper : Gaudi::Algorithm {
public:
explicit MarlinProcessorWrapper(const std::string& name, ISvcLocator* pSL);
virtual ~MarlinProcessorWrapper() = default;
virtual StatusCode execute() override final;
virtual StatusCode execute(const EventContext&) const override final;
virtual StatusCode finalize() override final;
virtual StatusCode initialize() override final;

Expand Down
6 changes: 3 additions & 3 deletions k4MarlinWrapper/src/components/LcioEventAlgo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@

DECLARE_COMPONENT(LcioEvent)

LcioEvent::LcioEvent(const std::string& name, ISvcLocator* pSL) : GaudiAlgorithm(name, pSL) {}
LcioEvent::LcioEvent(const std::string& name, ISvcLocator* pSL) : Gaudi::Algorithm(name, pSL) {}

StatusCode LcioEvent::initialize() {
StatusCode sc = GaudiAlgorithm::initialize();
StatusCode sc = Gaudi::Algorithm::initialize();
if (sc.isFailure())
return sc;

Expand All @@ -37,7 +37,7 @@ StatusCode LcioEvent::initialize() {
return StatusCode::SUCCESS;
}

StatusCode LcioEvent::execute() {
StatusCode LcioEvent::execute(const EventContext&) const {
auto theEvent = m_reader->readNextEvent(EVENT::LCIO::UPDATE);

if (theEvent == nullptr) {
Expand Down
2 changes: 1 addition & 1 deletion k4MarlinWrapper/src/components/LcioEventOutput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ void LcioEventOutput::revertSubsets(const std::vector<lcio::LCCollectionVec*>& s
////////////////////////////////////////////
// Get LCIO event from event service, write it to output file
////////////////////////////////////////////
StatusCode LcioEventOutput::execute() {
StatusCode LcioEventOutput::execute(const EventContext&) const {
// Get event
DataObject* pObject = nullptr;
StatusCode sc = evtSvc()->retrieveObject("/Event/LCEvent", pObject);
Expand Down
4 changes: 2 additions & 2 deletions k4MarlinWrapper/src/components/MarlinProcessorWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

DECLARE_COMPONENT(MarlinProcessorWrapper)

MarlinProcessorWrapper::MarlinProcessorWrapper(const std::string& name, ISvcLocator* pSL) : GaudiAlgorithm(name, pSL) {
MarlinProcessorWrapper::MarlinProcessorWrapper(const std::string& name, ISvcLocator* pSL) : Gaudi::Algorithm(name, pSL) {
// register log level names with the logstream ---------
streamlog::out.addLevelName<streamlog::DEBUG>();
streamlog::out.addLevelName<streamlog::DEBUG0>();
Expand Down Expand Up @@ -186,7 +186,7 @@ StatusCode MarlinProcessorWrapper::initialize() {
return StatusCode::SUCCESS;
}

StatusCode MarlinProcessorWrapper::execute() {
StatusCode MarlinProcessorWrapper::execute(const EventContext&) const {
// Get flag to know if there was an underlying LCEvent
DataObject* pStatus = nullptr;
StatusCode scStatus = eventSvc()->retrieveObject("/Event/LCEventStatus", pStatus);
Expand Down
4 changes: 2 additions & 2 deletions test/src/MCRecoLinkChecker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@

DECLARE_COMPONENT(MCRecoLinkChecker)

MCRecoLinkChecker::MCRecoLinkChecker(const std::string& name, ISvcLocator* pSL) : GaudiAlgorithm(name, pSL) {
MCRecoLinkChecker::MCRecoLinkChecker(const std::string& name, ISvcLocator* pSL) : Gaudi::Algorithm(name, pSL) {
declareProperty("InputMCRecoLinks", m_relationCollHandle, "Name of the input MC Reco link collection");
declareProperty("InputMCs", m_mcCollHandle, "Name of the input MC collection");
declareProperty("InputRecos", m_recoCollHandle, "Name of the input Reco collection");
}

StatusCode MCRecoLinkChecker::execute() {
StatusCode MCRecoLinkChecker::execute(const EventContext&) const {
const auto relationColl = m_relationCollHandle.get();
const auto mcColl = m_mcCollHandle.get();
const auto recoColl = m_recoCollHandle.get();
Expand Down
14 changes: 7 additions & 7 deletions test/src/MCRecoLinkChecker.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,21 @@

#include "k4FWCore/DataHandle.h"

#include <GaudiAlg/GaudiAlgorithm.h>
#include <Gaudi/Algorithm.h>
#include <GaudiKernel/ISvcLocator.h>

#include <string>

class MCRecoLinkChecker : public GaudiAlgorithm {
class MCRecoLinkChecker : Gaudi::Algorithm {
public:
explicit MCRecoLinkChecker(const std::string& name, ISvcLocator* pSL);
StatusCode execute() final;
StatusCode execute(const EventContext&) const;

private:
DataHandle<edm4hep::MCRecoParticleAssociationCollection> m_relationCollHandle{"MCRecoTruthLinks",
Gaudi::DataHandle::Reader, this};
DataHandle<edm4hep::MCParticleCollection> m_mcCollHandle{"MCParticles", Gaudi::DataHandle::Reader, this};
DataHandle<edm4hep::ReconstructedParticleCollection> m_recoCollHandle{"RecoParticles", Gaudi::DataHandle::Reader,
mutable DataHandle<edm4hep::MCRecoParticleAssociationCollection> m_relationCollHandle{"MCRecoTruthLinks",
Gaudi::DataHandle::Reader, this};
mutable DataHandle<edm4hep::MCParticleCollection> m_mcCollHandle{"MCParticles", Gaudi::DataHandle::Reader, this};
mutable DataHandle<edm4hep::ReconstructedParticleCollection> m_recoCollHandle{"RecoParticles", Gaudi::DataHandle::Reader,
this};
};

Expand Down

0 comments on commit c771881

Please sign in to comment.