I have written a program ('pedestals') to write "spar files" to the disk
based on the information in RCxx banks. This program can also update the
Map for the SC package automatically. I could easily implement that
feature for the other packages also if the authors of those packages (whom
ever implemented the Map) contact me with the layout of their Maps.
The code works for all ADC in crates 12,13,14,15,16
I installed the program on the CLON cluster in
/usr/local/bin under the name pedestals.
To get help just type 'pedestals -help'
Please consider using this program for future creation of xx.spar files,
and please, when writing a pedestal data file, turn the RCxx banks on so
that information about all the channels in each ADC can be extracted,
instead of just the 'bossified' ones.
A more detailed description of the program follows below.
Regards,
Maurik Holtrop
----------------------------------------------------------------------
University of New Hampshire tel: (603) 862-2019
Physics Department fax: (603) 862-2998
DeMeritt Hall email: maurik.holtrop@unh.edu
Durham, NH 03824 Home:(603) 659-8765
----------------------------------------------------------------------
***************************************************************************
* *
* PEDESTALS *
* *
* A program to write sparcification tables. *
* *
***************************************************************************
This program intends to unify the way sparsification tables are computed
and written to disk. The code uses the mean of the distribution for the
pedestal and adds 10 to form the sparsification number. (A full gausian
is fit when the -fit option is specified.)
The main advantage of this code is that it retrieves the data directly
from the RCxx BOS banks. This means that an error in the Translation
Tables (TT) does not result in an incorrect entry in the *.spar file.
It also means that a pedestal and sparsification number is computed
for EACH and EVERY channel. Unlike many other programs that use the
'bossified' banks, where the user has to add in the channels that
were never 'bossified' by hand.
However, it is critical that the raw banks are written to disk for this
to work properly. Clearly it is a good idea to write the raw data
(RC banks) to the disk for the sparsification run. These runs are small
so the extra space used by the RC banks is negligible, while turning
them on allows this program to get a sparsification number for each channel
independent of the TT. (It would also be a good time to verify the TT.)
Another advantage is that this code writes a spar file for every
crate, and names the files in a consistent manner:
croc##_runnum_date.spar. It will then automatically backup the old
link file: croc##.spar to croc##.spar.~1~ and make a new link file
croc##.spar. A comparison between the old spar values and the new
values is made, and the user is warned if the difference is larger
than 25 channels. This can warn you if a channel has gone bad.
The code has a large number of command-line switches which are
explained when typing "pedestals -help". These switches allow
you to analyze only a single crate (use -only #), automatically
update the mapmanager MAP ( use -map )(SC package only for now)
or do a true gausian fit (-fit which gives proper error
estimates for each entry but is slower and does not always
converge.)
The standard way to run the code is:
pedestals datafile -quiet -m <#of_events>
where the -quiet flag suppresses the writing to stdout of the
resulting pedestal for each channel (makes it easier to see
any error messages.) and -m limits the number of events analyzed.
This code is intended to run on the CLON cluster, so I have
only tested it on SunOS and on Linux. the code is under CVS
in the directory: utilities/bosanal. It is compiled and installed
on the CLON cluster in /usr/local/bin
If you have any questions please contact me at:
maurik.holtrop@unh.edu
==============================================================================
A SAMPLE SESSION: (comments are in <> brackets.
< Start up the code in quiet mode (easier to see real errors) and only >
< analyze the first 500 entries in the data file. Don't write to the >
< MAP (no -map specified.) >
< Note that for this example CLON_PARMS was set to >
< /home/holtrop/codes/clas/parms >
> pedestals /work/clas/data/sep97/clas_peds_005912.A00 -quiet -m 500
Retreiving ROC12.tab from /apps/clas/u1/parms/TT
Retreiving ROC13.tab from /apps/clas/u1/parms/TT
Retreiving ROC14.tab from /apps/clas/u1/parms/TT
Retreiving ROC15.tab from /apps/clas/u1/parms/TT
Retreiving ROC16.tab from /apps/clas/u1/parms/TT
Running /work/clas/data/sep97/clas_peds_005912.A00 from 0 to 500
No data for Crate 16 Slot 7, Channel 53 < this indicates an ERROR in the ADC!>
No data for Crate 16 Slot 23, Channel 55 < there was no data in the RC for >
< this channel. >
No data for Crate=12, Slot=2. < this says that the ADC in Crate 12 >
< slot 2 was removed. >
This slot will be dropped from sparfile.
Comparing /home/holtrop/codes/clas/parms/initfiles/croc07.spar
Crate=12 Slot=3, Channel=24: old value= 1000 new value= 547
Ok to change value ? (Y/n/a/c/h=help) Y: Will use new value.
< These lines notified that a channel>
< Changed value by more than 25 >
< channels, which could be an error ?>
< in this case an unbossified channel>
Comparing /home/holtrop/codes/clas/parms/initfiles/croc07.spar
Crate=12 Slot=3, Channel=25: old value= 1000 new value= 589
Ok to change value ? (Y/n/a/c/h=help)
Y: Will use new value.
Comparing /home/holtrop/codes/clas/parms/initfiles/croc07.spar
Crate=12 Slot=3, Channel=26: old value= 1000 new value= 521
Ok to change value ? (Y/n/a/c/h=help)
Y: Will use new value.
Comparing /home/holtrop/codes/clas/parms/initfiles/croc07.spar
Crate=12 Slot=3, Channel=27: old value= 1000 new value= 570
Ok to change value ? (Y/n/a/c/h=help)c
Are you sure you want to continue without further interruption ?
(same as specifying -nocompare) (y/n)y
Y: Will use new value.
< User entered c for continue. >
< Code continues without further >
< interruption. >
Writing /home/holtrop/codes/clas/parms/initfiles/croc07_005912_Oct_09_97_19:26:21.spar
Relinking /home/holtrop/codes/clas/parms/initfiles/croc07.spar
Backup link in /home/holtrop/codes/clas/parms/initfiles/croc07.spar.~1~
Writing /home/holtrop/codes/clas/parms/initfiles/croc06_005912_Oct_09_97_19:26:21.spar
Relinking /home/holtrop/codes/clas/parms/initfiles/croc06.spar
Backup link in /home/holtrop/codes/clas/parms/initfiles/croc06.spar.~1~
Writing /home/holtrop/codes/clas/parms/initfiles/croc08_005912_Oct_09_97_19:26:21.spar
Relinking /home/holtrop/codes/clas/parms/initfiles/croc08.spar
Backup link in /home/holtrop/codes/clas/parms/initfiles/croc08.spar.~1~
Writing /home/holtrop/codes/clas/parms/initfiles/croc11_005912_Oct_09_97_19:26:21.spar
Relinking /home/holtrop/codes/clas/parms/initfiles/croc11.spar
Backup link in /home/holtrop/codes/clas/parms/initfiles/croc11.spar.~1~
Writing /home/holtrop/codes/clas/parms/initfiles/LAC_005912_Oct_09_97_19:26:21.spar
Relinking /home/holtrop/codes/clas/parms/initfiles/LAC.spar
Backup link in /home/holtrop/codes/clas/parms/initfiles/LAC.spar.~1~
<Finally the code tells you where it wrote the new spar files, and what the >
<name is of the backup link (or file) to the previous version. >