NPOL Analysis Program for E93-038

Version 2.4

Purpose:

    Our version of the Hall C engine analyzes HMS data and produces an ntuple containing analyzed HMS variables plus raw NPOL variables.  The program npol_calculations.exe analyzes the NPOL data and performs kinematic calculations, producing an expanded ntuple.  This document provides brief instructions for using the program and some sample results.  A more formal report describing the calculations in more detail will be provided later.

Event Classification

    Kinematic calculations depend upon reconstruction of tracks for the events of interest.  Although the simplest events contain a single hit in the front and rear arrays, most events are more complicated.  The steps of the reconstruction process are summarized below.

  1. The first step in the procedure is to evaluate mean pulse height, mean time, and position for every hit comprising an event.  A filtering procedure then discards hits which fall below software pulse-height thresholds, or reconstruct to positions significantly outside physical detectors, or fall outside time windows suitable for quasifree knockout and subsequent flight through the polarimeter.  
  2. During the filtering process we attempt to ascertain which hit produced the trigger, even if that hit fails one of the selection criteria.  
  3. The next step is to group the remaining hits into recognizable patterns.  A cluster in the front array is defined as a set of hits that are close in both time and position and which contain no missing layers.  We assume that the first nuclear interaction occurs within the layer closest to the target containing hits.  If that layer contains several hits, we assign the nuclear interaction either to the top or the bottom hit by determining whether the nucleon scatters upward or downward.  An error condition is set if the first layer contains a noncontiguous set of detectors because such gaps may indicate an accidental spoils the reconstruction.
  4. If there is a second cluster in the front array, we determine whether the nucleon scatters upward or downward using hits in the rear array.  We then decide whether the first scattering was upward or downward by comparison with the first cluster.  Note, however, that is difficult to analyze multiple scattering of the projectile within the front array and there is considerable room for improvement of this algorithm.  Fortunately, the frequency of such events is small enough that they can be discarded without significant loss of statistics.
  5. We then look for a hit in the rear tagger along the chosen track; if one is present within a specified distance the particle detected in the rear is assigned positive charge.  If both top and bottom rear subarrays contain filtered hits and it is not possible to choose the most probable track unambiguously, an error condition is set.  

    The following table summarizes the track reconstruction error conditions.

p_error

explanation
0 no reconstruction errors
1 no hits remain after filtering
2 no hits remain in the front array after filtering
3 no hits remain in the rear array after filtering
4 gap in first layer of first cluster in front array
5 gap in first layer of second cluster in front array
6 gaps within both first layers
7 ambiguity in selecting rear hit
8 unphysical kinematics
9 inconsistent detector numbers or multiplicities
10 incident charged particle with a missing layer in front array

The following table describes the tracking information contained in the output ntuple.

variable explanation
p_error an error code for the track reconstruction
p_gfr number of hits in front array after filtering
p_gtop number of hits in top rear array after filtering
p_gbot number of hits in bottom rear array after filtering
p_gvt number of hits in front tagger after filtering
p_gtg number of hits in rear tagger after filtering
p_idtrig detector ID with hit causing trigger
p_ncl1 number of hits within the first cluster in the front array
p_ncl2 number of hits within the second cluster in the front array
p_idfront detector ID for primary neutron scattering
p_idlast detector ID for second neutron scattering in front array
p_zfr charge for the incident particle (0 or 1)
p_zre charge for the track chosen in the rear array
p_idrear detector hit for hit track selected in rear array
p_rveto distance (cm) between track and nearest filtered hit in front tagger
p_rtag distance (cm) between track and nearest filtered hit in rear tagger

 

Instructions

Requirements:

The program is presently installed in the directory /u/group/e93038/Analyzer2.4/KinematicCalculation/npol_calculations.exe.  The following environment variables must be established by the script that runs the program.

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
time_calibration   parameter file containing time calibration data
tracking_cuts tracking_cuts_kin1.dat describes the cuts used for classifying events
pass1_directory /w/work406/e93038/ntuple directory containing ntuple files produced by engine
pass2_directory /w/work304/e93038b/ntuple2.4 directory containing ntuple files produced by engine
output_directory /w/work304/e93038b/ntuple2.4 directory for output files
run_number $1 5-digit run number
target $2 deuteron or proton for LD2 or LH2 targets
calibration_number $3 5-digit run number for calibration file

A sample script, do_npol_calculations, has been provided.  It uses the sample files and directory names listed above.  The program assumes that data are stored in ntuples with names of the form polraw#####_n.rzdat where ##### denotes the 5-digit run_number and n is an index for members of an ntuple chain belonging to a particular run.  Output ntuples are written to files named pol#####_n.paw.  In addition, a journal file, pol#####.log, is produced.

Instructions:

  1. Use source setup_analyzer to establish and verify the required environment variables.
  2. Examine the raw data and adjust the tracking cuts as needed.
  3. The program is launched by the command: do_npol_calculations   run_number   target  calibration_number where you must supply the appropriate run number and target (deuteron or proton) values.  Time calibration parameters are read from a file named time_#####.dat where ##### is a 5-digit calibration_number for a nearby run used for calibration.
  4. Examine the output ntuple.  The auxiliary program basic_histograms produces an hbook file containing various diagnostic and physics histograms.  The auxiliary program check_detectors produces a more extensive set of diagnostic histograms useful for evaluating the performance of each detector.  PAW kumacs for displaying these results are available.

Limitations:

  1. Kinematic calculations do not account for the energy loss suffered by protons passing through the lead sheets or the detector elements.
  2. The analysis does not account for bending of proton trajectories in Charybdis.
  3. Compatibility with earlier versions requires that events be limited to 62 hits even though there are 70 detectors, but this limitation is benign because such high multiplicities should never be seen if the data acquisition is working properly.

Auxiliary programs

    A couple of simple programs for producing useful histograms from the output ntuple have been provided, together with sample kumacs for display purposes.  

