From 7150ee89bf949c4b59919b1c325495de8ca9b713 Mon Sep 17 00:00:00 2001 From: Valentin Volkl Date: Mon, 28 Feb 2022 14:21:56 +0100 Subject: [PATCH] [clang-format] --- .../src/components/CreateExampleEventData.cpp | 19 +++++++---------- .../src/components/CreateExampleEventData.h | 21 +++++++++---------- k4ProjectTemplate/src/components/EmptyAlg.cpp | 15 ++++--------- k4ProjectTemplate/src/components/EmptyAlg.h | 9 ++++---- .../src/components/HelloWorldAlg.cpp | 8 +++---- .../src/components/HelloWorldAlg.h | 10 ++++----- 6 files changed, 34 insertions(+), 48 deletions(-) diff --git a/k4ProjectTemplate/src/components/CreateExampleEventData.cpp b/k4ProjectTemplate/src/components/CreateExampleEventData.cpp index 5b94048..66c5483 100644 --- a/k4ProjectTemplate/src/components/CreateExampleEventData.cpp +++ b/k4ProjectTemplate/src/components/CreateExampleEventData.cpp @@ -1,14 +1,13 @@ #include "CreateExampleEventData.h" - // datamodel #include "edm4hep/MCParticleCollection.h" #include "edm4hep/SimTrackerHitCollection.h" - DECLARE_COMPONENT(CreateExampleEventData) -CreateExampleEventData::CreateExampleEventData(const std::string& aName, ISvcLocator* aSvcLoc) : GaudiAlgorithm(aName, aSvcLoc) { +CreateExampleEventData::CreateExampleEventData(const std::string& aName, ISvcLocator* aSvcLoc) + : GaudiAlgorithm(aName, aSvcLoc) { declareProperty("mcparticles", m_mcParticleHandle, "Dummy Particle collection (output)"); declareProperty("trackhits", m_simTrackerHitHandle, "Dummy Hit collection (output)"); } @@ -23,28 +22,26 @@ StatusCode CreateExampleEventData::initialize() { } StatusCode CreateExampleEventData::execute() { - m_singleIntHandle.put(new int(12345)); std::vector* floatVector = m_vectorFloatHandle.createAndPut(); - floatVector->emplace_back( 125.); - floatVector->emplace_back( 25.); + floatVector->emplace_back(125.); + floatVector->emplace_back(25.); edm4hep::MCParticleCollection* particles = m_mcParticleHandle.createAndPut(); auto particle = particles->create(); auto& p4 = particle.momentum(); - p4.x = m_magicNumberOffset + 5; - p4.y = m_magicNumberOffset + 6; - p4.z = m_magicNumberOffset + 7; + p4.x = m_magicNumberOffset + 5; + p4.y = m_magicNumberOffset + 6; + p4.z = m_magicNumberOffset + 7; particle.setMass(m_magicNumberOffset + 8); auto* hits = m_simTrackerHitHandle.createAndPut(); - auto hit = hits->create(); + auto hit = hits->create(); hit.setPosition({3, 4, 5}); - return StatusCode::SUCCESS; } diff --git a/k4ProjectTemplate/src/components/CreateExampleEventData.h b/k4ProjectTemplate/src/components/CreateExampleEventData.h index 4cc78ed..a433094 100644 --- a/k4ProjectTemplate/src/components/CreateExampleEventData.h +++ b/k4ProjectTemplate/src/components/CreateExampleEventData.h @@ -5,17 +5,15 @@ #include "GaudiAlg/GaudiAlgorithm.h" // edm4hep -#include "k4FWCore/DataHandle.h" #include "TTree.h" +#include "k4FWCore/DataHandle.h" - - -// datamodel +// datamodel namespace edm4hep { -class MCParticleCollection; -class SimTrackerHitCollection; -class SimCaloHit; -} + class MCParticleCollection; + class SimTrackerHitCollection; + class SimCaloHit; +} // namespace edm4hep /** @class CreateExampleEventData * Lightweight producer for edm data for tests that do not depend on the actual @@ -43,14 +41,15 @@ class CreateExampleEventData : public GaudiAlgorithm { private: /// integer to add to the dummy values written to the edm - Gaudi::Property m_magicNumberOffset{this, "magicNumberOffset", 0, "Integer to add to the dummy values written to the edm"}; + Gaudi::Property m_magicNumberOffset{this, "magicNumberOffset", 0, + "Integer to add to the dummy values written to the edm"}; /// Handle for the genparticles to be written DataHandle m_mcParticleHandle{"MCParticles", Gaudi::DataHandle::Writer, this}; /// Handle for the genvertices to be written DataHandle m_simTrackerHitHandle{"SimTrackerHit", Gaudi::DataHandle::Writer, this}; - DataHandle m_singleFloatHandle{"SingleFloat", Gaudi::DataHandle::Writer, this}; + DataHandle m_singleFloatHandle{"SingleFloat", Gaudi::DataHandle::Writer, this}; DataHandle> m_vectorFloatHandle{"VectorFloat", Gaudi::DataHandle::Writer, this}; - DataHandle m_singleIntHandle{"SingleInt", Gaudi::DataHandle::Writer, this}; + DataHandle m_singleIntHandle{"SingleInt", Gaudi::DataHandle::Writer, this}; }; #endif /* TESTFWCORE_CREATEEXAMPLEEVENTDATA */ diff --git a/k4ProjectTemplate/src/components/EmptyAlg.cpp b/k4ProjectTemplate/src/components/EmptyAlg.cpp index 5cf4e1b..c656758 100644 --- a/k4ProjectTemplate/src/components/EmptyAlg.cpp +++ b/k4ProjectTemplate/src/components/EmptyAlg.cpp @@ -2,19 +2,12 @@ DECLARE_COMPONENT(EmptyAlg) -EmptyAlg::EmptyAlg(const std::string& aName, ISvcLocator* aSvcLoc) : GaudiAlgorithm(aName, aSvcLoc) { -} +EmptyAlg::EmptyAlg(const std::string& aName, ISvcLocator* aSvcLoc) : GaudiAlgorithm(aName, aSvcLoc) {} EmptyAlg::~EmptyAlg() {} -StatusCode EmptyAlg::initialize() { - return StatusCode::SUCCESS; -} +StatusCode EmptyAlg::initialize() { return StatusCode::SUCCESS; } -StatusCode EmptyAlg::execute() { - return StatusCode::SUCCESS; -} +StatusCode EmptyAlg::execute() { return StatusCode::SUCCESS; } -StatusCode EmptyAlg::finalize() { - return StatusCode::SUCCESS; -} +StatusCode EmptyAlg::finalize() { return StatusCode::SUCCESS; } diff --git a/k4ProjectTemplate/src/components/EmptyAlg.h b/k4ProjectTemplate/src/components/EmptyAlg.h index f83a2f2..e33e143 100644 --- a/k4ProjectTemplate/src/components/EmptyAlg.h +++ b/k4ProjectTemplate/src/components/EmptyAlg.h @@ -1,9 +1,8 @@ -#pragma once +#pragma once // GAUDI -#include "GaudiAlg/GaudiAlgorithm.h" #include "Gaudi/Property.h" - +#include "GaudiAlg/GaudiAlgorithm.h" class EmptyAlg : public GaudiAlgorithm { public: @@ -23,6 +22,6 @@ class EmptyAlg : public GaudiAlgorithm { virtual StatusCode finalize() final; private: - // member variable - int m_member = 0; + // member variable + int m_member = 0; }; diff --git a/k4ProjectTemplate/src/components/HelloWorldAlg.cpp b/k4ProjectTemplate/src/components/HelloWorldAlg.cpp index 1bf31e8..c66361b 100644 --- a/k4ProjectTemplate/src/components/HelloWorldAlg.cpp +++ b/k4ProjectTemplate/src/components/HelloWorldAlg.cpp @@ -3,7 +3,7 @@ DECLARE_COMPONENT(HelloWorldAlg) -HelloWorldAlg::HelloWorldAlg(const std::string& aName, ISvcLocator* aSvcLoc) : GaudiAlgorithm(aName, aSvcLoc) { } +HelloWorldAlg::HelloWorldAlg(const std::string& aName, ISvcLocator* aSvcLoc) : GaudiAlgorithm(aName, aSvcLoc) {} HelloWorldAlg::~HelloWorldAlg() {} @@ -17,12 +17,10 @@ StatusCode HelloWorldAlg::initialize() { StatusCode HelloWorldAlg::execute() { info() << endmsg; info() << endmsg; - info() << theMessage << endmsg; + info() << theMessage << endmsg; info() << endmsg; info() << endmsg; return StatusCode::SUCCESS; } -StatusCode HelloWorldAlg::finalize() { - return GaudiAlgorithm::finalize(); -} +StatusCode HelloWorldAlg::finalize() { return GaudiAlgorithm::finalize(); } diff --git a/k4ProjectTemplate/src/components/HelloWorldAlg.h b/k4ProjectTemplate/src/components/HelloWorldAlg.h index 6bcea51..1918042 100644 --- a/k4ProjectTemplate/src/components/HelloWorldAlg.h +++ b/k4ProjectTemplate/src/components/HelloWorldAlg.h @@ -1,12 +1,11 @@ #ifndef TESTFWCORE_HELLOWORLDALG #define TESTFWCORE_HELLOWORLDALG -#pragma once +#pragma once // GAUDI -#include "GaudiAlg/GaudiAlgorithm.h" #include "Gaudi/Property.h" - +#include "GaudiAlg/GaudiAlgorithm.h" class HelloWorldAlg : public GaudiAlgorithm { public: @@ -26,8 +25,9 @@ class HelloWorldAlg : public GaudiAlgorithm { virtual StatusCode finalize() final; private: - // member variable - Gaudi::Property theMessage{this, "PerEventPrintMessage", "Hello ", "The message to printed for each Event"}; + // member variable + Gaudi::Property theMessage{this, "PerEventPrintMessage", "Hello ", + "The message to printed for each Event"}; }; #endif /* TESTFWCORE_HELLOWORLDALG */