Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC: Magnetic field coordinate specification #280

Open
wdconinc opened this issue Oct 3, 2019 · 1 comment
Open

RFC: Magnetic field coordinate specification #280

wdconinc opened this issue Oct 3, 2019 · 1 comment

Comments

@wdconinc
Copy link
Member

wdconinc commented Oct 3, 2019

Is your feature request related to a problem? Please describe.

  1. 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.
  2. 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.
  3. 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.
  4. 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

<auxiliary auxtype="FieldMapFile" auxvalue="map_directory/blockyHybrid_rm_3.0.txt">
<auxiliary auxtype="FieldMapRef"  auxvalue="global"> <!-- options: "global" | "local", where "local" (preferred) considers zero to be at origin of enclosing volume -->
<auxiliary auxtype="FieldMapScale"   auxvalue="1.0"> <!-- scale the field map -->
<auxiliary auxtype="FieldMapCurrent" auxvalue="1000.0*A"> <!-- set the field map current -->
<auxiliary auxtype="FieldMapZOffset" auxvalue="-5.087*m"> <!-- shift the field map in z -->

that can be loaded as an entity in with:

<!DOCTYPE gdml [
<!ENTITY field SYSTEM "fields/blockyHybrid_rm_3.0.xml">
]>
...
    <volume name="logicDownstream">
      <materialref ref="VacuumColl"/>
      <solidref ref="tubeDownstream"/>
      &field;

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.

@wdconinc
Copy link
Member Author

wdconinc commented Oct 3, 2019

Requesting comments from @cameronc137 @rahmans1 @rakithab.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant