File: insert_metadata_version.C Function: The user can specify the version of the tests whose metadata he wants to update or insert. This version is specified as a command line argument to the Root script The macro iterates through every system test in that version and retrieves the histogram file and the standardtest_id of that test. For every histogram in the histogram file the mean, rms and the number of entries are calculated. Using the standardtest_id the histogram of the standard is compared with the original to get the KS value. A check is made to see if the values of the metadata are already present in the metadata table for this system test. If yes then the table is updated and the macro exists. If the metadata is not present(i.e it has to be inserted) a check is first made to see if the corresponding info/label is present in the info_labels table. If yes then the labels which already exist are retrieved and used to insert into the metadata table. If not then new labels are generated, inserted into the info_labels table and these are used to perform the insertion in the metadata table.