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

Does the IOSvc support pasing std::vector<T> via the TES? #238

Open
tmadlener opened this issue Sep 19, 2024 · 7 comments
Open

Does the IOSvc support pasing std::vector<T> via the TES? #238

tmadlener opened this issue Sep 19, 2024 · 7 comments
Labels
question Further information is requested

Comments

@tmadlener
Copy link
Contributor

I just stumbled over this question while looking at some tracking code. EDM4hep has the TrackerHit interface, which means that there is no TrackerHitCollection. Hence, if I want to move a heterogenous collection of TrackerHitPlane and TrackerHit3D around between algorithms, I have to do it via std::vector<TrackerHitPlane>. Is this possible at the moment?

@tmadlener tmadlener added the question Further information is requested label Sep 19, 2024
@m-fila
Copy link
Contributor

m-fila commented Sep 20, 2024

Not with k4FWCore:: functional algorithms as they require collections or std::vectors of collections

Gaudi::Functional algorithms with std::vector<TrackerHit> give compilation error from a template about AnyDataWrapper<std::vector<TrackerHit>>. Non-interface types give no error

@tmadlener
Copy link
Contributor Author

Interesting. What does the compiler complain about in that case? I would have (naively) expected that interface types and non-interface types behave the same in this regard.

@m-fila
Copy link
Contributor

m-fila commented Sep 20, 2024

The interface types have templated constructor and for some reason it's AnyDataWrapper wants to construct TrackerHit with vector<TrackerHit> rather than use move constructor (I guess) for the vector

@tmadlener
Copy link
Contributor Author

Ah. I didn't foresee that. This constructor here would probably have to use some std::enable_if instead of a (late) static_assert

https://github.com/AIDASoft/podio/blob/64e87e153e8217375a167123d3567a765935333a/python/templates/Interface.h.jinja2#L92-L96

That should take care of matching a wrong constructor. We might have to add a default constructor as well.

@m-fila
Copy link
Contributor

m-fila commented Sep 20, 2024

Yes, see linked PR 😁 AIDASoft/podio#683

@giovannimarchiori
Copy link
Contributor

I don't know if my problem is related to this issue, the title made me think so but the topic being discussed is different.
I cannot pass to k4run the input files to process via --IOSvc.input blah.root. On the other hand IOSvc.output foo.root works like a charm. The difference between the two is that output is a string property while input is a vector property, so the problem seems to be in IOSvc parsing of vector<..>. Is there a special syntax to be used in the CLI that I am unaware of or is it a parsing problem in IOSvc?

@m-fila
Copy link
Contributor

m-fila commented Sep 26, 2024

This is valid but different issue. Opened #241

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants