diff --git a/.github/workflows/key4hep-build.yaml b/.github/workflows/key4hep-build.yaml index 2acf1746..f0bcb2c1 100644 --- a/.github/workflows/key4hep-build.yaml +++ b/.github/workflows/key4hep-build.yaml @@ -18,7 +18,7 @@ jobs: strategy: matrix: build_type: ["release", "nightly"] - image: ["alma9", "ubuntu22", "centos7"] + image: ["alma9", "ubuntu22"] fail-fast: false runs-on: ubuntu-latest steps: diff --git a/k4FWCore/components/IOSvc.cpp b/k4FWCore/components/IOSvc.cpp index b88858bd..0a92a560 100644 --- a/k4FWCore/components/IOSvc.cpp +++ b/k4FWCore/components/IOSvc.cpp @@ -74,7 +74,6 @@ std::tuple>, std::vector lock(m_changeBufferLock); - info() << "m_nextEntry = " << m_nextEntry << " m_entries = " << m_entries << endmsg; if (m_nextEntry < m_entries) { frame = podio::Frame(std::move(m_reader->readEntry(podio::Category::Event, m_nextEntry))); } else { @@ -88,14 +87,12 @@ std::tuple>, std::vector= m_entries) { - // if (true) { auto ep = serviceLocator()->as(); StatusCode sc = ep->stopRun(); if (sc.isFailure()) { error() << "Error when stopping run" << endmsg; throw GaudiException("Error when stopping run", name(), StatusCode::FAILURE); } - info() << "m_nextEntry = " << m_nextEntry << " m_entries = " << m_entries << endmsg; } std::vector> collections; @@ -143,10 +140,9 @@ void IOSvc::handle(const Incident& incident) { if (code.isSuccess()) { debug() << "Removing the collection: " << coll << " from the store" << endmsg; code = m_dataSvc->unregisterObject(collPtr); + } else { + error() << "Expected collection " << coll << " in the store but it was not found" << endmsg; } - // else { - // info() << "Collection not found: " << coll << endmsg; - // } } } diff --git a/k4FWCore/include/k4FWCore/FunctionalUtils.h b/k4FWCore/include/k4FWCore/FunctionalUtils.h index 61aab1aa..84778e53 100644 --- a/k4FWCore/include/k4FWCore/FunctionalUtils.h +++ b/k4FWCore/include/k4FWCore/FunctionalUtils.h @@ -138,15 +138,17 @@ namespace k4FWCore { // 1. a mistake was made in the input types of a functional algorithm // 2. the data was produced using the old DataHandle, which is never going to be in the input type if (e.message().find("different from") != std::string::npos) { - thisClass->error() << "Trying to cast the collection " << std::get(handles)[0].objKey() - << " to the requested type " << thisClass->name() << endmsg; + thisClass->debug() << "Trying to cast the collection " << std::get(handles)[0].objKey() + << " to the requested type didn't work " << endmsg; DataObject* p; IDataProviderSvc* svc = thisClass->serviceLocator()->template service("EventDataSvc"); svc->retrieveObject("/Event/" + std::get(handles)[0].objKey(), p).ignore(); const auto wrp = dynamic_cast>>*>(p); if (!wrp) { throw GaudiException(thisClass->name(), - "Failed to cast collection " + std::get(handles)[0].objKey(), + "Failed to cast collection " + std::get(handles)[0].objKey() + + " to the requested type " + + typeid(std::tuple_element_t>).name(), StatusCode::FAILURE); } std::get(inputTuple) = const_cast>*>(wrp->getData()); diff --git a/test/k4FWCoreTest/options/runFunctionalMix.py b/test/k4FWCoreTest/options/runFunctionalMix.py index d80bac86..5c1387e4 100644 --- a/test/k4FWCoreTest/options/runFunctionalMix.py +++ b/test/k4FWCoreTest/options/runFunctionalMix.py @@ -20,7 +20,7 @@ # This is an example mixing functional and non-functional algorithms # -from Gaudi.Configuration import INFO, DEBUG +from Gaudi.Configuration import INFO from Configurables import ( ExampleFunctionalConsumerMultiple, ExampleFunctionalTransformerMultiple, @@ -102,7 +102,9 @@ InputCollectionParticles=["FunctionalMCParticles"], Offset=0, ) -consumer_producerfun_algorithm = k4FWCoreTest_CheckExampleEventData("CheckFunctional") +consumer_producerfun_algorithm = k4FWCoreTest_CheckExampleEventData( + "CheckFunctional", keepEventNumberZero=True +) consumer_producerfun_algorithm.mcparticles = "FunctionalMCParticles" consumer_producerfun_algorithm.keepEventNumberZero = True @@ -125,6 +127,7 @@ ) consumer_produceralg_algorithm = k4FWCoreTest_CheckExampleEventData("CheckAlgorithm") consumer_produceralg_algorithm.mcparticles = "OldAlgorithmMCParticles" +consumer_produceralg_algorithm.vectorfloat = "OldAlgorithmVectorFloat" ############################### @@ -160,5 +163,5 @@ EvtSel="NONE", EvtMax=10, ExtSvc=[iosvc if args.iosvc else podioevent], - OutputLevel=DEBUG, + OutputLevel=INFO, ) diff --git a/test/k4FWCoreTest/src/components/ExampleFunctionalConsumerMultiple.cpp b/test/k4FWCoreTest/src/components/ExampleFunctionalConsumerMultiple.cpp index d21efb94..75af64ca 100644 --- a/test/k4FWCoreTest/src/components/ExampleFunctionalConsumerMultiple.cpp +++ b/test/k4FWCoreTest/src/components/ExampleFunctionalConsumerMultiple.cpp @@ -102,12 +102,10 @@ struct ExampleFunctionalConsumerMultiple final } if ((tracks[0].getType() != 1) || (std::abs(tracks[0].getChi2() - 2.1) > 1e-6) || (tracks[0].getNdf() != 3) || - (std::abs(tracks[0].getDEdx() - 4.1) > 1e-6) || (std::abs(tracks[0].getDEdxError() - 5.1) > 1e-6) || (std::abs(tracks[0].getRadiusOfInnermostHit() - 6.1) > 1e-6)) { std::stringstream error; error << "Wrong data in tracks collection, expected 1, 2.1, 3, 4.1, 5.1, 6.1 got " << tracks[0].getType() << ", " - << tracks[0].getChi2() << ", " << tracks[0].getNdf() << ", " << tracks[0].getDEdx() << ", " - << tracks[0].getDEdxError() << ", " << tracks[0].getRadiusOfInnermostHit() << ""; + << tracks[0].getChi2() << ", " << tracks[0].getNdf() << ", " << tracks[0].getRadiusOfInnermostHit() << ""; throw std::runtime_error(error.str()); } } diff --git a/test/k4FWCoreTest/src/components/ExampleFunctionalConsumerRuntimeCollectionsMultiple.cpp b/test/k4FWCoreTest/src/components/ExampleFunctionalConsumerRuntimeCollectionsMultiple.cpp index 5b2ca067..4695bd55 100644 --- a/test/k4FWCoreTest/src/components/ExampleFunctionalConsumerRuntimeCollectionsMultiple.cpp +++ b/test/k4FWCoreTest/src/components/ExampleFunctionalConsumerRuntimeCollectionsMultiple.cpp @@ -71,12 +71,11 @@ struct ExampleFunctionalConsumerRuntimeCollectionsMultiple final } for (auto& [key, tracks] : trackMap) { if ((tracks[0].getType() != 1) || (std::abs(tracks[0].getChi2() - 2.1) > 1e-6) || (tracks[0].getNdf() != 3) || - (std::abs(tracks[0].getDEdx() - 4.1) > 1e-6) || (std::abs(tracks[0].getDEdxError() - 5.1) > 1e-6) || (std::abs(tracks[0].getRadiusOfInnermostHit() - 6.1) > 1e-6)) { std::stringstream error; error << "Wrong data in tracks collection, expected 1, 2.1, 3, 4.1, 5.1, 6.1 got " << tracks[0].getType() - << ", " << tracks[0].getChi2() << ", " << tracks[0].getNdf() << ", " << tracks[0].getDEdx() << ", " - << tracks[0].getDEdxError() << ", " << tracks[0].getRadiusOfInnermostHit() << ""; + << ", " << tracks[0].getChi2() << ", " << tracks[0].getNdf() << ", " + << tracks[0].getRadiusOfInnermostHit() << ""; throw std::runtime_error(error.str()); } } diff --git a/test/k4FWCoreTest/src/components/ExampleFunctionalProducerMultiple.cpp b/test/k4FWCoreTest/src/components/ExampleFunctionalProducerMultiple.cpp index 40ef1331..62f56421 100644 --- a/test/k4FWCoreTest/src/components/ExampleFunctionalProducerMultiple.cpp +++ b/test/k4FWCoreTest/src/components/ExampleFunctionalProducerMultiple.cpp @@ -84,8 +84,6 @@ struct ExampleFunctionalProducerMultiple final : k4FWCore::Producer { track.setType(1); track.setChi2(2.1); track.setNdf(3); - track.setDEdx(4.1); - track.setDEdxError(5.1); track.setRadiusOfInnermostHit(6.1); track.addToSubdetectorHitNumbers(1); track.addToSubdetectorHitNumbers(4); diff --git a/test/k4FWCoreTest/src/components/ExampleFunctionalTransformerRuntimeCollectionsMultiple.cpp b/test/k4FWCoreTest/src/components/ExampleFunctionalTransformerRuntimeCollectionsMultiple.cpp index 0cf79e30..3988bb5b 100644 --- a/test/k4FWCoreTest/src/components/ExampleFunctionalTransformerRuntimeCollectionsMultiple.cpp +++ b/test/k4FWCoreTest/src/components/ExampleFunctionalTransformerRuntimeCollectionsMultiple.cpp @@ -171,13 +171,11 @@ struct ExampleFunctionalTransformerRuntimeCollectionsMultiple final for (auto& [key, tracks] : trackMap) { auto coll = edm4hep::TrackCollection(); if ((tracks.at(0).getType() != 1) || (std::abs(tracks.at(0).getChi2() - 2.1) > 1e-6) || - (tracks.at(0).getNdf() != 3) || (std::abs(tracks.at(0).getDEdx() - 4.1) > 1e-6) || - (std::abs(tracks.at(0).getDEdxError() - 5.1) > 1e-6) || - (std::abs(tracks.at(0).getRadiusOfInnermostHit() - 6.1) > 1e-6)) { + (tracks.at(0).getNdf() != 3) || (std::abs(tracks.at(0).getRadiusOfInnermostHit() - 6.1) > 1e-6)) { std::stringstream error; error << "Wrong data in tracks collection, expected 1, 2.1, 3, 4.1, 5.1, 6.1 got " << tracks.at(0).getType() - << ", " << tracks.at(0).getChi2() << ", " << tracks.at(0).getNdf() << ", " << tracks.at(0).getDEdx() - << ", " << tracks.at(0).getDEdxError() << ", " << tracks.at(0).getRadiusOfInnermostHit() << ""; + << ", " << tracks.at(0).getChi2() << ", " << tracks.at(0).getNdf() << ", " + << tracks.at(0).getRadiusOfInnermostHit() << ""; throw std::runtime_error(error.str()); } coll->push_back(tracks.at(0).clone()); diff --git a/test/k4FWCoreTest/src/components/k4FWCoreTest_CheckExampleEventData.cpp b/test/k4FWCoreTest/src/components/k4FWCoreTest_CheckExampleEventData.cpp index 172d51f1..afb26804 100644 --- a/test/k4FWCoreTest/src/components/k4FWCoreTest_CheckExampleEventData.cpp +++ b/test/k4FWCoreTest/src/components/k4FWCoreTest_CheckExampleEventData.cpp @@ -21,17 +21,6 @@ // datamodel #include "edm4hep/MCParticleCollection.h" -#include "edm4hep/SimTrackerHitCollection.h" -#include "edm4hep/TrackCollection.h" -#if __has_include("edm4hep/TrackerHit3DCollection.h") -#include "edm4hep/TrackerHit3DCollection.h" -#else -#include "edm4hep/TrackerHitCollection.h" -namespace edm4hep { - using TrackerHit3DCollection = edm4hep::TrackerHitCollection; -} // namespace edm4hep -#endif -#include "edm4hep/TrackerHitPlaneCollection.h" DECLARE_COMPONENT(k4FWCoreTest_CheckExampleEventData) @@ -48,9 +37,10 @@ StatusCode k4FWCoreTest_CheckExampleEventData::initialize() { return Gaudi::Algo StatusCode k4FWCoreTest_CheckExampleEventData::execute(const EventContext&) const { auto floatVector = m_vectorFloatHandle.get(); if (floatVector->size() != 3 || (*floatVector)[2] != m_event) { - fatal() << "Contents of vectorfloat collection is not as expected: size = " << floatVector->size() - << " (expected 3), contents = " << *floatVector << " (expected [125., 25., " << m_event << "]) " << endmsg; - // return StatusCode::FAILURE; + std::stringstream error; + error << "Contents of vectorfloat collection is not as expected: size = " << floatVector->size() + << " (expected 3), contents = " << *floatVector << " (expected [125., 25., " << m_event << "]) "; + throw std::runtime_error(error.str()); } auto particles = m_mcParticleHandle.get(); diff --git a/test/k4FWCoreTest/src/components/k4FWCoreTest_CreateExampleEventData.cpp b/test/k4FWCoreTest/src/components/k4FWCoreTest_CreateExampleEventData.cpp index f52bbf75..cb5757ab 100644 --- a/test/k4FWCoreTest/src/components/k4FWCoreTest_CreateExampleEventData.cpp +++ b/test/k4FWCoreTest/src/components/k4FWCoreTest_CreateExampleEventData.cpp @@ -89,8 +89,6 @@ StatusCode k4FWCoreTest_CreateExampleEventData::execute(const EventContext&) con track.setType(1); track.setChi2(2.1); track.setNdf(3); - track.setDEdx(4.1); - track.setDEdxError(5.1); track.setRadiusOfInnermostHit(6.1); // set vectormembers #if EDM4HEP_BUILD_VERSION > EDM4HEP_VERSION(0, 9, 0)