basic_histograms

    The program basic_histograms found in subdirectory BasicHistograms produces an hbook file containing many histograms that are useful for evaluating the quality of the data.  The program is launched by the command make_histograms run_number.  The paw kumac basic_histograms.kumac can then be used to display the histograms.  The file histo_38295.ps contains a set of figures based upon run 38295.  Below we provide a brief description of the pages.

  1. Mean pulse height spectra for front, rear, front tagger, and rear tagger arrays.  No cuts were applied.  Calibrations of the front and rear arrays were used to convert ADC channels to MeVee.  The spectrum for the rear array includes a structure beyond 60 MeVee arising from ADC overflow.
  2. The position spectra for the front and rear arrays show sharp edges defined by the sizes of these detectors.  Constant-fraction discrimination gives these detectors have relatively good position resolution.  Positions in the taggers were calibrated by comparing tracks with the nearest hit in the front array, but the resolution with leading-edge discrimination is relatively poor giving these spectra a more Gaussian appearance.  The width of these spectra is significantly less than the size of the detectors, which are not completely illuminated.
  3. The mean-time spectum for the front array shows a dominant peak produced by the primary scattering event centered at zero, followed by secondary peaks arising from multiple scattering of the recoil proton, superimposed upon an uncorrelated background.  Although no cuts were applied to this spectrum, it is clear that track reconstruction can safely disregard hits outside a (-5,+10) ns window.  The peak in the rear array corresponds to quasielastic scattering between the front and rear arrays.  Early hits can be eliminated using a window (-10, 25) ns.  The front tagger also displays a quasifree proton peak superimposed upon an uncorrelated background.  Offsets were chosen to place the proton peak in the rear array at zero also.  Thus, initial and final protons can be eliminated using a (-12 ns, +5 ns) cut.
  4. The trigger time spectrum shows a 0.5 ns resolution for reconstruction of the trigger time.  The error spectrum shows that the most common tracking problem is exclusion of all rear hits, usually because the rear hit occurs too early to arise from a valid track.
  5. The rveto spectrum of distances between the incoming track and the nearest hit in the front tagger contains a relatively narrow distribution superimposed upon a flatter distribution, with a significant change in slope at about 30 cm which is related to the position resolution for the tagger array.  Therefore, we identify tracks with front tagger hits within 30 cm and within the time window as charged particles and disregard front tagger hits at larger distance or inappropriate time.  The rtag spectrum is essentially featureless because recoil protons are widely distributed in angle and originate anywhere along the track.  Nevertheless, we use the same proximity conditions to identify a charged track from front to rear, arguing that similar position resolution is expected.
  6. Hit frequencies are shown by detector number and by array.
  7. Filtered hits shows multiplicities after application of filtering conditions.
  8. The raw tof spectrum is simply ph_start converted to ns.  The upper right spectrum shows the path-length correction to the electron time of flight.  The tof spectrum includes offset and trigger-delay corrections for the neutron arm.  The ctof spectrum subtracts the calculated flight time for a d(e,e'n) reaction and, hence, should be centered at zero.  This spectrum selects neutrons without track reconstruction errors and includes HMS particle-identification cuts (see item 10).  We then obtain FWHM about 2 ns.  The tail on the right side might include neutrons from the d(e,e'p)(p,n), which are expected to be late because of proton energy loss in various materials.
  9. The front-to-rear velocity spectra require neutrals in front and rear, HMS particle identification, and include a ±2 ns cut on ctof..  The velocity ratio compares the measured velocity to that for the p(n,n)p reaction at the same scattering angle and shows a strong quasifree peak.
  10. Electron particle identification (PID) spectra include the Cerenkov signal converted to number of photo-electrons (npe), total energy in the show detector, velocity, and chi-square for track reconstruction.  Spectra here that include electron PID require >2 photo-electrons, >1 GeV in the shower detector, and 0.7<beta<1.3.
  11. HMS focal-plane variables.  Some neutron spectra include a cut on |delta|<4.
  12. Target variables reconstructed using HMS optics.  Some neutron spectra include a |z|<7 cm cut on the vertex position.
  13. Momentum transfer variables. 
  14. Electron scattering angles, invariant mass, and virtuality.
  15. theta_nq and phi_nq are neutron polar and azimuthal angles relative to the momentum transfer, while theta_sc and phi_sc are polar and azimuthal scattering angles.  These spectra require neutrals in front and rear, electron PID and delta cuts, and a tight ctof cut.
  16. Components of missing momentum, total missing momentum energy, and mass. Note that the missing mass is sharp because the neutron momentum is computed from the electron scattering kinematics and neutron angle; this calculation does not use the time of flight.

