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

how to retrieve the cell ID encoding from the metadata in the output ROOT file #537

Open
atolosadelgado opened this issue Jan 11, 2024 · 2 comments

Comments

@atolosadelgado
Copy link

atolosadelgado commented Jan 11, 2024

Hi,

The following piece of code shows how to retrieve the cell ID encoding (as string) from the metadata in the output ROOT file

import podio
podio.root_io.Reader("test.root")
metadata = reader.get("metadata")[0]

cellid_encoding = metadata.get_parameter("ArcCollection__CellIDEncoding")

I think this is missing in the examples/documentation, but Thomas answered promptly. I think it is worth to include it :)

Best,
Alvaro

@jmcarcell
Copy link
Member

You can make a PR to the key4hep documentation where you consider it would be useful 😃 ; for the podio documentation you can at most add how to get parameters if it's not already there but the cell encoding being in the metadata category (and the metadata category existing) are conventions from elsewhere.

@tmadlener
Copy link
Collaborator

I think this specific bit should / could go to https://github.com/key4hep/key4hep-tutorials/blob/main/edm4hep_analysis/edm4hep_api_intro.md although it does not fit completely there(?)

In general we might want to think about a slightly nicer interface that doesn't depend on too much inside knowledge, e.g. we have the https://github.com/AIDASoft/podio/blob/master/include/podio/FrameCategories.h#L23C20-L23C41 function to stitch together the collection name and the parameter name, and I think also having the [0] index could be improved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants