ldmx-sw icon indicating copy to clipboard operation
ldmx-sw copied to clipboard

MagneticFieldError with propagation interpolation

Open tvami opened this issue 10 months ago • 13 comments

Describe the bug

[ ecalVeto ] 122  info:  Recoil tracking for projections; with 1 tracks, fiducial in tracker = true
  [ ecalVeto ] 122  info: Finding linreg tracks from a total of 6 hits using a radius of 35 mm
  [ ecalVeto ] 122  info:  MIP tracking completed; found 0 straight tracks and 0 lin-reg tracks
  [ ecalVeto ] 122  info:   BDT was ran, score is 0.999697
  [ hcalVeto ] 122  info: There are 0 / 0 HCal hits read out. 0 are not associated with the recoil ele. Total PE of 0
  [ hcalVeto ] 122  info: HCAL veto passed? true
  [ ElectronCounter ] 122  info: Found 1 electrons (tracks) using input collection TriggerPadTracksY_
  [ trigger ] 122  info: Got trigger energy cut 3000 for 1 electrons counted in the event.
  [ trigger ] 122  info: Got trigger energy sum 807.849; and decision is pass = true
  05:29:18    PROP           ERROR     Step failed with MagneticFieldError:1: Interpolation out of bounds was requested
  
   *** Break *** segmentation violation

To Reproduce Add tracking in the signal CI, the inverse of this commit: https://github.com/LDMX-Software/ldmx-sw/pull/1551/commits/3c61e7093d429fa16270cc4b88111c90ed489360

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 https://github.com/LDMX-Software/ldmx-sw/pull/1551#issuecomment-2629112746

tvami avatar Feb 02 '25 15:02 tvami

This comes up in bkg too, although no seg fault, here is the huge output from ACTS

[ Recoil_TrackFinder ] 5  info:     Could not extrapolate to ECAL!! Please check the track states
Surface::93.5
 -48
 -40
