Time Calibration Program for E93-038
Version 2.4
Purpose:
Optimization of track reconstruction and background
rejection in the nucleon polarimeter requires accurate calibration of the timing
relationships between detector elements and between the nucleon and electron
arms. The time calibration program performs the following tasks:
- position calibration
- obtains a linear relationship between right and left TDC differences and
the hit position in each detector
- front calibration
- obtains offsets between mean times for each detector in the front array
- trigger calibration
- obtains relationships between trigger time and mean time for each element
of front array
- ctof calibration
- relates the event time in the target to the flight times in the two arms,
such that the corrected time of flight (ctof) peak for quasielastic knockout
from deuterium should be centered at zero and be as narrow as possible
- rtof calibration
- obtains offsets for rear detectors which optimize the time of flight for
quasielastic scattering between front and rear arrays, such that the rtof
peak should be centered at zero and be as narrow as possible
- tagger calibration
- uses charged-particle tracks to align times in front and rear
tagger arrays. Tagger calibration also includes walk corrections and
modifies the position calibration by comparison with reconstructed tracks.
This document describes the use of the program and
associated shell scripts as presently installed on JLab computers and provides
some sample output for comparison purposes. A brief revision history is
provided also. A more detailed presentation of the algorithms used in Version 2.2 of the program npol_time_calibration
is provided in the
report time_calibration.ps.
This report will soon be updated for Version 2.4.
Instructions
Procedure
The program is presently installed in the directory /u/group/e93038/Analyzer2.4/
under the subdirectory TimeCalibration. The Samples
subdirectory provides sample scripts and input files that may used as templates
for your work.
- Copy the required scripts and input files into your own directory and
modify the environment variables established by the script setup_analyzer
appropriately. Use source setup_analyzer to establish and verify the required
environment variables.
- Select suitable runs for each step of the procedure and enter your
selections into an input file; the format of this file is described below.
- Determine the range covered by the ph_start
peak, and adjust the values of min_phstart and max_phstart
used by $cuts_calibration. These values should comfortably
bracket the neutron peak.
- Check that the particle ID cuts are set properly for the present
kinematics or are disabled by using very wide windows.
- The program is run by the shell script do_time_calibration $1 using
the input file time_$1.inp.
- After completion of the program, examine the summary file, which reports statistics and/or results for each step
- Examine the histograms. The paw script check_calibration.kumac
displays these in a convenient format. If some of the plots appear to
have insufficient statistics, add more runs to the input list for the
appropriate steps and repeat.
Environment variables
The following environment variables must be established by the script that runs
the program. Some may set in advance by setup_analyzer
environment variable |
sample file |
explanation |
detector_geometry |
pgeom_detector.dat |
parameter file specifying the physical locations of each detector |
ph_calibration |
phcalib.dat |
parameter file containing pulse-height calibration data |
cuts_calibration |
time_calibration_kin1.cuts |
parameter file containing time window and PID cuts |
pass1_directory |
/w/work406/e93038/ntuple |
directory containing ntuple files produced by engine |
output_directory |
/w/work304/e93038b/ntuple2.4 |
directory for output files |
input_calibration |
|
an input calibration file is needed only if a subset of the
calibration steps is employed. Most users should use none for this variable. |
log_file |
time_$1.log |
output file containing procedure log |
summary_file |
time_$1.sum |
output file containing summary of results |
test_hbook |
time_$1.hbook |
histograms for evaluation of calibration |
output_calibration |
time_$1.dat |
output file containing calibration parameters |
Properties of good calibration runs
For best results, choose runs with the following characteristics:
- all elements must be active
- Charybdis should be off for position calibration
- Charybdis must be off for successful tagger calibration
- low beam currents (<20 ľA) with Charybdis on gives the best results for ctof
and rtof calibrations
- high statistics
Format of the input file
Each line begins in column 1 and contains a single item
without spaces. Keywords must be lowercase. The first line contains
either of the keywords calibrate or check. If calibrate
is chosen, some or all of the calibration steps will be performed and the file $output_calibration
will be updated. If check is chosen, $test_hbook will be
produced using calibration parameters read from $input_calibration
without altering any of the parameters.
Next a sequence of blocks is read where each block begins
with one of the keywords position, front, trigger, ctof,
rtof, or tagger to identify the desired calibration step.
The sequence is terminated by line containing the keywork end.
Steps cannot be repeated and must appear in order, but if $input_calibration
already contains reasonable parameters for the omitted steps it is not necessary
to include all steps when updating $output_calibration or checking one or
more steps. However, most users should set $input_calibration to none
and perform a complete calibration rather than a selection of steps. A
list of suitable 5-digit run numbers, one per line, follows each step
selection. Each list is terminated by line containing a slash (/).
The list for each step is handled independently. Up to 10 runs can be
employed by each step.
Sample results
The file time_38295.ps
displays output from check_calibration.kumac for a calibration based
upon Samples/time_38295.inp.
Most spectra are designed to be centered upon zero after successful
calibration. The pages of this file are described briefly below.
- Position spectra for each of the four arrays, summed over elements, look
fine. Spectra for the front and rear are confined to the physical
extent of the detectors and show sharp edges; these spectra are
inclusive. Spectra for the charged-particle tagger select tracks which
pass through each layer of the tagger and front array. The calibration
procedure aligns the position of a track in tagger elements with the
corresponding position in the nearest layer of the front array.
Therefore, although these detectors are larger, the spectra are limited to
the size of the front detectors with some spreading due to resolution.
- Time alignment spectra for each array should be centered upon
zero. Although these spectra do not include kinematic
corrections, they can be used to select hits which are associated with the
npol trigger.
- The procedure for the front array uses events with a single hit in
the front and none in the front tagger. The shape of this spectra
arises from the correlation between time and position.
- The procedure for the rear array uses events with one hit in the
front, one hit in the rear array, and no hits in either tagger array. Relative offsets are adjusted to
align all elements of the rear array at zero for the purpose of
filtering.
- Tagger alignment uses tracks with one hit in each layer of the tagger
and front arrays; such tracks arise primarily from quasifree
protons. The present procedure aligns the peaks for each tagger
element at zero; hence, the offsets include the effects of energy loss.
- Several time-of-flight spectra are collected on this page.
- The ctof spectrum uses events with a
single hit in the front and none in the front tagger. Measured
flight times are compared with kinematical calculations using electron
information and neutron position, such that ctof should be
centered upon zero for quasielastic knockout. Note that the
alignment uses the mean time but the distribution has a tail, such that
the peak becomes slightly negative.
- The lower-left panel compares the measured time between front and rear
arrays with a calculation based upon elastic scattering from the
nucleon. The procedure uses events with single hits in the front
and rear arrays and none in the taggers. A cut on |ctof|<2
is applied also. Note that because quasifree
scattering from carbon produces a long tail on the velocity
distribution, the calibration procedure aligns the mode instead of the
mean of the distribution. A small satellite peak at rtof ~
-2.5 ns due to lightspeed particles is visible, but is more clearly
separated at Q2 = 1 and here at Q2=1.5 (GeV/c)2.
- The upper-right panel shows the front-rear velocity spectrum for the same data.
- The lower-right panel shows the ratio between measured and elastic
velocities with a prominent peak at unity.
- This page shows that ctof spectra for each element of the front
array are individually well aligned.
- The next two pages show that rtof spectra for each element of the
rear array are individually aligned, but the statistics remain somewhat
limited for the new procedure. Using additional runs for the rtof
step would help.
- The trigger calibration corrects the mean time in the front array for the
correlation between time and position, using events with a single hit in the
front array and none in the front tagger. These self-timing peaks are all
centered upon zero, with small residual offsets probably due to binning in
the calibration procedure.
- Position spectra for individual elements of the front array all look
normal. The spiky appearance is an artifact of binning.
- With the exception of detector 22, position spectra for individual elements of the bottom array all look
normal. The spiky appearance is an artifact of binning. The dip
in the left half of the position spectrum for detector 22 causes
difficulties throughout the January, 2001 run period. For some runs
the peak at the left edge is small and the calibration identifies the right
edge of the dip as the end of the detector, while in other runs the left
peak is strong enough that the program chooses the left edge of this peak as
the end of the detector. A genlog entry discusses this problem in more
detail.
- With the exception of detector 36, position spectra for individual
elements of the bottom array all look normal.
- Position spectra for individual elements of front tagger array all look
normal.
- Position spectra for individual elements of rear tagger array all look
normal. The statistics for the outermost elements remain limited
despite the improvement in the algorithm.
- Mean-time spectra for the front array are used in the filtering process to
select relevant hits. These are all well aligned and the shapes are
related to the time versus position correlation, although there are
interesting variations in detail.
- Mean-time spectra for the rear array are used in the filtering process to
select relevant hits. These are all well aligned, although the
statistics for events with single hits in the front and rear and none in the
taggers are limited.
- Front tagger mean times are aligned well.
- Rear tagger mean times are aligned well also, but the statistics for outer
detectors are limited.
Auxiliary programs
tdc_correlations
The program tdc_correlations, found in subdirectory TDCcorrelations,
produces an hbook file containing two-dimensional histograms of tdcl vs. tdcr
for each detector in the front array. The entire set is displayed on a
single page using the paw kumac tdc_correlations.kumac. A sample
figure can be found at tdc_correlation_38295.ps.
Single-hit neutral events in the front array are selected to ensure that one
identifies the detector responsible for the trigger correctly. Each
detector shows a dominant band consisting of horizontal and vertical segments
joined by a curved transition region. When the signal for the left PMT
arrives at the trigger module first, the value of tdcl is determined by
the delay between the resultant TDC start and its own timing signal.
Consequently, the horizontal segment represents the tdcl self-timing peak
for events in which the left PMT produces the trigger. Similarly, the
vertical segment represents the tdcr self-timing peak for events in which
the right PMT produces the trigger. If the delays within these PMTs and in
the cables were equal, these two segments would have the same lengths and the
transition region would represent the middle of the detector. However,
these segments have quite different lengths for some detectors, probably due to
performance or voltage differences between their two PMTs. The curvature
of the transition region is probably related to variation of the effective
signal velocity in the detectors due to reflections.
The variable p_tc represents the position of the
self-timing peak based upon a parametrization of the tdcl vs. tdcr
correlation. Using single-hit neutron events, the tc spectrum for
each detector should be centered at zero after calibration and should have a
width determined primarily by the intrinsic resolution of the detector,
typically 0.5 ns FWHM, as seen in the widths of each segment. By contrast,
the td spectra are much wider -- their widths are determined by the size
of the detector. Assuming that the effective signal speed is 15 cm/s and
that a signal needs to cover half the detector on average, the width of td
spectra is expected to be about 3.3 ns. Most td spectra have a
relatively narrow peak at the right side arising from accumulation in the
transition region where the time between scattering and the trigger is equal for
both sides. This peak is preceded by a slope toward the left, but the
detailed shape varies with the relative sizes of the two segments of the tdc_correlation
spectrum for each detector. After calibration, the mean td is
aligned at zero, such that the positive peak is typically near +0.5 ns and the
left edge near -2.5 ns.
Summary of recent changes
Version 2.4
- A typographical error in the velocity calibration, identified by Shige,
has been corrected. Unfortunately, this changes the relative timing
between the front and rear arrays, requiring that new calibrations be
performed.
- Brad's improvements to the tagger calibrations, adding statistics from np
events, have been incorporated into the standard version.
- Calibration of the rear detectors no longer uses cosmic runs. We now
use a procedure based upon the Duke calibration method, which uses
quasielastic neutron scattering events with a single hit in both front and
rear arrays, that Shige has shown gives better resolution for the front-rear
time of flight. However, because it is often necessary to employ
several runs to achieve sufficient statistics for this procedure, all
calibration steps may now use up to 10 runs; different sets of runs may be
selected for each step.
- The definition of p_td for the rear array has been changed so that
quasielastic NN events now appear near zero for this variable. This
modification is useful for the filtering step of the second-pass
replay. The ctof_offset array has been expanded to include the
offsets needed to center rtof at zero also. These and other
changes to the calibration parameters make the new files incompatible with
previous versions.
Version 2.3
- The makefiles for npol_time_calibration and related programs have
been substantially rewritten for use with the gmake utility and will
produce executables for either Linux or Sun computers. The script setup_analyzer
establishes pointers to the executables for the current platform and
environment variables for the files containing parameters and cuts for the
desired kinematical conditions. Although these scripts were written
specifically for the JLab environment, modification for use at other
institutions should be straightforward. Details may be found at installation
notes.
- The check_calibration kumac has been modified to produce postscript
output quickly without the HIGZ screen. Use pawps check_calibration
[run_number]. This procedure is much faster than before and is
suitable for batch processing also.
- Numerous small changes were made for compatibility with g77,
including the addition of trigonometric functions with arguments in degrees.
- Additional selection criteria can be used in several steps of the time
calibration procedure to improve the event samples. These criteria are
read from the file $cuts_calibration.
- The detector numbers in each event are tested for internal
consistency. This usually isn't necessary, but some versions of engine
produced corrupted ntuples that generated either inconsistent results or
crashes. The new calibration programs detects such problems.
Version 2.2
- the alignment procedure for the tagger detectors has been changed.
Previous versions tried to align tagger elements with respect to the nearest
element of the front array, accounting for time of flight between these
elements. The staggered arrangement of the rear taggers with respect
to the last layer of the front array caused some difficulties for this
procedure. Most notably, of the tracks which pass through detectectors
59 and 67, half pass through detector 18 and half through 19. Although
the ctof offsets are very similar within the groups 16-18 and 19-20,
the two groups differ by more than 3 ns. This effect is responsible
for the double peaks seen in time calibrations for detectors 59 and 67 in
Version 2.1. These double peaks are present in the calibration
spectra, which compare tagger and front times, but not in mean-time
spectra. Although I had hoped to use time of flight between front and
rear tagger arrays to differentiate between protons and pions, the time
difference or the frequency of pions is apparently too small to discern a
second peak. Therefore, I decided to simplify the tagger calibration
and to simply align mean-times at zero for charged particles that pass
through both veto layers, all front layers, and the tagger layers.
Note that this procedure works with protons which are delayed by the lead
and for the rear tagger by the front array detectors. Consequently,
recoil proton produced by incident neutrons tend to arrive at the rear
tagger early (p_td ~ -3 ns).
Version 2.1
- ctof calibration can now use a separate run. This procedure only
employs events with one hit in the front and none in the veto array.
For best results use a high-statistics low-current run taken with Charybdis
ON in order to optimize signal to noise in the ctof spectra for individual
elements of the front array.
- Previous versions produced all histograms used for verification of the
calibration from a single subroutine; hence no histograms were produced if
the program was used for a single step of the calibration.
Furthermore, it was becoming increasingly difficult to select the same
samples of events for these histograms as employed for each of the various
calibration steps, especially now that the procedure can use three different
ntuples. Therefore, the production of histograms has now been
distributed to each calibration task separately. This revision costs
more computation time, but the histograms portray the results for each step
more accurately.
- A new tdc_correlations program displays the tdcl vs. tdcr
correlation, which helps to explain the shape of mean time spectra for
single-hit events and to recover self-timing information.
Version 2.0
- Installed in /u/group/e93038/Analyzer2.0.
- Data for the new fourth tagger layer is included, but the programs will
still work for runs replayed with earlier versions of engine before
implementation of the fourth tagger. However, formats for the
parameter files have changed.
Version 1.6
- Installed in /u/group/e93038/Analyzer1.6.
Version 1.5
- Walk corrections for the tagger times are included. The procedure
uses only tracks which fall in the central 20 cm of the front array.
Two parameters in a model of tagger time versus pulse height are then fitted
by linear regression. Consult the longer calibration report for
further details.
- Position calibration for the taggers compare time differences for tagger
elements with predicted tracks. For the front tagger elements we
minimize the difference between positions in the tagger with the position in
the first layer of the front array. For the rear tagger the intercept
is based upon the line between a hit in the rear array and a hit in the last
layer of the front array. However, because these procedures do not
produce reliable slopes, a fixed slope of 0.37 cm/ns based upon the
calibration of the front array is employed.
- The procedure for finding centroids has been improved. Rather than
using the mean for an entire histogram, which can be distorted by
background, the highest channel is found and the mean computed for a
suitable width surrounding the highest channel (mode) of the distribution.
- The front-rear velocity calibration uses the mode rather than the mean of
the time-difference spectrum because that distribution is significantly
asymmetric.
Version 1.4
- File names and range parameters are now obtained from environment
variables rather than from interactive dialog. These changes
facilitate use
of the program in batch mode for production processing. A sample
script is provided as do_time_calibration.
- The definition of the coincidence time of flight, p_ctof, is now ctof
= tof - ntof
where tof is the corrected time of flight and ntof is predicted from the
electron kinematics and nucleon angle. The result should be zero,
within resolution, if the event arises from the d(e,e'n)p reaction.
- RF information is no longer used in the ctof algorithm.
- Ntuple chains are now processed.
Maintained by: James J. Kelly
Last revised: January 3, 2002