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 inputReader for easy reading of edm4hep or lcio files #179

Merged
merged 2 commits into from
Mar 21, 2024

Conversation

Zehvogel
Copy link
Contributor

BEGINRELEASENOTES

  • Add inputReader for easy reading of edm4hep or lcio files

ENDRELEASENOTES

see discussion in #178

@tmadlener
Copy link
Contributor

Since we are on the topic of making this "easy to use". Is there an easy way to also deal with the conditional attaching of a converter? From a quick look at the code we would need the algList and attach it to the first MarlinWrapper algorithm? That could also check that the first / only algorithm before that is the PodioInput (or do nothing in case it's an LcioEvent?

Maybe there is something more clever, but I would be happy with a two step/function approach for the moment.

@Zehvogel
Copy link
Contributor Author

I will add conversion in the other direction in another pr later

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.

Apart from a bit of missing documentation I am very happy with this. Thanks :)

return read


def attach_edm4hep2lcio_conversion(algList, read):
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add a brief description as a docstring that contains the fact that this is pretty much what you want to do if you have used create_reader unconditionally?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done :)


# find first wrapper
for alg in algList:
if (isinstance(alg, MarlinProcessorWrapper)):
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if (isinstance(alg, MarlinProcessorWrapper)):
if isinstance(alg, MarlinProcessorWrapper):

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thx

@tmadlener tmadlener merged commit c52547d into key4hep:main Mar 21, 2024
6 of 10 checks passed
@Zehvogel Zehvogel deleted the input-reader branch March 22, 2024 07:18
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.

3 participants