Smoothed:: -22.2343   38.0839 -0.597976   1.54822  -16.4095   99.7591
HasSmoothed::1
Filtered:: -22.2343   38.0839 -0.597976   1.54822  -16.4095   99.7591
21:03:59    ACTS_PROP      VERBOSE   Path aborter limit set to 658.7 (full helix = 1317.4, previous limit = 1.79769e+308)
21:03:59    ACTS_PROP      VERBOSE   Entering propagation.
21:03:59    ACTS_PROP      VERBOSE   MaterialInteractor | Found material on surface vol=3|lay=10|sen=9
21:03:59    ACTS_PROP      VERBOSE   MaterialInteractor | x0=95.7|l0=465.2|ar=28.03|z=14|molar_rho=8.27685e-05|t=0.387284 absPdg=e- mass=0.510999MeV momentum=0.0609402GeV energyloss=0.164588MeV
21:03:59    ACTS_PROP      VERBOSE   MaterialInteractor | Found material in volume vol=3
21:03:59    ACTS_PROP      VERBOSE    -> near limit, far limit, distance: -0.1, 1.79769e+308, 177.909
21:03:59    ACTS_PROP      VERBOSE   Intersection is WITHIN limit
21:03:59    ACTS_PROP      VERBOSE   SurfaceReached aborter | Target stepSize (surface) updated to ( +∞,  +∞, 177.909,  +∞)
21:03:59    ACTS_PROP      VERBOSE   PathLimit aborter | Target stepSize (path limit) updated to ( +∞,  +∞, 177.909,  +∞)
21:03:59    ACTS_PROP      VERBOSE   Starting stepping loop.
21:03:59    ACTS_PROP      VERBOSE   Step with size = 1.45232 performed
21:03:59    ACTS_PROP      VERBOSE   MaterialInteractor | Found material in volume vol=3
21:03:59    ACTS_PROP      VERBOSE    -> near limit, far limit, distance: -0.1, 1.79769e+308, 177.3
21:03:59    ACTS_PROP      VERBOSE   Intersection is WITHIN limit
21:03:59    ACTS_PROP      VERBOSE   SurfaceReached aborter | Target stepSize (surface) updated to ( +∞, 0.00345436, 177.3,  +∞)
21:03:59    ACTS_PROP      VERBOSE   PathLimit aborter | Target stepSize (path limit) updated to ( +∞, 0.00345436, 177.3,  +∞)
21:03:59    ACTS_PROP      VERBOSE   Step with size = 0.00345436 performed
21:03:59    ACTS_PROP      VERBOSE   MaterialInteractor | Found material in volume vol=3
21:03:59    ACTS_PROP      VERBOSE    -> near limit, far limit, distance: -0.1, 1.79769e+308, 177.298
21:03:59    ACTS_PROP      VERBOSE   Intersection is WITHIN limit
21:03:59    ACTS_PROP      VERBOSE   SurfaceReached aborter | Target stepSize (surface) updated to ( +∞,  +∞, 177.298,  +∞)
21:03:59    ACTS_PROP      VERBOSE   PathLimit aborter | Target stepSize (path limit) updated to ( +∞,  +∞, 177.298,  +∞)
21:03:59    ACTS_PROP      VERBOSE   Step with size = 1.61733 performed
21:03:59    ACTS_PROP      VERBOSE   MaterialInteractor | Found material in volume vol=3
21:03:59    ACTS_PROP      VERBOSE    -> near limit, far limit, distance: -0.1, 1.79769e+308, 176.623
21:03:59    ACTS_PROP      VERBOSE   Intersection is WITHIN limit
21:03:59    ACTS_PROP      VERBOSE   SurfaceReached aborter | Target stepSize (surface) updated to ( +∞, 0.00431707, 176.623,  +∞)
21:03:59    ACTS_PROP      VERBOSE   PathLimit aborter | Target stepSize (path limit) updated to ( +∞, 0.00431707, 176.623,  +∞)
21:03:59    ACTS_PROP      VERBOSE   Step with size = 0.00431707 performed
21:03:59    ACTS_PROP      VERBOSE   MaterialInteractor | Found material in volume vol=3
21:03:59    ACTS_PROP      VERBOSE    -> near limit, far limit, distance: -0.1, 1.79769e+308, 176.622
21:03:59    ACTS_PROP      VERBOSE   Intersection is WITHIN limit
21:03:59    ACTS_PROP      VERBOSE   SurfaceReached aborter | Target stepSize (surface) updated to ( +∞,  +∞, 176.622,  +∞)
21:03:59    ACTS_PROP      VERBOSE   PathLimit aborter | Target stepSize (path limit) updated to ( +∞,  +∞, 176.622,  +∞)
21:03:59    ACTS_PROP      VERBOSE   Step with size = 6.67359 performed
21:03:59    ACTS_PROP      VERBOSE   MaterialInteractor | Found material in volume vol=3
21:03:59    ACTS_PROP      VERBOSE    -> near limit, far limit, distance: -0.1, 1.79769e+308, 173.873
21:03:59    ACTS_PROP      VERBOSE   Intersection is WITHIN limit
21:03:59    ACTS_PROP      VERBOSE   SurfaceReached aborter | Target stepSize (surface) updated to (5.32558, 102.447, 173.873,  +∞)
21:03:59    ACTS_PROP      VERBOSE   PathLimit aborter | Target stepSize (path limit) updated to (5.32558, 102.447, 173.873,  +∞)
21:03:59    ACTS_PROP      VERBOSE   Step with size = 5.32558 performed
21:03:59    ACTS_PROP      VERBOSE   MaterialInteractor | Found material in volume vol=3
21:03:59    ACTS_PROP      VERBOSE    -> near limit, far limit, distance: -0.1, 1.79769e+308, 171.713
21:03:59    ACTS_PROP      VERBOSE   Intersection is WITHIN limit
21:03:59    ACTS_PROP      VERBOSE   SurfaceReached aborter | Target stepSize (surface) updated to (5.40895, 98.9663, 171.713,  +∞)
21:03:59    ACTS_PROP      VERBOSE   PathLimit aborter | Target stepSize (path limit) updated to (5.40895, 98.9663, 171.713,  +∞)
21:03:59    ACTS_PROP      VERBOSE   Step with size = 5.40895 performed
21:03:59    ACTS_PROP      VERBOSE   MaterialInteractor | Found material in volume vol=3
21:03:59    ACTS_PROP      VERBOSE    -> near limit, far limit, distance: -0.1, 1.79769e+308, 169.545
21:03:59    ACTS_PROP      VERBOSE   Intersection is WITHIN limit
21:03:59    ACTS_PROP      VERBOSE   SurfaceReached aborter | Target stepSize (surface) updated to (5.52258, 95.403, 169.545,  +∞)
21:03:59    ACTS_PROP      VERBOSE   PathLimit aborter | Target stepSize (path limit) updated to (5.52258, 95.403, 169.545,  +∞)
21:03:59    ACTS_PROP      VERBOSE   Step with size = 5.52258 performed
21:03:59    ACTS_PROP      VERBOSE   MaterialInteractor | Found material in volume vol=3
21:03:59    ACTS_PROP      VERBOSE    -> near limit, far limit, distance: -0.1, 1.79769e+308, 167.35
21:03:59    ACTS_PROP      VERBOSE   Intersection is WITHIN limit
21:03:59    ACTS_PROP      VERBOSE   SurfaceReached aborter | Target stepSize (surface) updated to (5.60194, 91.729, 167.35,  +∞)
21:03:59    ACTS_PROP      VERBOSE   PathLimit aborter | Target stepSize (path limit) updated to (5.60194, 91.729, 167.35,  +∞)
21:03:59    ACTS_PROP      VERBOSE   Step with size = 5.60194 performed
21:03:59    ACTS_PROP      VERBOSE   MaterialInteractor | Found material in volume vol=3
21:03:59    ACTS_PROP      VERBOSE    -> near limit, far limit, distance: -0.1, 1.79769e+308, 165.139
21:03:59    ACTS_PROP      VERBOSE   Intersection is WITHIN limit
21:03:59    ACTS_PROP      VERBOSE   SurfaceReached aborter | Target stepSize (surface) updated to (5.67129, 87.9595, 165.139,  +∞)
21:03:59    ACTS_PROP      VERBOSE   PathLimit aborter | Target stepSize (path limit) updated to (5.67129, 87.9595, 165.139,  +∞)
21:03:59    ACTS_PROP      VERBOSE   Step with size = 5.67129 performed
21:03:59    ACTS_PROP      VERBOSE   MaterialInteractor | Found material in volume vol=3
21:03:59    ACTS_PROP      VERBOSE    -> near limit, far limit, distance: -0.1, 1.79769e+308, 162.911
21:03:59    ACTS_PROP      VERBOSE   Intersection is WITHIN limit
21:03:59    ACTS_PROP      VERBOSE   SurfaceReached aborter | Target stepSize (surface) updated to (5.75651, 84.094, 162.911,  +∞)
21:03:59    ACTS_PROP      VERBOSE   PathLimit aborter | Target stepSize (path limit) updated to (5.75651, 84.094, 162.911,  +∞)
21:03:59    ACTS_PROP      VERBOSE   Step with size = 5.75651 performed
21:03:59    ACTS_PROP      VERBOSE   MaterialInteractor | Found material in volume vol=3
21:03:59    ACTS_PROP      VERBOSE    -> near limit, far limit, distance: -0.1, 1.79769e+308, 160.655
21:03:59    ACTS_PROP      VERBOSE   Intersection is WITHIN limit
21:03:59    ACTS_PROP      VERBOSE   SurfaceReached aborter | Target stepSize (surface) updated to (5.88692, 80.1143, 160.655,  +∞)
21:03:59    ACTS_PROP      VERBOSE   PathLimit aborter | Target stepSize (path limit) updated to (5.88692, 80.1143, 160.655,  +∞)
21:03:59    ACTS_PROP      VERBOSE   Step with size = 5.88692 performed
21:03:59    ACTS_PROP      VERBOSE   MaterialInteractor | Found material in volume vol=3
21:03:59    ACTS_PROP      VERBOSE    -> near limit, far limit, distance: -0.1, 1.79769e+308, 158.351
21:03:59    ACTS_PROP      VERBOSE   Intersection is WITHIN limit
21:03:59    ACTS_PROP      VERBOSE   SurfaceReached aborter | Target stepSize (surface) updated to (6.01982, 75.9805, 158.351,  +∞)
21:03:59    ACTS_PROP      VERBOSE   PathLimit aborter | Target stepSize (path limit) updated to (6.01982, 75.9805, 158.351,  +∞)
21:03:59    ACTS_PROP      VERBOSE   Step with size = 6.01982 performed
21:03:59    ACTS_PROP      VERBOSE   MaterialInteractor | Found material in volume vol=3
21:03:59    ACTS_PROP      VERBOSE    -> near limit, far limit, distance: -0.1, 1.79769e+308, 155.993
21:03:59    ACTS_PROP      VERBOSE   Intersection is WITHIN limit
21:03:59    ACTS_PROP      VERBOSE   SurfaceReached aborter | Target stepSize (surface) updated to (6.14321, 71.6811, 155.993,  +∞)
21:03:59    ACTS_PROP      VERBOSE   PathLimit aborter | Target stepSize (path limit) updated to (6.14321, 71.6811, 155.993,  +∞)
21:03:59    ACTS_PROP      VERBOSE   Step with size = 6.14321 performed
21:03:59    ACTS_PROP      VERBOSE   MaterialInteractor | Found material in volume vol=3
21:03:59    ACTS_PROP      VERBOSE    -> near limit, far limit, distance: -0.1, 1.79769e+308, 153.583
21:03:59    ACTS_PROP      VERBOSE   Intersection is WITHIN limit
21:03:59    ACTS_PROP      VERBOSE   SurfaceReached aborter | Target stepSize (surface) updated to (6.28467, 67.2124, 153.583,  +∞)
21:03:59    ACTS_PROP      VERBOSE   PathLimit aborter | Target stepSize (path limit) updated to (6.28467, 67.2124, 153.583,  +∞)
21:03:59    ACTS_PROP      VERBOSE   Step with size = 6.28467 performed
21:03:59    ACTS_PROP      VERBOSE   MaterialInteractor | Found material in volume vol=3
21:03:59    ACTS_PROP      VERBOSE    -> near limit, far limit, distance: -0.1, 1.79769e+308, 151.108
21:03:59    ACTS_PROP      VERBOSE   Intersection is WITHIN limit
21:03:59    ACTS_PROP      VERBOSE   SurfaceReached aborter | Target stepSize (surface) updated to (6.45843, 62.5504, 151.108,  +∞)
21:03:59    ACTS_PROP      VERBOSE   PathLimit aborter | Target stepSize (path limit) updated to (6.45843, 62.5504, 151.108,  +∞)
21:03:59    ACTS_PROP      VERBOSE   Step with size = 6.45843 performed
21:03:59    ACTS_PROP      VERBOSE   MaterialInteractor | Found material in volume vol=3
21:03:59    ACTS_PROP      VERBOSE    -> near limit, far limit, distance: -0.1, 1.79769e+308, 148.552
21:03:59    ACTS_PROP      VERBOSE   Intersection is WITHIN limit
21:03:59    ACTS_PROP      VERBOSE   SurfaceReached aborter | Target stepSize (surface) updated to (6.21577,  +∞, 148.552,  +∞)
21:03:59    ACTS_PROP      VERBOSE   PathLimit aborter | Target stepSize (path limit) updated to (6.21577,  +∞, 148.552,  +∞)
21:03:59    ACTS_PROP      VERBOSE   Step with size = 6.21577 performed
21:03:59    ACTS_PROP      VERBOSE   MaterialInteractor | Found material in volume vol=3
21:03:59    ACTS_PROP      VERBOSE    -> near limit, far limit, distance: -0.1, 1.79769e+308, 146.079
21:03:59    ACTS_PROP      VERBOSE   Intersection is WITHIN limit
21:03:59    ACTS_PROP      VERBOSE   SurfaceReached aborter | Target stepSize (surface) updated to (6.79099, 146.079, 146.079,  +∞)
21:03:59    ACTS_PROP      VERBOSE   PathLimit aborter | Target stepSize (path limit) updated to (6.79099, 146.079, 146.079,  +∞)
21:03:59    ACTS_PROP      VERBOSE   Step with size = 6.79099 performed
21:03:59    ACTS_PROP      VERBOSE   MaterialInteractor | Found material in volume vol=3
21:03:59    ACTS_PROP      VERBOSE    -> near limit, far limit, distance: -0.1, 1.79769e+308, 143.358
21:03:59    ACTS_PROP      VERBOSE   Intersection is WITHIN limit
21:03:59    ACTS_PROP      VERBOSE   SurfaceReached aborter | Target stepSize (surface) updated to (6.81635, 143.358, 143.358,  +∞)
21:03:59    ACTS_PROP      VERBOSE   PathLimit aborter | Target stepSize (path limit) updated to (6.81635, 143.358, 143.358,  +∞)
21:03:59    ACTS_PROP      VERBOSE   Step with size = 6.81635 performed
21:03:59    ACTS_PROP      VERBOSE   MaterialInteractor | Found material in volume vol=3
21:03:59    ACTS_PROP      VERBOSE    -> near limit, far limit, distance: -0.1, 1.79769e+308, 140.606
21:03:59    ACTS_PROP      VERBOSE   Intersection is WITHIN limit
21:03:59    ACTS_PROP      VERBOSE   SurfaceReached aborter | Target stepSize (surface) updated to (7.01214, 140.606, 140.606,  +∞)
21:03:59    ACTS_PROP      VERBOSE   PathLimit aborter | Target stepSize (path limit) updated to (7.01214, 140.606, 140.606,  +∞)
21:03:59    ACTS_PROP      VERBOSE   Step with size = 7.01214 performed
21:03:59    ACTS_PROP      VERBOSE   MaterialInteractor | Found material in volume vol=3
21:03:59    ACTS_PROP      VERBOSE    -> near limit, far limit, distance: -0.1, 1.79769e+308, 137.75
21:03:59    ACTS_PROP      VERBOSE   Intersection is WITHIN limit
21:03:59    ACTS_PROP      VERBOSE   SurfaceReached aborter | Target stepSize (surface) updated to (7.30065, 137.75, 137.75,  +∞)
21:03:59    ACTS_PROP      VERBOSE   PathLimit aborter | Target stepSize (path limit) updated to (7.30065, 137.75, 137.75,  +∞)
21:03:59    ACTS_PROP      VERBOSE   Step with size = 7.30065 performed
21:03:59    ACTS_PROP      VERBOSE   MaterialInteractor | Found material in volume vol=3
21:03:59    ACTS_PROP      VERBOSE    -> near limit, far limit, distance: -0.1, 1.79769e+308, 134.748
21:03:59    ACTS_PROP      VERBOSE   Intersection is WITHIN limit
21:03:59    ACTS_PROP      VERBOSE   SurfaceReached aborter | Target stepSize (surface) updated to (6.61904, 134.748, 134.748,  +∞)
21:03:59    ACTS_PROP      VERBOSE   PathLimit aborter | Target stepSize (path limit) updated to (6.61904, 134.748, 134.748,  +∞)
21:03:59    ACTS_PROP      VERBOSE   Step with size = 6.61904 performed
21:03:59    ACTS_PROP      VERBOSE   MaterialInteractor | Found material in volume vol=3
21:03:59    ACTS_PROP      VERBOSE    -> near limit, far limit, distance: -0.1, 1.79769e+308, 131.999
21:03:59    ACTS_PROP      VERBOSE   Intersection is WITHIN limit
21:03:59    ACTS_PROP      VERBOSE   SurfaceReached aborter | Target stepSize (surface) updated to (7.40769, 131.999, 131.999,  +∞)
21:03:59    ACTS_PROP      VERBOSE   PathLimit aborter | Target stepSize (path limit) updated to (7.40769, 131.999, 131.999,  +∞)
21:03:59    ACTS_PROP      VERBOSE   Step with size = 7.40769 performed
21:03:59    ACTS_PROP      VERBOSE   MaterialInteractor | Found material in volume vol=3
21:03:59    ACTS_PROP      VERBOSE    -> near limit, far limit, distance: -0.1, 1.79769e+308, 128.889
21:03:59    ACTS_PROP      VERBOSE   Intersection is WITHIN limit
21:03:59    ACTS_PROP      VERBOSE   SurfaceReached aborter | Target stepSize (surface) updated to (7.61414, 128.889, 128.889,  +∞)
21:03:59    ACTS_PROP      VERBOSE   PathLimit aborter | Target stepSize (path limit) updated to (7.61414, 128.889, 128.889,  +∞)
21:03:59    ACTS_PROP      VERBOSE   Step with size = 7.61414 performed
21:03:59    ACTS_PROP      VERBOSE   MaterialInteractor | Found material in volume vol=3
21:03:59    ACTS_PROP      VERBOSE    -> near limit, far limit, distance: -0.1, 1.79769e+308, 125.656
21:03:59    ACTS_PROP      VERBOSE   Intersection is WITHIN limit
21:03:59    ACTS_PROP      VERBOSE   SurfaceReached aborter | Target stepSize (surface) updated to (7.91679, 125.656, 125.656,  +∞)
21:03:59    ACTS_PROP      VERBOSE   PathLimit aborter | Target stepSize (path limit) updated to (7.91679, 125.656, 125.656,  +∞)
21:03:59    ACTS_PROP      VERBOSE   Step with size = 7.91679 performed
21:03:59    ACTS_PROP      VERBOSE   MaterialInteractor | Found material in volume vol=3
21:03:59    ACTS_PROP      VERBOSE    -> near limit, far limit, distance: -0.1, 1.79769e+308, 122.251
21:03:59    ACTS_PROP      VERBOSE   Intersection is WITHIN limit
21:03:59    ACTS_PROP      VERBOSE   SurfaceReached aborter | Target stepSize (surface) updated to (7.20607, 122.251, 122.251,  +∞)
21:03:59    ACTS_PROP      VERBOSE   PathLimit aborter | Target stepSize (path limit) updated to (7.20607, 122.251, 122.251,  +∞)
21:03:59    ACTS_PROP      VERBOSE   Step with size = 7.20607 performed
21:03:59    ACTS_PROP      VERBOSE   MaterialInteractor | Found material in volume vol=3
21:03:59    ACTS_PROP      VERBOSE    -> near limit, far limit, distance: -0.1, 1.79769e+308, 119.111
21:03:59    ACTS_PROP      VERBOSE   Intersection is WITHIN limit
21:03:59    ACTS_PROP      VERBOSE   SurfaceReached aborter | Target stepSize (surface) updated to (7.95908, 119.111, 119.111,  +∞)
21:03:59    ACTS_PROP      VERBOSE   PathLimit aborter | Target stepSize (path limit) updated to (7.95908, 119.111, 119.111,  +∞)
21:03:59    ACTS_PROP      VERBOSE   Step with size = 7.95908 performed
21:03:59    ACTS_PROP      VERBOSE   MaterialInteractor | Found material in volume vol=3
21:03:59    ACTS_PROP      VERBOSE    -> near limit, far limit, distance: -0.1, 1.79769e+308, 115.597
21:03:59    ACTS_PROP      VERBOSE   Intersection is WITHIN limit
21:03:59    ACTS_PROP      VERBOSE   SurfaceReached aborter | Target stepSize (surface) updated to (8.25127, 115.597, 115.597,  +∞)
21:03:59    ACTS_PROP      VERBOSE   PathLimit aborter | Target stepSize (path limit) updated to (8.25127, 115.597, 115.597,  +∞)
21:03:59    ACTS_PROP      VERBOSE   Step with size = 8.25127 performed
21:03:59    ACTS_PROP      VERBOSE   MaterialInteractor | Found material in volume vol=3
21:03:59    ACTS_PROP      VERBOSE    -> near limit, far limit, distance: -0.1, 1.79769e+308, 111.898
21:03:59    ACTS_PROP      VERBOSE   Intersection is WITHIN limit
21:03:59    ACTS_PROP      VERBOSE   SurfaceReached aborter | Target stepSize (surface) updated to (8.38407, 111.898, 111.898,  +∞)
21:03:59    ACTS_PROP      VERBOSE   PathLimit aborter | Target stepSize (path limit) updated to (8.38407, 111.898, 111.898,  +∞)
21:03:59    ACTS_PROP      VERBOSE   Step with size = 8.38407 performed
21:03:59    ACTS_PROP      VERBOSE   MaterialInteractor | Found material in volume vol=3
21:03:59    ACTS_PROP      VERBOSE    -> near limit, far limit, distance: -0.1, 1.79769e+308, 108.077
21:03:59    ACTS_PROP      VERBOSE   Intersection is WITHIN limit
21:03:59    ACTS_PROP      VERBOSE   SurfaceReached aborter | Target stepSize (surface) updated to (7.36596, 108.077, 108.077,  +∞)
21:03:59    ACTS_PROP      VERBOSE   PathLimit aborter | Target stepSize (path limit) updated to (7.36596, 108.077, 108.077,  +∞)
21:03:59    ACTS_PROP      VERBOSE   Step with size = 7.36596 performed
21:03:59    ACTS_PROP      VERBOSE   MaterialInteractor | Found material in volume vol=3
21:03:59    ACTS_PROP      VERBOSE    -> near limit, far limit, distance: -0.1, 1.79769e+308, 104.666
21:03:59    ACTS_PROP      VERBOSE   Intersection is WITHIN limit
21:03:59    ACTS_PROP      VERBOSE   SurfaceReached aborter | Target stepSize (surface) updated to (9.09676, 104.666, 104.666,  +∞)
21:03:59    ACTS_PROP      VERBOSE   PathLimit aborter | Target stepSize (path limit) updated to (9.09676, 104.666, 104.666,  +∞)
21:03:59    ACTS_PROP      VERBOSE   Step with size = 9.09676 performed
21:03:59    ACTS_PROP      VERBOSE   MaterialInteractor | Found material in volume vol=3
21:03:59    ACTS_PROP      VERBOSE    -> near limit, far limit, distance: -0.1, 1.79769e+308, 100.381
21:03:59    ACTS_PROP      VERBOSE   Intersection is WITHIN limit
21:03:59    ACTS_PROP      VERBOSE   SurfaceReached aborter | Target stepSize (surface) updated to (7.96255, 100.381, 100.381,  +∞)
21:03:59    ACTS_PROP      VERBOSE   PathLimit aborter | Target stepSize (path limit) updated to (7.96255, 100.381, 100.381,  +∞)
21:03:59    ACTS_PROP      VERBOSE   Step with size = 7.96255 performed
21:03:59    ACTS_PROP      VERBOSE   MaterialInteractor | Found material in volume vol=3
21:03:59    ACTS_PROP      VERBOSE    -> near limit, far limit, distance: -0.1, 1.79769e+308, 96.5598
21:03:59    ACTS_PROP      VERBOSE   Intersection is WITHIN limit
21:03:59    ACTS_PROP      VERBOSE   SurfaceReached aborter | Target stepSize (surface) updated to (9.28068, 96.5598, 96.5598,  +∞)
21:03:59    ACTS_PROP      VERBOSE   PathLimit aborter | Target stepSize (path limit) updated to (9.28068, 96.5598, 96.5598,  +∞)
21:03:59    ACTS_PROP      VERBOSE   Step with size = 9.28068 performed
21:03:59    ACTS_PROP      VERBOSE   MaterialInteractor | Found material in volume vol=3
21:03:59    ACTS_PROP      VERBOSE    -> near limit, far limit, distance: -0.1, 1.79769e+308, 92.0164
21:03:59    ACTS_PROP      VERBOSE   Intersection is WITHIN limit
21:03:59    ACTS_PROP      VERBOSE   SurfaceReached aborter | Target stepSize (surface) updated to (8.60837, 92.0164, 92.0164,  +∞)
21:03:59    ACTS_PROP      VERBOSE   PathLimit aborter | Target stepSize (path limit) updated to (8.60837, 92.0164, 92.0164,  +∞)
21:03:59    ACTS_PROP      VERBOSE   Step with size = 8.60837 performed
21:03:59    ACTS_PROP      VERBOSE   MaterialInteractor | Found material in volume vol=3
21:03:59    ACTS_PROP      VERBOSE    -> near limit, far limit, distance: -0.1, 1.79769e+308, 87.7021
21:03:59    ACTS_PROP      VERBOSE   Intersection is WITHIN limit
21:03:59    ACTS_PROP      VERBOSE   SurfaceReached aborter | Target stepSize (surface) updated to (9.67494, 87.7021, 87.7021,  +∞)
21:03:59    ACTS_PROP      VERBOSE   PathLimit aborter | Target stepSize (path limit) updated to (9.67494, 87.7021, 87.7021,  +∞)
21:03:59    ACTS_PROP      VERBOSE   Step with size = 9.67494 performed
21:03:59    ACTS_PROP      VERBOSE   MaterialInteractor | Found material in volume vol=3
21:03:59    ACTS_PROP      VERBOSE    -> near limit, far limit, distance: -0.1, 1.79769e+308, 82.724
21:03:59    ACTS_PROP      VERBOSE   Intersection is WITHIN limit
21:03:59    ACTS_PROP      VERBOSE   SurfaceReached aborter | Target stepSize (surface) updated to (9.73229, 82.724, 82.724,  +∞)
21:03:59    ACTS_PROP      VERBOSE   PathLimit aborter | Target stepSize (path limit) updated to (9.73229, 82.724, 82.724,  +∞)
21:03:59    ACTS_PROP      VERBOSE   Step with size = 9.73229 performed
21:03:59    ACTS_PROP      VERBOSE   MaterialInteractor | Found material in volume vol=3
21:03:59    ACTS_PROP      VERBOSE    -> near limit, far limit, distance: -0.1, 1.79769e+308, 77.5608
21:03:59    ACTS_PROP      VERBOSE   Intersection is WITHIN limit
21:03:59    ACTS_PROP      VERBOSE   SurfaceReached aborter | Target stepSize (surface) updated to (8.6471, 77.5608, 77.5608,  +∞)
21:03:59    ACTS_PROP      VERBOSE   PathLimit aborter | Target stepSize (path limit) updated to (8.6471, 77.5608, 77.5608,  +∞)
21:03:59    ACTS_PROP      VERBOSE   Step with size = 8.6471 performed
21:03:59    ACTS_PROP      VERBOSE   MaterialInteractor | Found material in volume vol=3
21:03:59    ACTS_PROP      VERBOSE    -> near limit, far limit, distance: -0.1, 1.79769e+308, 72.8232
21:03:59    ACTS_PROP      VERBOSE   Intersection is WITHIN limit
21:03:59    ACTS_PROP      VERBOSE   SurfaceReached aborter | Target stepSize (surface) updated to (7.85534, 72.8232, 72.8232,  +∞)
21:03:59    ACTS_PROP      VERBOSE   PathLimit aborter | Target stepSize (path limit) updated to (7.85534, 72.8232, 72.8232,  +∞)
21:03:59    ACTS_PROP      VERBOSE   Step with size = 7.85534 performed
21:03:59    ACTS_PROP      VERBOSE   MaterialInteractor | Found material in volume vol=3
21:03:59    ACTS_PROP      VERBOSE    -> near limit, far limit, distance: -0.1, 1.79769e+308, 68.3899
21:03:59    ACTS_PROP      VERBOSE   Intersection is WITHIN limit
21:03:59    ACTS_PROP      VERBOSE   SurfaceReached aborter | Target stepSize (surface) updated to (8.68067, 68.3899, 68.3899,  +∞)
21:03:59    ACTS_PROP      VERBOSE   PathLimit aborter | Target stepSize (path limit) updated to (8.68067, 68.3899, 68.3899,  +∞)
21:03:59    ACTS_PROP      VERBOSE   Step with size = 8.68067 performed
21:03:59    ACTS_PROP      VERBOSE   MaterialInteractor | Found material in volume vol=3
21:03:59    ACTS_PROP      VERBOSE    -> near limit, far limit, distance: -0.1, 1.79769e+308, 63.3298
21:03:59    ACTS_PROP      VERBOSE   Intersection is WITHIN limit
21:03:59    ACTS_PROP      VERBOSE   SurfaceReached aborter | Target stepSize (surface) updated to (9.40036, 63.3298, 63.3298,  +∞)
21:03:59    ACTS_PROP      VERBOSE   PathLimit aborter | Target stepSize (path limit) updated to (9.40036, 63.3298, 63.3298,  +∞)
21:03:59    ACTS_PROP      VERBOSE   Step with size = 9.40036 performed
21:03:59    ACTS_PROP      VERBOSE   MaterialInteractor | Found material in volume vol=3
21:03:59    ACTS_PROP      VERBOSE    -> near limit, far limit, distance: -0.1, 1.79769e+308, 57.6369
21:03:59    ACTS_PROP      VERBOSE   Intersection is WITHIN limit
21:03:59    ACTS_PROP      VERBOSE   SurfaceReached aborter | Target stepSize (surface) updated to (9.34768, 57.6369, 57.6369,  +∞)
21:03:59    ACTS_PROP      VERBOSE   PathLimit aborter | Target stepSize (path limit) updated to (9.34768, 57.6369, 57.6369,  +∞)
21:03:59    ACTS_PROP      ERROR     Step failed with MagneticFieldError:1: Interpolation out of bounds was requested
Propagation failed

