The Production and Ntupling daemons
How to submit a job to the ntupling daemon
- You need to create a definition file for each ntupling job you wish
to run. The file will be executed as a bash shell script; this means you
can set environment variables to be passed to your tcl file, run commands,
etc. The file will be executed under the peonyisi
username, so please be careful with what commands you use (in particular
be careful about assuming what directory you're in). It should look
something like this:
USERNAME=peonyisi
STNCODEVER=4.0.0
STNTCL=/cdf/data2e/stream_daemons/stnfilter_inclusive.tcl
LOGFILE=/cdf/data2h/ntupled_318int3/log_3.18.0int1_125994_1.txt
SPLITMODE=1
STN_INPUT=/cdf/data9c/produced_stream_a/prod_3.18.0int1_125994_1.root
STN_OUTPUT=/cdf/data2h/ntupled_318int3/ntupled_3.18.0int7_125994_1.root
export STN_INPUT STN_OUTPUT
The only required fields are USERNAME and STNTCL. A listing of commands
that have meaning to the daemon follows:
- USERNAME: if email necessary, will email to this username
- STNTCL: sets tcl file that is passed to stnmaker
- STNCODEVER: sets version of code to use (if not set, defaults to
whatever version is "current")
- LOGFILE: sets log file name is to be placed. If not set,
output of stnmaker will be emailed to USERNAME.
- SPLITMODE: if set to anything non-empty, will cause files to be written
in split mode. Non-split mode is default.
STNINPUT and STNOUTPUT are environment variables that I set for the benefit
of my tcl file, and so need to be exported; they're an example of what
else you can do in these files.
- Place the description file in the ntuple spool directory:
/cdf/data2e/stream_daemons/nt_spool. Please give it group-write permissions,
as the spooler needs to delete it when done.
- Wait.
- Unfortunately, the output will be under my username; at least it will
be group-writable, so you can do as you wish with the files.
How to use the daemon to make ntuples from a list of post-production files:
An example shell script, using the ntupling daemon, follows. Cut and
paste into a .sh file, adapt as desired [though if you want to remake
the ntuples in /cdf/data2h/ntupled_318int3, please change only STNCODEVER],
and call with absolute path names
of the production files you want to ntuple.
#!/bin/bash
EXECDIRECT=/cdf/data2e/stream_daemons
STNDIR=/cdf/data2h/ntupled_318int3
STNCODEVER=4.0.0
for i in $@ ; do {
SPOOLFILE=$EXECDIRECT/nt_spool/`basename $i`.dsc
BASENAME=`basename $i`
RUNNUM=`echo $BASENAME | awk -F _ '{print $3}'`
FILENUM=`echo $BASENAME | awk -F _ '{print $4}' | awk -F . '{print $1}'`
ERROR=log_${STNCODEVER}_${RUNNUM}_${FILENUM}.txt
echo "USERNAME=$USER" > $SPOOLFILE
echo "STNCODEVER=$STNCODEVER" >> $SPOOLFILE
echo "STNTCL=$EXECDIRECT/stnfilter_inclusive.tcl" >> $SPOOLFILE
echo "LOGFILE=$STNDIR/error_logs/$ERROR" >> $SPOOLFILE
echo "STN_INPUT=$i" >> $SPOOLFILE
echo "STN_OUTPUT=$STNDIR/ntupled_${STNCODEVER}_${RUNNUM}_${FILENUM}.root" >> $SPOOLFILE
echo "export STN_INPUT STN_OUTPUT" >> $SPOOLFILE
} ; done
10 Sep 2001, Peter Onyisi