gemc / source

gemc website:
gemc.jlab.org
14 stars 71 forks source link

stitch multiple global field map #148

Open zhaozhiwen opened 5 years ago

zhaozhiwen commented 5 years ago

sometimes local field maps are not convenient because it needs a volume. for example, in EIC, a beamline magnet can have a volume with a local map including empty space in middle where a beam pipe needs to passing through. Then this beampipe would overlap with the magnet volume. The only way to avoid this now is to make beampipe in pieces when it go through many magnets and this becomes tedious. An easy solution would be make those beamline magnet maps all global maps.

If we can have multiple global field map and stitch them together, it would be great for many things.

maureeungaro commented 5 years ago

This would be useful indeed. Perhaps with a single field but with variable steps? Large step where there is no field. Or do you have in mind some other solution?

zhaozhiwen commented 5 years ago

eic beamline has about 20 magnets and each of them have different location and size. I think we want to keep them as individual map files. If they can all be loaded in as global maps and gemc can just provide field value at any location, it would be good. I think this can be done in code by two ways

  1. looping through all global maps for any location when field value is requested, this is easy to code but could be bad for running
  2. define an object which go through all global maps at once and know each field boundary, for any location when field value is requested, ask this object which map covers this location, then get value from that map

In case where map overlaps, get field value from different maps and add them together.