Notes for the g-2 Offline use

These instructions are derived from the notes which were taped into the detector logbook on how to use the offline. Before noting anything else it should be pointed out that the main offline account is the g2off account on the physgi01.phy.bnl.gov computer. If you would like to know the password for that account just mail to Dave Zimmerman and ask him nicely.

NEW!!! How to read tapes in physics!

There is now a tape drive in physics which can be used to play back the data which we are writing to tape. Charles has created a friendly interface which allows us to read files off it. The drive is available for tape mounting in the RHIC printer room. When bringing copied data tapes to physics please remember to put them on the tape storage shelf in room 1-102 (Ofer and Stratos' office)


For those of you interested in more detailed information and stuff like that regarding the offline, check out the Offline Documentation page. It has all sorts of the hottest latest and greatest information about how you too can become an offline maven.

The heart of the quick documentation

There are several different ways of running the g2 analysis code. They range from the quick and easy to use runoff to the onliney onoff to the full power of the offline itself.



Ofer's Runoff Tool

This tool allows you to quickly determine specified data regarding a particular run. At present it gives a count of how many electrons there are in a particular run. Where the electron's are defined according to the definition which can be found the file countem.f in the ~g2off/g2off directory. This code is run by typing

runoff XXX (where XXX is the run number for the run which you wish to analyze)

The runoff script ftp's the relevant data file from the online cluster and brings it to physgi where it is analyzed.







The Offline version of the online analysis:: OnOff

This program enables you to run online.f over data in the offline part of the computing world. The program can be used by typing

onoff filename (or device name if you are using a tape)

as an example of this sort of behavior you could do::

cd ~g2off/unidir/unitape/examples

to get to the right directory

onoff /dev/mt/tps7d5nsvc

then it asks for a copy tapedrive. The answer is none. Then it reads in the configuration file and "it goes...". This creates the online histograms and allows you to copy the raw data to disk or tape. You can then use paw to access the histograms which are thereby created.







The Offline in all its glory

The first step in the offline analysis on physgi is to make certain that the data which you wish to analyze is in the appropriate directory. That being the directory::

g2off/ring97/data

Now you are ready to do the analysis. First go to the

g2off

subdirectory (so youll be in ~g2off/g2off in this case...) and type

g2off

to get into the g2off program interface (looks like PAW, dont it? Gotta love KUIP)
Now you have a choice. We can do this the hard way or the easy way. The easy way is to use the g2run.kumac to do all the setting up commands for you. You can do that by typing

exec ~/g2run

If you opted for this easy option you should click here to skip the next few steps.

But for those of you who like manual transmissions, word processing in latex and baking your own bagels you wont be satisfied with that. You'll wanna type the following series of commands out yourself.

algo defna

to use the default pulse finding algorithm (Dont know how to make my own pulse finding algoriddem yet)

/g2off/default/set adcmin -1

This establishes the treatment of the ADC words in the WFD record

setenv G2OUTFILE $G2DATA/g2gaf.fz

This will cause the g2gaf adamo file to be placed on the $G2DATA disk at the end of the job.
Now you are ready to setup your input file. To do this you type the following...

setenv g2infile $G2DATA/r0000XXX.dat

Please note that the file must actually be there for this process to work. If the run which you want to analyze isnt there ftp it to that directory from the online cluster.
Now you're all set to go...type

run

and then.....

Next YYYYY

where the YYYYY are the number of events in that run which you wish to analyze. Now you will receive the mother of all error messages. Ignore the man behind the curtain....












OK NOW WE ARE ALL TOGETHER AGAIN....

You will now have created a file called g2gaf.fz in the directory in which youve been running. This fz file has all sorts of potential. By merely typing

example2

you can now turn it into a useful ntuple! This ntuple will be called g2off.paw. It is highly recommended that you rename it to something else fast before it gets overwritten by one of your analysis colleagues. Do this by the following tricks....

mv g2off.paw $G2DATA/../pawfiles/g2offXXX.paw

rm g2gaf.fz

move to the $G2DATA disk where this file is placed and then type the rm command where XXX is that pesky run number again.


The file which you have created will now allow you to utilize the full power of PAW!!!!!

Here are a listing of the variables in this ntuple.
  • STAR:: start time of pulse (time of first sample)
  • STOP:: stop time of pulse (time of last sample)
  • MEAN:: energy weighted mean time of pulse occurence
  • DETE:: detector number in which the pulse was found
  • SPIL:: fill number
  • AREA:: integrated pulse height with pedestal subtracted (in WFD units)
  • PEDE:: pedestal for the pulse
  • MAXV:: maximum ADC value for this pulse (0-255)
  • NSAM:: number of samples in pulse