Skip to content

Feature/ddceler covfie fieldmap#2298

Draft
rahmans1 wants to merge 9 commits intoceleritas-project:developfrom
rahmans1:feature/ddceler-covfie-fieldmap
Draft

Feature/ddceler covfie fieldmap#2298
rahmans1 wants to merge 9 commits intoceleritas-project:developfrom
rahmans1:feature/ddceler-covfie-fieldmap

Conversation

@rahmans1
Copy link
Contributor

@rahmans1 rahmans1 commented Mar 4, 2026


Add covfie field map loaders (3D Cartesian and 2D BrBz) for ddceler

Description

Summary

  • Add helper classes for loading covfie field maps with ddceler (f8689c0)
  • Add covfie field map support to ddceler CelerPhysics plugin (d5cb97c)
  • Fix 3D Cartesian covfie loader to match converter output format (aafeada)
  • Add LoadCovfieFieldBrBz for 2D cylindrical covfie field maps (0692491)
  • Add FieldMapCoordType property to select BrBz or BxByBz field loader (35eea59)
  • Include placeholder values for field map parameters in steering file (ec9f96b)

Labels

  • Change type: enhancement
  • Category: external

Sakib Rahman and others added 6 commits March 4, 2026 13:39
Extend CelerPhysics with a FieldMapFile property that, when set, loads a
binary covfie field map (affine→nearest_neighbour→strided→array pipeline,
cm/T units) via LoadCovfieField and configures a CartMapFieldAlongStepFactory
instead of the uniform-field path. Guarded by CELERITAS_USE_covfie; the
uniform ConstantField path is preserved as the default when FieldMapFile is
empty.

- CelerPhysics: add FieldMapFile property, covfie branch in make_options()
- CMakeLists: conditionally compile LoadCovfieField.covfie.cc and link covfie
- steeringFile.py: document the new FieldMapFile property

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
…ge the deserialization pipeline from nearest_neighbour to linear interpolation to match the actual format written by the covfie convert_bfield tool. Also read grid node values directly from the strided backend instead of querying through the linear interpolator, which would access out-of-bounds neighbors at grid boundaries.
…lize covfie files with the affine → linear → strided(size2) → array(float2) pipeline, and convert to RZMapFieldInput for use with Celeritas RZMapFieldAlongStepFactory. Grid node values are read directly from the strided backend to avoid out-of-bounds access from the linear interpolation layer at boundaries.
… When FieldMapCoordType is BrBz, use LoadCovfieFieldBrBz with RZMapFieldAlongStepFactory. When BxByBz (default), use the existing LoadCovfieField with CartMapFieldAlongStepFactory. The BrBz path also dumps the loaded RZMapFieldInput to rzmap-field-dump.json for diagnostic verification.
@rahmans1
Copy link
Contributor Author

rahmans1 commented Mar 4, 2026

Tried to load ePIC field maps with simple example eic/epic#934. https://github.com/eic/epic-data/blob/5a853e4e19f2072db725f1c96a97b2f7198c6a4b/MARCO_v.7.6.2.2.11_1.7T_Magnetic_Field_Map_2024_05_02_rad_coords_cm_T.BMap.covfie

Geant4UI         INFO  +++ Geant4RunManager> Install Geant4 control directory:/ddg4/Geant4RunManager/
Geant4RunManager WARN  +++ Configured run manager of type: G4RunManager.
Geant4Kernel     WARN  +++ Multi-threaded mode requested, but not supported by this compilation of Geant4.
Geant4Kernel     WARN  +++ Falling back to single threaded mode.
Geant4Exec       WARN  +++ Only 1 subdetectors present. You sure you loaded the geometry properly?
G4PhysListFactory::GetReferencePhysList <QGSP_BERT>  EMoption= 0
<<< Geant4 Physics List simulation engine: QGSP_BERT


/home/srahman1/celeritas-dd4hep/celeritas-covfie/src/corecel/sys/ScopedMpiInit.cc:57: debug: MPI initialization took 0.050046s
debug@accel/detail/IntegrationSingleton.cc:303: Celeritas logging redirected through Geant4
debug@ddceler/CelerPhysics.cc:120: Loaded field driver options from DD4hep FieldSetup action
debug@ddceler/CelerPhysics.cc:131: Field driver options: min_step=0.001 mm, delta_chord=0.025 mm, delta_intersection=0.01 mm
info@ddceler/CelerPhysics.cc:147: Loading covfie field map from '/home/srahman1/celeritas-dd4hep/epic-data/MARCO_v.7.6.2.2.11_1.7T_Magnetic_Field_Map_2024_05_02_rad_coords_cm_T.BMap.covfie' (coord_type=BrBz)
info@ddceler/CelerPhysics.cc:166: Using covfie RZMapField for along-step
Myphysics        INFO  Registered Geant4 physics constructor G4StepLimiterPhysics to physics list
UserInitialization INFO  +++ Executing Geant4UserActionInitialization::Build. Context:0x5d780f27f750 Kernel:0x5d780f2706b0 [-1]
SignalHandler    INFO  ++ Re-apply signal handlers
Geant4Converter  INFO  +++  Successfully converted geometry to Geant4. [  0.005 seconds]
Geant4UI         INFO  +++ ConstructGeo> Install Geant4 control directory:/ddg4/ConstructGeo/

debug@accel/detail/IntegrationSingleton.cc:325: Initializing shared params
debug@corecel/sys/ScopedProfiling.cc:53: Disabling NVTX performance profiling
debug@corecel/sys/Device.cc:115: Querying CUDA device count...
info@celeritas/setup/FrameworkInput.cc:33: Activating Celeritas version 0.7+d5cb97c1 on GPU
debug@celeritas/setup/System.cc:42: Celeritas environment variables: {
  CELER_DISABLE_PARALLEL: '',
  CELER_LOG: 'debug',
  NO_COLOR: '',
  CELER_COLOR: '1',
  CELER_LOG_LOCAL: 'debug',
  CELER_STRIP_SOURCEDIR: '1',
  CELER_KILL_OFFLOAD: '0',
  CELER_DISABLE: '0',
  CELER_ENABLE_PROFILING: '0',
  CELER_DISABLE_DEVICE: '',
}
debug@corecel/sys/Device.cc:188: Constructing device ID 0
debug@corecel/sys/Device.cc:388: Initializing 'NVIDIA RTX 1000 Ada Generation Laptop GPU', ID 0 of 1
debug@geocel/GeantGeoParams.cc:596: Setting celeritas::global_geant_geo
status@celeritas/ext/GeantImporter.cc:1404: Transferring data from Geant4
debug@geocel/ScopedGeantExceptionHandler.cc:171: Creating scoped G4 exception handler (depth 0)
debug@celeritas/ext/GeantImporter.cc:438: Loaded 4 particles
warning@celeritas/ext/GeantImporter.cc:566: Optical materials were requested but none are present
debug@celeritas/ext/GeantImporter.cc:497: Loaded 16 isotopes
debug@celeritas/ext/GeantImporter.cc:550: Loaded 6 elements
debug@celeritas/ext/GeantImporter.cc:811: Loaded 3 geo materials
debug@celeritas/ext/GeantImporter.cc:915: Loaded 3 physics materials
debug@celeritas/ext/detail/GeantProcessImporter.cc:347: Saving MSC model 'UrbanMsc' for particle e+ (-11)
debug@celeritas/ext/detail/GeantProcessImporter.cc:347: Saving MSC model 'WentzelVIUni' for particle e+ (-11)
debug@celeritas/ext/detail/GeantProcessImporter.cc:119: Saving process 'eIoni' for particle e+ (-11)
debug@celeritas/ext/detail/GeantProcessImporter.cc:119: Saving process 'eBrem' for particle e+ (-11)
debug@celeritas/ext/detail/GeantProcessImporter.cc:119: Saving process 'annihil' for particle e+ (-11)
debug@celeritas/ext/detail/GeantProcessImporter.cc:119: Saving process 'CoulombScat' for particle e+ (-11)
debug@celeritas/ext/detail/GeantProcessImporter.cc:347: Saving MSC model 'UrbanMsc' for particle e- (11)
debug@celeritas/ext/detail/GeantProcessImporter.cc:347: Saving MSC model 'WentzelVIUni' for particle e- (11)
debug@celeritas/ext/detail/GeantProcessImporter.cc:119: Saving process 'eIoni' for particle e- (11)
debug@celeritas/ext/detail/GeantProcessImporter.cc:119: Saving process 'eBrem' for particle e- (11)
debug@celeritas/ext/detail/GeantProcessImporter.cc:119: Saving process 'CoulombScat' for particle e- (11)
debug@celeritas/ext/detail/GeantProcessImporter.cc:119: Saving process 'phot' for particle gamma (22)
debug@celeritas/ext/detail/GeantProcessImporter.cc:119: Saving process 'compt' for particle gamma (22)
debug@celeritas/ext/detail/GeantProcessImporter.cc:119: Saving process 'conv' for particle gamma (22)
debug@celeritas/ext/detail/GeantProcessImporter.cc:119: Saving process 'Rayl' for particle gamma (22)
debug@celeritas/ext/GeantImporter.cc:1098: Loaded 11 processes
debug@celeritas/ext/GeantImporter.cc:1099: Loaded 4 msc models
debug@celeritas/ext/GeantImporter.cc:1100: Loaded 0 optical models
debug@geocel/GeantGeoParams.cc:533: Loaded 2 regions out of 3 Geant4 regions and created 0 new regions
debug@celeritas/ext/GeantImporter.cc:1356: Loaded 3 of 3 volumes
debug@celeritas/ext/GeantImporter.cc:739: Loaded 1 optical surfaces (0 physics surfaces)
diagnostic@corecel/io/ScopedTimeLog.hh:104: ... 0.0166975 s
debug@geocel/ScopedGeantExceptionHandler.cc:191: Destroying scoped G4 exception handler (depth 0)
debug@geocel/GeantGeoParams.cc:533: Loaded 2 regions out of 3 Geant4 regions and created 0 new regions
debug@accel/SetupOptions.cc:182: Getting RZ map field
debug@ddceler/LoadCovfieField.covfie.cc:285: BrBz covfie field: 500x800 grid, r=[-0, 998] cm, z=[-800, 798] cm
debug@ddceler/LoadCovfieField.covfie.cc:288: On-axis field at z_mid=-1 cm: Br=0 T, Bz=-1.7063 T
debug@ddceler/CelerPhysics.cc:161: Dumped RZMapFieldInput to rzmap-field-dump.json
status@celeritas/setup/Problem.cc:470: Initializing problem
status@geocel/vg/VecgeomParams.cc:411: Loading VecGeom geometry from in-memory Geant4 geometry
status: Converting Geant4 geometry
status@geocel/vg/VecgeomParams.cc:488: Initializing tracking information
info@corecel/sys/ScopedLimitSaver.cuda.cc:54: CUDA stack size was changed from 1024 to 8192; restoring to original values
debug@geocel/vg/VecgeomParams.cc:803: Converting to CUDA geometry
debug@geocel/vg/VecgeomParams.cc:811: Transferring geometry to GPU
diagnostic@corecel/io/ScopedTimeLog.hh:104: ... 0.111012 s
debug@geocel/vg/VecgeomParams.cc:822: Initializing BVH on GPU
status@geocel/vg/VecgeomParams.cc:500: Constructing metadata
diagnostic@corecel/io/ScopedTimeLog.hh:104: ... 0.144195 s
debug@geocel/VolumeParams.cc:56: Setting celeritas::volumes
debug@celeritas/setup/Model.cc:117: No surfaces are defined
debug@celeritas/geo/GeoMaterialParams.cc:315: Building geometry->physics map using VolumeParams (3 volumes) and import data (3 volumes)
debug@celeritas/geo/GeoMaterialParams.cc:144: Filling geometry->physics map using canonical volumes
warning@celeritas/phys/ProcessBuilder.cc:259: Omitting coulomb_scat from physics process list
debug@celeritas/setup/Problem.cc:126: Ignored process class coulomb_scat
debug@celeritas/setup/Problem.cc:230: Set default track order init_charge
info@corecel/sys/Device.cc:307: Creating 1 device streams
debug@corecel/sys/Stream.cc:108: Created stream id=13
status@celeritas/global/CoreParams.cc:359: Celeritas core setup complete
info@geocel/GeantGdmlLoader.cc:148: Writing Geant4 geometry to GDML at ddceler.out.gdml
debug@geocel/ScopedGeantLogger.cc:250: Ignoring ScopedGeantLogger initialization because log redirection is disabled
debug@geocel/ScopedGeantExceptionHandler.cc:171: Creating scoped G4 exception handler (depth 0)
G4GDML: Writing 'ddceler.out.gdml'...
G4GDML: Writing definitions...
G4GDML: Writing materials...
G4GDML: Writing solids...
G4GDML: Writing structure...
G4GDML: Writing userinfo...
G4GDML: Writing setup...
G4GDML: Writing surfaces...
G4GDML: Writing 'ddceler.out.gdml' done !
debug@geocel/ScopedGeantExceptionHandler.cc:191: Destroying scoped G4 exception handler (depth 0)
debug@celeritas/ext/detail/SensDetInserter.cc:47: Mapped sensitive detector "DetectionLayer" on logical volume "DetectionLayer_vol"@0x5d78105ae960 (ID=1) to volume ID 1
debug@geocel/GeantGeoParams.cc:596: Setting celeritas::global_geant_geo
warning@accel/SharedParams.cc:127: Mismatch between ParticlesParams (size 4) and user-defined offload list (size 3). Geant4 data import is not properly defined.
debug@accel/SharedParams.cc:452: Setting number of streams to 1
info@accel/SharedParams.cc:475: Wrote Geant4 diagnostic output to "ddceler.out.json"
diagnostic@corecel/io/ScopedTimeLog.hh:104: ... 2.3282 s
debug@accel/detail/IntegrationSingleton.cc:368: Constructing local state
debug@celeritas/ext/detail/HitProcessor.cc:106: Setting up thread-local hit processor for 1 sensitive detectors
status@celeritas/global/CoreState.cc:82: Celeritas core state initialization complete
debug@accel/TrackingManagerIntegration.cc:169: Verifying tracking managers
SignalHandler    INFO  ++ Re-apply signal handlers
GenerationInit   INFO  +++ Initializing event 1. Within run:0 event 1.
Gun              INFO  Shoot [0] [5.000 , 5.000] GeV e- pos:(0.000 0.000 0.000)[mm] dir:( 0.000  0.000  1.000)
Gun              INFO  Particle [0] e-           Mom:5.000 GeV vertex:( 0.000  0.000  0.000)[mm] direction:( 0.013 -0.003  1.000)
Gun              INFO  +-> Interaction [0] [5.000 , 5.000] GeV e- pos:(0.000 0.000 0.000)[mm]
Gun              INFO  +++   +-> ID:  0 e-           status:00000002 PDG:    11 Vtx:(+0.00e+00,+0.00e+00,+0.00e+00)[mm] time: +0.00e+00 [ns] #Dau:  0 #Par:0
PrimaryHandler   INFO  +++++ G4PrimaryVertex at (+0.00e+00,+0.00e+00,+0.00e+00) [mm] +0.00e+00 [ns]
ParticleHandler  INFO  +++ Event 0 Begin event action. Access event related information.
debug@accel/LocalTransporter.cc:340: Transporting 1 tracks (4999.49 MeV cumulative kinetic energy) from event 0 with Celeritas
status@accel/LocalTransporter.cc:364: Executing the first Celeritas stepping loop
debug@accel/LocalTransporter.cc:410: Reconstituted 41176 hits for event 0
RootOutput       WARN  +++ [Event:0] No valid MC truth info present. Is a Particle handler installed ?
GenerationInit   INFO  +++ Initializing event 2. Within run:0 event 2.
Gun              INFO  Shoot [1] [5.000 , 5.000] GeV e- pos:(0.000 0.000 0.000)[mm] dir:( 0.000  0.000  1.000)
Gun              INFO  Particle [0] e-           Mom:5.000 GeV vertex:( 0.000  0.000  0.000)[mm] direction:( 0.011  0.007  1.000)
Gun              INFO  +-> Interaction [0] [5.000 , 5.000] GeV e- pos:(0.000 0.000 0.000)[mm]
Gun              INFO  +++   +-> ID:  0 e-           status:00000002 PDG:    11 Vtx:(+0.00e+00,+0.00e+00,+0.00e+00)[mm] time: +0.00e+00 [ns] #Dau:  0 #Par:0
PrimaryHandler   INFO  +++++ G4PrimaryVertex at (+0.00e+00,+0.00e+00,+0.00e+00) [mm] +0.00e+00 [ns]
ParticleHandler  INFO  +++ Event 1 Begin event action. Access event related information.
debug@accel/LocalTransporter.cc:340: Transporting 1 tracks (4999.49 MeV cumulative kinetic energy) from event 1 with Celeritas
debug@accel/LocalTransporter.cc:410: Reconstituted 23187 hits for event 1
RootOutput       WARN  +++ [Event:1] No valid MC truth info present. Is a Particle handler installed ?
GenerationInit   INFO  +++ Initializing event 3. Within run:0 event 3.
Gun              INFO  Shoot [2] [5.000 , 5.000] GeV e- pos:(0.000 0.000 0.000)[mm] dir:( 0.000  0.000  1.000)
Gun              INFO  Particle [0] e-           Mom:5.000 GeV vertex:( 0.000  0.000  0.000)[mm] direction:(-0.000 -0.013  1.000)
Gun              INFO  +-> Interaction [0] [5.000 , 5.000] GeV e- pos:(0.000 0.000 0.000)[mm]
Gun              INFO  +++   +-> ID:  0 e-           status:00000002 PDG:    11 Vtx:(+0.00e+00,+0.00e+00,+0.00e+00)[mm] time: +0.00e+00 [ns] #Dau:  0 #Par:0
PrimaryHandler   INFO  +++++ G4PrimaryVertex at (+0.00e+00,+0.00e+00,+0.00e+00) [mm] +0.00e+00 [ns]
ParticleHandler  INFO  +++ Event 2 Begin event action. Access event related information.
debug@accel/LocalTransporter.cc:340: Transporting 1 tracks (4999.49 MeV cumulative kinetic energy) from event 2 with Celeritas
debug@accel/LocalTransporter.cc:410: Reconstituted 18221 hits for event 2
RootOutput       WARN  +++ [Event:2] No valid MC truth info present. Is a Particle handler installed ?
GenerationInit   INFO  +++ Initializing event 4. Within run:0 event 4.
Gun              INFO  Shoot [3] [5.000 , 5.000] GeV e- pos:(0.000 0.000 0.000)[mm] dir:( 0.000  0.000  1.000)
Gun              INFO  Particle [0] e-           Mom:5.000 GeV vertex:( 0.000  0.000  0.000)[mm] direction:( 0.013  0.001  1.000)
Gun              INFO  +-> Interaction [0] [5.000 , 5.000] GeV e- pos:(0.000 0.000 0.000)[mm]
Gun              INFO  +++   +-> ID:  0 e-           status:00000002 PDG:    11 Vtx:(+0.00e+00,+0.00e+00,+0.00e+00)[mm] time: +0.00e+00 [ns] #Dau:  0 #Par:0
PrimaryHandler   INFO  +++++ G4PrimaryVertex at (+0.00e+00,+0.00e+00,+0.00e+00) [mm] +0.00e+00 [ns]
ParticleHandler  INFO  +++ Event 3 Begin event action. Access event related information.
debug@accel/LocalTransporter.cc:340: Transporting 1 tracks (4999.49 MeV cumulative kinetic energy) from event 3 with Celeritas
debug@accel/LocalTransporter.cc:410: Reconstituted 17461 hits for event 3
RootOutput       WARN  +++ [Event:3] No valid MC truth info present. Is a Particle handler installed ?
GenerationInit   INFO  +++ Initializing event 5. Within run:0 event 5.
Gun              INFO  Shoot [4] [5.000 , 5.000] GeV e- pos:(0.000 0.000 0.000)[mm] dir:( 0.000  0.000  1.000)
Gun              INFO  Particle [0] e-           Mom:5.000 GeV vertex:( 0.000  0.000  0.000)[mm] direction:( 0.004 -0.013  1.000)
Gun              INFO  +-> Interaction [0] [5.000 , 5.000] GeV e- pos:(0.000 0.000 0.000)[mm]
Gun              INFO  +++   +-> ID:  0 e-           status:00000002 PDG:    11 Vtx:(+0.00e+00,+0.00e+00,+0.00e+00)[mm] time: +0.00e+00 [ns] #Dau:  0 #Par:0
PrimaryHandler   INFO  +++++ G4PrimaryVertex at (+0.00e+00,+0.00e+00,+0.00e+00) [mm] +0.00e+00 [ns]
ParticleHandler  INFO  +++ Event 4 Begin event action. Access event related information.
debug@accel/LocalTransporter.cc:340: Transporting 1 tracks (4999.49 MeV cumulative kinetic energy) from event 4 with Celeritas
debug@accel/LocalTransporter.cc:410: Reconstituted 21897 hits for event 4
RootOutput       WARN  +++ [Event:4] No valid MC truth info present. Is a Particle handler installed ?
GenerationInit   INFO  +++ Initializing event 6. Within run:0 event 6.
Gun              INFO  Shoot [5] [5.000 , 5.000] GeV e- pos:(0.000 0.000 0.000)[mm] dir:( 0.000  0.000  1.000)
Gun              INFO  Particle [0] e-           Mom:5.000 GeV vertex:( 0.000  0.000  0.000)[mm] direction:( 0.013 -0.000  1.000)
Gun              INFO  +-> Interaction [0] [5.000 , 5.000] GeV e- pos:(0.000 0.000 0.000)[mm]
Gun              INFO  +++   +-> ID:  0 e-           status:00000002 PDG:    11 Vtx:(+0.00e+00,+0.00e+00,+0.00e+00)[mm] time: +0.00e+00 [ns] #Dau:  0 #Par:0
PrimaryHandler   INFO  +++++ G4PrimaryVertex at (+0.00e+00,+0.00e+00,+0.00e+00) [mm] +0.00e+00 [ns]
ParticleHandler  INFO  +++ Event 5 Begin event action. Access event related information.
debug@accel/LocalTransporter.cc:340: Transporting 1 tracks (4999.49 MeV cumulative kinetic energy) from event 5 with Celeritas
debug@accel/LocalTransporter.cc:410: Reconstituted 34592 hits for event 5
RootOutput       WARN  +++ [Event:5] No valid MC truth info present. Is a Particle handler installed ?
GenerationInit   INFO  +++ Initializing event 7. Within run:0 event 7.
Gun              INFO  Shoot [6] [5.000 , 5.000] GeV e- pos:(0.000 0.000 0.000)[mm] dir:( 0.000  0.000  1.000)
Gun              INFO  Particle [0] e-           Mom:5.000 GeV vertex:( 0.000  0.000  0.000)[mm] direction:(-0.006 -0.012  1.000)
Gun              INFO  +-> Interaction [0] [5.000 , 5.000] GeV e- pos:(0.000 0.000 0.000)[mm]
Gun              INFO  +++   +-> ID:  0 e-           status:00000002 PDG:    11 Vtx:(+0.00e+00,+0.00e+00,+0.00e+00)[mm] time: +0.00e+00 [ns] #Dau:  0 #Par:0
PrimaryHandler   INFO  +++++ G4PrimaryVertex at (+0.00e+00,+0.00e+00,+0.00e+00) [mm] +0.00e+00 [ns]
ParticleHandler  INFO  +++ Event 6 Begin event action. Access event related information.
debug@accel/LocalTransporter.cc:340: Transporting 1 tracks (4999.49 MeV cumulative kinetic energy) from event 6 with Celeritas
debug@accel/LocalTransporter.cc:410: Reconstituted 18546 hits for event 6
RootOutput       WARN  +++ [Event:6] No valid MC truth info present. Is a Particle handler installed ?
GenerationInit   INFO  +++ Initializing event 8. Within run:0 event 8.
Gun              INFO  Shoot [7] [5.000 , 5.000] GeV e- pos:(0.000 0.000 0.000)[mm] dir:( 0.000  0.000  1.000)
Gun              INFO  Particle [0] e-           Mom:5.000 GeV vertex:( 0.000  0.000  0.000)[mm] direction:(-0.002  0.013  1.000)
Gun              INFO  +-> Interaction [0] [5.000 , 5.000] GeV e- pos:(0.000 0.000 0.000)[mm]
Gun              INFO  +++   +-> ID:  0 e-           status:00000002 PDG:    11 Vtx:(+0.00e+00,+0.00e+00,+0.00e+00)[mm] time: +0.00e+00 [ns] #Dau:  0 #Par:0
PrimaryHandler   INFO  +++++ G4PrimaryVertex at (+0.00e+00,+0.00e+00,+0.00e+00) [mm] +0.00e+00 [ns]
ParticleHandler  INFO  +++ Event 7 Begin event action. Access event related information.
debug@accel/LocalTransporter.cc:340: Transporting 1 tracks (4999.49 MeV cumulative kinetic energy) from event 7 with Celeritas
debug@accel/LocalTransporter.cc:410: Reconstituted 24776 hits for event 7
RootOutput       WARN  +++ [Event:7] No valid MC truth info present. Is a Particle handler installed ?
GenerationInit   INFO  +++ Initializing event 9. Within run:0 event 9.
Gun              INFO  Shoot [8] [5.000 , 5.000] GeV e- pos:(0.000 0.000 0.000)[mm] dir:( 0.000  0.000  1.000)
Gun              INFO  Particle [0] e-           Mom:5.000 GeV vertex:( 0.000  0.000  0.000)[mm] direction:( 0.008 -0.011  1.000)
Gun              INFO  +-> Interaction [0] [5.000 , 5.000] GeV e- pos:(0.000 0.000 0.000)[mm]
Gun              INFO  +++   +-> ID:  0 e-           status:00000002 PDG:    11 Vtx:(+0.00e+00,+0.00e+00,+0.00e+00)[mm] time: +0.00e+00 [ns] #Dau:  0 #Par:0
PrimaryHandler   INFO  +++++ G4PrimaryVertex at (+0.00e+00,+0.00e+00,+0.00e+00) [mm] +0.00e+00 [ns]
ParticleHandler  INFO  +++ Event 8 Begin event action. Access event related information.
debug@accel/LocalTransporter.cc:340: Transporting 1 tracks (4999.49 MeV cumulative kinetic energy) from event 8 with Celeritas
debug@accel/LocalTransporter.cc:410: Reconstituted 25215 hits for event 8
RootOutput       WARN  +++ [Event:8] No valid MC truth info present. Is a Particle handler installed ?
GenerationInit   INFO  +++ Initializing event 10. Within run:0 event 10.
Gun              INFO  Shoot [9] [5.000 , 5.000] GeV e- pos:(0.000 0.000 0.000)[mm] dir:( 0.000  0.000  1.000)
Gun              INFO  Particle [0] e-           Mom:5.000 GeV vertex:( 0.000  0.000  0.000)[mm] direction:( 0.005 -0.012  1.000)
Gun              INFO  +-> Interaction [0] [5.000 , 5.000] GeV e- pos:(0.000 0.000 0.000)[mm]
Gun              INFO  +++   +-> ID:  0 e-           status:00000002 PDG:    11 Vtx:(+0.00e+00,+0.00e+00,+0.00e+00)[mm] time: +0.00e+00 [ns] #Dau:  0 #Par:0
PrimaryHandler   INFO  +++++ G4PrimaryVertex at (+0.00e+00,+0.00e+00,+0.00e+00) [mm] +0.00e+00 [ns]
ParticleHandler  INFO  +++ Event 9 Begin event action. Access event related information.
debug@accel/LocalTransporter.cc:340: Transporting 1 tracks (4999.49 MeV cumulative kinetic energy) from event 9 with Celeritas
debug@accel/LocalTransporter.cc:410: Reconstituted 22231 hits for event 9
RootOutput       WARN  +++ [Event:9] No valid MC truth info present. Is a Particle handler installed ?
GenerationInit   WARN  +++ Finished run 0 after 10 events (10 events in total)
debug@accel/detail/IntegrationSingleton.cc:382: Destroying local state
info@accel/LocalTransporter.cc:434: Finalizing Celeritas after 448723 steps from 10 offloaded tracks over 10 events, generating 247302 hits
debug@celeritas/ext/GeantTrackReconstruction.cc:90: Deallocating track reconstruction
status@accel/detail/IntegrationSingleton.cc:397: Finalizing Celeritas
info@accel/SharedParams.cc:475: Wrote Geant4 diagnostic output to "ddceler.out.json"
debug@accel/SharedParams.cc:382: Resetting shared parameters
debug@celeritas/global/CoreState.cc:97: Deallocating device core state (stream 0)
debug@geocel/vg/VecgeomParams.cc:604: Clearing VecGeom volumeGPU data
debug@geocel/vg/VecgeomParams.cc:641: Clearing VecGeom CPU data
debug@corecel/sys/Device.cc:330: Destroying streams
debug@corecel/sys/Stream.cc:68: Destroying stream id=13

Geant4Kernel     INFO  ++ Terminate Geant4 and delete associated actions.
RootOutput       INFO  +++ Closing ROOT output file preshower.root
DDSim            INFO Total Time:   16.88 s (User), 2.73 s (System)
DDSim            INFO StartUp Time: 2.59 s, Processing and Init: 14.29 s (~1.43 s/Event)

@sethrj sethrj added enhancement New feature or request external Dependencies and framework-oriented features labels Mar 4, 2026
@sethrj sethrj self-requested a review March 4, 2026 22:25
@github-actions
Copy link

github-actions bot commented Mar 4, 2026

Test summary

 2 064 files   3 327 suites   1m 10s ⏱️
 1 379 tests  1 359 ✅ 20 💤 0 ❌
11 090 runs  11 058 ✅ 32 💤 0 ❌

Results for commit 2426885.

♻️ This comment has been updated with latest results.

@codecov
Copy link

codecov bot commented Mar 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.59%. Comparing base (ee2ab3b) to head (ec9f96b).
⚠️ Report is 40 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #2298      +/-   ##
===========================================
- Coverage    86.84%   85.59%   -1.25%     
===========================================
  Files         1331     1320      -11     
  Lines        42224    41491     -733     
  Branches     12997    10775    -2222     
===========================================
- Hits         36669    35516    -1153     
- Misses        4344     4395      +51     
- Partials      1211     1580     +369     

see 809 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sakib Rahman added 3 commits March 4, 2026 23:27
… is enabled, RZMapField uses covfie for storage and bilinear interpolation on the R-Z grid, with CUDA texture acceleration on GPU. When covfie is disabled, the existing Celeritas interpolation via UniformGrid and Collection is unchanged.
…RZMapFieldMscAction into the covfie/non-covfie CMake branches, mirroring AlongStepCartMapFieldMscAction. Previously it was

compiled unconditionally via celeritas_polysource but its .cu file includes covfie headers through RZMapField.hh, causing an undefined fatbin symbol at runtime when covfie+CUDA is enabled.
@rahmans1
Copy link
Contributor Author

rahmans1 commented Mar 5, 2026

When covfie is enabled, RZMapField produces substantially different field values compared to the non-covfie path. The root cause is a fundamental difference in interpolation scheme, not a precision or grid resolution issue.

Non-covfie interpolation (RZMapField.hh)

The non-covfie RZMapField::operator() interpolates each field component along a single axis only:

  • Bz: interpolated along z at fixed grid index ir (1D in z)
  • Br: interpolated along r at fixed grid index iz (1D in r)
// z component: interpolate along z only
value[2] = fieldmap[id(iz, ir)].value_z
         + (fieldmap[id(iz+1, ir)].value_z - fieldmap[id(iz, ir)].value_z) * interp_z.fraction;

// r component: interpolate along r only
tmp = fieldmap[id(iz, ir)].value_r
    + (fieldmap[id(iz, ir+1)].value_r - fieldmap[id(iz, ir)].value_r) * interp_r.fraction;

Note: the code comment says "2-D interpolation" but the implementation is 1D per component.

Covfie interpolation (RZMapField.covfie.hh)

Covfie stores both Br and Bz in a single float2 field and applies 2D bilinear interpolation to both components simultaneously via covfie::backend::linear. There is no way to interpolate Br along r-only and Bz along z-only through covfie's linear interpolation backend — it always interpolates all dimensions.

Impact on field values

Using the cms-tiny.field.json test data (10×33 grid, 100 cm spacing):

Sample point (cm) Component Non-covfie Covfie (bilinear) Relative difference
r=16.97, z=25 Br −6.72e−05 +7.89e−04 12.7× (sign flip)
r=50.91, z=75 Br −2.02e−04 +7.50e−03 38.2× (sign flip)
r=84.85, z=125 Br +1.68e−02 +2.11e−02 25.9 %
r=118.79, z=175 Br +2.35e−02 +4.01e−02 70.7 %
r=16.97, z=25 Bz 3.8062 3.8078 0.04 %

The Br differences are large because Br has steep gradients along z (e.g., Br goes from ~0 at z=0 to 0.02 at z=100 cm). The 1D scheme interpolates Br only along r and ignores the z variation entirely, while bilinear mixes in the large neighbouring z-values.

Grid refinement does not resolve this

Refining the grid reduces the discrepancy but convergence is slow for Br:

Refinement Grid spacing Max Br relative diff
1× (original) 100 cm 47×
25 cm 74 %
16× 6.25 cm 13 %
32× 3.12 cm 3.8 %

What is done for other Celeritas field maps?

The other Celeritas field maps use full multilinear interpolation:

  • CylMapField (3D cylindrical): trilinear interpolation on all components
  • CartMapField (3D Cartesian via covfie): trilinear interpolation on all components

The non-covfie RZMapField 1D-per-component scheme is the outlier.

Affected tests

  • RZMapFieldTest.all: expected values were generated from the non-covfie 1D interpolation. Fails when covfie is enabled.
  • RZMapFieldTest.device (new): compares device output against host covfie output, so it is self-consistent regardless of which scheme is used. But the precision threshold should be examined closely.

@rahmans1
Copy link
Contributor Author

rahmans1 commented Mar 5, 2026

cms_field_gradient

RZMapField Interpolation Discrepancy Report

Input: test/celeritas/data/cms-tiny.field.json
Grid: 10 r x 33 z, cell size 100.0 x 100.0 cm
r range: [0.0, 900.0] cm
z range: [-1600.0, 1600.0] cm
Br range: [-1.887915, 1.895809] T
Bz range: [-1.723144, 3.928247] T

Two interpolation methods are compared:

  1. Default Celeritas: Bz interpolated along z only (fixed ir), Br interpolated along r only (fixed iz)
  2. Covfie bilinear: both Br and Bz interpolated with full 2D bilinear interpolation across (r, z)

1. CTest sample points (RZMapFieldTest::all)

These are the 8 points from the unit test: pos = (i*12, i*12, i*25) cm for i=0..7.

i x y z r Bx default Bx covfie Bx rel% Bz default Bz covfie Bz rel%
0 0 0 0 0.0 -0.000000e+00 0.000000e+00 0.00 3.811202e+00 3.811202e+00 0.00
1 12 12 25 17.0 -4.752282e-05 5.577305e-04 108.52 3.806211e+00 3.807820e+00 0.04
2 24 24 50 33.9 -9.504563e-05 2.325968e-03 104.09 3.801220e+00 3.804498e+00 0.09
3 36 36 75 50.9 -1.425685e-04 5.304711e-03 102.69 3.796229e+00 3.801236e+00 0.13
4 48 48 100 67.9 9.493961e-03 9.493961e-03 0.00 3.791239e+00 3.798033e+00 0.18
5 60 60 125 84.9 1.186745e-02 1.493891e-02 20.56 3.775991e+00 3.784962e+00 0.24
6 72 72 150 101.8 1.424099e-02 2.153777e-02 33.88 3.771880e+00 3.772388e+00 0.01
7 84 84 175 118.8 1.661489e-02 2.835992e-02 41.41 3.757196e+00 3.762944e+00 0.15

Points with >1% discrepancy: [1, 2, 3, 5, 6, 7]

Cell corner details

ctest i=1: pos=(12.0, 12.0, 25.0) cm, r=16.97 cm

  • Cell: ir=0 (r=[0, 100]), iz=16 (z=[0, 100])
  • Fractions: fr=0.1697, fz=0.2500
  • Br corners: [-0.000000, 0.000000, -0.000396, 0.019779]
  • Bz corners: [3.811202, 3.791239, 3.820508, 3.801247]
  • Br variation: along r=0.000396, along z=0.000000
  • Bz variation: along r=0.009305, along z=0.019964

ctest i=2: pos=(24.0, 24.0, 50.0) cm, r=33.94 cm

  • Cell: ir=0 (r=[0, 100]), iz=16 (z=[0, 100])
  • Fractions: fr=0.3394, fz=0.5000
  • Br corners: [-0.000000, 0.000000, -0.000396, 0.019779]
  • Bz corners: [3.811202, 3.791239, 3.820508, 3.801247]
  • Br variation: along r=0.000396, along z=0.000000
  • Bz variation: along r=0.009305, along z=0.019964

ctest i=3: pos=(36.0, 36.0, 75.0) cm, r=50.91 cm

  • Cell: ir=0 (r=[0, 100]), iz=16 (z=[0, 100])
  • Fractions: fr=0.5091, fz=0.7500
  • Br corners: [-0.000000, 0.000000, -0.000396, 0.019779]
  • Bz corners: [3.811202, 3.791239, 3.820508, 3.801247]
  • Br variation: along r=0.000396, along z=0.000000
  • Bz variation: along r=0.009305, along z=0.019964

ctest i=5: pos=(60.0, 60.0, 125.0) cm, r=84.85 cm

  • Cell: ir=0 (r=[0, 100]), iz=17 (z=[100, 200])
  • Fractions: fr=0.8485, fz=0.2500
  • Br corners: [0.000000, 0.000000, 0.019779, 0.040255]
  • Bz corners: [3.791239, 3.730250, 3.801247, 3.742513]
  • Br variation: along r=0.019779, along z=0.000000
  • Bz variation: along r=0.010009, along z=0.060988

ctest i=6: pos=(72.0, 72.0, 150.0) cm, r=101.82 cm

  • Cell: ir=1 (r=[100, 200]), iz=17 (z=[100, 200])
  • Fractions: fr=0.0182, fz=0.5000
  • Br corners: [0.019779, 0.040255, 0.039562, 0.068925]
  • Bz corners: [3.801247, 3.742513, 3.823576, 3.775848]
  • Br variation: along r=0.019783, along z=0.020476
  • Bz variation: along r=0.022329, along z=0.058735

ctest i=7: pos=(84.0, 84.0, 175.0) cm, r=118.79 cm

  • Cell: ir=1 (r=[100, 200]), iz=17 (z=[100, 200])
  • Fractions: fr=0.1879, fz=0.7500
  • Br corners: [0.019779, 0.040255, 0.039562, 0.068925]
  • Bz corners: [3.801247, 3.742513, 3.823576, 3.775848]
  • Br variation: along r=0.019783, along z=0.020476
  • Bz variation: along r=0.022329, along z=0.058735

2. High-r, low-z scan

Sweep r from 100 cm to near max_r at small z values, where Br cross-gradients (dBr/dz) tend to be largest.

z r Bx default Bx covfie Bx rel% Bz default Bz covfie Bz rel%
0 100 -3.960235e-04 -3.960235e-04 0.00 3.820508e+00 3.820508e+00 0.00
0 207 -6.430123e-04 -6.430123e-04 0.00 3.850628e+00 3.856172e+00 0.14
0 314 -8.830837e-04 -8.830837e-04 0.00 3.928247e+00 3.120906e+00 20.55
0 421 -8.929423e-04 -8.929423e-04 0.00 -1.723144e+00 -1.354584e+00 21.39
0 529 -4.972557e-05 -4.972557e-05 0.00 -3.196663e-03 -2.629825e-03 17.73
0 636 1.648416e-04 1.648416e-04 0.00 -1.212732e-03 -1.293706e-03 6.26
0 743 3.168276e-04 3.168276e-04 0.00 -1.439460e-03 -1.594596e-02 90.97
0 850 1.200145e-04 1.200145e-04 0.00 -3.528795e-02 -1.764398e-02 50.00
10 100 -3.960235e-04 1.621487e-03 124.42 3.818582e+00 3.818582e+00 0.00
10 207 -6.430123e-04 3.908262e-03 116.45 3.847923e+00 3.853035e+00 0.13
10 314 -8.830837e-04 9.129344e-03 109.67 3.919496e+00 3.120113e+00 20.40
10 421 -8.929423e-04 -6.534694e-04 26.82 -1.676185e+00 -1.318590e+00 21.33
10 529 -4.972557e-05 -3.738424e-03 98.67 -7.407263e-03 -5.989080e-03 19.15
10 636 1.648416e-04 -5.398301e-03 103.05 -2.443621e-03 -2.103990e-03 13.90
10 743 3.168276e-04 -4.440516e-03 107.13 -1.492655e-03 -1.663001e-02 91.02
10 850 1.200145e-04 -8.487906e-05 170.72 -3.681314e-02 -1.840657e-02 50.00
25 100 -3.960235e-04 4.647754e-03 108.52 3.815693e+00 3.815693e+00 0.00
25 207 -6.430123e-04 1.073517e-02 105.99 3.843865e+00 3.848329e+00 0.12
25 314 -8.830837e-04 2.414798e-02 103.66 3.906368e+00 3.118923e+00 20.16
25 421 -8.929423e-04 -2.942599e-04 67.05 -1.605747e+00 -1.264599e+00 21.25
25 529 -4.972557e-05 -9.271471e-03 99.46 -1.372316e-02 -1.102796e-02 19.64
25 636 1.648416e-04 -1.374301e-02 101.20 -4.289954e-03 -3.319416e-03 22.62
25 743 3.168276e-04 -1.157653e-02 102.74 -1.572447e-03 -1.765608e-02 91.09
25 850 1.200145e-04 -3.922194e-04 130.60 -3.910092e-02 -1.955046e-02 50.00
50 100 -3.960235e-04 9.691531e-03 104.09 3.810878e+00 3.810878e+00 0.00
50 207 -6.430123e-04 2.211336e-02 102.91 3.837102e+00 3.840487e+00 0.09
50 314 -8.830837e-04 4.917905e-02 101.80 3.884488e+00 3.116940e+00 19.76
50 421 -8.929423e-04 3.044225e-04 134.09 -1.488350e+00 -1.174614e+00 21.08
50 529 -4.972557e-05 -1.849322e-02 99.73 -2.424966e-02 -1.942610e-02 19.89
50 636 1.648416e-04 -2.765087e-02 100.60 -7.367177e-03 -5.345126e-03 27.45
50 743 3.168276e-04 -2.346989e-02 101.35 -1.705434e-03 -1.936620e-02 91.19
50 850 1.200145e-04 -9.044534e-04 113.27 -4.291389e-02 -2.145695e-02 50.00

Discrepancies

  • Bx: 170.7% at z=10, r=850 cm (abs diff: 2.048936e-04 T)
  • Bz: 91.2% at z=50, r=743 cm (abs diff: 1.766077e-02 T)

Bx peak (z=10, r=850): pos=(850.0, 0.0, 10.0) cm, r=850.00 cm

  • Cell: ir=8 (r=[800, 900]), iz=16 (z=[0, 100])
  • Fractions: fr=0.5000, fz=0.1000
  • Br corners: [0.000240, -0.003858, 0.000000, 0.000000]
  • Bz corners: [-0.035288, -0.050540, 0.000000, 0.000000]
  • Br variation: along r=0.000240, along z=0.004098
  • Bz variation: along r=0.035288, along z=0.015252

Bz peak (z=50, r=743): pos=(742.9, 0.0, 50.0) cm, r=742.86 cm

  • Cell: ir=7 (r=[700, 800]), iz=16 (z=[0, 100])
  • Fractions: fr=0.4286, fz=0.5000
  • Br corners: [0.000374, -0.079806, 0.000240, -0.003858]
  • Bz corners: [-0.001439, -0.001971, -0.035288, -0.050540]
  • Br variation: along r=0.000134, along z=0.080180
  • Bz variation: along r=0.033848, along z=0.000532

3. Gradient statistics

| Gradient | Max |grad| (T/cm) | Used by |
|----------|--------------------:|---------|
| dBr/dr | 0.009172 | Default Celeritas |
| dBr/dz | 0.009415 | Covfie bilinear (cross-term) |
| dBz/dz | 0.015453 | Default Celeritas |
| dBz/dr | 0.027869 | Covfie bilinear (cross-term) |

Cross/along gradient ratio (Br): 1.0x
Cross/along gradient ratio (Bz): 1.8x

When the cross-gradient ratio is >= 1, the 1D interpolation is missing variation comparable to or larger than what it captures.

@rahmans1
Copy link
Contributor Author

rahmans1 commented Mar 5, 2026

rzmap-field-dump_gradient

RZMapField Interpolation Discrepancy Report for realistic ePIC experiment field map

Input: example/ddceler/output/celeritas/rzmap-field-dump.json
Grid: 500 r x 800 z, cell size 2.0 x 2.0 cm
r range: [-0.0, 998.0] cm
z range: [-800.0, 798.0] cm
Units: Gauss (CGS; 10000 Gauss = 1 T)
Br range: [-18996.00, 18799.00] Gauss
Bz range: [-19870.00, 12810.00] Gauss

Two interpolation methods are compared:

  1. Default Celeritas: Bz interpolated along z only (fixed ir), Br interpolated along r only (fixed iz)
  2. Covfie bilinear: both Br and Bz interpolated with full 2D bilinear interpolation across (r, z)

1. CTest sample points (RZMapFieldTest::all)

These are the 8 points from the unit test: pos = (i*12, i*12, i*25) cm for i=0..7.

i x y z r Bx default Bx covfie Bx rel% Bz default Bz covfie Bz rel%
0 0 0 0 0.0 0.000000e+00 0.000000e+00 0.00 -1.706300e+04 -1.706300e+04 0.00
1 12 12 25 17.0 -9.494975e+01 -9.758579e+01 2.70 -1.683750e+04 -1.684138e+04 0.02
2 24 24 50 33.9 -3.402635e+02 -3.402635e+02 0.00 -1.637700e+04 -1.639350e+04 0.10
3 36 36 75 50.9 -7.320833e+02 -7.424350e+02 1.39 -1.570850e+04 -1.572149e+04 0.08
4 48 48 100 67.9 -1.336097e+03 -1.336097e+03 0.00 -1.476500e+04 -1.480359e+04 0.26
5 60 60 125 84.9 -2.149476e+03 -2.166696e+03 0.79 -1.349350e+04 -1.351525e+04 0.16
6 72 72 150 101.8 -3.241183e+03 -3.241183e+03 0.00 -1.147600e+04 -1.150609e+04 0.26
7 84 84 175 118.8 -4.181714e+03 -4.152946e+03 0.69 -8.136500e+03 -8.104346e+03 0.40

Points with >1% discrepancy: [1, 3]

Cell corner details

ctest i=1: pos=(12.0, 12.0, 25.0) cm, r=16.97 cm

  • Cell: ir=8 (r=[16, 18]), iz=412 (z=[24, 26])
  • Fractions: fr=0.4853, fz=0.5000
  • Br corners: [-126.999998, -132.999998, -142.000001, -151.000004]
  • Bz corners: [-16854.000092, -16821.000576, -16861.000061, -16829.999685]
  • Br variation: along r=15.000002, along z=5.999999
  • Bz variation: along r=6.999969, along z=32.999516

ctest i=3: pos=(36.0, 36.0, 75.0) cm, r=50.91 cm

  • Cell: ir=25 (r=[50, 52]), iz=437 (z=[74, 76])
  • Fractions: fr=0.4558, fz=0.5000
  • Br corners: [-1018.000022, -1045.000032, -1055.999994, -1088.000014]
  • Bz corners: [-15749.000311, -15667.999983, -15778.000355, -15695.999861]
  • Br variation: along r=37.999973, along z=27.000010
  • Bz variation: along r=29.000044, along z=81.000328

Active field region (|B| > 50.0 Gauss): z in [-454, 508] cm, r in [0, 366] cm

2. On-axis (r < 50 cm)

Small radius across the active z range.

z r Bx default Bx covfie Bx rel% Bz default Bz covfie Bz rel%
-367 5 3.200000e+01 3.272727e+01 2.22 -1.705636e+03 -1.705136e+03 0.03
-367 15 9.600000e+01 9.854545e+01 2.58 -1.694909e+03 -1.693045e+03 0.11
-367 25 1.585000e+02 1.632273e+02 2.90 -1.672182e+03 -1.669182e+03 0.18
-367 50 3.060000e+02 3.147273e+02 2.77 -1.557455e+03 -1.557455e+03 0.00
-279 5 1.080000e+02 1.077727e+02 0.21 -4.024091e+03 -4.022864e+03 0.03
-279 15 3.185000e+02 3.212273e+02 0.85 -4.004545e+03 -4.001364e+03 0.08
-279 25 5.285000e+02 5.335000e+02 0.94 -3.963636e+03 -3.958136e+03 0.14
-279 50 1.047000e+03 1.057000e+03 0.95 -3.749636e+03 -3.749636e+03 0.00
-192 5 1.825000e+02 1.825000e+02 0.00 -9.308545e+03 -9.308136e+03 0.00
-192 15 5.480000e+02 5.482727e+02 0.05 -9.304727e+03 -9.304318e+03 0.00
-192 25 9.205000e+02 9.208636e+02 0.04 -9.298091e+03 -9.297091e+03 0.01
-192 50 1.904000e+03 1.904909e+03 0.05 -9.256909e+03 -9.256909e+03 0.00
-104 5 1.180000e+02 1.170909e+02 0.77 -1.492246e+04 -1.492400e+04 0.01
-104 15 3.560000e+02 3.500909e+02 1.66 -1.494645e+04 -1.495000e+04 0.02
-104 25 5.940000e+02 5.835455e+02 1.76 -1.499545e+04 -1.500200e+04 0.04
-104 50 1.192000e+03 1.166545e+03 2.14 -1.525245e+04 -1.525245e+04 0.00
-17 5 1.050000e+01 8.590909e+00 18.18 -1.707345e+04 -1.707445e+04 0.01
-17 15 3.150000e+01 2.672727e+01 15.15 -1.709445e+04 -1.709795e+04 0.02
-17 25 5.100000e+01 4.336364e+01 14.97 -1.713945e+04 -1.714514e+04 0.03
-17 50 1.010000e+02 8.636363e+01 14.49 -1.736409e+04 -1.736409e+04 0.00
71 5 -9.850000e+01 -9.940909e+01 0.91 -1.554927e+04 -1.555032e+04 0.01
71 15 -2.920000e+02 -2.943636e+02 0.80 -1.557127e+04 -1.557527e+04 0.03
71 25 -4.850000e+02 -4.897273e+02 0.97 -1.562164e+04 -1.562832e+04 0.04
71 50 -9.630000e+02 -9.731818e+02 1.05 -1.587800e+04 -1.587800e+04 0.00
158 5 -1.815000e+02 -1.815455e+02 0.03 -1.035882e+04 -1.035882e+04 0.00
158 15 -5.470000e+02 -5.470909e+02 0.02 -1.036164e+04 -1.036168e+04 0.00
158 25 -9.185000e+02 -9.185909e+02 0.01 -1.036655e+04 -1.036750e+04 0.01
158 50 -1.905000e+03 -1.905273e+03 0.01 -1.039445e+04 -1.039445e+04 0.00
246 5 -1.180000e+02 -1.151364e+02 2.43 -4.808091e+03 -4.807500e+03 0.01
246 15 -3.540000e+02 -3.478636e+02 1.73 -4.786909e+03 -4.783409e+03 0.07
246 25 -5.885000e+02 -5.795000e+02 1.53 -4.740909e+03 -4.734500e+03 0.14
246 50 -1.177000e+03 -1.155727e+03 1.81 -4.503091e+03 -4.503091e+03 0.00
333 5 -3.300000e+01 -3.381818e+01 2.42 -2.408273e+03 -2.408273e+03 0.00
333 15 -9.250000e+01 -9.140909e+01 1.18 -2.409455e+03 -2.408500e+03 0.04
333 25 -1.385000e+02 -1.346818e+02 2.76 -2.392636e+03 -2.389136e+03 0.15
333 50 -2.440000e+02 -2.347273e+02 3.80 -2.233727e+03 -2.233727e+03 0.00
421 15 -1.300000e+01 -1.286364e+01 1.05 -1.232636e+03 -1.232500e+03 0.01
421 25 -1.165000e+02 -1.158182e+02 0.59 -1.222636e+03 -1.221136e+03 0.12
421 50 -3.020000e+02 -3.009091e+02 0.36 -1.140182e+03 -1.140182e+03 0.00

9 points with |B| < 50.0 Gauss omitted.

Discrepancies

  • Bx: 18.2% at z=-17, r=5 cm (abs diff: 1.909091e+00 Gauss)
  • Bz: 0.2% at z=-367, r=25 cm (abs diff: 2.999976e+00 Gauss)

Bx discrepancy (z=-17, r=5): pos=(5.0, 0.0, -16.7) cm, r=5.00 cm

  • Cell: ir=2 (r=[4, 6]), iz=391 (z=[-18, -16])
  • Fractions: fr=0.5000, fz=0.6364
  • Br corners: [9.000000, 6.000000, 12.000001, 9.000000]
  • Bz corners: [-17069.000006, -17075.999975, -17071.000338, -17078.000307]
  • Br variation: along r=3.000001, along z=3.000000
  • Bz variation: along r=2.000332, along z=6.999969

Bz discrepancy (z=-367, r=25): pos=(25.0, 0.0, -366.5) cm, r=25.00 cm

  • Cell: ir=12 (r=[24, 26]), iz=216 (z=[-368, -366])
  • Fractions: fr=0.5000, fz=0.7273
  • Br corners: [152.000003, 159.000009, 164.999999, 171.000008]
  • Bz corners: [-1653.999984, -1678.999960, -1648.000032, -1673.000008]
  • Br variation: along r=12.999997, along z=7.000007
  • Bz variation: along r=5.999953, along z=24.999976

3. Solenoid barrel boundary

Radial transition region where field strength changes rapidly.

z r Bx default Bx covfie Bx rel% Bz default Bz covfie Bz rel%
-367 100 5.270000e+02 5.422727e+02 2.82 -1.137364e+03 -1.137364e+03 0.00
-367 117 5.660000e+02 5.827273e+02 2.87 -9.594545e+02 -9.517879e+02 0.80
-367 133 5.810000e+02 5.989394e+02 3.00 -7.685455e+02 -7.525454e+02 2.08
-367 150 5.670000e+02 5.851818e+02 3.11 -5.469091e+02 -5.469091e+02 0.00
-367 167 5.203333e+02 5.370606e+02 3.11 -3.532727e+02 -3.456970e+02 2.14
-367 183 4.390000e+02 4.528182e+02 3.05 -1.799091e+02 -1.672424e+02 7.04
-367 200 3.380000e+02 3.474546e+02 2.72 -3.245455e+01 -3.245455e+01 0.00
-367 217 2.276667e+02 2.397879e+02 5.05 8.190909e+01 8.754546e+01 6.44
-367 233 6.166667e+01 5.487879e+01 11.01 9.300000e+01 8.669697e+01 6.78
-279 100 1.968000e+03 1.990273e+03 1.12 -2.864273e+03 -2.864273e+03 0.00
-279 117 2.197667e+03 2.223424e+03 1.16 -2.443636e+03 -2.424818e+03 0.77
-279 133 2.361000e+03 2.389485e+03 1.19 -1.967091e+03 -1.925515e+03 2.11
-279 150 2.447000e+03 2.477000e+03 1.21 -1.389273e+03 -1.389273e+03 0.00
-279 167 2.451667e+03 2.480758e+03 1.17 -8.693636e+02 -8.482121e+02 2.43
-279 183 2.373667e+03 2.400182e+03 1.10 -3.759091e+02 -3.370000e+02 10.35
-279 200 2.182000e+03 2.203818e+03 0.99 8.063636e+02 8.063636e+02 0.00
-279 217 1.831000e+03 1.844333e+03 0.72 1.109545e+03 1.119182e+03 0.86
-279 233 1.387000e+03 1.395333e+03 0.60 1.301454e+03 1.313091e+03 0.89
-279 250 9.000000e+02 9.040909e+02 0.45 1.426091e+03 1.426091e+03 0.00
-192 100 4.474000e+03 4.478000e+03 0.09 -8.963273e+03 -8.963273e+03 0.00
-192 117 5.764333e+03 5.772879e+03 0.15 -8.677727e+03 -8.660727e+03 0.20
-192 133 7.601000e+03 7.626939e+03 0.34 -8.012364e+03 -7.913939e+03 1.23
-192 150 9.926000e+03 1.005018e+04 1.24 -5.005364e+03 -5.005364e+03 0.00
-192 167 8.152666e+03 8.190424e+03 0.46 -1.048273e+03 -9.804242e+02 6.47
-192 183 6.285333e+03 6.291394e+03 0.10 -1.567273e+02 -1.298788e+02 17.13
-192 200 5.106000e+03 5.103636e+03 0.05 4.089818e+03 4.089818e+03 0.00
-192 217 3.451333e+03 3.448182e+03 0.09 4.528818e+03 4.538970e+03 0.22
-192 233 2.296333e+03 2.293606e+03 0.12 4.725545e+03 4.737970e+03 0.26
-192 250 1.371000e+03 1.369182e+03 0.13 4.852727e+03 4.852727e+03 0.00
-104 100 2.313000e+03 2.252091e+03 2.63 -1.638145e+04 -1.638145e+04 0.00
-104 117 2.582333e+03 2.504454e+03 3.02 -1.697873e+04 -1.700715e+04 0.17
-104 133 2.738000e+03 2.634667e+03 3.77 -1.775027e+04 -1.782567e+04 0.42
-104 150 2.812000e+03 2.684727e+03 4.53 -1.889009e+04 -1.889009e+04 0.00
-104 167 2.863667e+03 2.737909e+03 4.39 1.075273e+03 1.029818e+03 4.23
-104 183 2.715333e+03 2.602909e+03 4.14 2.909091e+01 5.555636e+03 99.48
-104 200 2.141000e+03 2.063727e+03 3.61 8.215455e+03 8.215455e+03 0.00
-104 217 1.614667e+03 1.567697e+03 2.91 8.128909e+03 8.125546e+03 0.04
-104 233 1.131000e+03 1.100091e+03 2.73 8.064000e+03 8.060606e+03 0.04
-104 250 6.950000e+02 6.768182e+02 2.62 8.026000e+03 8.026000e+03 0.00
-17 100 2.080000e+02 1.780909e+02 14.38 -1.824109e+04 -1.824109e+04 0.00
-17 117 2.550000e+02 2.176667e+02 14.64 -1.866373e+04 -1.868361e+04 0.11
-17 133 3.060000e+02 2.606061e+02 14.83 -1.917873e+04 -1.922606e+04 0.25
-17 150 3.370000e+02 2.867273e+02 14.92 -1.986018e+04 -1.986018e+04 0.00
-17 167 3.270000e+02 2.782121e+02 14.92 6.043636e+02 5.790303e+02 4.19
-17 183 2.946667e+02 2.511818e+02 14.76 1.900000e+01 6.162879e+03 99.69
-17 200 2.280000e+02 1.949091e+02 14.51 9.164545e+03 9.164545e+03 0.00
-17 217 1.763333e+02 1.508788e+02 14.44 9.112546e+03 9.110667e+03 0.02
-17 233 1.180000e+02 1.016667e+02 13.84 9.046182e+03 9.041091e+03 0.06
-17 250 7.200000e+01 6.245455e+01 13.26 8.991545e+03 8.991545e+03 0.00
71 100 -1.790000e+03 -1.811455e+03 1.18 -1.692118e+04 -1.692118e+04 0.00
71 117 -1.921333e+03 -1.945576e+03 1.25 -1.741273e+04 -1.743479e+04 0.13
71 133 -1.833667e+03 -1.868212e+03 1.85 -1.801718e+04 -1.807858e+04 0.34
71 150 -1.551000e+03 -1.609909e+03 3.66 -1.914636e+04 -1.914636e+04 0.00
71 167 -1.739000e+03 -1.780091e+03 2.31 7.631818e+02 7.262424e+02 4.84
71 183 -1.777333e+03 -1.805818e+03 1.58 2.072727e+01 5.704364e+03 99.64
71 200 -1.478000e+03 -1.498727e+03 1.38 8.447636e+03 8.447636e+03 0.00
71 217 -1.167333e+03 -1.184061e+03 1.41 8.391182e+03 8.389515e+03 0.02
71 233 -8.590000e+02 -8.691818e+02 1.17 8.349363e+03 8.345545e+03 0.05
71 250 -5.310000e+02 -5.364546e+02 1.02 8.308273e+03 8.308273e+03 0.00
158 100 -4.544000e+03 -4.544545e+03 0.01 -1.053700e+04 -1.053700e+04 0.00
158 117 -5.933333e+03 -5.934667e+03 0.02 -1.064191e+04 -1.064761e+04 0.05
158 133 -8.090667e+03 -8.095212e+03 0.06 -1.087873e+04 -1.091206e+04 0.31
158 150 -1.294900e+04 -1.306836e+04 0.91 -1.343718e+04 -1.343718e+04 0.00
158 167 -9.196000e+03 -9.195061e+03 0.01 1.734364e+03 1.735848e+03 0.09
158 183 -5.712667e+03 -5.705757e+03 0.12 2.855364e+03 2.946818e+03 3.10
158 200 -4.449000e+03 -4.410909e+03 0.86 3.413455e+03 3.413455e+03 0.00
158 217 -3.422000e+03 -3.418697e+03 0.10 4.719455e+03 4.742333e+03 0.48
158 233 -2.310000e+03 -2.309667e+03 0.01 5.101636e+03 5.122970e+03 0.42
158 250 -1.363000e+03 -1.363182e+03 0.01 5.294455e+03 5.294455e+03 0.00
246 100 -2.275000e+03 -2.227545e+03 2.09 -3.486909e+03 -3.486909e+03 0.00
246 117 -2.560667e+03 -2.504758e+03 2.18 -2.987273e+03 -2.964485e+03 0.76
246 133 -2.761667e+03 -2.699212e+03 2.26 -2.411909e+03 -2.361000e+03 2.11
246 150 -2.852000e+03 -2.786546e+03 2.30 -1.708455e+03 -1.708455e+03 0.00
246 167 -2.825667e+03 -2.761303e+03 2.28 -1.075364e+03 -1.049303e+03 2.42
246 183 -2.698667e+03 -2.638667e+03 2.22 -4.690000e+02 -4.207576e+02 10.29
246 200 -2.418000e+03 -2.365636e+03 2.17 8.873636e+02 8.873636e+02 0.00
246 217 -1.902000e+03 -1.865727e+03 1.91 1.316182e+03 1.330848e+03 1.10
246 233 -1.379000e+03 -1.356091e+03 1.66 1.614091e+03 1.633424e+03 1.18
246 250 -8.650000e+02 -8.519091e+02 1.51 1.818818e+03 1.818818e+03 0.00
333 100 -4.350000e+02 -4.180909e+02 3.89 -1.609818e+03 -1.609818e+03 0.00
333 117 -4.846667e+02 -4.655758e+02 3.94 -1.343909e+03 -1.332061e+03 0.88
333 133 -5.500000e+02 -5.238182e+02 4.76 -1.042273e+03 -1.013061e+03 2.80
333 150 -4.930000e+02 -4.799091e+02 2.66 -5.391818e+02 -5.391818e+02 0.00
333 167 -3.473333e+02 -3.613333e+02 3.87 -2.830000e+02 -3.366364e+02 15.93
333 183 -3.636667e+02 -3.520303e+02 3.20 -4.345454e+01 -9.060606e+01 52.04
333 200 -1.790000e+02 -1.451818e+02 18.89 1.267273e+02 1.267273e+02 0.00
333 217 -3.666667e+00 -2.212121e+00 39.67 4.704545e+02 4.713030e+02 0.18
333 233 0.000000e+00 0.000000e+00 0.00 4.774545e+02 4.778182e+02 0.08
333 250 2.000000e+00 1.454545e+00 27.27 4.740000e+02 4.740000e+02 0.00
421 100 -6.410000e+02 -6.456364e+02 0.72 -7.755455e+02 -7.755455e+02 0.00
421 117 -7.830000e+02 -7.866364e+02 0.46 -5.883636e+02 -5.804545e+02 1.34
421 133 -8.800000e+02 -8.819091e+02 0.22 -3.960000e+02 -3.806667e+02 3.87
421 150 -8.770000e+02 -8.737273e+02 0.37 -2.356364e+02 -2.356364e+02 0.00
421 167 -8.166667e+02 -8.139394e+02 0.33 -1.481818e+02 -1.448485e+02 2.25
421 183 -7.583333e+02 -7.561515e+02 0.29 -7.472727e+01 -6.921212e+01 7.38
421 200 -7.040000e+02 -7.015454e+02 0.35 -1.000000e+00 -1.000000e+00 0.00
421 217 -6.510000e+02 -6.487273e+02 0.35 6.500000e+01 6.800000e+01 4.41
421 233 -5.983333e+02 -5.951515e+02 0.53 1.424545e+02 1.497879e+02 4.90
421 250 -5.310000e+02 -5.269091e+02 0.77 2.583636e+02 2.583636e+02 0.00

21 points with |B| < 50.0 Gauss omitted.

Discrepancies

  • Bx: 39.7% at z=333, r=217 cm (abs diff: 1.454545e+00 Gauss)
  • Bz: 99.7% at z=-17, r=183 cm (abs diff: 6.143879e+03 Gauss)

Bx discrepancy (z=333, r=217): pos=(216.7, 0.0, 333.1) cm, r=216.67 cm

  • Cell: ir=108 (r=[216, 218]), iz=566 (z=[332, 334])
  • Fractions: fr=0.3333, fz=0.5455
  • Br corners: [-4.000000, -1.000000, -3.000000, -1.000000]
  • Bz corners: [471.000001, 469.999984, 472.999997, 472.999997]
  • Br variation: along r=1.000000, along z=3.000000
  • Bz variation: along r=1.999997, along z=1.000017

Bz discrepancy (z=-17, r=183): pos=(183.3, 0.0, -16.7) cm, r=183.33 cm

  • Cell: ir=91 (r=[182, 184]), iz=391 (z=[-18, -16])
  • Fractions: fr=0.6667, fz=0.6364
  • Br corners: [299.999993, 230.999999, 292.000007, 223.999992]
  • Bz corners: [19.000000, 19.000000, 9230.999947, 9236.999750]
  • Br variation: along r=7.999986, along z=68.999995
  • Bz variation: along r=9211.999946, along z=0.000000

4. Barrel boundary, fine z near midplane

Dense z sampling near z=0 across the radial transition.

z r Bx default Bx covfie Bx rel% Bz default Bz covfie Bz rel%
-100 130 2.401000e+03 2.401000e+03 0.00 -1.773800e+04 -1.773800e+04 0.00
-100 143 2.392143e+03 2.392143e+03 0.00 -1.842700e+04 -1.848314e+04 0.30
-100 156 2.407857e+03 2.407857e+03 0.00 4.060000e+02 1.510000e+03 73.11
-100 169 2.461857e+03 2.461857e+03 0.00 8.700000e+02 8.337143e+02 4.17
-100 181 2.402286e+03 2.402286e+03 0.00 1.410000e+02 5.957143e+01 57.75
-100 194 2.046286e+03 2.046286e+03 0.00 8.323000e+03 8.321286e+03 0.02
-100 207 1.713000e+03 1.713000e+03 0.00 8.265000e+03 8.260428e+03 0.06
-100 220 1.377000e+03 1.377000e+03 0.00 8.198000e+03 8.198000e+03 0.00
-82 130 1.658000e+03 1.653636e+03 0.26 -1.786736e+04 -1.786736e+04 0.00
-82 143 1.193000e+03 1.182013e+03 0.92 -1.828373e+04 -1.833714e+04 0.29
-82 156 8.520000e+02 8.271169e+02 2.92 6.100000e+01 1.058403e+03 94.24
-82 169 1.504143e+03 1.498844e+03 0.35 3.908182e+02 3.724546e+02 4.70
-82 181 1.636143e+03 1.632026e+03 0.25 6.209091e+01 2.754545e+01 55.64
-82 194 1.455286e+03 1.451662e+03 0.25 8.538545e+03 8.537701e+03 0.01
-82 207 1.236000e+03 1.232779e+03 0.26 8.507000e+03 8.504195e+03 0.03
-82 220 1.010000e+03 1.007091e+03 0.29 8.478363e+03 8.478363e+03 0.00
-64 130 1.553000e+03 1.552455e+03 0.04 -1.800346e+04 -1.800346e+04 0.00
-64 143 2.151000e+03 2.169390e+03 0.85 -1.770418e+04 -1.763468e+04 0.39
-64 156 4.234857e+03 4.148338e+03 2.04 -1.357636e+03 -8.070389e+02 40.56
-64 169 1.702143e+03 1.709104e+03 0.41 -7.654545e+01 -6.438961e+01 15.88
-64 181 1.476429e+03 1.475208e+03 0.08 1.072727e+01 6.636364e+00 38.14
-64 194 1.225571e+03 1.221909e+03 0.30 8.722909e+03 8.723026e+03 0.00
-64 207 9.915714e+02 9.873896e+02 0.42 8.718545e+03 8.717403e+03 0.01
-64 220 7.820000e+02 7.781818e+02 0.49 8.703182e+03 8.703182e+03 0.00
-45 130 1.254000e+03 1.236818e+03 1.37 -1.865536e+04 -1.865536e+04 0.00
-45 143 1.566143e+03 1.537117e+03 1.85 -1.913273e+04 -1.917866e+04 0.24
-45 156 1.678571e+03 1.643468e+03 2.09 -2.230000e+02 8.904286e+02 125.04
-45 169 1.414000e+03 1.392922e+03 1.49 4.485454e+02 4.272468e+02 4.75
-45 181 1.221571e+03 1.206766e+03 1.21 6.863636e+01 3.051948e+01 55.53
-45 194 9.757143e+02 9.656623e+02 1.03 8.982364e+03 8.981467e+03 0.01
-45 207 7.598571e+02 7.515584e+02 1.09 8.944273e+03 8.940688e+03 0.04
-45 220 5.820000e+02 5.751818e+02 1.17 8.904182e+03 8.904182e+03 0.00
-27 130 6.430000e+02 6.175455e+02 3.96 -1.902473e+04 -1.902473e+04 0.00
-27 143 7.262857e+02 6.965195e+02 4.10 -1.947955e+04 -1.951469e+04 0.18
-27 156 7.502857e+02 7.193247e+02 4.13 -3.232727e+02 8.302078e+02 138.94
-27 169 7.071429e+02 6.789870e+02 3.98 5.293636e+02 5.073636e+02 4.16
-27 181 6.500000e+02 6.248052e+02 3.88 8.836364e+01 3.881818e+01 56.07
-27 194 5.355714e+02 5.146364e+02 3.91 9.148000e+03 9.147000e+03 0.01
-27 207 4.380000e+02 4.209610e+02 3.89 9.109273e+03 9.105844e+03 0.04
-27 220 3.340000e+02 3.223636e+02 3.48 9.053364e+03 9.053364e+03 0.00
-9 130 2.100000e+01 -9.909091e+00 147.19 -1.912500e+04 -1.912500e+04 0.00
-9 143 2.200000e+01 -1.274026e+01 157.91 -1.956055e+04 -1.959312e+04 0.17
-9 156 2.300000e+01 -1.290909e+01 156.13 -3.630000e+02 7.967143e+02 145.56
-9 169 2.200000e+01 -1.196104e+01 154.37 5.270000e+02 5.055714e+02 4.07
-9 181 2.100000e+01 -1.049351e+01 149.97 8.900000e+01 3.900000e+01 56.18
-9 194 1.900000e+01 -7.233766e+00 138.07 9.196000e+03 9.194792e+03 0.01
-9 207 1.700000e+01 -4.103896e+00 124.14 9.149546e+03 9.145805e+03 0.04
-9 220 1.600000e+01 -1.727273e+00 110.80 9.107000e+03 9.107000e+03 0.00
9 130 -6.010000e+02 -6.380909e+02 5.81 -1.901236e+04 -1.901236e+04 0.00
9 143 -6.808571e+02 -7.260520e+02 6.22 -1.946955e+04 -1.950516e+04 0.18
9 156 -7.032857e+02 -7.507403e+02 6.32 -3.220909e+02 8.306883e+02 138.77
9 169 -6.601428e+02 -7.025325e+02 6.03 5.254545e+02 5.035844e+02 4.16
9 181 -6.050000e+02 -6.422468e+02 5.80 8.745455e+01 3.855844e+01 55.91
9 194 -4.957143e+02 -5.261818e+02 5.79 9.140454e+03 9.139454e+03 0.01
9 207 -4.015714e+02 -4.265844e+02 5.86 9.102545e+03 9.099117e+03 0.04
9 220 -3.020000e+02 -3.189091e+02 5.30 9.043909e+03 9.043909e+03 0.00
27 130 -1.208000e+03 -1.244909e+03 2.96 -1.862191e+04 -1.862191e+04 0.00
27 143 -1.515000e+03 -1.585727e+03 4.46 -1.908627e+04 -1.913295e+04 0.24
27 156 -1.625571e+03 -1.714571e+03 5.19 -2.279091e+02 8.753117e+02 126.04
27 169 -1.361000e+03 -1.407455e+03 3.30 4.152727e+02 3.949610e+02 4.89
27 181 -1.170571e+03 -1.202117e+03 2.62 6.281818e+01 2.775325e+01 55.82
27 194 -9.300000e+02 -9.520909e+02 2.32 8.963818e+03 8.962909e+03 0.01
27 207 -7.198571e+02 -7.383117e+02 2.50 8.928364e+03 8.925299e+03 0.03
27 220 -5.470000e+02 -5.616364e+02 2.61 8.891273e+03 8.891273e+03 0.00
45 130 -1.501000e+03 -1.497364e+03 0.24 -1.799018e+04 -1.799018e+04 0.00
45 143 -2.088286e+03 -1.926208e+03 7.76 -1.755200e+04 -1.744653e+04 0.60
45 156 -4.172571e+03 -3.892571e+03 6.71 -3.903364e+03 -2.279545e+03 41.60
45 169 -1.636000e+03 -1.591532e+03 2.72 -1.315455e+02 -1.152078e+02 12.42
45 181 -1.413143e+03 -1.414390e+03 0.09 5.545455e+00 4.441558e+00 19.91
45 194 -1.169714e+03 -1.182182e+03 1.05 8.710546e+03 8.710584e+03 0.00
45 207 -9.431428e+02 -9.584156e+02 1.59 8.707546e+03 8.706403e+03 0.01
45 220 -7.410000e+02 -7.555455e+02 1.93 8.692273e+03 8.692273e+03 0.00
64 130 -1.601000e+03 -1.647636e+03 2.83 -1.793318e+04 -1.793318e+04 0.00
64 143 -1.122429e+03 -1.230195e+03 8.76 -1.841227e+04 -1.846994e+04 0.31
64 156 -7.722857e+02 -9.615195e+02 19.68 6.327273e+01 1.092935e+03 94.21
64 169 -1.418571e+03 -1.477247e+03 3.97 4.396364e+02 4.185974e+02 4.79
64 181 -1.549143e+03 -1.591104e+03 2.64 6.736364e+01 2.970130e+01 55.91
64 194 -1.381714e+03 -1.416779e+03 2.47 8.542091e+03 8.541091e+03 0.01
64 207 -1.175143e+03 -1.205416e+03 2.51 8.505000e+03 8.502143e+03 0.03
64 220 -9.590000e+02 -9.860000e+02 2.74 8.473545e+03 8.473545e+03 0.00
82 130 -2.345000e+03 -2.438636e+03 3.84 -1.778855e+04 -1.778855e+04 0.00
82 143 -2.314429e+03 -2.432481e+03 4.85 -1.848764e+04 -1.854331e+04 0.30
82 156 -2.304429e+03 -2.430922e+03 5.20 3.590000e+02 1.466273e+03 75.52
82 169 -2.337000e+03 -2.449208e+03 4.58 8.483637e+02 8.127533e+02 4.20
82 181 -2.271714e+03 -2.371584e+03 4.21 1.376364e+02 5.848052e+01 57.51
82 194 -1.945714e+03 -2.022727e+03 3.81 8.330909e+03 8.329195e+03 0.02
82 207 -1.634714e+03 -1.697312e+03 3.69 8.268909e+03 8.264857e+03 0.05
82 220 -1.326000e+03 -1.366000e+03 2.93 8.196636e+03 8.196636e+03 0.00
100 130 -3.483000e+03 -3.483000e+03 0.00 -1.720200e+04 -1.720200e+04 0.00
100 143 -3.661571e+03 -3.661571e+03 0.00 -1.800900e+04 -1.807071e+04 0.34
100 156 -3.745286e+03 -3.745286e+03 0.00 7.580000e+02 1.852571e+03 59.08
100 169 -3.715429e+03 -3.715429e+03 0.00 1.099000e+03 1.054429e+03 4.06
100 181 -3.549571e+03 -3.549571e+03 0.00 1.830000e+02 7.657143e+01 58.16
100 194 -2.949714e+03 -2.949714e+03 0.00 7.919000e+03 7.918428e+03 0.01
100 207 -2.375429e+03 -2.375429e+03 0.00 7.832000e+03 7.823429e+03 0.11
100 220 -1.861000e+03 -1.861000e+03 0.00 7.752000e+03 7.752000e+03 0.00

Discrepancies

  • Bx: 157.9% at z=-9, r=143 cm (abs diff: 3.474026e+01 Gauss)
  • Bz: 145.6% at z=-9, r=156 cm (abs diff: 1.159714e+03 Gauss)

Bx discrepancy (z=-9, r=143): pos=(142.9, 0.0, -9.1) cm, r=142.86 cm

  • Cell: ir=71 (r=[142, 144]), iz=395 (z=[-10, -8])
  • Fractions: fr=0.4286, fz=0.4545
  • Br corners: [22.000000, -54.000001, 22.000000, -55.000000]
  • Bz corners: [-19560.999870, -19559.999704, -19637.000561, -19636.000395]
  • Br variation: along r=0.000000, along z=76.000001
  • Bz variation: along r=76.000690, along z=1.000166

Bz discrepancy (z=-9, r=156): pos=(155.7, 0.0, -9.1) cm, r=155.71 cm

  • Cell: ir=77 (r=[154, 156]), iz=395 (z=[-10, -8])
  • Fractions: fr=0.8571, fz=0.4545
  • Br corners: [23.000001, -55.999998, 23.000001, -55.999998]
  • Bz corners: [-362.999998, -362.999998, 989.999995, 989.999995]
  • Br variation: along r=0.000000, along z=78.999999
  • Bz variation: along r=1352.999993, along z=0.000000

5. Forward/backward transition

z regions where the solenoid field begins and ends.

z r Bx default Bx covfie Bx rel% Bz default Bz covfie Bz rel%
-440 10 9.900000e+01 1.058571e+02 6.48 -5.600000e+01 -5.600000e+01 0.00
-440 37 1.161857e+03 1.162714e+03 0.07 -6.567143e+02 -6.532041e+02 0.53
-440 64 1.924286e+03 1.925143e+03 0.04 -5.838571e+02 -5.829796e+02 0.15
-440 91 2.531857e+03 2.533041e+03 0.05 -4.987143e+02 -4.940204e+02 0.94
-440 119 2.948571e+03 2.949714e+03 0.04 -3.905714e+02 -3.882041e+02 0.61
-440 146 3.155000e+03 3.156408e+03 0.04 -2.844286e+02 -2.774490e+02 2.45
-440 173 3.166429e+03 3.167429e+03 0.03 -1.785714e+02 -1.758776e+02 1.51
-440 200 3.021000e+03 3.021857e+03 0.03 -9.700000e+01 -9.700000e+01 0.00
-418 10 8.600000e+01 6.885714e+01 19.93 -1.259857e+03 -1.259857e+03 0.00
-418 37 3.757143e+01 4.406122e+01 14.73 -1.266571e+03 -1.262571e+03 0.32
-418 64 5.628571e+01 6.571428e+01 14.35 -1.138571e+03 -1.136980e+03 0.14
-418 91 7.271429e+01 8.471429e+01 14.17 -9.707143e+02 -9.606123e+02 1.04
-418 119 8.100000e+01 9.471429e+01 14.48 -7.547143e+02 -7.501428e+02 0.61
-418 146 8.000000e+01 9.371429e+01 14.63 -5.420000e+02 -5.282857e+02 2.53
-418 173 6.814286e+01 7.965306e+01 14.45 -3.301429e+02 -3.245102e+02 1.71
-418 200 4.800000e+01 5.657143e+01 15.15 -1.651429e+02 -1.651429e+02 0.00
-397 10 3.500000e+01 3.557143e+01 1.61 -1.402000e+03 -1.402000e+03 0.00
-397 37 1.144286e+02 1.184286e+02 3.38 -1.349857e+03 -1.345857e+03 0.30
-397 64 1.835714e+02 1.905102e+02 3.64 -1.215286e+03 -1.213571e+03 0.14
-397 91 2.371429e+02 2.461224e+02 3.65 -1.034143e+03 -1.022714e+03 1.11
-397 119 2.662857e+02 2.765714e+02 3.72 -7.964286e+02 -7.911224e+02 0.67
-397 146 2.641429e+02 2.744286e+02 3.75 -5.591429e+02 -5.437143e+02 2.76
-397 173 2.252857e+02 2.341837e+02 3.80 -3.204286e+02 -3.137551e+02 2.08
-397 200 1.570000e+02 1.632857e+02 3.85 -1.357143e+02 -1.357143e+02 0.00
-375 10 5.500000e+01 5.557143e+01 1.03 -1.593286e+03 -1.593286e+03 0.00
-375 37 1.987143e+02 2.010000e+02 1.14 -1.527000e+03 -1.522020e+03 0.33
-375 64 3.251429e+02 3.289388e+02 1.15 -1.372429e+03 -1.370531e+03 0.14
-375 91 4.232857e+02 4.287143e+02 1.27 -1.163286e+03 -1.149918e+03 1.15
-375 119 4.805714e+02 4.866531e+02 1.25 -8.831429e+02 -8.771429e+02 0.68
-375 146 4.812857e+02 4.876122e+02 1.30 -5.964286e+02 -5.775714e+02 3.16
-375 173 4.125714e+02 4.182857e+02 1.37 -2.984286e+02 -2.901633e+02 2.77
-375 200 2.840000e+02 2.877143e+02 1.29 -6.971428e+01 -6.971428e+01 0.00
-354 10 8.200000e+01 8.200000e+01 0.00 -1.885000e+03 -1.885000e+03 0.00
-354 37 2.975714e+02 2.975714e+02 0.00 -1.806000e+03 -1.800286e+03 0.32
-354 64 4.908571e+02 4.908571e+02 0.00 -1.624000e+03 -1.621571e+03 0.15
-354 91 6.454286e+02 6.454286e+02 0.00 -1.373000e+03 -1.357286e+03 1.14
-354 119 7.424286e+02 7.424286e+02 0.00 -1.031000e+03 -1.023286e+03 0.75
-354 146 7.602857e+02 7.602857e+02 0.00 -6.670000e+02 -6.421428e+02 3.73
-354 173 6.638572e+02 6.638572e+02 0.00 -2.600000e+02 -2.480000e+02 4.62
-354 200 4.270000e+02 4.270000e+02 0.00 3.600000e+01 3.600000e+01 0.00
408 37 -2.457143e+02 -2.457143e+02 0.00 -1.368000e+03 -1.363429e+03 0.33
408 64 -4.347143e+02 -4.347143e+02 0.00 -1.223000e+03 -1.221143e+03 0.15
408 91 -5.781429e+02 -5.781429e+02 0.00 -1.030000e+03 -1.017857e+03 1.18
408 119 -7.290000e+02 -7.290000e+02 0.00 -7.410000e+02 -7.335715e+02 1.00
408 146 -8.978572e+02 -8.978572e+02 0.00 -3.780000e+02 -3.548572e+02 6.12
408 173 -8.531428e+02 -8.531428e+02 0.00 -1.310000e+02 -1.267143e+02 3.27
408 200 -7.530000e+02 -7.530000e+02 0.00 -7.000000e+00 -7.000000e+00 0.00
429 37 -2.030000e+02 -2.022857e+02 0.35 -1.080143e+03 -1.076306e+03 0.36
429 64 -3.961429e+02 -4.033877e+02 1.80 -9.522857e+02 -9.505306e+02 0.18
429 91 -6.415714e+02 -6.594286e+02 2.71 -7.374286e+02 -7.231429e+02 1.94
429 119 -8.428571e+02 -8.502041e+02 0.86 -4.491429e+02 -4.430612e+02 1.35
429 146 -8.418572e+02 -8.332857e+02 1.02 -2.477143e+02 -2.374286e+02 4.15
429 173 -7.590000e+02 -7.528775e+02 0.81 -1.085714e+02 -1.051429e+02 3.16
429 200 -6.720000e+02 -6.670000e+02 0.74 7.142857e-01 7.142857e-01 0.00
451 37 -3.195714e+02 -3.170000e+02 0.80 -7.067143e+02 -7.032857e+02 0.49
451 64 -5.620000e+02 -5.572857e+02 0.84 -5.907143e+02 -5.892041e+02 0.26
451 91 -7.050000e+02 -7.002857e+02 0.67 -4.445714e+02 -4.360000e+02 1.93
451 119 -7.530000e+02 -7.487143e+02 0.57 -2.890000e+02 -2.861020e+02 1.00
451 146 -7.344286e+02 -7.310000e+02 0.47 -1.730000e+02 -1.661429e+02 3.96
451 173 -6.778572e+02 -6.754694e+02 0.35 -7.871429e+01 -7.614286e+01 3.27
451 200 -6.000000e+02 -5.978571e+02 0.36 -1.428571e+00 -1.428571e+00 0.00
472 37 -2.702857e+02 -2.699388e+02 0.13 -3.262857e+02 -3.251429e+02 0.35
472 64 -4.807143e+02 -4.800204e+02 0.14 -2.760000e+02 -2.753061e+02 0.25
472 91 -6.130000e+02 -6.123878e+02 0.10 -2.130000e+02 -2.095306e+02 1.63
472 119 -6.722857e+02 -6.717143e+02 0.08 -1.450000e+02 -1.436122e+02 0.96
472 146 -6.712857e+02 -6.708572e+02 0.06 -9.185714e+01 -8.842857e+01 3.73
472 173 -6.292857e+02 -6.288572e+02 0.07 -4.642857e+01 -4.520408e+01 2.64
472 200 -5.570000e+02 -5.565714e+02 0.08 -9.142857e+00 -9.142857e+00 0.00

60 points with |B| < 50.0 Gauss omitted.

Discrepancies

  • Bx: 19.9% at z=-418, r=10 cm (abs diff: 1.714286e+01 Gauss)
  • Bz: 6.1% at z=408, r=146 cm (abs diff: 2.314283e+01 Gauss)

Bx discrepancy (z=-418, r=10): pos=(10.0, 0.0, -418.3) cm, r=10.00 cm

  • Cell: ir=5 (r=[10, 12]), iz=190 (z=[-420, -418])
  • Fractions: fr=0.0000, fz=0.8571
  • Br corners: [86.000003, 66.000000, 85.000005, 68.999999]
  • Bz corners: [-1240.999997, -1263.000071, -1268.000007, -1277.000010]
  • Br variation: along r=0.999998, along z=20.000003
  • Bz variation: along r=27.000010, along z=22.000074

Bz discrepancy (z=408, r=146): pos=(145.7, 0.0, 408.0) cm, r=145.71 cm

  • Cell: ir=72 (r=[144, 146]), iz=604 (z=[408, 410])
  • Fractions: fr=0.8571, fz=0.0000
  • Br corners: [-891.000032, -895.999968, -899.000019, -904.000029]
  • Bz corners: [-377.999991, -357.000008, -351.000018, -331.000015]
  • Br variation: along r=7.999986, along z=4.999936
  • Bz variation: along r=26.999973, along z=20.999983

6. Gradient statistics

| Gradient | Max |grad| (Gauss/cm) | Used by |
|----------|--------------------:|---------|
| dBr/dr | 1485.75 | Default Celeritas |
| dBr/dz | 2341.00 | Covfie bilinear (cross-term) |
| dBz/dz | 1390.25 | Default Celeritas |
| dBz/dr | 4876.75 | Covfie bilinear (cross-term) |

Cross/along gradient ratio (Br): 1.6x
Cross/along gradient ratio (Bz): 3.5x

When the cross-gradient ratio is >= 1, the 1D interpolation is missing variation comparable to or larger than what it captures.

Copy link
Member

@sethrj sethrj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @rahmans1 , it took me a minute to grasp the goal(s) of this PR: the idea is that ePIC stores its magnetic field as a covfie binary file?

I think since the existing RZ map field is an older input definition and not used any more, let's simply replace it: this should simplify the code greatly.

I think it would help a lot to also break this into three smaller PRs:

  1. Importing fields from covfie (just loading field inputs, not changing test values). This should include some small binary test files that have size {2,3,4} for cartesian (to allow us to make sure we're not screwing up the strides) and {2, 3} for RZ. You can just test the imported Params data, not even bothering to evaluate the field. Alternatively, we could define an alternative input with just the covfie filename and field options, rather than having a celer->covfie->celer flow, and that could load the file without a translation layer (though you may need to scale the units).
  2. Replacing the RZ map field with a covfie back-end. If it's easier/more natural for covfie to use [r][z] stride rather than the fortran [Z][R] stride that's there not, do that.
  3. Adding the DD4hep interface to the new capabilities.

We definitely want non-dd users to be able to take advantage of this cool new capability! Thanks!

{
return {vec[0], vec[1]};
}
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's possible this could be combined with the 3D CovfieFieldTraits, but I think that it would be more confusing. Since there's nothing specific to RZ in this one or XYZ in the existing, could you rename this to CovfieFieldTraits2 and @esseivaju 's existing one to CovfieFieldTraits3?

Comment on lines +51 to +54
celeritas::real_type min_r_;
celeritas::real_type max_r_;
celeritas::real_type min_z_;
celeritas::real_type max_z_;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to keep a copy of these here but not the XYZ field? If it's necessary, then I would considering refactoring the data to have:

EnumArray<Bound, Real2> extents;

and store a reference to those. You'd access the min_r as extents[Bound::lo, 0], and you could define locally

constexpr auto lo = Bounds::lo;
constexpr auto hi = Bounds::hi;
constexpr auto R = 0;
constexpr auto Z = 1;

Or since that may be overthinking it, perhaps:

struct RZExtents
{
    real_type min_r;
    real_type max_r;
...
};

Comment on lines +207 to +212
<< "Celeritas uniform field mode only supports "
"ConstantField "
"components. Found non-constant field in DD4hep "
"description."
" Set FieldMapFile to use a covfie field map "
"instead.");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reindent; use R"(...)" if you want.

// Copyright Celeritas contributors: see top-level COPYRIGHT file for details
// SPDX-License-Identifier: (Apache-2.0 OR MIT)
//---------------------------------------------------------------------------//
//! \file ddceler/LoadCovfieField.covfie.cc
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you move this to src/celeritas/field?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request external Dependencies and framework-oriented features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants