Open
Conversation
Some events have parameter throws that make the xsec_total < 0. Add error handling to account for events where re-weighting failed. An example of what sometimes happens: Executing tool LoadWCSim with MC entry 20, trigger 0 Analyse: GReWeightXSecMEC.cxx:500: double genie::rew::GReWeightXSecMEC::CalcWeightPNDelta(const genie::EventRecord&): Assertion `xsec_tot > 0.' failed. Aborted (core dumped) This causes the toolchain to crash at entry N, leading to a large loss in statistics. To remedy this we can use a recovery point where the weight will automatically be assigned as 1.0 if such a problematic value is sampled in multisim.
jminock
approved these changes
Jan 16, 2026
Collaborator
jminock
left a comment
There was a problem hiding this comment.
Looks good! Thank you for this!!
Collaborator
|
Interesting! I've never used such old-school techniques myself but it seems like it should be fine. I've asked @brichards64 if he can see any problems, but otherwise I'd be happy to merge. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
When running
LoadReweightGenieEvent, it was noticed that some events have parameter throws that make the calculated cross section negative (xsec_total < 0). I'm not sure what the specific cause is, but in the meantime I have added some error handling to account for events where re-weighting failed. We can use a recovery point where the given weight will automatically be assigned as 1.0 if such a problematic value is sampled in multisim/unisim.Without any error handling, this error causes the toolchain to crash at entry N, leading to a large loss in statistics. Say you're running over 1000 events, you therefore lose out on 1000 - N. This particular issue is observed more in World events (at the ~1% level) than in tank samples.
Here's an example of the particular error (
/pnfs/annie/persistent/simulations/genie3/G1810a0211a/standardv1.0/world/gntp.85.ghep.root):The abort message seems to exclusively happen in
GReWeightXSecMEC. The default knobs set that I believe affect this are:I have tested the error handling and its stable over many (~1000) files. It just assigns a weight = 1.0 if it encounters said problem. I also haven't noticed any glaring oddities in the resulting weight distributions. More work is obviously needed to understand what could be going wrong.
Describe your changes
Checklist before submitting your PR
newusage, there is a reason the data must be on the heapnewthere is adelete, unless I explicitly know why (e.g. ROOT or a BoostStore takes ownership)Additional Material
In discussions with Andy, he says he does not recall observing this in any MicroBooNE analysis. The worry is that we may a mismatch in the version, model configuration, or phase space type when events are generated vs. reweighted, or else the interaction is amiss somehow. Given it happens more in World events, maybe it suggests a target dependence (C, H, O, Si, etc...). James and I don't have a ton of time to track down the source of the bug, so this is the best solution in the short term.