Next: Slow Controls data Up: MiniDAQ instructions Previous: Pedestal/pulser study code

Macros for Pedestal/Pulser Studies (Obsolete)

There are several STAF macros; they perform some typical tasks and serve as examples for the user to produce his/her own macros. In all cases, start by logging on as staronl to spica.lbl.gov, deneb.lbl.gov or another machine which supports it, and starting TCLSTAF. Currently, STAF appears to work under Solaris, provided that one does not attempt to access data through a network socket.

On spica, the executable is $HOME/tcl/bin/irix/tclStaf; on deneb, rncsv1, or rncus1, it is $HOME/tcl/bin/irix/sun4os5; one should not have to be in any particular directory to run the macros discussed below. However, at least on deneb, it is necessary to do a ``klog user_name'' to access afs. There is no afs account for staronl, so you must use your own.

The pre-defined pedestal/pulser procedures which run from netfeed are:

Some more analysis macros from Nathan Stone:

Finally, several PAW macros exist to simplify saving graphics output:


Producing a Basic Pedestal Ntuple

Extracting information from a STAF table can be slow because getvalue echoes information; an alternate command is planned, but not yet available. The fastest approach is often to create an ntuple from the table, then to manipulate the ntuple. The following commands take 100 events from netfeed0, create an ntuple 10.bucket, channel, ave, rms and save it to the disk file $DATA_STAB/file_out.nt:

STAF> nt_basic Socket 100 file_out

This kumac will also process a saved run.


Plotting Noise vs FEE Chip Number

The following commands take 100 events from netfeed0, create an ntuple 10.bucket, channel, ave, rms, and save it to the disk file $DATA_STAB/file_out.nt. The ntuple is manipulated to histogram the pedestal rms values for each FEE board chip, with an entry for each time bucket of each channel on the chip. Five pages, six histograms to the page, are plotted to the screen and the file noise_by_chip_100709pm.ps :

STAF> exec nt_basic Socket 100 file_out
STAF> exec shadow noise_by_chip_100709pm.ps
STAF> exec noise_by_chip
STAF> exec noshadow


Comparing Multiple Measurements

The following commands make three measurements, 64 events each, from netfeed0, then plot the pedestal mean and rms as a function of FEE chip number; after the first measurement, the pedestal shift relative to the first is plotted instead of the mean. All measurements are plotted together, distinguished by color. Each point is averaged over all channels on a chip and a subset of the time buckets (101-110 in the example). After three data-taking cycles, the final commands replot the data somewhat differently and save the plots in the Postscript files output1.ps and output2.ps:

STAF> exec setup_pedplot_live 0
STAF> exec ped_measure_socket 64
STAF> exec pedplot_live 101 10

STAF> exec ped_measure_socket 64
STAF> exec pedplot_live 101 10

STAF> exec ped_measure_socket 64
STAF> exec pedplot_live 101 10

STAF> exec pedplot_save output1.ps

STAF> exec pedplot_vs_measure output2.ps


make_dummy_tables

This STAF macro creates dummy tables needed by the tcl modules. Typically, it will be called from within another macro, rather than directly by the user.


noise_by_chip

This STAF/PAW macro simply histograms the rms distributions for FEE boards 1-15, by chip. Five pages, six histograms each, are produced. The macro assumes that ntuple 10, with entries bucket, channel, ave and rms, has already been loaded. The histograms are numbered as

Here, chip number one pertains to the one mapping to lower channel numbers, while the FEE number is numbered 1-15, starting with the outermost card on the test sector.

The following are referenced (directly or indirectly):


nt_basic 1='Socket' 2='100' 3='output'

This STAF macro takes events from a socket or a file, calculates the mean and rms for each pixel, then saves the results both as a STAF table and as an ntuple. The tails of the input distributions are not truncated by the underlying routine (tstam), so the rms is occasionally dominated by a single outlier (most notably when an event is corrupted).

Source, destination directories in the .kumac are
data_dir_in = $DATA_STAB ; and
data_dir_out = $DATA_STAB ,
where $DATA_STAB is defined as part of the user environment.
LUN 29 is used temporarily to output the ntuple.

The following are referenced (directly or indirectly):


nt_dump 1='output'

This STAF macro simply creates an ntuple from the {tstam) pedestal table (such as that created through the nt_basic macro.

The destination directory is wired into the .kumac as
data_dir_out = $DATA_STAB ,
where $DATA_STAB is defined as part of the user environment.
No other macros are referenced; LUN 29 is used temporarily to output the ntuple.


ped_measure 1='input' 2='output' 3='100'

This STAF macro assumes that a system test data file already exists and that a substantial amount of setup has already been done; typically, it will be called from within another macro, such as nt_basic, which performs the setup. It loops over the requested number of events, using tstam to calculate the mean and rms for each pixel.

References (directly or indirectly) the following:


ped_measure_socket 1='Socket' 2='100'

This STAF macro assumes that setup_pedplot_live, or the equivalent, has been executed. It loops over events from netfeed, using tstam to calculate the mean and rms for each pixel. Currently, netfeed has 10 chances to deliver an event, before the run exits.

References (directly or indirectly) the following:


pedplot_live 1='101' 2='25'

This STAF macro assumes that setup_pedplot_live and ped_measure_socket (or the equivalent) have already been executed, so as to fill the /dui/NewPedestalsGains/Pedestals table. It then averages over the requested time buckets and over all 16 channels in each chip on the 15 FEE's. Two pages of output are produced, one of pedestal means, one of rms's.

Note:


pedplot_save 1='pedplot_save.ps'

This STAF macro replots results from the pedplot_live macro to a Postscript file; nothing is recalculated.


pedplot_vs_measure 1='ped_vs_measurement.ps'

This STAF macro replots the information compiled through multiple calls to pedplot_live; the format is to plot the pedestal shifts relative to the first measurement on one set of histograms and the pedestal rms measurements on a second set; separate histograms are plotted for each chip.


read_systest_setup

This STAF reads the bad channel list, etc. to setup the analysis of a run. Typically, it will be called by other macros, rather than by the user.

The following are referenced (directly or indirectly):


setup_pedplot_live 1=''

This STAF macro sets up a run to get pedestal or pulser data from the netfeed, but does not read any events itself. If one does not specify an argument of 0 or 1 for the netfeed, the macro will prompt for it.

The following are referenced (directly or indirectly):


setup_switches

This STAF macro sets creates tables and sets switches used by tstam to analyse a pedestal or pulser run. Typically, it will be called by other macros, rather than by the user.


calibrate

This STAF macro performs pedestal and gain calculations and creates the calibration file.

table962

Sub-macro calibrate#now makes it easy to define the command-line inputs without typing at the command line. It takes no command line arguments; one edits the sub-macro to enter the appropriate filenames (allowing for time-stamp/disk redundancy).

Written: 05-DEC-1996 by Nathan Stone


delta

This STAF macro calculates the separation between incident and reflected laser track hits.

table971

The Staf-resident result are:

Written: 05-DEC-1996 by Nathan Stone


stability

This STAF macro calculates/displays pedestal and gain stabilty data.

table983

Additional Input:

  1. A series of calibration files--the user needs to edit the aliases sub-macro of this file to declare which calibration files will be used.
  2. The comis file date.for must be disk resident in the current directory.

Results:

/dui/Stab/pedstab
A Staf-resident table holding shift-averaged ped/rms/gain values with drifts (differential from first shift) and deviations (differential from shift-averaged values).
stability.xdf
File written to the current directory, holding the "pedstab" table described above.

Sub-macro stability#plot

(Generates "stability-style" plots from calculated stability results.)

table997

Sub-macro stability#gauss

(Generates 1D plots of drifts and deviations fitted with gaussians to characterize the overall magnitude of the variations.)

table1003

Sub-macro stability#read

(Reads a previously generated set of stability tables, and sets up proper aliases, to allow plotting at a later date, for example.)

No Command Line Arguments.

Written: 05-DEC-1996 by Nathan Stone


epsshadow 1='output'

This STAF/PAW macro simply directs a copy of the graphics output to a portrait-mode encapsulated Postscript file at unit 66.


shadow 1='output'

This STAF/PAW macro directs a copy of the graphics output to a portrait-mode Postscript file at unit 66.


landshadow 1='output'

This STAF/PAW macro directs a copy of the graphics output to a landscape-mode Postscript file at unit 66.


noshadow

This STAF/PAW macro closes unit 66, which is presumably a graphics metafile.


Page maintenance:

Roy Bossingham, LBNL
RRBossingham@lbl.gov