Entry 1

Objective: to determine the Beam Crossing Offsets for all of the runs in the testSummaryClean.txt file and upload it to the SpinDB.

testSummaryClean.txt is a list of all of the fills and runs that I was supposed to analyze. The original file is available online. I was provided with two main pieces of code, TestChain.C and and findBXoff.C (the other code given to me were simply "easier" ways to call these two .C files, and they came in .xml and .sh formats). Both files are attached below, in .txt formats because this blog does not support uploading .C files.

TestChain.C produces a .hist.root file, which once opened in Root, shows the histograms of the beam crossings. It also produces a .ideal file, which shows what the crossing pattern should look like. The other program, findBXoff.C, takes in a .hist.root file and after running a chi squared function over the data, determines where the two histograms fit together best. There are two outputs for the findBXoff.C, a .ps file for each run, which lists the beam crossings offset 7 and the beam crossing offset 48, and a summary.pass8a.dat file which records certain information about all of the runs in the following order (run number, bxoff7, bxoff48, number of events 7, number of events 48, error flag variable, chi squared value, chi squared minimum value).

As there are hundreds of runs in testSummaryClean.txt, submitting the jobs individually would have been inefficient, so Wayne helped me write a perl script which searches through the .txt file for the run numbers, and then submits them in the terminal. One of these files should be attached below. Armed with this, I chopped testSummaryClean.txt into 16 smaller "bit sized pieces" which were small enough to be submitted reasonably. For the sake of reproducibility, each smaller .txt file has its own corresponding .pl file that iterates over it. If I had to disconnect from the internet for any reason, I'd make a new .txt and .pl file, with the remaining run numbers inside it, naming it something like testSummaryClean_SecondSubmissionRedo.txt and getAllRuns_SecondRedo.pl, the only difference between each file being only the .txt file over which it iterates.

Sometimes there would be technical problems, or I would accidentally not include a few run numbers in the new .txt file. So to catch these problems I wrote runNumberComparer.pl , which compares the run numbers I Have in the summary.pass8a.dat file, to the numbers I Should Have in TotalFileList, this prints out all the run numbers that I should but do not have, which was then piped into a text file called runNumberList.txt. Submitting all of the TestChain.C files takes a long time, and I'm currently not finished going through all of the run numbers, but as soon as I finish doing so, I will execute runNumberComparer.pl to catch any files that I might have missed, and then resubmit them.