Current version of spill building for nersc production #59
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This code is not ready
Towards the end of the PR, I'll talk about current issues.
First, this PR builds spills from multiple TG4 events using the spill time.
overlaySinglesIntoSpillsSorted.C
takes multiple streams and combines them into a single file. The time of the hits is set according to the flux spill structure. The events are inserted into the output sequentially but as separate TG4EventsBut dune-tms is setup to use edep sim's overlay code. Its code combines all the hits into a single TG4Event so we can process it as normal. But overlaySinglesIntoSpillsSorted end up as separate events ordered in time without this PR.
In theory, this PR fixes the issue by combining events using the TMS_Event.AddEvent functionality. It's a draft because the code is messy and broken, but I'm low on time. I was trying to fix two issues.
The 1.2e9 spill offset causes issues with floats. 100 + 1e9 = 1e9 when using a float. The output branches are floats and so a lot of precision is lost. Switching to doubles causes some of the crashes below. The causes aren't clear and I'll talk about them more at the end.
One solution to the float issue was to subtract the spill offset from the hit time. First I tried to subtract the time from the hit by passing the spill time into the hit. This actually worked but was awkward because you're passing that through the hit and true hit.
The second solution was to undo the overlaySinglesIntoSpillsSorted code before creating the TMS_Event. This seemed to work but then started crashing again. That's what's currently in the code and for some reason it's crashing, see below.
The second issue is the crashes described below. I'm not sure what's causing them and I've run out of time to try to fix it. I'm not sure if this is caused by adding events or what
About the crashes:
I get all sorts of crashes. Sometimes doing a full
make clean
helps. Most of the time it's intermittent, and literally running the code multiple times leads to different crashes, and then eventually it works. Sometimes you change something in the code, and it will just crash forever for no reason. The only thing to do is to change it back.The current crash is:
But here are additional other examples: