Difference between revisions of "Magnetic Field Map"

From Hall A Wiki
Jump to: navigation, search
(plot SF7 map and integrate over B)
Line 1: Line 1:
 
Refer to the design of [[Solid_Magnet]]
 
Refer to the design of [[Solid_Magnet]]
  
== create field map for GEMC from possion output ==
+
== GEMC field map location ==
  
 
located at Solid website http://hallaweb.jlab.org/12GeV/SoLID/download/
 
located at Solid website http://hallaweb.jlab.org/12GeV/SoLID/download/
Line 10: Line 10:
 
*[http://hallaweb.jlab.org/12GeV/SoLID/download/solenoid_ZEUS.dat  ZEUS map]
 
*[http://hallaweb.jlab.org/12GeV/SoLID/download/solenoid_ZEUS.dat  ZEUS map]
  
== SF7toGEMCmap.C ==
+
== map script ==
  
 
checkout from svn "database_io/halla12/solid/field/"  
 
checkout from svn "database_io/halla12/solid/field/"  
Line 16: Line 16:
 
or  
 
or  
  
download https://clas12svn.jlab.org/repos/trunk/clas12/gemc/production/database_io/halla12/solid/field/SF7toGEMCmap.C
+
download  
 +
 
 +
https://clas12svn.jlab.org/repos/trunk/clas12/gemc/production/database_io/halla12/solid/field/SF7toGEMCmap.C
 +
 
 +
https://clas12svn.jlab.org/repos/trunk/clas12/gemc/production/database_io/halla12/solid/field/SF7map_compare.C
  
 
=== convert SF7 to GEMC map ===
 
=== convert SF7 to GEMC map ===
Line 31: Line 35:
  
 
  for example:
 
  for example:
  To covert SF7 map file CDFv2.sf7, start root and run ".x SF7toGEMCmap.C("CDFv2.sf7")",  
+
  To covert SF7 map file CDFv4.sf7, start root and run ".x SF7toGEMCmap.C("CDFv4.sf7",0)",  
 
  the output should be like:
 
  the output should be like:
   open SF7 file CDFv2.sf7 ok
+
   open SF7 file CDFv4.sf7 ok
 
   Rmin 0 Zmin -300
 
   Rmin 0 Zmin -300
   Rmax 300 Zmax 475
+
   Rmax 400 Zmax 600
   R and Z increments:    300     775
+
   R and Z increments:    400     1000
   please put 301 776 instead into database
+
   please put 401 1001 instead into database
 
   the units are in cm and G
 
   the units are in cm and G
   covert to GEMC map file CDFv2.sf7.GEMCmap ok
+
   covert to GEMC map file CDFv4.sf7.GEMCmap ok
  
 
=== plot SF7 map and integrate over B ===
 
=== plot SF7 map and integrate over B ===
Line 58: Line 62:
 
3. Zoom on colz axis to explore map details
 
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 produced
+
4. not matter which option you use, a root file "SF7_filename.root" with all plots will be created.
  
 
=== compare SF7 map ===
 
=== 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"
 
After you produce the root files for different configuration, use this to show the difference of "field in v2 - field in v1"
  
SF7map_compare.C("v2.root","v1.root")
+
some root files are stored in the download already.
  
note: the two versions have to have the same grid size, and map range
+
note: the two versions have to have the same grid size and map range
  
 
== field map file info in database ==
 
== field map file info in database ==

Revision as of 19:52, 6 April 2011

Refer to the design of Solid_Magnet

GEMC field map location

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

map script

checkout from svn "database_io/halla12/solid/field/"

or

download

https://clas12svn.jlab.org/repos/trunk/clas12/gemc/production/database_io/halla12/solid/field/SF7toGEMCmap.C

https://clas12svn.jlab.org/repos/trunk/clas12/gemc/production/database_io/halla12/solid/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 -300
  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

field map file info in database

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

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

edit the file "magnetic_fields.txt" with grid info from output of "SF7toGEMCmap.C"

just run "go_table_magf magnetic_fields.txt user_geometry"