check_detectors

    The program check_detectors, found in subdirectory CheckDetectors, produces an hbook file containing many histograms useful for evaluating the performance of each detector.  Sample scripts for running the program and displaying the histograms using PAW may be found in the Samples subdirectory.   Sample output is contained in check_38295.ps.  

    The program reads parameters for event selection from a file, identified as check_detectors.cuts in the sample script.  The sample input file includes comments identifying these cuts.  The table below lists the available cuts, the parameters chosen by the sample file for Q2=1.5 (GeV/c)2, and the histograms affected by those cuts.  Some cuts are defined by either a minimum or maximum value, but most cuts require both.  All histograms are subject to electron PID cuts.  Spectra for the front array array require p_zfr=0; spectra for the rear array require p_zfr=0.and.p_zre=0; spectra for the front and rear tagger arrays require p_nvt>1.  These choices of charge are hardwired and were chosen to emphasize the performance for (n,n') events of greatest interest to GEn.

quantity variable minimum maximum affected histograms
number of Cerenkov photoelectrons h_cer_npe 2.0   all
energy in shower detector (GeV) hs_track_et 1.6   all
HMS chisquare hs_chi2   50.0 all
HMS delta (%) hms_delta -3.0 10.0 all
electron beta hs_beta 0.7 1.3 all
target position (cm) hs_zbeam -7.0 7.0 all
coincidence time (ns) p_ctof -2.0 2.0 rear array, dtof, rtof

    Some additional cuts are inherited from the filtering performed by npol_calculations.  Only events with p_error=0 are histogrammed by check_detectors.  Therefore, there must be at least one hit in both front array and rear arrays satisfying the position and time filters.  The tracking algorithms in npol_calculations attempt to identify the hit in the front array representing the primary neutron scattering event, called idfront, and the hit in the rear array, called idrear, representing detection of the scattered neutron.  Spectra for individual detectors in the front or rear arrays are sorted by either idfront or idrear, discarding secondary hits due to recoil protons or rescattering.  Self-timing peaks are sorted by idtrig, which is the hit believed to be responsible for the trigger, which need not be the same as idfront.  Therefore, these spectra retain multiple-hit events while testing the tracking algorithms.

A brief description of some of the output pages follows.

  1. Position spectra for each array include all hits subject only to the charge selection and electron PID cuts above.
  2. Mean-time spectra for each array include all hits subject to charge selection and electron PID cuts.  The restriction on the front mean-time is a result of filtering.
  3. The dtof spectra for the top and bottom rear arrays include a ctof cut that emphasizes the quasifree neutron scattering events.
  4. Position spectra for the primary neutron scattering event in the front array are all very similar, with sharply defined edges at the borders of the physical detectors.  Some affect of attenuation is apparent in deeper layers.
  5. Position spectra in the rear arrays follow a fairly simple pattern.  The outer detecters in each layer have more strength because they are wider.  The positive slopes arise from the forward-peaked angular distribution for neutron scattering (positive x is toward the back of the detector).  This slope is smaller for inner than for outer layers.  The requirement on ctof and (n,n') limit the statistics in these spectra.
  6. Position spectra for the front tagger are all very similar.  Position spectra for the rear tagger are also similar to each other, with outer detectors being a little weaker.
  7. Mean-time spectra for the front array shoul show a single narrow peak centered at zero, but shoulders on the late side for detectors 4 and 14 might indicate occasional errors in identifying idfront.
  8. Mean-time spectra for the rear array should show a neutron scattering peak superimposed upon an uncorrelated background.  The offsets are chosen to center these peaks at zero.  The relative intensities generally follow the pattern expected from geometry, except that detectors 22 and 36 are somewhat too weak.  Both of these detectors also had poor position and pulse-height spectra throughout the January run.
  9. Mean-time spectra for the tagger arrays should contain a dominant peak at zero produced by quasifree protons passing through all elements of the tagger and front array, with secondary features attributed to recoil protons, superimposed upon an uncorrelated background.  All spectra for the front tagger are very similar.  Outer elements of the rear tagger are somewhat weaker and have flatter background.
  10. All self-timing peaks are centered at zero and contained within about ±1 ns.  These p_tc are cut off on the positive side because idtrig is identified as the detector with the smallest value of p_tc.
  11. The ctof spectra all centered at zero with similar widths and strengths.  The uncorrelated background appears to decrease slightly with depth.
  12. The dtof spectra are very similar to the mean-time spectra for the rear array.
  13. Pulse-height spectra for the front array are all very similar to each other, with minor variations in threshold and leakage through the discriminators.
  14. Pulse-height spectra for the rear array sometimes show ADC overflow within the plotted range, which is represented by a spike at the end of the left or right spectra and an associated ridge in the mean pulse height.  The droop in phR22 is probably related to the anomalous position spectrum in detector 22.  Similarly, the steeper than average slope in phL36 and droop in phR36 are probably responsible for its unusual position spectrum.  The thresholds are clearly visible in these spectra, but these discriminators are fairly leaky.
  15. The pulse-height spectra for most tagger elements look fine, but the thresholds and gains for both 45R and 46R are too small, producing unusual structure on the low side.

Summary of recent changes

Version 2.4

Version 2.3

Version 2.2

Version 2.0

Version 1.6

Version 1.5

Version 1.4


Maintained by: James J. Kelly

Last revised: January 3, 2002