Finding Total Luminosity (and other information)(updated)


My python tool for getting luminosity values and sums now has increased functionality. Originally, you could only find the luminosities for a consecutive list of runs. Now, you can still find the luminosity for consecutive run, but you can also find the luminosity associated with a directory containing ntupler and/or production files.

This tool is simple to use and forgiving for entry errors because it is menu driven. Each stage of selection has a self explainitory menu to lead you through. However, first it is important to understand what information this tool needs and why. This tool was designed to accept either a start/end run pair from which to generate a list of consecutive runs, or a directory name which it is to search to find the list of required runs. In directory mode, the program will accept to the list of runs any run represented by a production or ntuple file of the form _runnumber_filenumber.root. Any file of this form will be taken into account, and duplicates will be searched for. This information is used in accessing the cdf database using simple SQL commands in python. In addtion, some data, is accessed by Randy's database browser through email. My program has a built in email client to send the appropriate data, but you will have to manually copy the return email into a file for the program to use. With this data, and your appropriate email information, we can get all the information we need.

  • First, you must copy the python script from my home directory to a directory of your choosing.
    "cp ~jude/tool.py ~username/directory/tool.py"
  • Open a terminal and setup cdfsoft. When I tested this program, I used version 4.4.0, but I assume that the script should work with other (newer) versions.
    "source ~cdfsoft/cdf2.shrc"
    "setup cdfsoft2 4.4.0"
  • To start the program running, make sure that you have the script set as executable and you can start it merely by typing its name in the terminal. Otherwise, you must evoke the python program:
    "chmod u+x tool.py"
    "tool.py" or
    "python tool.py"
  • Once the program is running, you will see a menu giving options. The first menu allows you to select the mode in which to run. You must decide whether you wish to find information on a continuous range of runs or a list of runs represented by a directory of production and ntupler files. Type the appropriate number and press enter.
  • The next menu sets the run parameters for the mode selected. No matter which mode you selected, you will need to send an email to Randy's browser to obtain part of the necessary data. The script has a built in email client, so the program will do all the sending. Therefore, you must provide:
    your email user name
    the host name of your email server (this only works when you know the server name ie. hep.uchciago.edu, not like commercial email yahoo.com, since that is not the actual server name
    and the name of the file you will save the resultant email file in (you must manually copy the response email to file for the program to parse)
  • You must also select a file name that you want the final results to be written to. This is the results file name.
  • Select the physics stream that you want to know the number of events from by selecting physics stream and entering in the letter designation of the desired stream.
  • For run range mode, you will also need to provide a start and ending run number. From these numbers, the tool will generate a consecutive list.
  • For directory mode, you need to provide the path of the directory which you wish the script to search. From this directory, the script will generate a list of runs represented by the files in the directory.
  • Now that our data is entered, regardless of the mode we used, we press n for next screen and enter. This will take us to the tool menu. The script is actually a composite of two different tools. One tool sends an email to Randy's browser based on the information you provided, and the other tool generates a table that combines the data from the cdf database and the email file you recieved.
  • We must first have an email file of the name we entered earlier, so enter 1 to send the appropriate email. Continue checking your email to find when the response email comes. This is not necessarily a fast process, but it will come. When it comes, copy it into the filename that you gave the script earlier.
  • After you have properly saved the email file, press 2 to generate your table. Once again, this tool must access many pieces of data for many runs, so if you have a large set of runs you are considering, do not expect for the tool to finish processing quickly. 1000 runs can take upward of 30 minutes to process.

    Remember, at any time in the process of entering data, you can move forward or backward in the menu hierarchy to correct any mistakes or to skip any steps you do not need for the processing you are doing. The tool maintains a configuration file which stores the last data you entered, so often times, you will not have to re enter data many times if you want to rerun the data with only slightly different parameters. In addition, if you already have an email file for the runs you are using, there is no reason to continue to send emails. If you are not going to use the email tool, you can skip entering your email information.


    If you have an questions, concerns, comments, or suggestions, please email me at jude@uchicago.edu


    Adam Aurisano, 1 February 2002