README

Oct. 20, 2009  David Lawrence

This directory contains so ROOT macros that can be used to produce
a parameterization of the solenoidal magnetic field map of the
GlueX detector. Currently, the only available maps are 2-D and
so the parameterization is also 2-D.

To produce a parameterization of a field map, do the following:

1.) Use the bfield2root utility program to produce a bfield.root
file containing a (more or less) full field map.

> bfield2root

Note: run "bfield2root -h" to see a list of options including 
ones that can be used to specify a map other than the default.


2.) Run the ParameterizeBField.C macro

> root -q -b ParameterizeBField.C


3.) Run the ParameterizeBField_codegen.C macro, giving it the
specialized part of the name of the original map so that it
can be used in the output file names to make it clear what the
parameterization represents. 

e.g. If the Magnets/Solenoid/solenoid_1500_poisson_20090827_03
map was used to generate bfield.root, then pass the
"_1500_poisson_20090827_03" as the argument.

> root -q -b ParameterizeBField_codegen.C("_1500_poisson_20090827_03")

In this example several files will be produced with names like:
solenoid_1500_poisson_20090827_03_Bx_chebyshev_sec1
solenoid_1500_poisson_20090827_03_Bx_chebyshev_sec2
solenoid_1500_poisson_20090827_03_Bx_chebyshev_sec3
solenoid_1500_poisson_20090827_03_Bz_chebyshev_sec1
solenoid_1500_poisson_20090827_03_Bz_chebyshev_sec2
solenoid_1500_poisson_20090827_03_Bz_chebyshev_sec3


4.) Copy these into the Magnets/Solenoid directory of the root 
directory used to locally store calibration constants. You
can then specify the parameterized by setting the 
BFIELD_MAP and BFIELD_TYPE configuration parameters.

> hd_root -PBFIELD_MAP=Magnets/Solenoid/solenoid_1500_poisson_20090827_03 -PBFIELD_TYPE=Parameterized ....