Difference between revisions of "Magnetic Field Map"

From Hall A Wiki
Jump to: navigation, search
(Field map files)
(Link to new wiki)
 
(33 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== How to produce the filed map ==
+
This page has been moved to [https://solid.jlab.org/wiki/index.php/Magnetic_Field_Map https://solid.jlab.org/wiki/index.php/Magnetic_Field_Map] in the new [https://solid.jlab.org/wiki SoLID Wiki]. Please do not edit this page.
* use program "Possion Superfish" from LANL http://laacg1.lanl.gov/laacg/services/download_sf.phtml or local copy [http://hallaweb.jlab.org/12GeV/SOLID/download/PoissonSuperfish_7.18.exe]
+
: It's a windows program and need installation, it can run with wine in linux or winXP, but not win7
+
: see manuals for detailed help, especially for the postprocessor program SF7.EXE
+
* produce mesh by AUTOMESH.EXE with input from a ".am" file, output file will be ".T35" with only geometry and material
+
* then run POISSON.EXE with the ".T35" file which will be added with field.
+
* use WSFPLOT.EXE to view the ".T35" file
+
* then run SF7.EXE on the ".T35" file, do the field extrapolation for a line, arc or grid, the result is in a txt file "OUTSF7.TXT"
+
: a ".TBL" filed file may be produced also which can be directly viewed by TABLPLOT.EXE
+
  
== Field map files ==
+
Refer to the design of [[Solid_Magnet]]
  
all files are at svn "database_io/halla12/solid/field/"
+
== GEMC field map location ==
  
* BaBar_from_Eugene has center of solenoid is at 600cm)
+
located at Solid website http://hallaweb.jlab.org/12GeV/SoLID/download/field/
* BaBar magnet files created by Zhiwen is based on Eugene's file but moved to the center of solenoid to origin
+
  
== create field map for GEMC from possion output ==
+
*[http://hallaweb.jlab.org/12GeV/SoLID/download/field/solenoid_BaBar.dat  BaBar map]
 +
*[http://hallaweb.jlab.org/12GeV/SoLID/download/field/solenoid_CLEO.dat  CLEO map]
 +
*[http://hallaweb.jlab.org/12GeV/SoLID/download/field/solenoid_CDF.dat  CDF map]
 +
*[http://hallaweb.jlab.org/12GeV/SoLID/download/field/solenoid_ZEUS.dat  ZEUS map]
 +
*[http://hallaweb.jlab.org/12GeV/SoLID/download/field/solenoid_HALLD.dat  HallD map]
 +
*[http://hallaweb.jlab.org/12GeV/SoLID/download/field/solenoid_SolCust.dat  SolCust map]
  
[http://hallaweb.jlab.org/12GeV/SoLID/download/solenoid_BaBar.dat solenoid_BaBar.dat]
+
== map script ==
  
== filed map file info in database ==
+
checkout from SoLID_GEMC svn "database_io/field/"
 +
 
 +
or
 +
 
 +
download
 +
 
 +
https://jlabsvn.jlab.org/svnroot/solid/solid_gemc/database_io/field/SF7toGEMCmap.C
 +
 
 +
https://jlabsvn.jlab.org/svnroot/solid/solid_gemc/database_io/field/SF7map_compare.C
 +
 
 +
=== convert SF7 to GEMC map ===
 +
 
 +
For solenoid type of magnet, assume azimuthal symmetry.
 +
 
 +
SF7 map format produced by PossionSuperfish program SF7.exe contain text lines for explanation, map range and grid size, map values (R, Z, Br, Bz, B, A, dBz/dr, dBr/dz, field index).
 +
 
 +
GEMC map format requires R, Z, Br, Bz
 +
 
 +
Additional difference is SF7 map values are in order of R increasing first when Z is fixed, while GEMC map values are in order of Z increasing first when R is fixed.
 +
 
 +
Thus we need the conversion script
 +
 
 +
for example:
 +
To covert SF7 map file CDFv4.sf7, start root and run ".x SF7toGEMCmap.C("CDFv4.sf7",0)",
 +
the output should be like:
 +
  open SF7 file CDFv4.sf7 ok
 +
  Rmin 0 Zmin -400
 +
  Rmax 400 Zmax 600
 +
  R and Z increments:    400    1000
 +
  please put 401 1001 instead into database
 +
  the units are in cm and G
 +
  covert to GEMC map file CDFv4.sf7.GEMCmap ok
 +
 
 +
=== plot SF7 map and integrate over B ===
 +
 
 +
SF7toGEMCmap.C(options)
 +
options:
 +
"SF7_filename",0                convert map only
 +
"SF7_filename",1                convert map and show map plot
 +
"SF7_filename",2                show map plot only
 +
"SF7_filename",3,x1,y1,x2,y2    show map plot and integrate over B along the line (x1,y1)-(x2,y2)
 +
 
 +
note:
 +
 
 +
1. To view values in map, turn on "Event Statusbar" in menu "view" on root Canvas, then use mouse to look around.
 +
 
 +
2. Edit the code to use something like "hB->SetMinimum(20)" to make a cut.
 +
 
 +
3. Zoom on colz axis to explore map details
 +
 
 +
4. not matter which option you use, a root file "SF7_filename.root" with all plots will be created.
 +
 
 +
=== compare SF7 map ===
 +
 
 +
SF7map_compare.C("v2.root","v1.root")
 +
 
 +
After you produce the root files for different configuration, use this to show the difference of "field in v2 - field in v1"
 +
 
 +
some root files are stored in the download already.
 +
 
 +
note: the two versions have to have the same grid size and map range
 +
 
 +
== update field map info in database ==
 +
 
 +
To make GEMC aware the field map file name, grid, position etc, we need to put those in table "magnetic_fields" of the geometry database
 +
 
 +
The scripts are at svn "database_io/solid/field/"
 +
 
 +
The map info is stored in "magnetic_fields.txt"
 +
 
 +
'''''Note: this text file needs special format, all entry should be separated by a tab, not just some space. If you edit the file,  you better check the database afterwards to make sure the resulting table is correct!'''''
 +
 
 +
The field unit are implemented as "gauss","kilogauss","T"
 +
 
 +
run "go_table_magf magnetic_fields.txt geometry_database_of_your_choice"
 +
 
 +
==check map in GMEC ==
 +
 
 +
There's no direct check in GEMC, but you can checking how particle bending in the field region.
 +
 
 +
use option MGN_VERBOSITY=99 when you run gemc to check field, it does two things
 +
 
 +
1. output more info about the filed loading
 +
 
 +
2. make particle travel only one step, this way you can start a particle at certain place and see how it bends.

Latest revision as of 15:40, 7 December 2020

This page has been moved to https://solid.jlab.org/wiki/index.php/Magnetic_Field_Map in the new SoLID Wiki. Please do not edit this page.

Refer to the design of Solid_Magnet

GEMC field map location

located at Solid website http://hallaweb.jlab.org/12GeV/SoLID/download/field/

map script

checkout from SoLID_GEMC svn "database_io/field/"

or

download

https://jlabsvn.jlab.org/svnroot/solid/solid_gemc/database_io/field/SF7toGEMCmap.C

https://jlabsvn.jlab.org/svnroot/solid/solid_gemc/database_io/field/SF7map_compare.C

convert SF7 to GEMC map

For solenoid type of magnet, assume azimuthal symmetry.

SF7 map format produced by PossionSuperfish program SF7.exe contain text lines for explanation, map range and grid size, map values (R, Z, Br, Bz, B, A, dBz/dr, dBr/dz, field index).

GEMC map format requires R, Z, Br, Bz

Additional difference is SF7 map values are in order of R increasing first when Z is fixed, while GEMC map values are in order of Z increasing first when R is fixed.

Thus we need the conversion script

for example:
To covert SF7 map file CDFv4.sf7, start root and run ".x SF7toGEMCmap.C("CDFv4.sf7",0)", 
the output should be like:
  open SF7 file CDFv4.sf7 ok
  Rmin 0 Zmin -400
  Rmax 400 Zmax 600
  R and Z increments:     400     1000
  please put 401 1001 instead into database
  the units are in cm and G
  covert to GEMC map file CDFv4.sf7.GEMCmap ok

plot SF7 map and integrate over B

SF7toGEMCmap.C(options)

options:
"SF7_filename",0                convert map only 
"SF7_filename",1                convert map and show map plot
"SF7_filename",2                show map plot only
"SF7_filename",3,x1,y1,x2,y2    show map plot and integrate over B along the line (x1,y1)-(x2,y2)

note:

1. To view values in map, turn on "Event Statusbar" in menu "view" on root Canvas, then use mouse to look around.

2. Edit the code to use something like "hB->SetMinimum(20)" to make a cut.

3. Zoom on colz axis to explore map details

4. not matter which option you use, a root file "SF7_filename.root" with all plots will be created.

compare SF7 map

SF7map_compare.C("v2.root","v1.root")

After you produce the root files for different configuration, use this to show the difference of "field in v2 - field in v1"

some root files are stored in the download already.

note: the two versions have to have the same grid size and map range

update field map info in database

To make GEMC aware the field map file name, grid, position etc, we need to put those in table "magnetic_fields" of the geometry database

The scripts are at svn "database_io/solid/field/"

The map info is stored in "magnetic_fields.txt"

Note: this text file needs special format, all entry should be separated by a tab, not just some space. If you edit the file, you better check the database afterwards to make sure the resulting table is correct!

The field unit are implemented as "gauss","kilogauss","T"

run "go_table_magf magnetic_fields.txt geometry_database_of_your_choice"

check map in GMEC

There's no direct check in GEMC, but you can checking how particle bending in the field region.

use option MGN_VERBOSITY=99 when you run gemc to check field, it does two things

1. output more info about the filed loading

2. make particle travel only one step, this way you can start a particle at certain place and see how it bends.