Currently productions with low selection rates often have issues when files have a small number of events and end up selecting nothing.
It would be nicer if FunTuple could always produce it's TTrees even if they contain no events. This would allow LHCbDIRAC to treat the jobs as successful and continue to merge the output files instead of marking the job as failed for not producing output.
(This might already be the case for Run 3 DaVinci but I just had a bunch of painful Run 1 productions to deal with for this issue.)
Designs
Child items
...
Show closed items
Linked items
0
Link issues together to show that they're related or that one is blocking others.
Learn more.
I'm actually unsure myself if that's the case already with FunTuple. @amathad, can you comment on that and if it would be much work for FunTuple to comply with Chris's suggestion?
The only downside I see is that analysts might worry to find empty ntuples in files, concluding there was a bug in the writing process ...
So we want to write a root file even if an event does not contain any candidates? Is that correct?
This would allow LHCbDIRAC to treat the jobs as successful and continue to merge the output files instead of marking the job as failed for not producing output.
Is it painful to ask LHCbDIRAC to skip the jobs marked as failed and continue merging? Guess the answer is yes.
Thanks @cburr. I think we all agree this is the way to go. Let's try and get a stack with this sorted in the next round, and that will require that one Gaudi MR to be in, cc @clemenci :-).
Me either ... One thing is being necessary, the other sufficient ;-). [I did not dwell into Gaudi internals but believe experts when they tell me that one change is necessary. We will likely have some bits to change in DaVinci.]
by "greatly profit" I think you mean that this is the only way to correctly account for the luminosity. If an ntuple job does not produce an output file when no events are selected, that would mean you miss the luminosity corresponding to the input file. The end result is that the luminosity will be underestimated.
(This might already be the case for Run 3 DaVinci but I just had a bunch of painful Run 1 productions to deal with for this issue.)
It's the first time I hear about this being a problem for Run 1/2. Perhaps it's good to keep this in mind in case people observe discrepancies
I think the problem is more general and I would not couple tupling and lumi. In that sense the fact that lumi FSRs use the Sink functionality is most probably the way to go.
Why does it work for Sprucing though, @cburr we sorted this for Sprucing right? Output files are always created with the FSRs in even if no events pass
Hello @cbozzi, @bcouturi, the issue here is not that DaVinci specific but more Gaudi related, since a solution likely requires updates in Gaudi. @clemenci is away. Can you let us know who else from the Computing project can help us undo the knot? I recall there was some issue created by @cburr, I believe, that relates to this. If anyone can post the link that would help get all matters/parties involved.
Hello @clemenci, I'm assigning this to you since the issue is becoming urgent for nominal data taking in mid-ish September IMO. I suspect we may need to touch Gaudi again, not just things on the LHCb side, hence the assignment. Let's please discuss soon when you're back from holidays (welcome back, hope you had a good/proper break, BTW). Many thanks.
Hi @clemenci, we have a lumi test for this purpose: $DAVINCIEXAMPLESROOT/tests/qmtest/tupling.qms/test_davinci_tupling_from_spruce_noEventsInSelection.qmt
It would also be nice to have a reproducer for DecayTreeTuple as well in case fixing both at the same time is practical so it's also annoying for Run 1+2.
Good morning @clemenci, all. I was too late with my reply as I was replying elsewhere :D. People are "au taquet", it seems .
A simple plain Gaudi(Python) unit test would also seem like a good idea to me as we want to ensure that the FSR infrastructure works just fine even if we are not doing a standard tupling job - imagine for the sake of argument a merging job or a copy-stream type of job. Maybe I'm being maniac but better be as comprehensive as possible, once and for all.
Hello @clemenci, let me check with you since we're talking today a lot around lumi - are your investigations here going OK? Do you need anything else? We're trying to get things around lumi ready as much as possible in time for LHCb week.
Thanks for the reminder. I'm basically done with what I wanted to do this week. I start now a build of the full stack so that I can have it done on Monday.
The summary of my investigation is that the handling of ROOT files in Gaudi is a disaster.
The weird thing with NTuples is that the output ROOT file is always created, but it gets re-created when we try to write NTuple entries to it. On the second create we notify LumiFSRtoTTree, but not on the first one and that's why we only get the Lumi TTree is we actually select something.
Patching this weird behaviour might be possible, but the hack is going to be too awful.
Anyway I have an idea for a cleaner fix. For that I'd like to have a chat with @efranzos in the coming weeks, since it involves some change in the logic of both FSRSink and LumiFSRtoTTree.
Hi @clemenci, thanks so much for investigating this. What you describe is very weird and I wonder if it is actually intended to work this way, or it just 'happens' to work. Obviously the ideal scenario would be to have this cleaned up, but I understand that the moment you touch this logic you immediately affect all the rest of the LHCb software.
Anyway, please, keep me in the loop when discussing your idea for a cleaner fix. Looking forward!
I think the current implementation is the result of some poorly designed services. I do not think it's meant to work like that, but it has been made to work despite the mess.
Hello @clemenci, we talked the other day in your office about this matter. As it is important albeit not trivial, can you post an update here on the status of the solution? Are you needing any input from DPA? Advance thanks.