tvami avatar Feb 05 '25 05:02 tvami

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).

-250.0 -55.0 1490.0 2.029E-07 -4.495E-06 -8.496E-07 
-250.0 -55.0 1495.0 1.980E-07 -4.427E-06 -8.140E-07 
-250.0 -55.0 1500.0 1.931E-07 -4.359E-06 -7.783E-07 
-250.0 -50.0 -1500.0 1.758E-07 -4.369E-06 7.085E-07 
-250.0 -50.0 -1495.0 1.803E-07 -4.438E-06 7.410E-07 
-250.0 -50.0 -1490.0 1.847E-07 -4.507E-06 7.735E-07 

@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?

tvami avatar Feb 05 '25 05:02 tvami

The reason we haven't run into this before is because the simulation just sets the Bfield outside of the interpolatable region to zero

https://github.com/LDMX-Software/ldmx-sw/blob/ea2a21c94057cf6eba09ce2b75f555976f6097df/SimCore/src/SimCore/MagneticFieldMap3D.cxx#L253-L257

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 G4MagneticField), then I think we could make it work well.

tomeichlersmith avatar Feb 05 '25 13:02 tomeichlersmith

Here is where CKFProcessor gets the field and gives it to ACTS (via the Stepper).

https://github.com/LDMX-Software/ldmx-sw/blob/ea2a21c94057cf6eba09ce2b75f555976f6097df/Tracking/src/Tracking/Reco/CKFProcessor.cxx#L118

