Procedures for HMS drift chamber calibration and checkout.

Minimum calibration to get tracking working well:
Open up tracking cuts (step 8).
Analyze      ~2k events.   Set hardware windows (steps 1 and 2 below) .
Reanalyze ~5k events.   Determine drift chamber time offsets (step 3).
Reanalyze >20k events. Generate time to distance map (step 4).
Reanalyze ~10k events. Check detector positions (step 5)

To check that everything is working well:
Make sure drift time spectrum is nearly flat
Make sure that the drift chamber residuals are good.

Before executing paw kumacs remember to first execute the kumac paw/paw[runnumber].kumac to define the aliases
The paw kumacs are available in the directory /group/hallc/mkj/replay/akumacs

For improved timing/tracking:
Reanalyze with MANY events (>20k, 100k for full fitting (including pulse height corrections).
Fit hodoscope timing parameters and/or set tracking cuts (steps 7/8).

step 1> Set scintillator TDC window: (requires ~2k events -)
Parameters hstart_time_center and hstart_time_slop (in PARAM/hhodo.param file) define a window for "real" scintillator hits. Set the slop to a very large number (~50) and look at the hscintimes histogram with paw kumac  htime.kumacto decide on a good central value. The cut should be loose to avoid throwing out good events (it only needs to be tightened for detailed tracking studies).

step 2> Set drift chamber TDC window: (requires ~2k events )
Parameters hdc_tdc_min_win and hdc_tdc_max_win (in PARAM/hdc.param file) define the window for good drift chamber TDC values. Look at the  'hdc raw tdcs' histogram using thepaw kumac  htime.kumac to determine the TDC window. This should be large enough to include ALL events that are near the main peak, to avoid throwing out good events. The cut usually only needs to be tightened for detailed efficiency tests.

step 3> Determine drift chamber time offsets: (~5k events )
The parameters hdc_plane_time_zero (1 per plane) is used to determine the 'zero' for the drift time. Look at the dtime histograms with paw kumac  hdtime.kumac The drift time spectra already have the 'zero' for the drift time subtracted and if the hdc_plane_time_zero is correct then the drift time spectrum  should start somewhere around t=0. The  hdtime.kumac   calculates how much the hdc_plane_time_zero   for each plane needs to be changed.  If the drift spectra need to be shifted the change  the hdc_plane_time_zero array values (in file PARAM/hdc.param) .  The order of the array is c1x1, c1y1, c1u1,c1v1, c1y2,c1x2,c2x1, c2y1, c2u1,c2v1, c2y2,c2x2 . The shift calculated by hdtime.kumac    should be subtracted from the present value in the hdc.param. If the drift spectra need to be shifted then change  hdc_plane_time_zero values (in file PARAM/hdc.param) .You should be able to get them all fairly close with the same value of hdc_plane_time_zero for each plane.

step 4> Generate time-to-distance maps for the drift chamber: (>20k events)
First look at the plots of the  drift distances by executing the paw kumac  hdist.kumac  . A typical output might look like this.     A good drift distance spectra are like the ones for hdc2 which are flat while a bad spectra might look like the spectra for hdc1 which droop down. Execute paw kumac hdrift.kumac  after replaying a high statistics run.  This will create the file hms.driftmap. The values from this must be pasted into PARAM/hdriftmap.param.  Now replay the run again and excute the paw kumac hdist.kumac and the drift distance spectra all should be flat as shown here. The driftmap values always go from 0.000 to 1.000, but you should make sure that the values are not changing significantly at the beginning or end of the tabulated values. If they are, you may need to readjust hdc_plane_time_zero (step 3) in order to better center the distribution within the drift map time window.

step 5> Determine detector positions: (~10k events - hpos.kumac)
The 'dpos' histograms show the difference between the track position and the center of the detector elements for each plane (summed over all counters in the plane). An example of the histograms is here.  The first two scintillator planes should have fairly clear edges. The later detector elements have longer tails because of the multiple scattering in previous detectors. The signs are such that increasing the position in the parameter files will move the dpos to a higher value. The calorimeter xpositions have to be changed for each block individually. Each scintillator plane has an offset value, that is added to the nominal positions for each element.

step 6> Check wire chamber residuals: (>20k events)
Execute the paw kumac hres.kumac  . An example of the histograms is here.

step 7> Fit time of flight parameters: (>20k events)
Requires external code (TOF calibration).

NOTE: any change in the timing will have some effect on the drift chamber drift distances. If you change the timing in any way, you should check that the drift distance histograms look good. If not, you need to adjust the hdc_time_zero parameters and/or the driftmap (steps 3 and 4 above). Most timing changes only affect the offset, so it usually not necessary to redo the drift map once you adjust the time zero properly.

step 8> Set cleantrack cuts:
There are several cuts for defining good tracks. The parameters are in PARAM/htracking.param. There is a chisquared cut, a beta cut, a calorimeter cut, and a dedxcut (scintillator ADC's). Initially, these should be WIDE OPEN (e.g. -100000 to 100000). If you want to require that the particle hit the scintillators (calorimeter), you should modify the cut to exclude zero (e.g. .001 to 100000). This ensures that the track points at the scintillators (or Pb glass blocks) that fired, but does not rely on good particle ID.

File initially written by I.  Niculescu. Presently maintained by M Jones (x7733 , Last updated Feb. 10, 2003 .