Skip to content

Commit

Permalink
Use final consistently throughout all classes
Browse files Browse the repository at this point in the history
  • Loading branch information
tmadlener committed Dec 10, 2024
1 parent 8c1ae10 commit 243a041
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 19 deletions.
6 changes: 3 additions & 3 deletions k4MarlinWrapper/k4MarlinWrapper/LcioEventAlgo.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ namespace MT {
class LcioEvent : public Gaudi::Algorithm {
public:
explicit LcioEvent(const std::string& name, ISvcLocator* pSL);
StatusCode initialize() override final;
StatusCode execute(const EventContext&) const override;
StatusCode initialize() final;
StatusCode execute(const EventContext&) const final;

private:
Gaudi::Property<std::vector<std::string>> m_fileNames{this, "Files", {}};
MT::LCReader* m_reader = nullptr;
bool isReEntrant() const override { return false; }
bool isReEntrant() const final { return false; }
};

#endif
4 changes: 2 additions & 2 deletions k4MarlinWrapper/k4MarlinWrapper/LcioEventOutput.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ namespace MT {
class LcioEventOutput : public Gaudi::Algorithm {
public:
explicit LcioEventOutput(const std::string& name, ISvcLocator* pSL);
StatusCode initialize() override final;
StatusCode initialize() final;
StatusCode execute(const EventContext&) const final;
StatusCode finalize() override final;
StatusCode finalize() final;

private:
MT::LCWriter* m_writer = nullptr;
Expand Down
8 changes: 4 additions & 4 deletions k4MarlinWrapper/k4MarlinWrapper/MarlinProcessorWrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ namespace marlin {
class MarlinProcessorWrapper : public Gaudi::Algorithm {
public:
explicit MarlinProcessorWrapper(const std::string& name, ISvcLocator* pSL);
StatusCode execute(const EventContext&) const override final;
StatusCode finalize() override final;
StatusCode initialize() override final;
StatusCode execute(const EventContext&) const final;
StatusCode finalize() final;
StatusCode initialize() final;

private:
std::string m_verbosity = "ERROR";
Expand All @@ -78,7 +78,7 @@ class MarlinProcessorWrapper : public Gaudi::Algorithm {

static std::stack<marlin::Processor*>& ProcessorStack();

bool isReEntrant() const override { return false; }
bool isReEntrant() const final { return false; }
};

std::stack<marlin::Processor*>& MarlinProcessorWrapper::ProcessorStack() {
Expand Down
6 changes: 3 additions & 3 deletions k4MarlinWrapper/k4MarlinWrapper/converters/EDM4hep2Lcio.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ struct CollectionPairMappings;
class EDM4hep2LcioTool : public AlgTool, virtual public IEDMConverter {
public:
EDM4hep2LcioTool(const std::string& type, const std::string& name, const IInterface* parent);
StatusCode initialize() override;
StatusCode finalize() override;
StatusCode initialize() final;
StatusCode finalize() final;

StatusCode convertCollections(lcio::LCEventImpl* lcio_event) override;
StatusCode convertCollections(lcio::LCEventImpl* lcio_event) final;

private:
Gaudi::Property<std::map<std::string, std::string>> m_collNames{this, "collNameMapping", {}};
Expand Down
2 changes: 1 addition & 1 deletion k4MarlinWrapper/k4MarlinWrapper/converters/Lcio2EDM4hep.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class Lcio2EDM4hepTool : public AlgTool, virtual public IEDMConverter {
// - Convert associated collections from LCRelation for existing EDM4hep relations
// - Converted collections are put into TES
// **********************************
StatusCode convertCollections(lcio::LCEventImpl* lcio_event) override;
StatusCode convertCollections(lcio::LCEventImpl* lcio_event) final;

private:
Gaudi::Property<std::map<std::string, std::string>> m_collNames{this, "collNameMapping", {}};
Expand Down
4 changes: 2 additions & 2 deletions test/src/MarlinMCRecoLinkChecker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ class MarlinMCRecoLinkChecker : public marlin::Processor {
public:
MarlinMCRecoLinkChecker();

marlin::Processor* newProcessor() override { return new MarlinMCRecoLinkChecker; }
marlin::Processor* newProcessor() final { return new MarlinMCRecoLinkChecker; }

void processEvent(LCEvent* evt) override;
void processEvent(LCEvent* evt) final;

private:
std::string m_mcCollName{};
Expand Down
2 changes: 1 addition & 1 deletion test/src/PseudoRecoAlgorithm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ struct PseudoRecoAlgorithm final
: Transformer(name, svcLoc, {KeyValues("InputMCs", {"MCParticles"})},
{KeyValues("OutputRecos", {"PseudoRecoParticles"})}) {}

edm4hep::ReconstructedParticleCollection operator()(const edm4hep::MCParticleCollection& input) const override {
edm4hep::ReconstructedParticleCollection operator()(const edm4hep::MCParticleCollection& input) const final {
auto coll_out = edm4hep::ReconstructedParticleCollection();
for (const auto& particle : input) {
auto new_particle = coll_out.create();
Expand Down
2 changes: 1 addition & 1 deletion test/src/TrivialMCRecoLinker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ struct TrivialMCRecoLinker final

edm4hep::RecoMCParticleLinkCollection operator()(
const edm4hep::MCParticleCollection& mcParticles,
const edm4hep::ReconstructedParticleCollection& recoParticles) const override {
const edm4hep::ReconstructedParticleCollection& recoParticles) const final {
auto links = edm4hep::RecoMCParticleLinkCollection{};

for (size_t i = 0; i < mcParticles.size(); ++i) {
Expand Down
4 changes: 2 additions & 2 deletions test/src/TrivialMCTruthLinkerProcessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ class TrivialMCTruthLinkerProcessor : public marlin::Processor {
public:
TrivialMCTruthLinkerProcessor();

marlin::Processor* newProcessor() override { return new TrivialMCTruthLinkerProcessor; }
marlin::Processor* newProcessor() final { return new TrivialMCTruthLinkerProcessor; }

/** process the event - In this case simply link MCparticle[i] with
* ReconstructedParticle[i]
*/
void processEvent(LCEvent* evt) override;
void processEvent(LCEvent* evt) final;

private:
std::string m_mcCollName{};
Expand Down

0 comments on commit 243a041

Please sign in to comment.