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.

  1. 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.  
  2. 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.
  3. 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.  
  4. Check that the particle ID cuts are set properly for the present kinematics or are disabled by using very wide windows.
  5. The program is run by the shell script do_time_calibration $1 using the input file time_$1.inp.
  6. After completion of the program, examine the summary file, which reports statistics and/or results for each step
  7. 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:

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.

  1. 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.
  2. 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.
    1. 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.
    2. 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.  
    3. 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.
  3. Several time-of-flight spectra are collected on this page.
    1. 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.
    2. 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.
    3. The upper-right panel shows the front-rear velocity spectrum for the same  data.  
    4. The lower-right panel shows the ratio between measured and elastic velocities with a prominent peak at unity.
  4. This page shows that ctof spectra for each element of the front array are individually well aligned.
  5. 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.
  6. 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.
  7. Position spectra for individual elements of the front array all look normal.  The spiky appearance is an artifact of binning.
  8. 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.
  9. With the exception of detector 36, position spectra for individual elements of the bottom array all look normal.  
  10. Position spectra for individual elements of front tagger array all look normal. 
  11. 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.
  12. 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.
  13. 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.
  14. Front tagger mean times are aligned well.
  15. 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

Version 2.3

Version 2.2

Version 2.1

Version 2.0

Version 1.6

Version 1.5

Version 1.4

 


Maintained by: James J. Kelly

Last revised: January 3, 2002