diff --git a/README.md b/README.md index a2400414..b2f41dd7 100644 --- a/README.md +++ b/README.md @@ -69,9 +69,8 @@ make install ``` ## Implementing algorithms -k4FWCore uses (or will use) `Gaudi::Functional` for executing algorithms. In -`Gaudi::Functional` we have three different base classes that we will use -depending on how may input and output types they take: +k4FWCore uses `Gaudi::Functional` for executing algorithms. There are several +types of algorithms, depending on your use case: - The `Consumer` takes inputs but no outputs; can be used for reading - The `Producer` takes outputs but no inputs; can be used for generating collections or events @@ -79,11 +78,18 @@ depending on how may input and output types they take: `Producer` are a particular case of this one) and takes both inputs and outputs -In all cases the implementation process is the same, we'll create a new class -that will implement `operator()`, that is where our algorithm will be. Simple -examples can be found in the test folder for each one of these three. In -addition, there are tests that have either multiple inputs and / or multiple -outputs (like `ExampleFunctionalProducerMultiple`) that can be used as a -template for the more typical case when working with multiple inputs or outputs. +A more complete list of algorithms can be found in +https://lhcb.github.io/DevelopKit/03a-gaudi/, in the `Gaudi::Functional` +section. + +In all cases the implementation process is the same: we'll create a new class +that will inherit from one of the previous algorithms. Then, we implement +`operator()`, where our algorithm will be. This `operator()` will return either +a single type (including `void`) or a tuple with multiple types. It will take +one parameter per input. Simple examples can be found in the test folder for +each one of the above-mentioned algorithms. In addition, there are tests that +have either multiple inputs and / or multiple outputs (like +`ExampleFunctionalProducerMultiple`) that can be used as a template for the more +typical case when working with multiple inputs or outputs. `GaudiAlg` is deprecated and will be removed in future versions of Gaudi. diff --git a/k4FWCore/src/PodioDataSvc.cpp b/k4FWCore/src/PodioDataSvc.cpp index c048983a..956ab2da 100644 --- a/k4FWCore/src/PodioDataSvc.cpp +++ b/k4FWCore/src/PodioDataSvc.cpp @@ -150,7 +150,7 @@ PodioDataSvc::PodioDataSvc(const std::string& name, ISvcLocator* svc) : DataSvc( PodioDataSvc::~PodioDataSvc() {} const std::string_view PodioDataSvc::getCollectionType(const std::string& collName) { - auto coll = m_eventframe.get(collName); + const auto coll = m_eventframe.get(collName); if (coll == nullptr) { error() << "Collection " << collName << " does not exist." << endmsg; } diff --git a/test/k4FWCoreTest/src/components/ExampleFunctionalConsumerMultiple.cpp b/test/k4FWCoreTest/src/components/ExampleFunctionalConsumerMultiple.cpp index 453f16dd..23e6309e 100644 --- a/test/k4FWCoreTest/src/components/ExampleFunctionalConsumerMultiple.cpp +++ b/test/k4FWCoreTest/src/components/ExampleFunctionalConsumerMultiple.cpp @@ -44,9 +44,9 @@ struct ExampleFunctionalConsumerMultiple final const FloatColl& floatVector, const ParticleColl& particles, const SimTrackerHitColl& simTrackerHits, const TrackerHitColl& trackerHits, const TrackColl& tracks) const override { - // if ((floatVector[0] != 125) || (floatVector[1] != 25) || (floatVector[2] != m_event)) { - // fatal() << "Wrong data in floatVector collection"; - // } + if ((floatVector[0] != 125) || (floatVector[1] != 25) || (floatVector[2] != m_event)) { + fatal() << "Wrong data in floatVector collection"; + } auto p4 = particles.momentum()[0]; if ((p4.x != m_magicNumberOffset + m_event + 5) || (p4.y != m_magicNumberOffset + 6) || diff --git a/test/k4FWCoreTest/src/components/ExampleFunctionalTransformer.cpp b/test/k4FWCoreTest/src/components/ExampleFunctionalTransformer.cpp index 86403094..d26c55cd 100644 --- a/test/k4FWCoreTest/src/components/ExampleFunctionalTransformer.cpp +++ b/test/k4FWCoreTest/src/components/ExampleFunctionalTransformer.cpp @@ -33,7 +33,6 @@ struct ExampleFunctionalTransformer final new_particle.setCharge(particle.getCharge() + 10); new_particle.setTime(particle.getTime() + 10); new_particle.setMass(particle.getMass() + 10); - // new_particle. coll_out->push_back(new_particle); } return coll_out;