How to run DrcOedPlayback

The DrcOedPlayback is a useful tool (running on SunOS, not linux) that can be used to investigate timing problems (i.e. related to a TDC) and contains many other useful informations.
It is run offline over the xtc files corresponding to runs taken in IR2.
Usually the xtc files are located in:
/nfs/bbr-nfs102/pubxtc/theData/
and have names like this:
babar-0071501-001.xtc

where 71501 is the run number in this case.
In order to run DrcOedPlayback, do the following:

ssh -X babardrc@bbr-refsun
cd $drc/bin
mkdir $BFROOT/work/b/babardrc → this is not always necessary, usually the directory is already there
Note: the link $BFROOT does not always work from babardrc, the corresponding directory is:
/afs/slac.stanford.edu/g/babar/work/b/babardrc/
setenv LD_LIBRARY_PATH /afs/slac/package/amulet/SunOS5/lib
DrcOedPlayback -n <numberOfEvents> -f <filename> tcl/myDrcOed.tcl

numberOfEvents is the number of L1Accept events in the xtc file you want to process. Note that this number includes the number of events you want to skip at the start of the run. If you want to process 100000 events from 1000-11000 chose numberOfEvent to be at least 11001.
filename is the xtc file we just mentioned

/nfs/bbr-nfs102/pubxtc/theData/babar-0071501-001.xtc

if the xtc file is not there you can stage it with the following command
tcstage 0071501-001

this will produce the file in a different folder:
/nfs/babar/tcfiles/

I typically use another tcl file:

tcl/test-myDrcOed.tcl
where I set by hand the number of events to process, the initial and the final event in the last part of it:
 
(...)
module talk DrcOed
first_event set 0
last_event set 1000
(...)
 

A few things to know about it:

  1. Do not run too many events, otherwise it will take forever to be finished (1000 is a good number)
  2. Sometimes the job misteriously crashes at some event:
    Do not waste too much time on it, just skip it by changing the first event in the tcl/test-myDrcOed.tcl

When the job is done, you have this file:

/afs/slac.stanford.edu/g/babar/work/b/babardrc/drcoed.hbook

Move it to a safer place:

/nfs/farm/babar/drc/babardrc/OedNtuples/run71501_1k.hbook

Now you can open the hbook file with paw. Here is a list of useful paw commands for your purpose:

h/file 1 /nfs/farm/babar/drc/babardrc/oedntuples/run71501_1k.hbook 0 → open the file
n/list you see two ntuples:

1 (N) DIRC Feature Extraction (event)
2 (N) DIRC Feature Extraction (hit)
n/print 2 → choose the second, (per hit)
opt zfl1 this is in case you want to save the .eps file
n/plot 2.timeCorr → to plot the corrected timing
n/pl 2.timeCorr uwfunc=sector.eq.0
n/pl 2.timeCorr uwfunc=sector.eq.0.and.harness.eq.0
n/pl 2.timeCorr uwfunc=sector.eq.0.and.harness.eq.1.and.chiptdc.eq.0
p/print myfile.eps
Here is an example of wrong timing distribution, in sector 0:

IR2 orientation
wrong corrected timing in sector 0

and here is an example of a good one:

IR2 orientation
good corrected timing in sector 0


Emmanuele Salvati
Last modified: Fri Mar 30 10:45:30 PDT 2007