Checking and Updating the dE/dx Tables

The BPF tracker keeps its own dE/dx tables to properly handle the tracking and scattering through different detector materials, and to allow for it to properly calculate each track's momenta. This information is kept in BreakPointFitter/func/dEdxTable.{h,cxx} When changes are made to the simulation or to the geometry, these tables may need to be updated.

To update the BPF tables, there is a function within the wrapper function for geant (g4nova/Modules/ that will dump this information to text files. These text files can then be checked against the information in BPF. Specific instructions:

1. Check out the g4nova package.
2. Edit the fcl parameter PrintTables to "true".
3. Build the package.
4. Run a gen job to make one event (prodgenie.fcl seems to work straight out of the box...):

nova -c prodgenie.fcl -n 1

5. This job will generate a couple of root files that you can discard. The text files generated should look like this:
-rw-r--r-- 1 mbaird42 nova  617 Apr 21 10:55 g4nova-materials.txt
-rw-r--r-- 1 mbaird42 nova 1612 Apr 21 10:55 g4nova-muon-dedx-Air.txt
-rw-r--r-- 1 mbaird42 nova 1613 Apr 21 10:55 g4nova-muon-dedx-BariteRock.txt
-rw-r--r-- 1 mbaird42 nova 1613 Apr 21 10:55 g4nova-muon-dedx-Concrete.txt
-rw-r--r-- 1 mbaird42 nova 1608 Apr 21 10:55 g4nova-muon-dedx-Dirt.txt
-rw-r--r-- 1 mbaird42 nova 1602 Apr 21 10:55 g4nova-muon-dedx-Glue.txt
-rw-r--r-- 1 mbaird42 nova 1608 Apr 21 10:55 g4nova-muon-dedx-Granite.txt
-rw-r--r-- 1 mbaird42 nova 1608 Apr 21 10:55 g4nova-muon-dedx-PVC.txt
-rw-r--r-- 1 mbaird42 nova 1619 Apr 21 10:55 g4nova-muon-dedx-PivoterSteel.txt
-rw-r--r-- 1 mbaird42 nova 1614 Apr 21 10:55 g4nova-muon-dedx-Scintillator.txt
-rw-r--r-- 1 mbaird42 nova 1612 Apr 21 10:55 g4nova-muon-dedx-ShotRock.txt
-rw-r--r-- 1 mbaird42 nova 1608 Apr 21 10:55 g4nova-muon-dedx-Steel.txt
-rw-r--r-- 1 mbaird42 nova 1611 Apr 21 10:55 g4nova-muon-dedx-Vacuum.txt
-rw-r--r-- 1 mbaird42 nova 1611 Apr 21 10:55 g4nova-muon-dedx-WLSFiber.txt
-rw-r--r-- 1 mbaird42 nova 1599 Apr 21 10:55 g4nova-muon-dedx-Water.txt

Currently, I am keeping records of the dE/dx tables (separated by date generated and/or the release they were generated in) here: /nova/ana/users/mbaird42/geant_dEdx_tables/.

6. Copy the macro BreakPointFitter/macros/convert_geant_tables_to_BPF.C to the directory with the geant text files and run it. This will read in the info from the geant files and format it nicely for easy copying and pasting into BPF. NOTE: It is hard-coded in the macro that the number of lines with numerical entries in each file is 90. You MUST check that this is true and adjust the macro if it is not.

Now you can go through the dE/dx tables in BPF and check them against the values in these files. Have fun!