Magnetic Field Maps for Solenoid

From GlueXWiki
Revision as of 08:44, 16 July 2012 by Davidl (Talk | contribs) (update directory holding field maps)

Jump to: navigation, search

Several field maps exists for the GlueX superconducting solenoidal magnet. This page lists them along with some notes for each and how to specify one in the simulation and reconstruction software. If you have a new Ansys-generated field map in excel format that you'd like to convert to a form that can be used by the software, please see the HOWTO Convert a B-field Map from Excel page. Remember to update this page when you are done.

Location of the Field Maps

Some field maps are kept alongside other calibration constants used by the offline reconstruction software in the calibration database. At the time of this writing, the calibration "database" is just a collection of ASCII files kept in the subversion repository. A recently-checked-out version of these is kept updated on the halld group disk here (and yes, there should be 2 "calib"s):

/group/halld/Software/calib/calib

Other maps listed on the page but not commonly used can also be found on the group disk in this location:

/group/halld/Engineering/Solenoid/MagneticFieldMaps

Note that in order to use the field map with the offline reconstruction code, it will need to be placed in the Magnets/Solenoid subdirectory relative to the directory indicated by the JANA_CALIB_URL environment variable.

example:

mkdir -p /home/davidl/HallD/calib/Magnets/Solenoid
cp /group/halld/solenoid/MagneticFieldMaps/solenoid_1600_20081112-2 home/davidl/HallD/calib/Magnets/Solenoid
setenv JANA_CALIB_URL file:///home/davidl/HallD/calib


Specifying a different field map

Numerous field maps exist for the solenoid and a system is in place where one can specify the map of choice when running the simulation/reconstruction software. To specify a different field map for hdgeant to use, use

Technical details require that a recompile of hdgeant be done when specifying a different map for the simulation, but any existing reconstruction program can be reconfigured to use a different map without recompiling. Here I'm referring only to full maps, not the special field types of "Const" and "Spoiled" described below.

It should be noted that the *easiest* way to switch fields is really just to replace the default file in the calib directory tree with the desired map. Just be careful if you go that route since it will be easy to get confused since the file name will no longer be indicative of the content of the file.


Simulation

To change the map used in the simulation, one would need to edit the src/programs/Simulation/HDGeant/calibDB.cc file. Inside the initcalibdb_ routine, there is a line like the following:

Bmap = new DMagneticFieldMapCalibDB(jcalib);

which should be changed to something like:

Bmap = new DMagneticFieldMapCalibDB(jcalib, "Magnets/Solenoid/solenoid_1600_20090312-2");

to specify the solenoid_1600_20090312-2 map. Similarly, if you plan to use a "Spoiled" map (which is based on an unspoiled map" then you'll need to add the second, string argument to the constructor call for the DMagneticFieldMapSpoiled object. (One should not add a second argument if using a "Const" field.

Reconstruction

For reconstruction, one simply needs to specify the BFIELD_MAP configuration parameter either on the command line or through a configuration file. For example, using the command line one passes a "-PBFIELD_MAP=Magnets/Solenoid/solenoid_1600_20090312-2" argument as follows:

hdview2 -PBFIELD_MAP=Magnets/Solenoid/solenoid_1600_20090312-2 hdgeant.hddm


Special Field Types

There are 2 special field types available also. They are the "Const" and "Spoiled" fields.

The "Const" field type is a uniform-everywhere-in-the-universe field. The parameters are set in the Magnets/Solenoid/solenoid_const calibration parameters. One can specify the 3 components of the field in cylindrical coordinates so the field is necessarily radially symmetric. The default values are just a 2T field in the -z direction. To specify this field in simulation, one needs to set the "BFIELD" parameter in the control.in file to "'Const'". This already exists, but is commented out, in the default control.in file one gets from the repository with the HDGeant package. To specify the "Const" map in a reconstruction program, one just needs to se the BFIELD_TYPE configuration parameter. This can be done by adding the "-PBFIELD_TYPE=Const" argument to the command line when the reconstruction program is started.

The "Spoiled" field type uses a full field map, but spoils it by scaling the amplitude with some combination of r, phi, and z dependences. Each of the dependences has both an amplitude and an angular frequency that are set using configuration parameters. The relevant configuration parameters are:

BFIELD:PHI_AMP
BFIELD:PHI_OMEGA
BFIELD:R_AMP
BFIELD:R_OMEGA
BFIELD:Z_AMP
BFIELD:Z_OMEGA

The underlying unspoiled map that is determined using the BFIELD_MAP configuration parameter as is normally done when using an unspoiled field.

Known field maps

File Generator Date Notes
solenoid_1400 TOSCA 9/21/2001 From Paul Brindza's original map "dsolenoid.table". This was very probably generated at 1400A, though there is a small question regarding that.
solenoid_1500 TOSCA 4/19/2007 From Paul Brindza's original map "smoothsolenoid1500.table". This was the default map used up until 6/22/2009. Comment from Paul's e-mail regarding this:

"I used integral coil and integral mesh fields to compute the grid. There may be places like in the iron or near the coils where the results will be different than before. The region inside the useful volume of the Solenoid where the detectors are should be more accurate and smoother."

solenoid_1500kinked TOSCA ~2006 From Paul Brindza's map "largegridat1500.table". This map had an unintentional kink in it due to a change in the grid size for the inner and outer parts of the solenoid. I beieve it was used for some time before being replaced in spring 2007 when "smoothsolenoid1500.table" was generated after finally noticing the kink. Since the kink appeared outside of the active tracking area, it didn't really affect the tracking at all.
solenoid_1500spoiledA TOSCA 3/19/2007 This map was generated by Paul Brindza at Elke's request to study the effect of having a field with distortions at the 10-3 level from our best guess of what the field is. The nature of the distortions was kept secret so Paul or Elke would need to be contacted for details.
solenoid_1500_20081112-1 ANSYS 11/12/2008 One of Floyd Martins original ANSYS-generated maps. This was never used for anything but to check that the map was roughly consistent with TOSCA. From the e-mail sent by George Biallas regarding this and the following 3 maps:
"David and Elton,
The results are in the folder below.
1. Note that because of the FEA calcultion doesn't do well on the sharp corner of a wedge, we don't have a field value on the Magnet Axis
2. We have changed the Z axis to the standard Z axis origin for the experiment, the inner surface of the Upstream Front Yoke.
3. We have solutions at 1500 to 1800 A.  So far, the nominal current is 1500A.  I don't know how we want to characterize beyond that.
4. ANSYS output is in comma delimited EXCEL files.  I didn't want to cram more huge, translated  files in our folders, so I will let you do the translations to what you need.
5. We will title the files by date and run on that date.  The translation file to what the run consisted of is in the main folder.
6. We don't have the FCAL steel plate in these runs.
7. As more runs accumulate, we will have to maintain configuration control with a designation of what is the OFFICIAL RUN and notify everyone if the run changes. "
solenoid_1600_20081112-2 ANSYS 11/12/2008 See notes for solenoid_1500_20081112-1 above.
solenoid_1700_20081112-3 ANSYS 11/12/2008 See notes for solenoid_1500_20081112-1 above.
solenoid_1800_20081112-4 ANSYS 11/12/2008 See notes for solenoid_1500_20081112-1 above.
solenoid_1500_20081126-3 ANSYS 11/26/2008
solenoid_1800_20081126-3 ANSYS 11/26/2008
solenoid_1500_20081209-1 ANSYS 12/09/2008
solenoid_1800_20081209-1 ANSYS 12/09/2008
solenoid_const none 11/10/2008 This is not actually a field map, but holds constants that are used when the BFIELD_TYPE configuration parameter is set to "Const". This is useful in simulation studies using a perfectly uniform magnetic field.
solenoid_1500_20090312-2 ANSYS 3/12/2009 From Floyd's e-mail describing the differences between the 20090312 maps and the 20081209 maps:
The differences I can see are:

On the initial 20081209-1 tabulation (pg 9):
1) The small upstream yoke bore liner was 1.5"
2) Coil locations and sizes were at room temperature.

On the latest 20090312-2 tabulation (pg 14):
1) The small upstream yoke bore liner is 1.25"
2) Coil locations & sizes are at a liquid Helium state.

I think that's the only differences between the two dates.
solenoid_1600_20090312-2 ANSYS 3/12/2009 See notes for solenoid_1500_20090312-2 above.
solenoid_1500_poisson_20090814_01 POISSON 8/14/2009 Nominal geometry and current as calculated by POISSON
(this is currently the default map used by the offline software)
solenoid_1200_poisson_20091123_01 POISSON 11/23/2009 80% field (uses same geometry as solenoid_1500_poisson_20090814_01)
solenoid_1050_poisson_20091123_02 POISSON 11/23/2009 70% field (uses same geometry as solenoid_1500_poisson_20090814_01)
solenoid_0750_poisson_20091123_03 POISSON 11/23/2009 50% field (uses same geometry as solenoid_1500_poisson_20090814_01)
solenoid_1500_poisson_20100622_01 POISSON 6/22/2010 Simple, single coil configuration using the same cross-sectional area and total current as in solenoid_1500_poisson_20090814_01. Baffles have been removed, but iron yoke is the same.
solenoid_1500_poisson_20100622_02 POISSON 6/22/2010 Similar to solenoid_1500_poisson_20100622_01, but following BaBar model as specified in babar_transv_3_4.am file Eugene sent me on 6/22/2010. Namely, three sections where outer ones are half as long as middle but all 3 carry the same amount of current (outer ones have higher current density).
solenoid_1500_poisson_20100622_03 POISSON 6/22/2010 Similar to solenoid_1500_poisson_20100622_01, but with additional coils outside of long, inner coil. The outer coils are 30cm long in z. The inner coil thickness in r is reduced such that the total cross-sectional area and total current are the same as the solenoid_1500_poisson_20090814_01 configuration.
solenoid_1500_poisson_20100701_03 POISSON 7/7/2010 This map is a multi coil design, but much simpler than the LASS magnet design. It is symmetric in z about the magnet center. It has a central coil that is ~33cm long, 2 inner coils that are upstream and downstream of that that are 150cm long, and 2 outer coils that are flush with the upstream and downstream ends of the inner coils that are 20cm long. The currents were adjusted by hand to give a flat, uniform field in the central region of the magnet.
solenoid_1500_poisson_MIT20111104_01 POISSON 11/4/2011 This map implements the 3-coil MIT design.


Creating a ROOT file of the magnetic field

The bfield2root program can be used to create a ROOT file of the magnetic field map as is used by the simulation/reconstruction code. The ROOT file will contain a TTree with entries from several points in the map. It is important to note that the values going into the TTree come from interpolating the map whose grid is determined by the ASCII file. The bfield2root program has default settings to match the default grid of the ASCII files. If a map with different grid spacing is generated then the bfield2root program will still work but one should be aware that the resulting ROOT file will contain interpolated values.

Another "gotcha" is that the origin of the lab coordinate system used by the original field maps is not in the same location as is currently used. The TOSCA generated maps have the origin close to the center of the target, 26 inches (=66.04 cm) offset from the modern coordinate system. As of svn revision 5316 on June 22, 2009, the reconstruction code no longer assumes this offset is there and so one must correct for it when using a TOSCA map. In the mean time, the bfield2root program must be told about this offset via a command line parameter (see below).

The following instructions are for doing this on the JLab CUE system (e.g. ifarml3). However, one can of course do this on another system where the Hall-D software is compiled and the desired map is located in the directory indicated by the JANA_CALIB_URL environment variable (note: this is set in step 1 below for the CUE).


  1. Make sure bfield2root is in your path. If it's not, then source a setup script for a pre-built Hall-D software release.
    e.g. source /group/halld/Software/builds/release-2009-05-27/setenv.csh
  2. Run bfield2root specifying the specific map
    e.g. bfield2root -PBFIELD_MAP=Magnets/Solenoid/solenoid_1500_20090312-2
  3. Run bfield2root using an older, TOSCA generated map
    e.g. bfield2root -PBFIELD_MAP=Magnets/Solenoid/solenoid_1500 -Z0 -66.04