Running the PC Reduction
Running the PC Reduction
Kate Scholberg, Duke University
September 2005
Abstract
The purpose of this memo is to document the current PC reduction software
tools, without going into the details of the cuts (i.e. "form" as opposed to
"content".)
Introduction
The current PC reduction tools are committed to the patcomb
module of the cvs repository.
PC Reduction Overview
Here is an outline of the steps. See the multi-GeV and combined papers
for more details of the specific cuts at each step.
- PC1: This is run in "near real-time". This does the PC1 clustering
algorithm, and rejects events with >1 cluster, as well as events with wide
time distribution. PC2-4 starts with PC1 output.
- PC2: This runs the PC2 fast clustering algorithm and applies
a series of cuts based on the clusters found, as well as other fast cuts.
- PC3: This runs tftdcfit, and removes some entering events
by rejecting events with hits near the projected entry point.
- PC4: This applies a few more cuts, including one based
on mfmufit.
- PC5: This applies a series of cuts based on the output of
the precision fitter.
- PC6: This is the scanning step.
patall
The central tool for doing PC reduction is the patall.pl script. This
script is written in Perl. It takes a list of arguments on the command line
which specify the parameters needed, generates the needed rflists, and runs
the patall executable. patall.pl is designed to be as flexible
as possible: you can specify different input and output areas, and specify a
particular range of reduction steps. For instance, you can choose to run
only PC 3 on a file, or to run PC 2 through PC 5.
Here's an explanation of the meaning of all of command-line arguments
for patall.pl.
The first argument is the mode:
this specifies how to use the script. The specific
list of command-line arguments depends on the mode.
- Mode=1 means that you are running the reduction on a single file
(given on the command-line), or on a list of files specified with a wildcard.
This mode is useful for testing.
- Mode=2 means that you are running the reduction on a set of
files specified by flag files in a given directory. This is the
usual mode for running reduction on the data.
Mode 1 arguments:
patall.pl mode mc firstred lastred exename logdir outdir iunit ounit hbkon filelist
- mc: This is 1 for running on MC, zero otherwise.
- firstred: This is the first reduction step to run (2-5).
- lastred: This is the last reduction step to run (2-5).
- exename: This is the full pathname of the patall executable to run.
- logdir: This is the name of the top directory where the log files
live (see below under "Directory Structure" for the required subdirectories).
- outdir: This is the name of the top directory where the output
files live (see below about "Directory Structure").
- iunit: DISK or LOCAL "unit" rflist parameter
for the input file (use DISK for files on MTL).
- ounit: DISK or LOCAL "unit" rflist parameter
for the output file (use DISK for files on MTL)
- hbkon: This is 1 if histograms are to be generated.
- filelist: This is a single file, or a list of files specified
by a wildcard, to run the specified reduction steps on. (Note that
if you are running, say, P3-5, you probably want to specify a PC2 output
file here as the input file.)
Here is an example of running PC2 through 4 on the files corresponding
to run 7813 from MTL.
# patall.pl 1 0 2 4 /home/atmpd/patcomb/patcomb/solaris_sparc/patall /home/atmpd/patcomb/test/logs/ /home/atmpd/patcomb/test/out/ DISK LOCAL 1 /mtl/atmpd/reduc/patrd2/patrd2.run007813*
Mode 2 arguments:
patall.pl mode mc firstred lastred exename logdir outdir iunit ounit hbkon flagdir indir infilestub
The first 10 arguments (mode through ounit) are the same as for mode 1.
However the others are different.
- flagdir: This is the directory where the list of flag files is
specified. For instance, this may be the list of flag files output by PC1.
Or, for
instance, it could be a list that you have made to pick up runs that
had problems the first time (or whatever). The flag file format
is XXXXXX.YYY, where XXXXXX is the run number and YYY is the file number.
(Note that runs are broken up into separate files based on maximum Zebra size).
- indir: This is the directory which contains the actual
data files specified by the flag files.
- infilestub: This is the generic file name for the input files.
For instance, PC1 output files (input files for PC2) are named "patrd2",
PC2 output files (input files for PC3) are named "patrd3", etc.
(This could be automated!)
Here's an example of running PC 2 through 5 on a list of files
specified in flag file directory /home/ocon/atmpd/flag/patrd2.
patall.pl 2 0 2 5 /home/atmpd/patcomb/patcomb/solaris_sparc/patall /home/atmpd/patcomb/test/logs/ /home/atmpd/patcomb/test/out/ DISK LOCAL 1 /home/ocon/atmpd/flag/patrd2 /mtl/atmpd/reduc/patrd2 patrd2
Source code and libraries
Here's a rough guide to the source code. The main routines
are listed here.
First the libpclib.a library contains code for the mechanics
of PC reduction: calling the separate reduction steps, logging,
opening and closing, etc.
- patall.F is the main routine, run by patall.pl.
This calls the specified PC reduction steps (the reduction step
information is passed in via environment variables by patall.pl.)
- The subroutines corresponding to each reduction step are named
obviously: pc_2nd.F, pc_3rd.F, pc_4th.F, and pc_5th.F. muesel.F contains the reduction code for the patmue selection
at the PC2 step.
- There are various other utility routines for logging, file opening
and closing, etc, mostly named pc_*.F.
- The store_red*_info.F routines store reduction information in
a ZBS bank for each step.
The libodlib.a library contains code which is the
guts of the PC reduction algorithms. For instance
grad_cluster.c contains the PC2 fast clustering
(this has been significantly rewritten.)
Please be sure to link against current versions of these libraries.