-
Notifications
You must be signed in to change notification settings - Fork 22
MagneticFieldError with propagation interpolation #1562
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
Comments
This comes up in bkg too, although no seg fault, here is the huge output from ACTS
|
Looking at the magnetic field map, it does seem to end at 1500 mm in Z so that should cover both the ECAL and the side-HCAL. But then it seems in Y we only go from -70 mm to 70 mm, which I dont understand since I'd assume that we want to cover the ECAL XY face (having X at 250 makes sense, I'd would have thought Y goes up to the same number).
@tomeichlersmith is there a way to easily add zeros everywhere else? At one point I remember discussions about having this in the Conditions, would that help this? |
The reason we haven't run into this before is because the simulation just sets the Bfield outside of the interpolatable region to zero ldmx-sw/SimCore/src/SimCore/MagneticFieldMap3D.cxx Lines 253 to 257 in ea2a21c
We could potentially put this kind of object in the conditions and then both the simulation and tracking would access it; however, I am unsure on how tracking accesses the magnetic field. If we can provide a simple specialization (like how we have a concrete derived class of |
Here is where CKFProcessor gets the field and gives it to ACTS (via the Stepper).
...loads it in from the text file. I'm a bit surprised the stepper doesn't try to do any extrapolation outside of the given limits. Let me look if there are any options for that (or maybe just assume 0 field instead of just crapping out). |
ah yes, I'm remembering working with PF now. It needs to be rotated into tracking coordinates so it can't be the exact same function as the sim. Do we control |
The InterpolatedMagneticField3 is defined here:
So, we sort of control it, but not the base "InterpolatedBFieldMap". One thing we might be able to do is to add a bin with 0 field at large +/- y (we'd have to use the variable bin size axis for this, but that's supported). Or, of course we can just make the map bigger and add lots of 0-field entries (or whatever, do our own exterpolation). Dumb, but easy. |
This might be the quick-and-dirty solution for short term, and we can think about something better for the long term. |
This was something that we took from HPS and then "expanded" to fit the space of the LDMX dipole. I inherited from my predecessors long ago and so the code doing this expansion has been lost to time. |
So I made new map where I add a lot of zeros... but the file gets huge, and I even notice the load time in runtime when I use it. I plotted the values for each dimension, and each B field dimension (so 9 plots in total) Blue is original, red is my addition, makes sense for both. Bz vs X (also By vs X) transition could be better, but at least it's going towards zero at 240. The Bx vs X tho didnt change sign yet in the original map, so this doesnt look great... And now it will not become better: @bloodyyugo @tomeichlersmith thoughts? |
I have never looked at the field so I'm not sure if these kinds of discontinuities make sense. |
I have an idea to only add the zero to a far point, and then let ACTS do the interpolation, but if it's a lin interpolation, it will lead to the same thing -- but it will decrease the file size / read in time. I'll let you know how that works. But in the meantime let's concentrate on what we have now, i.e. blue, and what's happening in Bx vs X, Bx vs Y and Bz vs Y . Maybe I'll ask Tim |
Okay, that makes sense to me, the Bx and Bz are mainly inside the big hunks of metal and then they drop off once outside? |
Describe the bug
To Reproduce
Add tracking in the signal CI, the inverse of this commit: 3c61e70
Desired behavior
Not have a seg fault...
Environment:
This happened in the github CI env, with ldmx-sw 4.2.8
Additional context
Came up here
#1551 (comment)
The text was updated successfully, but these errors were encountered: