Code to generate PDG web page AtomicNuclearProperties and more Don Groom Version 6 09 Feb 2009 This describes mudedxN.for, a somewhat malignant FORTRAN program which creates all of AtomicNuclearProperties except for index.html As of May 2008, the version number N is 6. It calculates tables of dE/dx for muons (including radiative contributions), writes web pages for AtomicNuclearProperties for the 325+ materials in the data file, and writes other output files. It has received concentrated attention sporadically, generally to add new features. Needless to say, it doesn't look very designed, and my successors may curse me. It is fluent in several languages, writing output in \TeX, html, and text. As time goes on, users will want more materials added to the data file, atomic masses updated, and many more properties such as melting and boiling points, refractive indices, etc. will need to be added to the data file. The code might be improved (for instance, it doesn't calculate stopping power for beta < 0.4, or 10 MeV for a muon). It is my hope that this writeup, plus comments scattered through the programs, can act as an "instruction manual" for whoever is saddled with the maintenance and improvement of AtomicNuclearProperties in the future. 1. Overview If you are not familiar with the files generated by this code, explore pdg.lbl.gov/AtomicNuclearProperties. Each local link from its home page or tables connects to a table, pdf file, or text file generated by by mudedxN. The table gives properties of the material, and has links to tables of stopping power generated by the code and outside links to isotopes and gamma attenuation data (NIST). The code writes \TeX tables of muon dEdx(T) and a computer-readable text file for each material. (T is the kinetic energy.) It was modified in early 2008 to add pion interaction and collision lengths and to make its html files less sensitive to platform. It was changed in Feb 2009 to print effective ionization potentials in the main tables. Because FORTRAN hates \TeX's backslash character, it is compiled with g77 -fno-backslash -o mudedx6 mudedx6.for e.g. for N = 6. This not-memorable command can be copied from the beginning of the code. The code is in a directory which I call 'dedx' but which can be anything. There are 7 subdirectories, for code, input data, and output. 2. Origins The code was originally written to generate the tables in D.E. Groom, N.V. Mokhov, and S.I. Striganov, "Muon stopping-power and range tables, 10 MeV-100 TeV,'' Atomic Data and Nuclear Data Tables 78, 183-356 (2001), where nearly-identical tables for many of the materials are given. The only part of this book which is useful is the discussion of stopping power for muons in materials. Sergei Striganov contributed the radiative losses part of the code. 3. Main program. Call is './mudedxN.for materials.dat', where the materials list materials.dat is discussed below. mudedx6.for is presently 580 lines. Of this, 56 lines are setup, then 'subroutine onetable' is called for each material in the list. 'onetable' includes SACRED/texheader A 158 line segment (not a subroutine) 'SACRED/tex_include.for' is included to do the heavy lifting in writing the \TeX files. A 436 line segment (not a subroutine) 'SACRED/html_include.for' is included to write the html files. The many subrouties are discussed below 4. Subdirectories Needed for input data: PROPERTIES contains the allegemeine data file propertiesN.dat, code for reading it, and propertiesN.common, which gives most subroutines access to all the variables read from propertiesN.dat, plus 2 FORTRAN routines. "fetchproN.for" puts the content of "properties6.dat" (presently 2335 lines) into propertiesN.common, and writes atomic_wts.dat each time the program is executed. "adndt_stern.for" generates density effect corrections if they are missing from the properties entry. Note that the data file *must* provide I_eff. MUBDAT_16feb07 b values for the elements, needed to calculate muon radiative losses for all materials. The tables can be regenerated with Sergei's make_mub_16feb08.for, which has had several revisions over the years. FORTRAN code used by mudedxN.for: SACRED 15 key routines and Sergei's directions for calculating nuclear interaction and collision lengths. Some of the *.for files are code inclusions rather than subroutines. STRINGS String manipulation tools, mostly developed by Gary Wagman and/or Orin Dahl to manipulate strings (duh!). in PROPERIES Output: MU_ELOSS \TeX and dat files for muon dedx/energy. Plus: Haven't found a really good way to make the .ps and .pdf files - tex_dvips_source \TeX's and mdvips's the files: mdvips: aliased to \dvips -t letter -D600 -o !*.ps !* The ps2pdf_source makes pdf files starting with the ps files. These are generated by IDL pro tex_dvips_ps2pdf.pro (Turns out doing the whole thing is much too slow. Fast to make the .ps file, let it grind on the .pdf creation) The .dat files are the ascii versions (TEXT). The first line of all the *.tex files is \input /home/sierra/deg/texstd/mtexsis because texsis is not installed on my machine. Either delete these 1200 lines, or modify mudedx6.for and run it again. So delete line 66 in tex_include.for and line 156 in getbval2.for, compile, run. MU_B_TABLES_TEX \TeX and .dat files for the muon b coefficients. As above, source files to make .dvi, .ps, and pdf files are also there, also an IDL program to write them. This time its OK to make ps and pdf in the same pass. HTML Files of the form ind.html, where ind is the 3-digit index. These are the tables AtomicNuclearProperties brings up. PROTON_ELOSS Just like muons, except for protons. Made in Sept 2000, and only includes 118 lines. These are only text files (.dat), and screwed up in format - always gives Z, even for non-elements. Incidental output files (in main directory) PROPERIES/atomic_wts.dat extracted from propertiesN.dat by fetchpro6.for, for the use of getbval2.for. substances.out list of html commands for editing into the main AtomicNuclearProperties/index.html (for the pull-down menus). Unnecessarily includes elements, which have a different format in index.html, RPP.out mv or cp to RPP.body if it's safe. Longer explanation below. 6. Usage Call generate everything for a list of materials is ./mudedx6 'mat_table_name' where 'mat_table_name' is the input file telling it which substances to do. It starts (i4) with ind, the index of the material. The rest of the identifier might be useful to the user but unused by the program e.g. 110 Anthracene (C#14%H#10%) 78 Platinum I use files elements.dat inorganics.dat organics.dat substances.dat to generate the appropriate kinds if only kind is wanted. mat_table.dat to generate everything RPP.dat lists the materials in Table 6, Atomic and Nuclear Properties of materials SOURCE DATA is 'PROPERTIES/propertiesN.dat' The obscure format is explained in 'PROPERTIES/propertiesN.common', and the syntax in PROPERTIES/Properties6_Key.pdf (Sorry; it grew, and besides I was stuck with FORTRAN.) Chemical formula notation is explained in note [1] at end. Directions for adding a new material are given in [3] below. OUTPUTS: Example below is substance 215; generated for all entries in 'mat_table_name' HTML/muonloss_215.html These get moved to 'public_html/AtomicNuclearProperties/substances' Sometimes convenient to 'rm muonloss*.html' before running mudedx6 if only a subset is wanted. DO NOT 'rm *' TEXT/muonloss_215.dat for each substance in 'mat_table_name' generates machine-readable text version of muon dE/dx in the substance TEX/muonloss_215.tex to make pretty TeX'd table of muon dE/dx See note [A2] below about how to make the .ps and .pdf files. MU_B_TABLES_TEX/muonb_215.tex, MU_B_TABLES_TEX/muonb_215.dat Same as in the TEX directory, except b(E) tables used to generate the dE/dx files. After running mudedx6, user must create muonb_215.ps and muonb_215.pdf, as was the case for the muonloss*.tex files above. Procedure the same as for the TEX and TEXT muonloss files (note [2] at end, except the .dat, .ps, and .pdf files should end up in public_html/AtomicNuclearProperties/substances/muon_b_tables See note [A2] below about how to make the .ps and .pdf files. RPP.out \TeX source file to make Table 6 in RPP. To do this, (a) Run the code with the .dat file with just the stuff you want in Table 6; at the moment this is called RPP.dat (b) \cp RPP.out RPP.body (c) Run RPP.tex (d) After editing: combine solid/liquid lines to have RPP format. (This affects only density and sometimes refractive index.) Remove and/or edit most chemical formulae so that the table fits on one page in portrait format. 7. Subroutines, functions, and code segments included by mudedx6.for, the 580 line main code: 'PROPERTIES/fetchpro6.for' 'PROPERTIES/adndt_stern.for' 'SACRED/btot.for' ! interpolates to find btot etc for given energy 'SACRED/dedx2.for' ! basic electronic dedx routine 'SACRED/dedxmin2.for' ! iterates to find minimum, using dedx2 'SACRED/etex.for' ! writes E format as TeX string 'SACRED/mucrit.for' ! iterates to find muon crit energy 'SACRED/linestr.for' ! assembles ascii string of real numbers in TeX 'SACRED/getbval2.for' ! form weight-fraction weighted b values 'SACRED/X0_recip.for' 'SACRED/nuclear_sergei.for' 'SACRED/alfnum.for' 'SACRED/dedx_ep.for' C PDG string manipulation routines from Orin 27jun06 C gconstn.for gimplic.for sindex.f slength.f slower.f ssubsti.f supper.f 'STRINGS/ssubsti.f' 'STRINGS/slength.f' 'STRINGS/sindex.f' 'STRINGS/sfirst_don.f' 'STRINGS/slower.f' PDG string manipulation routines in main directory: gconstn.for gimplic.for sindex.f slength.f ssubsti.f Some of the subrotines also input code strings. Also needs PROPERTIES/properties6.common: PROPERTIES/properties6.dat This is the most sacred data file from which *all* information about the materials is found. Make frequent backups if editing it. The obscure and mysterious format is explained in properties3.common (sorry, it grew) NB: Notation for subscripts in chemical formulae is like C#4%H#10%, where '#' means 'begin subscript' and '%' means 'end subscript.' When writing TeX file, the code replaces "#" by '\sub{' replaces '%' by '}' and when writing HTML file the code replaces "#" by '' replaces '%' by ' 8. OTHER ROUTINES: make_mat_table.for To make file mat_table.out listing all the materials in properties6.dat in the format that mudedx6 wants. Pieces of this can be edited into the 'mat_table_name' file for mudedx6. E.g. elements01-20.dat. Only advantage over a list of numbers from 1 to NMAT (1 in i4 format) is the explanatory text, which is ignored but makes it easier to rea. alfz.for Short test program to understand how to make format entry such as //fmtsig// plot_nuclear.for Sergei's program to test the generation of nuclear interaction and collision lengths gconstn.for is a relic of some kind; looks like Sergei's but is not refered to anywhere sort_typemat.pro IDL routine to take substances.for and sort it into files for E(lement), I(norganic), etc. for use in making the pulldown menus for the main AtomicNuclearProperties/index.html. Some reordering is needed, and a few silly substances should be dropped. plot_nuclear.pro IDL program to make plot of nuclear interaction and collision lengths for explain.html 9. Adding a new material (at end of properties3.dat) First make a backup of properties6.dat, of course. Follow the NaCl model. You MUST come up with a reasonable excitation potential, e.g. as described in D.E. Groom, N.V. Mokhov, and S.I. Striganov, ``Muon stopping-power and range tables, 10 MeV--100 TeV,'' Atomic Data and Nuclear Data Tables 78, 183-356 (2001), ICRU37, or references therein. fetchpro6.for checks to see if the next entry on the 3rd line (cbar) is zero; if so, it generates the rest. Not as accurate as more expert calculations/measurements of I. The text part of the ADNDT paper, the only interesting part, can be obtained by clicking on "pdf of introductory text (37 pages)" on the AtomicNuclearPhysics homepage. 10. Moving all this to the web From HTML, \cp *.html to AtomicNuclearProperties/substances From MU_ELOSS, \cp muonloss_*.ps to AtomicNuclearProperties/substances/muonloss \cp muonloss_*.pdf to AtomicNuclearProperties/substances/muonloss \cp muonloss_*.dat From MU_B_TABLES_TEX, \cp muonb_*.ps to AtomicNuclearProperties/substances/muon_b_tables \cp muonb_*.pdf to AtomicNuclearProperties/substances/muon_b_tables \cp muonb_*.dat to AtomicNuclearProperties/substances/muon_b_tables If new substances are being added, say to the pulldown menus, to AtomicNuclearProperties/substances/muonloss fro