Idiots Guide to CDF Software

As Prof. Frisch has warned me, if I wait any longer to document the oddities of CDF Soft, I'll know to much to care to do so. So here goes, the blind leading the blind.

To begin, there are three basic programs which you need learn, Pythia (or some other monte carlo generator) Root, and AC++. The first (Pythia) is a program which creates standard model interactions with which we may compare our real data, the second (Root) is a data analysis program with which we may make pretty pictures of our data, and the third (AC++) is a program from which we may control all the other programs and modules. This was a program created at Fermilab and it contains some of the information about the detector. In addition, you will have to learn Linux and C++.

The first thing you need to do upon logging in is open a terminal - click on the the little picture of a computer at the toolbar. Now, assuming that someone has pulled over a recent copy of the CDF software, you may proceed to set this up on your computer. Just type:

setenv USESHLIBS 1 source ~cdfsoft/cdf2.cshrc setup cdfsoft2 3.18.0int2 (or whatever version you want, ie setup cdfsoft2 XXX) The first line says that you want to USE SHared LIBraries. This means that code which is common to many different programs is all put into one place to save space. The second line is shorthand for "source /cdf/code/cdfsoft/cdf2.cshrc". The comm- and "source" tells Linux to read whatever is in the given file and execute those commands there. This .cshrc file sets up some environmental variables and refers to some other .cshrc files etc. Finally, setup cdfsoft2 3.18.0int2 tells the comp- uter which version you want to use. Leaving out the version number will (probably) set up the most recent version. Doing all this will allow you to use cdfsoft pro- grams like AC++ and it's various modules, Root, Pythia etc. Next, you want to setup an area where you want to do most of your work. This area should have alot of free disk space. Type "df" at the prompt to see which disks have space available, (you might want to ask someone where a good place to put you work area is). Suppose you find that /cdf/data1a looks good, then type: cd /cdf/data1a mkdir name_of_your_new_directory cd name_of_your_new_directory newrel 3.18.0int2 testrel (creates directory called testrel-name is arbitrary) cd testrel srt_setup -a addpkg Stntuple dev_220 -a list of file should scroll down your screen A few notes about this- You are creating an area which has a copy of "Stntuple" version 220 which is taken from the CDF software package you set up earlier. This contains the software needed to put some raw data into a standard data format call- ed a Stntuple. The current verion of the Stntuple package changes frequently, to find the latest one go to the web page:
  • Link to the Run II Stntuple Web Pages
  • Now, you probably want to quickly see something work so that you trust the ver- acity of this document. The following short tutorial allows one to generate the interaction p+pbar -> Z -> e+ebar -> whatever, look at the results, put the results into a standard format called an ntuple, and then look at this ntuple. 1. Copy these files into your testrel area:
  • ntuple.tcl
  • zee_generate.tcl
  • generic_cdfsim.tcl
  • (For the computer impaired- just click on these and when it ask for a Selection just type "cd /cdf/data1a/name_of_your_new_directory/testrel/ntuple.tcl".) 2. Type the following: "cdfSim zee_generate.tcl" A bunch of stuff should flash through your screen. After this is done, a file called zee_pythia_HEPG.root should be created in the testrel directory. Type "ls" at the prompt to see if it's in your directory. 3. If it's in there, you may quickly look at it by typing: "evd zee_pythia_HEPG.root" This will take a little while to load. Once done, click on "Window", then "COT", then "McParticle" on the left hand side. What you're looking at is a model of the detector with the tracks of the generated particles. Clicking on "McParticle" told evd that we wanted to see all particles that were created, not just the ones that were detected. Of course, none of the particles were detect- ed since they are imaginary! We can, however, actually run our imaginary particles through an imaginary detector to see what it would have produced. To do this: 4. Type "emacs generic_cdfsim.tcl". Emacs is a text editor and generic_cdfsim.tcl is a file which takes an input file with raw data and runs it through the detector. We want to change generic_cdfsim.tcl so that it knows which file of raw data to run on and where to put it once it's done. Goto the point where it says "input file" and change "$env(MC_INPUT_FILE)" to "zee_pythia_HEPG.root". Similiarly, change "$env(MC_OUTPUT_FILE" to "whatever_you_want.root". -The .root suffix is important. Now save your changes by holding down control and x together, and then typing s. Now kill this window. Now that your back at the prompt type: cdfSim generic_cdfsim.tcl 5. Now, to look at what the detector saw type: evd whatever_you_want.root When the CDF ED Manager comes up, click on "Window" and choose "LEGO", then "Cal Towers E". You should see a grid with lego blocks popping off. This is a picture of the detector sliced open and unrolled, the blocks represent energy deposited in that portion of the detector. If you click on "Pick" and then click your mouse on one of the towers you'll see statistics for that block appear on the terminal. To see the next event click on "next". Play around with this for a while. 6. Once you're bored with that, you'll want to ntuple the data so that it's in a more usable form. Click on your terminal and hold down "control" and "c" to end whatever evd was doing. When you get the root prompt again, type ".q". This will put you in the AC++ program. To exit that, type "exit", and you will get a program summary before you are given back your prompt. Now, ntupling works similiar to generation. There is a program, stnmaker.exe (instead of cdfSim) which we must give a .tcl file to tell it what to do. Again, we must alter this .tcl file so that it knows which file we're ntupling and where to put the result. So type "emacs ntuple.tcl". Where it says "input file $env(PWD)...", change the "$env(PWD)..." to "whatever_you_want.root", and similiarly change the file after "histfile" to "something_else.root". Save this, go to your terminal, and type: stnmaker.exe ntuple.tcl 7. Once this is done, you'll have a file called "something_else.root". To look at this, type "root". At the root prompt type: new TBrowser Double click on the testrel directory, then select your file "something_else. root". Now click on "ROOT" on the left hand side of the Browser. You should see your file in the window. Click on it, then select Stntuple, the select the Genp block. You can select icons in here to see various histograms of the data. Not Yet done with page!!! Will shortly be adding instructions on Pythia, and making everything pretty.

    Created by Billy Cottrell