...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).

bloodyyugo avatar Feb 05 '25 14:02 bloodyyugo

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 InterpolatedMagneticField3 or is it something we could override ourselves?

tomeichlersmith avatar Feb 05 '25 14:02 tomeichlersmith

The InterpolatedMagneticField3 is defined here:
https://github.com/LDMX-Software/ldmx-sw/blob/ea2a21c94057cf6eba09ce2b75f555976f6097df/Tracking/include/Tracking/Sim/BFieldXYZUtils.h#L18

using InterpolatedMagneticField3 = Acts::InterpolatedBFieldMap< Acts::Grid<Acts::Vector3, Acts::Axis<Acts::AxisType::Equidistant>, Acts::Axis<Acts::AxisType::Equidistant>, Acts::Axis<Acts::AxisType::Equidistant>>>;

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.

bloodyyugo avatar Feb 05 '25 14:02 bloodyyugo

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. @tomeichlersmith do you have the code that produced this txt file? Or this is something we just took from HPS as is?

tvami avatar Feb 05 '25 15:02 tvami

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.

tomeichlersmith avatar Feb 05 '25 15:02 tomeichlersmith

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) A few things tho that I see and dont understand. Well let's start with what I do:

Image

Image

Image

Blue is original, red is my addition, makes sense for both.

Image

Image

Image

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:

Image

Image

Image

@bloodyyugo @tomeichlersmith thoughts?

tvami avatar Feb 21 '25 05:02 tvami

I have never looked at the field so I'm not sure if these kinds of discontinuities make sense.

tomeichlersmith avatar Feb 21 '25 14:02 tomeichlersmith

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

tvami avatar Feb 21 '25 15:02 tvami

The 3D maps: Image Image Image Image

tvami avatar Feb 22 '25 00:02 tvami

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?

tomeichlersmith avatar Feb 24 '25 14:02 tomeichlersmith