This directory contains several scripts for dealing with CDC constants.
As always, when doing something new, test the procedure on a standalone SQLite 
version of the CCDB.


build_cdc_table.py:

This script is used to generate the drift time/distance table from a set of 
files generated by Garfield.  You should run it in the same directory as a 
bunch of files with names of the form xt_cdc_*.asc, and it will go through them 
in sorted order, building both a table compatible with CDC/drift_gas_tables and 
a header containing some of the meta info about the run

add_custom_data.py:

This script is used to insert the table meta-data into the CCDB.  It is needed 
because the normal CCDB add command assumes that the input file is some sort of 
tabularlly formatted set of data, and we just want to store the unformatted 
contents of the file.  It inserts a file named "header" - be sure to edit the 
various parameters that are set inside the python script before running.


Here is an example of injecting the constants into the CCDB:

ccdb mkvar CDC_9mm_0T #drift time/distance calculation for 9mm radius straws, no B field
ccdb add /CDC/cdc_gas_drift -v CDC_9mm_0T CDC_t2d_table
python add_custom_data.py