-
Notifications
You must be signed in to change notification settings - Fork 60
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
ROOTFrameWriter can produce unreadable files without warning #382
Comments
@tmadlener - after moving to hashes - how relevant is this now? so should it be a strict requirement of PODIO or just a policy of us in Key4hep? |
It is in principle a strict requirement of the ROOTFrameWriter. Things might work if collections are missing in events after the first, but new collections in all but the first event will still crash the whole thing. The hashes avoid creating unreadable files, but the contents will still be potentially unexpected. |
That means it is limited by implementation (setup of the branches etc), not a design decision. Just for future reference in case we want to change the policy |
Well technically it is an implementation that is forced onto podio by a design decision of ROOT. I don't think we can ever change policy here. It might work as expected with The simplest (and most likely sufficient) check for now would be to see whether the collections that should be written are the same as the ones that are available from the collection id table that was used for the first write. |
Yap. I was thinking of something like that. Looking at the map. Will put it on my todo list |
It seems the case of writing out something that hasn't been defined in the first event will not lead to a crash any more. Since the writing is based on the |
What happens in case there is a collection missing in the frame in the second event, i.e. something where we switch the two Frames in the example given in this issue? Does that crash, or will we simply write an empty collection? |
See above. Will integrate a test. |
The documentation states that the contents of the first Frame of a category determine the contents of all Frames of a given category:
podio/include/podio/ROOTFrameWriter.h
Lines 31 to 37 in 8488574
However, there is no currently no warning in case this happens, and the writer will simply ignore additional collections. This also has the potential to break the reader side, especially if the missing collections are not simply the last ones to be added to the frame, e.g.
produces a file for which
will run into a segmentation fault, because the collection ID for that is necessary for resolving the relations of the
ExampleMC
s has changed between the frames.The cause for the segmentation fault is actually a different issue (#381). Nevertheless, there should probably at least be a warning if different contents are present in Frames that should be written with the
ROOTFrameWriter
.The text was updated successfully, but these errors were encountered: