Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for running together with functional algorithms #188

Merged
merged 8 commits into from
Jul 9, 2024

Conversation

jmcarcell
Copy link
Contributor

@jmcarcell jmcarcell commented Jun 24, 2024

These are the minimal changes needed to make the wrapper work with functional algorithms using PodioInput and PodioOutput. Working with the new IOSvc will take a bit more work since more changes are needed.

BEGINRELEASENOTES

  • Add support for running together with functional algorithms
  • Add a test that creates MCParticles in EDM4hep with a functional algorithm that are later used by Marlin processors

ENDRELEASENOTES

@andresailer andresailer self-requested a review June 25, 2024 07:41
Comment on lines 292 to 305
DataObject* p;
auto sc = m_podioDataSvc->retrieveObject(e4h_coll_name, p);
auto ptr = dynamic_cast<AnyDataWrapper<std::shared_ptr<podio::CollectionBase>>*>(p);
if (sc.isFailure() || !ptr) {
error() << "No collection with name: " << e4h_coll_name << " available for conversion" << endmsg;
} else {
collPtr = dynamic_cast<podio::CollectionBase*>(ptr->getData().get());
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this path not possible for cases where it is in a Frame? I.e. could we just have one path through this, and drop the usage of the evtFrame?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this question mixes two things: the collection is either in the Frame if it has been produced with the non-functional algorithms or it is not if it has been produced by functional algorithms; then we can not use the event frame by asking the data service for the collections instead (but this could have been done earlier and doesn't have much to do with the current changes) as it is right now.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was more aiming at the question, whether we can reach collections that have been produced by non-functional algorithms via the data svc, instead of going to the event Frame?

@tmadlener
Copy link
Contributor

Looking at the test that you are hooking on here, I think we could even remove the current PseudoRecoProcessor and instead replace it with this algorithm and update the corresponding README. That would mean that we don't have effectively duplicated tests with slightly different implementations (and less code to maintain in the long run).

@jmcarcell
Copy link
Contributor Author

PseudoRecoProcessor removed.

@jmcarcell
Copy link
Contributor Author

Any more comments or can we merge this?

Copy link
Contributor

@tmadlener tmadlener left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Looks good to me.

Comment on lines +286 to +295
podio::CollectionBase* collPtr = nullptr;
DataObject* p;
auto sc = m_podioDataSvc->retrieveObject(e4h_coll_name, p);
if (sc.isFailure()) {
throw GaudiException("Collection not found", name(), StatusCode::FAILURE);
}
auto ptr = dynamic_cast<DataWrapperBase*>(p);
if (ptr) {
collPtr = ptr->collectionBase();
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Slightly more verbose than before, but at least we got the detail of using a Frame out of here.

@jmcarcell jmcarcell merged commit af28b7d into main Jul 9, 2024
8 of 11 checks passed
@jmcarcell jmcarcell deleted the functional branch July 9, 2024 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants