You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Magnetic fields in geant4 can be specified within a single volume or as a global field (i.e. associated to the world volume). Since we need to include fringe fields that extend beyond the magnet volumes, we need to use the global field approach.
Currently magnetic field maps files are specified in a macro, not in the standalone gdml geometry. This violates geometry encapsulation and separation of macros from geometry.
Magnetic field maps are with respect to a global coordinate system that is arbitrary and could change from field map to field map. This means a single load command will only continue to work if we don't change the coordinate system.
The origin of our current magnetic field maps corresponds to an arbitrary non-physical point that used to be the center of the target but isn't anymore. This introduces arbitrariness and potential for errors.
Describe the solution you'd like
It would be preferable to add the field map metadata (origin, etc) to the field map in a way that cannot be separated. It would be preferable to have new magnetic field maps generated in a coordinate system that has a physical connection to only the magnet system it describes (e.g. center of mass of the toroid, middle of z extent of the toroid). It would be preferable to load field maps through the gdml files, not macros, and in a way that connects them to the origin of the volume that loads them, so that a shift of the material volumes will automatically cause the same shift in the fields.
A possible solution is helper xml entities (geometry/fields/blockyHybrid_rm_3.0.xml) like
<auxiliaryauxtype="FieldMapFile"auxvalue="map_directory/blockyHybrid_rm_3.0.txt">
<auxiliaryauxtype="FieldMapRef"auxvalue="global"> <!-- options: "global" | "local", where "local" (preferred) considers zero to be at origin of enclosing volume -->
<auxiliaryauxtype="FieldMapScale"auxvalue="1.0"> <!-- scale the field map -->
<auxiliaryauxtype="FieldMapCurrent"auxvalue="1000.0*A"> <!-- set the field map current -->
<auxiliaryauxtype="FieldMapZOffset"auxvalue="-5.087*m"> <!-- shift the field map in z -->
Describe alternatives you've considered
Alternative approaches are:
Requiring field map loading with /control/execute macros/fields/blockyHybrid_rm_3.0.mac with a metadata macro for each field allows us to solve 3 above.
Keeping the current situation.
Additional context
No change to current field maps required. All field maps can start in "global" mode but can transition to "local" mode without change. Old geometry could be easily adapted to include these field maps and can then run with new simulation code.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
Describe the solution you'd like
It would be preferable to add the field map metadata (origin, etc) to the field map in a way that cannot be separated. It would be preferable to have new magnetic field maps generated in a coordinate system that has a physical connection to only the magnet system it describes (e.g. center of mass of the toroid, middle of z extent of the toroid). It would be preferable to load field maps through the gdml files, not macros, and in a way that connects them to the origin of the volume that loads them, so that a shift of the material volumes will automatically cause the same shift in the fields.
A possible solution is helper xml entities (geometry/fields/blockyHybrid_rm_3.0.xml) like
that can be loaded as an entity in with:
Describe alternatives you've considered
Alternative approaches are:
/control/execute macros/fields/blockyHybrid_rm_3.0.mac
with a metadata macro for each field allows us to solve 3 above.Additional context
No change to current field maps required. All field maps can start in "global" mode but can transition to "local" mode without change. Old geometry could be easily adapted to include these field maps and can then run with new simulation code.
The text was updated successfully, but these errors were encountered: