Skip to content

Commit

Permalink
[clang-format]
Browse files Browse the repository at this point in the history
  • Loading branch information
vvolkl committed Mar 1, 2022
1 parent 9a7df3c commit 7150ee8
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 48 deletions.
19 changes: 8 additions & 11 deletions k4ProjectTemplate/src/components/CreateExampleEventData.cpp
Original file line number Diff line number Diff line change
@@ -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)");
}
Expand All @@ -23,28 +22,26 @@ StatusCode CreateExampleEventData::initialize() {
}

StatusCode CreateExampleEventData::execute() {

m_singleIntHandle.put(new int(12345));

std::vector<float>* 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;
}

Expand Down
21 changes: 10 additions & 11 deletions k4ProjectTemplate/src/components/CreateExampleEventData.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -43,14 +41,15 @@ class CreateExampleEventData : public GaudiAlgorithm {

private:
/// integer to add to the dummy values written to the edm
Gaudi::Property<int> m_magicNumberOffset{this, "magicNumberOffset", 0, "Integer to add to the dummy values written to the edm"};
Gaudi::Property<int> m_magicNumberOffset{this, "magicNumberOffset", 0,
"Integer to add to the dummy values written to the edm"};
/// Handle for the genparticles to be written
DataHandle<edm4hep::MCParticleCollection> m_mcParticleHandle{"MCParticles", Gaudi::DataHandle::Writer, this};
/// Handle for the genvertices to be written
DataHandle<edm4hep::SimTrackerHitCollection> m_simTrackerHitHandle{"SimTrackerHit", Gaudi::DataHandle::Writer, this};

DataHandle<float> m_singleFloatHandle{"SingleFloat", Gaudi::DataHandle::Writer, this};
DataHandle<float> m_singleFloatHandle{"SingleFloat", Gaudi::DataHandle::Writer, this};
DataHandle<std::vector<float>> m_vectorFloatHandle{"VectorFloat", Gaudi::DataHandle::Writer, this};
DataHandle<int> m_singleIntHandle{"SingleInt", Gaudi::DataHandle::Writer, this};
DataHandle<int> m_singleIntHandle{"SingleInt", Gaudi::DataHandle::Writer, this};
};
#endif /* TESTFWCORE_CREATEEXAMPLEEVENTDATA */
15 changes: 4 additions & 11 deletions k4ProjectTemplate/src/components/EmptyAlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
9 changes: 4 additions & 5 deletions k4ProjectTemplate/src/components/EmptyAlg.h
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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;
};
8 changes: 3 additions & 5 deletions k4ProjectTemplate/src/components/HelloWorldAlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() {}

Expand All @@ -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(); }
10 changes: 5 additions & 5 deletions k4ProjectTemplate/src/components/HelloWorldAlg.h
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -26,8 +25,9 @@ class HelloWorldAlg : public GaudiAlgorithm {
virtual StatusCode finalize() final;

private:
// member variable
Gaudi::Property<std::string> theMessage{this, "PerEventPrintMessage", "Hello ", "The message to printed for each Event"};
// member variable
Gaudi::Property<std::string> theMessage{this, "PerEventPrintMessage", "Hello ",
"The message to printed for each Event"};
};

#endif /* TESTFWCORE_HELLOWORLDALG */

0 comments on commit 7150ee8

Please sign in to comment.