From e647e89b5168d090aca46f96ad83f3d9f73b97fb Mon Sep 17 00:00:00 2001
From: Vardan Tadevosyan <tadevosn@jlab.org>
Date: Wed, 28 Aug 2013 08:57:25 -0400
Subject: [PATCH] Added/modified comments to the HMS calorimeter header files

---
 examples/PARAM/52949/gbeam.param           |  96 +++++++++
 examples/PARAM/52949/gdebug.param          |   3 +
 examples/PARAM/52949/general.param         |  40 ++++
 examples/PARAM/52949/genflags.param        |  12 ++
 examples/PARAM/52949/gscalers.param        |  30 +++
 examples/PARAM/52949/gtarget.param         | 170 ++++++++++++++++
 examples/PARAM/52949/haero.param           |  12 ++
 examples/PARAM/52949/hcal.param.vt.52949   |  57 ++++++
 examples/PARAM/52949/hcal.pos              |  81 ++++++++
 examples/PARAM/52949/hcana.param           |  17 ++
 examples/PARAM/52949/hcer.param.vt         |  24 +++
 examples/PARAM/52949/hdc.param.vt.52927    |  44 +++++
 examples/PARAM/52949/hdc.pos               | 183 +++++++++++++++++
 examples/PARAM/52949/hdc_offsets.param     | 125 ++++++++++++
 examples/PARAM/52949/hdeadwires.param      |  10 +
 examples/PARAM/52949/hdebug.param          | 117 +++++++++++
 examples/PARAM/52949/hhodo.param.vt        | 185 ++++++++++++++++++
 examples/PARAM/52949/hhodo.pos             |  88 +++++++++
 examples/PARAM/52949/hms.driftmap.vt.52949 | 175 +++++++++++++++++
 examples/PARAM/52949/hmsflags.param        |  52 +++++
 examples/PARAM/52949/htracking.param       |  94 +++++++++
 examples/PARAM/52949/scal.param.vt.52843   |  58 ++++++
 examples/PARAM/52949/scal.pos              |  72 +++++++
 examples/PARAM/52949/scer.param.vt         |  23 +++
 examples/PARAM/52949/sdc.param.vt.53000    |  55 ++++++
 examples/PARAM/52949/sdc.pos               | 216 +++++++++++++++++++++
 examples/PARAM/52949/sdc_offsets.param     |  71 +++++++
 examples/PARAM/52949/sdebug.param          | 122 ++++++++++++
 examples/PARAM/52949/shodo.param.vt        | 190 ++++++++++++++++++
 examples/PARAM/52949/shodo.pos             | 103 ++++++++++
 examples/PARAM/52949/sos.driftmap.vt.52930 | 175 +++++++++++++++++
 examples/PARAM/52949/sosflags.param        |  42 ++++
 examples/PARAM/52949/stracking.param       |  76 ++++++++
 examples/hodtest_mkj.C                     |   7 +-
 examples/output_52949.def                  | 190 ++++++++++++++++++
 src/THcShower.cxx                          |   9 +-
 src/THcShower.h                            |  92 +++------
 src/THcShowerCluster.h                     |  35 ++--
 src/THcShowerHit.h                         |  29 ++-
 src/THcShowerPlane.cxx                     |   2 +-
 src/THcShowerPlane.h                       |  49 ++---
 41 files changed, 3099 insertions(+), 132 deletions(-)
 create mode 100644 examples/PARAM/52949/gbeam.param
 create mode 100644 examples/PARAM/52949/gdebug.param
 create mode 100644 examples/PARAM/52949/general.param
 create mode 100644 examples/PARAM/52949/genflags.param
 create mode 100644 examples/PARAM/52949/gscalers.param
 create mode 100644 examples/PARAM/52949/gtarget.param
 create mode 100644 examples/PARAM/52949/haero.param
 create mode 100644 examples/PARAM/52949/hcal.param.vt.52949
 create mode 100644 examples/PARAM/52949/hcal.pos
 create mode 100644 examples/PARAM/52949/hcana.param
 create mode 100644 examples/PARAM/52949/hcer.param.vt
 create mode 100644 examples/PARAM/52949/hdc.param.vt.52927
 create mode 100644 examples/PARAM/52949/hdc.pos
 create mode 100644 examples/PARAM/52949/hdc_offsets.param
 create mode 100644 examples/PARAM/52949/hdeadwires.param
 create mode 100644 examples/PARAM/52949/hdebug.param
 create mode 100644 examples/PARAM/52949/hhodo.param.vt
 create mode 100644 examples/PARAM/52949/hhodo.pos
 create mode 100644 examples/PARAM/52949/hms.driftmap.vt.52949
 create mode 100644 examples/PARAM/52949/hmsflags.param
 create mode 100644 examples/PARAM/52949/htracking.param
 create mode 100644 examples/PARAM/52949/scal.param.vt.52843
 create mode 100644 examples/PARAM/52949/scal.pos
 create mode 100644 examples/PARAM/52949/scer.param.vt
 create mode 100644 examples/PARAM/52949/sdc.param.vt.53000
 create mode 100644 examples/PARAM/52949/sdc.pos
 create mode 100644 examples/PARAM/52949/sdc_offsets.param
 create mode 100644 examples/PARAM/52949/sdebug.param
 create mode 100644 examples/PARAM/52949/shodo.param.vt
 create mode 100644 examples/PARAM/52949/shodo.pos
 create mode 100644 examples/PARAM/52949/sos.driftmap.vt.52930
 create mode 100644 examples/PARAM/52949/sosflags.param
 create mode 100644 examples/PARAM/52949/stracking.param
 create mode 100644 examples/output_52949.def

diff --git a/examples/PARAM/52949/gbeam.param b/examples/PARAM/52949/gbeam.param
new file mode 100644
index 0000000..fb15048
--- /dev/null
+++ b/examples/PARAM/52949/gbeam.param
@@ -0,0 +1,96 @@
+;                    BPM calibration constants
+;                    =========================
+  guse_bpm_in_recon  = 0   ; if 1 use bpm information for reconstruction
+  guse_bpmc = 1  ; if 1 use all 3 bpm info, if 0 use bpm A and B 
+  gbpm_sample  = 500 ; number of events, which are used for average 
+                     ; beam position ( <5000 ). Optimal value dep. on rate
+
+; the names are based on Paul Gueye's 'Status of the actual Beam Position
+;                   Monitors in the Hall C Beamline', December 1, 1995.
+; (mkj) apr-4-03 kappa,alpha and off for 3rd bpm are guesses,
+; need to find right values.
+;
+;  gbpm_kappa    = 1.85 ,1.85,1.85     ; sensitivity in cm
+gbpm_kappa    = 2.00 ,1.95,1.85  ; modified mkj 4/9/03
+  gbpm_alpha_x = 1.8192,0.7330 ,0.7   ; calibration gain: we may get them from the
+  gbpm_alpha_y = 1.0063,0.8935 ,0.7   ;  EPICS events, right now that's according to Paul's note
+
+; the following offsets get added to the calculated positions
+;  gbpm_x_off = -0.011,-0.004,0.      ; in cm: survey according to Paul's note
+;  gbpm_y_off = +0.052,+0.056,0.
+; From Dahlberg survey DT_C853 Apr 7, 2003
+gbpm_x_off = 0.017+.412,0.061-.353,0.037
+gbpm_y_off = 0.037+.381,-0.04-.211,0.028
+
+; average beam positions: only used if 'guse_bpm_in_recon=0' 
+;  gbeam_xoff  = +0.18
+  gbeam_xoff  = +0.00
+  gbeam_xpoff = +0.00
+  gbeam_yoff  = +0.00
+  gbeam_ypoff = +0.00
+
+; spectrometers would like to see this positions (from optics studies) 
+; we treat SOS and HMS the same, however, we may change this if necessary
+;  gspec_xoff  = +0.18
+  gspec_xoff  = +0.00
+  gspec_xpoff = +0.00
+  gspec_yoff  = +0.00
+  gspec_ypoff = +0.00
+
+; Pedestals for BPM ADCs: from cosmic run #10933, 10/3/96, book XI-137
+  gbpm_xp_ped = 431.9,331.0,0.  ; these pedestals have to be determined
+  gbpm_xm_ped = 514.7,350.6,0.  ; from runs with no beam in the cavities,
+  gbpm_yp_ped = 406.9,358.8,0.  ; e.g. cosmic runs.
+  gbpm_ym_ped = 499.7,292.7,0. ;
+
+; positions of BPMs relative to target (from Paul's note)
+  gbpm_zpos = 345.5,166.3,0.   ; cm
+
+
+;             Fast Raster calibration constants
+;             =================================
+
+; Various fast raster quantities: gUse* are flags
+
+  gusefr               = 1  ; if 1 correct for FRY in reconstruction
+
+  guse_frdefault       = 1  ; if 1 do no phase correction (default)
+                                ;if 0 apply phase correction 
+;      gfr_cal_mom      = 3.245  ; = beam momnetum during calibration run 
+;      gfrx_adcpercm    = 11328. ; = FR channels per cm deflection on target
+;      gfry_adcpercm    = 10708. ; from run 9981, August 25, 1996, book X-22
+
+      gfr_cal_mom      = 2.038  ; = beam momnetum during calibration run 
+      gfrx_adcpercm    = 4364.7 ; = FR channels per cm deflection on target
+      gfry_adcpercm    = 5471.9 ; from harp scan (H00A), June 19, 2004
+
+
+      gfrx_dphase      = 0.0    ; phase shift (never measured for x so far) 
+      gFrx_synccut     = 0.     ; should be zero if applied on centered distr.
+      gfrx_adcmax      = 1000   ; ADC amplitude in channels.
+      gfrx_maxsize     = 0.1    ; fast raster amplitude in centimeter.
+
+      gfry_dphase      = 5.8    ; phase shift 
+      gFry_synccut     = 0.     ; should be zero if applied on centered distr.
+      gfry_adcmax      = 1000   ; ADC amplitude in channels.
+      gfry_maxsize     = 0.1    ; fast raster amplitude in centimeter.
+
+; The latest FR phase analysis from spring '96 showed, that there is no
+; measurable phase shift. During early running (E91-13, E89-12) the FRY-phase
+; was determined to be 5.8 degree.
+
+; positions of FR magnets relative to target
+  gfrx_dist  = 2111   ; cm
+  gfry_dist  = 2071   ; cm
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/PARAM/52949/gdebug.param b/examples/PARAM/52949/gdebug.param
new file mode 100644
index 0000000..7ac0e01
--- /dev/null
+++ b/examples/PARAM/52949/gdebug.param
@@ -0,0 +1,3 @@
+  gmisc_min_peds = 500
+
+  gelossdebug = 0	;eloss debug (0=off,1=on)
diff --git a/examples/PARAM/52949/general.param b/examples/PARAM/52949/general.param
new file mode 100644
index 0000000..dbede2c
--- /dev/null
+++ b/examples/PARAM/52949/general.param
@@ -0,0 +1,40 @@
+#real raddeg
+raddeg=3.14159265/180
+part_mass=0.000511
+
+; hms/sosflags.param include spectrometer offsets and options.
+#include "PARAM/52949/hcana.param"
+#include "PARAM/52949/genflags.param"
+#include "PARAM/52949/hmsflags.param"
+#include "PARAM/52949/sosflags.param"
+
+#include "PARAM/52949/gdebug.param"
+#include "PARAM/52949/hdebug.param"
+#include "PARAM/52949/sdebug.param"
+#include "PARAM/52949/htracking.param"
+#include "PARAM/52949/stracking.param"
+
+#include "PARAM/52949/gscalers.param"
+#include "PARAM/52949/gbeam.param"
+#include "PARAM/52949/gtarget.param"
+#include "PARAM/52949/hdc_offsets.param"
+#include "PARAM/52949/hdc.pos"
+#include "PARAM/52949/hhodo.pos"
+#include "PARAM/52949/hcal.pos"
+#include "PARAM/52949/sdc_offsets.param"
+#include "PARAM/52949/sdc.pos"
+#include "PARAM/52949/shodo.pos"
+#include "PARAM/52949/scal.pos"
+
+#include "PARAM/52949/hdeadwires.param"
+#include "PARAM/52949/hdc.param.vt.52927"
+#include "PARAM/52949/hms.driftmap.vt.52949"
+#include "PARAM/52949/hhodo.param.vt"
+#include "PARAM/52949/hcal.param.vt.52949"
+#include "PARAM/52949/hcer.param.vt"
+#include "PARAM/52949/haero.param"
+#include "PARAM/52949/sdc.param.vt.53000"
+#include "PARAM/52949/sos.driftmap.vt.52930"
+#include "PARAM/52949/shodo.param.vt"
+#include "PARAM/52949/scal.param.vt.52843"
+#include "PARAM/52949/scer.param.vt"
diff --git a/examples/PARAM/52949/genflags.param b/examples/PARAM/52949/genflags.param
new file mode 100644
index 0000000..c9853a8
--- /dev/null
+++ b/examples/PARAM/52949/genflags.param
@@ -0,0 +1,12 @@
+;default settings for general option flags.
+  gen_run_starting_event = 1
+  gen_run_stopping_event = 0
+  gen_run_hist_dump_interval = 40000
+
+; hack_enable             run hack_anal if .ne. 0
+  hack_enable = 0
+
+; gen_eloss_enable         (0=disabled) total_eloss.f
+  gen_eloss_enable = 1
+
+
diff --git a/examples/PARAM/52949/gscalers.param b/examples/PARAM/52949/gscalers.param
new file mode 100644
index 0000000..af6a9bb
--- /dev/null
+++ b/examples/PARAM/52949/gscalers.param
@@ -0,0 +1,30 @@
+; These BCM's (1 and 2) numbers are from Jan 05 experiments (VT)
+ 
+
+;point to scaler indices for BCM's
+  gbcm1_index = 321
+  gbcm2_index = 322
+  gbcm3_index = 323
+  gunser_index = 324
+
+
+gbcm1_gain = 0.000328449              ; microA/Hz (New Value)
+gbcm2_gain = 0.000381451              ; microA/Hz (New Value)
+gbcm3_gain = 0.00043343               ; microA/Hz (Old, Value)
+
+gbcm1_offset =  250403.               ; Hz (New Value)
+gbcm2_offset =  250123.               ; Hz (New Value)
+gbcm3_offset =  245437.               ; Hz (Old, Value)
+
+gunser_offset =  514529.              ; Hz (Old, Value)
+gunser_gain = 0.00025001              ; microA/Hz (New Value)
+
+
+;define the threshold current at which beam is "on". (in microamps)
+g_beam_on_thresh_cur = 1.5, 1.5
+ bcm_for_threshold_cut = 1
+
+;point to hardware clock (1MHz scaler, scaler channel 325)
+  gclock_index = 325
+  gclock_rate = 1.e+6
+ 
diff --git a/examples/PARAM/52949/gtarget.param b/examples/PARAM/52949/gtarget.param
new file mode 100644
index 0000000..847e801
--- /dev/null
+++ b/examples/PARAM/52949/gtarget.param
@@ -0,0 +1,170 @@
+; MEC - updated for E02-109/E04-001  1/8/05
+;
+; This is the target parameter file.  Numbers 1-10 are solid targets,
+; 11-16 are cryotargets, and 17-20 are dummy/optics.
+;
+;The target order is:
+;
+;       Au_1%         C_2%        Fe_1%
+;       C_1%          C_5%        C_6%
+;       Cu_6%         Be_3%       Au_6%
+;       ---
+;       H (4cm)       ---
+;       ---           ---
+;       D (4cm)       ---
+;       Dummy (4cm)
+;       optics (8cm)
+;       optics (4 foil)
+;       NO target
+
+
+; non-existant targets have A=Z=M=...=0
+; dummy targets have A=Z=M=...=0
+; empty/dummy cells have A=Z=M=...= AS ALUMINUM (MAY NEED TO CHANGE FOR DUMMY DATA!!!)
+;
+;
+; 1=tuna can, 2=beer can, 21=solid
+ gtarg_type   =  21.     ,    21.     ,   21.
+	         21.     ,    21.     ,   21.
+                 21.     ,    21.     ,   21.
+                 21.
+                 1.      ,     1.
+                 1.      ,     1.
+                 1.      ,     1.
+                 21.     ,    21.
+                 21.     ,    21.
+
+  gtarg_z     = 79.0     ,     6.0    ,   26.0
+                 6.0     ,     6.0    ,    6.0
+                29.0     ,     0.0    ,   79.0
+                 0.0
+                 1.0     ,     0.0
+                 0.0     ,     0.0
+                 1.0     ,     0.0
+                 13.0    ,     0.0
+		 0.0     ,     0.0
+
+  gtarg_a     = 197.0    ,    12.0    ,    57.0
+                12.0     ,    12.0    ,    12.0
+                64.0     ,     0.0    ,   197.0
+                 0.0
+                 1.0     ,     0.0
+                 0.0     ,     0.0
+                 2.0     ,     0.0
+                 27.0    ,     0.0
+		 0.0     ,     0.0
+
+  gtarg_mass  = 196.9237    ,   12.0107   ,    56.85
+                12.0107     ,   12.0107   ,    12.0107 
+                63.546      ,   0.0  ,        196.9237    
+                 0.0
+                 1.00727647 ,    0.0 
+                 0.0   ,    0.0
+                 2.01355322,     0.0
+                 26.98       ,   0.0
+                 0.0        ,    0.0
+
+
+; Next is the radiation length in percent...  SOLID=APPROXIMATE, CRYO=GUESSES!!!!!
+  gtarg_lrad  =  1.0      ,    2.0     ,     1.0
+                 1.0      ,    5.2     ,     6.4
+                 6.0      ,    3.0     ,     6.0
+                 0.0 
+                 0.46     ,    0.0
+                 0.0      ,    0.0
+                 0.55     ,    0.0
+                 2.2      ,    0.0
+                 0.0      ,    0.0
+
+
+; Next is the thickness of the target in g/cm^2...
+; NOTE THE 3HE,4HE USE THICKNESS FROM KAON EXPERIMENT, WHICH HAD DIFFERENT CELLS!!!
+
+  gtarg_thick =  0.0417 ,    0.6706    ,     0.119
+                 0.346  ,    1.79      ,     2.735
+                 0.7986 ,    0.5       ,     0.3795
+                 0.0
+                 0.289  ,    0.0
+                 0.0    ,    0.0
+                 0.648  ,    0.0
+                 0.526  ,    0.0
+		 0.0    ,    0.0
+
+
+; Finally, the density of the target in g/cm^3.
+
+; Densities taken from http://pdg.lbl.gov/AtomicNuclearProperties
+;  used "Carbon (compact)" for Carbon - could be way off
+;  3He and 4He come from taking the total thickness (above) / 4cm - thickness could be way off
+
+  gtarg_dens  =  19.320    ,  2.265   ,     7.87
+                 2.265     ,  2.265   ,     2.265
+                 8.960     ,  0.0     ,     19.320
+                 0.0
+                 0.0723    ,  0.0
+                 0.0       ,  0.0
+                 0.167     ,  0.0
+		 2.265     ,  0.0
+                 0.0       ,  0.0
+
+; Target angle:  =90 deg. is perpendicluar to beam
+;                <90 deg. is face towards HMS
+;                >90 deg. is face towards SOS 
+; for E99118 target was rotated 20.3deg. to face HMS =>69.7deg. = 1.2164945rad
+  gtarg_theta =  1.570796327 
+
+
+;general target energy loss parameters. Vansyoc Mar.98
+
+;target cell****************
+; JRA: 09/19/04: Updated based on Meekins' report, June 30, 2004
+; 		gcell_radius was 1.0 - don't know why.  Changed to 2.0
+;  DID NOT UPDATED WALL/END/FRONT THICKNESSES - Don't know the units :(
+
+      gcell_radius = 2.008
+      gz_cell 	 =  13.0
+      ga_cell 	 =  27.0
+      gcell_den 	=   2.7
+      gwall_thk	 =  0.03429
+      gend_thk  	=   0.03429
+      gfront_thk  =  0.020574   
+
+;Air gap between the chamber and the entrance window
+      gair_dens 	=   0.00121
+      gair_thk 	=   0.018
+      gair_a 	=   14.68
+      gair _z 	=   7.32
+
+
+;HMS********
+;    HMS scattering chamber window specs.********** 
+      hscat_win_thk  = 0.109728
+      hscat_win_den =  2.70
+      hscat_win_z   =  13.0
+      hscat_win_a   =  27.0
+;    HMS entrance window specs.********************
+      hdet_ent_thk  =  0.049098
+      hdet_ent_den  =  0.878636
+      hdet_ent_z    =  2.67
+      hdet_ent_a    =  4.67
+;SOS********
+;    SOS scattering chamber window specs.**********
+      sscat_win_thk =  0.054864
+      sscat_win_den =  2.70
+      sscat_win_z   =  13.0
+      sscat_win_a   =  27.0
+;    SOS entrance window specs.********************
+      sdet_ent_thk  =  0.016421
+      sdet_ent_den  =  0.862
+      sdet_ent_z    =  2.67
+      sdet_ent_a    =  4.67
+;eloss debug   0 = off,1 = on
+;      gelossdebug = 0
+;use old cryo geometry? (1)
+;      old_tgeom = 1
+
+;
+
+
+
+
diff --git a/examples/PARAM/52949/haero.param b/examples/PARAM/52949/haero.param
new file mode 100644
index 0000000..d815c48
--- /dev/null
+++ b/examples/PARAM/52949/haero.param
@@ -0,0 +1,12 @@
+     haero_pos_gain   = 1/168.3, 1/233.9, 1/181.3, 1/169.2,
+                        1/177.6, 1/155.0, 1/169.5, 1/149.7,
+
+     haero_neg_gain   = 1/248.8, 1/186.4, 1/236.4, 1/172.0,
+                        1/205.3, 1/198.1, 1/227.9, 1/229.2,
+
+     haero_pos_ped_limit =  1000., 1000., 1000., 1000.,
+                            1000., 1000., 1000., 1000.,
+
+     haero_neg_ped_limit =  1000., 1000., 1000., 1000.,
+                            1000., 1000., 1000., 1000.,
+
diff --git a/examples/PARAM/52949/hcal.param.vt.52949 b/examples/PARAM/52949/hcal.param.vt.52949
new file mode 100644
index 0000000..8e5f719
--- /dev/null
+++ b/examples/PARAM/52949/hcal.param.vt.52949
@@ -0,0 +1,57 @@
+; Slop in x position.  Allowed distance between track and edge of block (in cm)
+; too tight djm hcal_slop = 7.5
+hcal_slop = 7.5
+
+;Turn on HMS cal. fiducial volume cut. 0="no cut"
+;Default hcal_fv_test=0
+hcal_fv_test = 0
+
+hcal_pos_cal_const =0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001
+                    0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001
+                    0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001
+                    0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001
+
+hcal_neg_cal_const =0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001
+                    0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001
+                    0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001
+                    0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001
+
+hcal_pos_gain_ini  =1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000
+                    1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000
+                    1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000
+                    1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000
+
+hcal_neg_gain_ini  =1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000
+                    1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000
+                    1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000
+                    1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000
+
+hcal_neg_gain_cur  =1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000
+                    1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000
+                    1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000
+                    1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000
+
+;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+
+hcal_pos_ped_limit =1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000
+                    1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000
+                    1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000
+                    1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000
+
+hcal_neg_ped_limit =1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000
+                    1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000
+                    1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000
+                    1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000
+
+;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+ 
+; Calibration constants for run   52949, 435527 events processed
+
+hcal_pos_gain_cor= 0.425, 0.355, 0.416, 0.385, 0.247, 0.512, 0.552, 0.378, 0.502, 0.345, 0.379, 0.390, 0.000,
+                   0.375, 0.428, 0.340, 0.387, 0.449, 0.485, 0.225, 0.445, 0.303, 0.269, 0.332, 0.653, 0.558,
+                   0.609, 0.630, 0.605, 0.857, 0.631, 0.658, 0.466, 0.547, 0.714, 0.733, 0.523, 0.636, 0.000,
+                   0.802, 0.600, 0.573, 0.720, 0.724, 0.822, 0.851, 0.744, 0.832, 0.614, 0.699, 0.738, 0.000,
+hcal_neg_gain_cor= 0.422, 0.269, 0.288, 0.367, 0.353, 0.050, 0.184, 0.449, 0.235, 0.334, 0.203, 0.170, 0.000,
+                   0.401, 0.353, 0.389, 0.511, 0.332, 0.337, 0.454, 0.304, 0.470, 0.363, 0.338, 0.371, 1.156,
+                   0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000,
+                   0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000,
diff --git a/examples/PARAM/52949/hcal.pos b/examples/PARAM/52949/hcal.pos
new file mode 100644
index 0000000..9906aae
--- /dev/null
+++ b/examples/PARAM/52949/hcal.pos
@@ -0,0 +1,81 @@
+; neglect extra tubes for now.
+hcal_num_neg_columns = 2
+
+; Z position of front of shower counter layers
+; guesses, based on the fact that the back scin plane is supposedly at 322.0
+;  (add 25 to each from original value) - JRA
+      hcal_1pr_zpos = (350.0-11.31)
+      hcal_2ta_zpos = (361.0-11.31)
+      hcal_3ta_zpos = (372.0-11.31)
+      hcal_4ta_zpos = (383.0-11.31)
+; Thickness of shower counter blocks, blocks are 10 * 10 * 70 cm^3
+      hcal_1pr_thick = 10.0
+      hcal_2ta_thick = 10.0
+      hcal_3ta_thick = 10.0
+      hcal_4ta_thick = 10.0
+; Number of shower counter blocks per layer
+      hcal_1pr_nr = 13
+      hcal_2ta_nr = 13
+      hcal_3ta_nr = 13
+      hcal_4ta_nr = 13
+; X,Y positions of shower counter blocks
+      hcal_1pr_left  =  35.0
+      hcal_1pr_right = -35.0
+      hcal_1pr_top   = (-69.0-1.4)
+                       (-59.0-1.4)
+                       (-49.0-1.4)
+                       (-39.0-1.4)
+                       (-29.0-1.4)
+                       (-19.0-1.4)
+                       ( -9.0-1.4)
+                       (  1.0-1.4)
+                       ( 11.0-1.4)
+                       ( 21.0-1.4)
+                       ( 31.0-1.4)
+                       ( 41.0-1.4)
+                       ( 51.0-1.4)
+      hcal_2ta_left  =  35.0
+      hcal_2ta_right = -35.0
+      hcal_2ta_top   = (-69.0-1.4)
+                       (-59.0-1.4)
+                       (-49.0-1.4)
+                       (-39.0-1.4)
+                       (-29.0-1.4)
+                       (-19.0-1.4)
+                       ( -9.0-1.4)
+                       (  1.0-1.4)
+                       ( 11.0-1.4)
+                       ( 21.0-1.4)
+                       ( 31.0-1.4)
+                       ( 41.0-1.4)
+                       ( 51.0-1.4)
+      hcal_3ta_left  =  35.0
+      hcal_3ta_right = -35.0
+      hcal_3ta_top   = (-69.0-1.4)
+                       (-59.0-1.4)
+                       (-49.0-1.4)
+                       (-39.0-1.4)
+                       (-29.0-1.4)
+                       (-19.0-1.4)
+                       ( -9.0-1.4)
+                       (  1.0-1.4)
+                       ( 11.0-1.4)
+                       ( 21.0-1.4)
+                       ( 31.0-1.4)
+                       ( 41.0-1.4)
+                       ( 51.0-1.4)
+      hcal_4ta_left  =  35.0
+      hcal_4ta_right = -35.0
+      hcal_4ta_top   = (-69.0-1.4)
+                       (-59.0-1.4)
+                       (-49.0-1.4)
+                       (-39.0-1.4)
+                       (-29.0-1.4)
+                       (-19.0-1.4)
+                       ( -9.0-1.4)
+                       (  1.0-1.4)
+                       ( 11.0-1.4)
+                       ( 21.0-1.4)
+                       ( 31.0-1.4)
+                       ( 41.0-1.4)
+                       ( 51.0-1.4)
diff --git a/examples/PARAM/52949/hcana.param b/examples/PARAM/52949/hcana.param
new file mode 100644
index 0000000..61d60c6
--- /dev/null
+++ b/examples/PARAM/52949/hcana.param
@@ -0,0 +1,17 @@
+;
+; Parameters that were built into Fortran analyzer that we want
+; to pass as parameters so that the resulting code can be more generic.
+;
+
+hhodo_num_planes = 4
+
+hcal_num_layers = 4
+
+haero_num_pairs = 8
+
+# Names of planes so that parameter names can be constructed
+hdc_plane_names = "1x1 1y1 1u1 1v1 1y2 1x2 2x1 2y1 2u1 2v1 2y2 2x2"
+
+hcal_layer_names = "1pr 2ta 3ta 4ta"
+
+hhodo_plane_names = "1x 1y 2x 2y"
diff --git a/examples/PARAM/52949/hcer.param.vt b/examples/PARAM/52949/hcer.param.vt
new file mode 100644
index 0000000..a23df2e
--- /dev/null
+++ b/examples/PARAM/52949/hcer.param.vt
@@ -0,0 +1,24 @@
+hcer_width = 50, 50
+
+hcer_adc_to_npe = 1/145.0, 1/122.0
+
+
+hcer_chi2max = 50.
+hcer_beta_min = 0.8
+hcer_beta_max = 1.2
+hcer_et_min = 0.95
+hcer_et_max = 5.0
+hcer_mirror_zpos = 230
+; hcer_region: 8 values for each region (1 per mirror + sum)
+; central x,y,dx,dy values and x,y,dx,dy half widths.
+hcer_region =   30,  -30,   0,
+                 0,    0,   0,
+                 0,    0,   0,
+                 0,    0,   0,
+                20,   20,  60,
+                30,   30,  30,
+                .1,   .1,  .1,
+                .1,   .1,  .1
+
+hcer_ped_limit =  1000,1000
+	       
diff --git a/examples/PARAM/52949/hdc.param.vt.52927 b/examples/PARAM/52949/hdc.param.vt.52927
new file mode 100644
index 0000000..becfff9
--- /dev/null
+++ b/examples/PARAM/52949/hdc.param.vt.52927
@@ -0,0 +1,44 @@
+;---------------------------------------------------------------------
+; HMS_TRACKING
+; CTP parameter file containing all tracking parameters for the HMS
+;----------------------------------------------------------------------
+; sigma of wire chamber resolution for each plane
+      hdc_sigma = 0.020
+                  0.020
+                  0.020
+                  0.020
+                  0.020
+                  0.020
+                  0.020
+                  0.020
+                  0.020
+                  0.020
+                  0.020
+                  0.020
+; hms dc tdc minimum tdc value array allowed for a good hit
+    hdc_tdc_min_win = 2750, 2750, 2750, 2750, 2750, 2750
+                      2750, 2750, 2750, 2750, 2750, 2750
+; hms dc tdc maximum tdc value array allowed for a good hit
+    hdc_tdc_max_win = 3500, 3500, 3500, 3500, 3500, 3500
+                      3500, 3500, 3500, 3500, 3500, 3500
+; hms drift chamber tdc's time per channel
+        hdc_tdc_time_per_channel = 0.50
+; hms zero time for drift chambers	!DECREASING this number moves the hdtime plots to LOWER time.
+        hdc_plane_time_zero = (1670+14+18-2-0)
+                              (1670+12+20-2-0)
+                              (1670+13+18-0-2)
+                              (1670+13+20-2-0)
+                              (1670+12+20-4-0)
+                              (1670+14+16-0+2-2)
+                              (1670+15+16+2-4)
+                              (1670+11.5+16)
+                              (1670+13+12+2-2)
+                              (1670+13+12+2-0)
+                              (1670+10.5+16-0)
+                              (1670+13+18-0-2)
+
+; Dave Abbott's wire velocity correction
+hdc_wire_velocity = 12.0
+hdc_central_time = 7,9,3,4,6,5
+                   7,5,3,4,6,6
+  
diff --git a/examples/PARAM/52949/hdc.pos b/examples/PARAM/52949/hdc.pos
new file mode 100644
index 0000000..fdbf2ae
--- /dev/null
+++ b/examples/PARAM/52949/hdc.pos
@@ -0,0 +1,183 @@
+; Number of planes installed in HMS detector setup
+      hdc_num_planes = 12
+; Number of chambers installed in HMS detector setup
+      hdc_num_chambers = 2
+; Names of each wire plane
+;
+; Z positions of various planes in HMS chambers
+; hdc_n_zpos is the surveyed Z position of the center of chamber n.
+      hdc_1_zpos = (-40.611-11.312+0.003)
+      hdc_2_zpos = (+40.611-11.312-0.008)
+      
+      hdc_zpos   = hdc_1_zpos - 3.6000
+                   hdc_1_zpos - 1.8000
+                   hdc_1_zpos - 0.0000
+                   hdc_1_zpos + 1.8000
+                   hdc_1_zpos + 3.6000
+                   hdc_1_zpos + 5.4000
+                   hdc_2_zpos - 3.6000
+                   hdc_2_zpos - 1.8000
+                   hdc_2_zpos - 0.0000
+                   hdc_2_zpos + 1.8000
+                   hdc_2_zpos + 3.6000
+                   hdc_2_zpos + 5.4000
+; Angle alpha of wires in wire chamber planes
+        hdc_alpha_angle =  (90. - 0.071)*raddeg
+                           (0.0 - 0.071)*raddeg
+                           (74.925 - 0.071)*raddeg
+                           (105.075 - 0.071)*raddeg
+                           (0.0 - 0.071)*raddeg
+                           (90.0 - 0.071)*raddeg
+                           (89.90814 - 0.153)*raddeg
+                           (0.01611 - 0.153)*raddeg
+                           (74.85 - 0.153)*raddeg
+                           (105.05 - 0.153)*raddeg
+                           (0.01611 - 0.153)*raddeg
+                           (89.90814 - 0.153)*raddeg
+;        hdc_alpha_angle = ( 90.1541 - 0.071)*raddeg
+;                          ( -0.0408 - 0.071)*raddeg
+;                          ( 75.1267 - 0.071)*raddeg
+;                          (105.1267 - 0.071)*raddeg
+;                          ( -0.0408 - 0.071)*raddeg
+;                          ( 90.1541 - 0.071)*raddeg
+;                          ( 90.1095 - 0.153)*raddeg
+;                          ( -0.0370 - 0.153)*raddeg
+;                          ( 75.0904 - 0.153)*raddeg
+;                          (105.0904 - 0.153)*raddeg
+;                          ( -0.0370 - 0.153)*raddeg
+;                          ( 90.1095 - 0.153)*raddeg
+;
+; Angle beta of wires in wire chamber planes
+      hdc_beta_angle =    -0.041*raddeg
+                          -0.041*raddeg
+                          -0.041*raddeg
+                          -0.041*raddeg
+                          -0.041*raddeg
+                          -0.041*raddeg
+                          +0.054*raddeg
+                          +0.054*raddeg
+                          +0.054*raddeg
+                          +0.054*raddeg
+                          +0.054*raddeg
+                          +0.054*raddeg
+; Angle gamma of wires in wire chamber planes
+      hdc_gamma_angle =   +0.0376*raddeg
+                          +0.0376*raddeg
+                          +0.0376*raddeg
+                          +0.0376*raddeg
+                          +0.0376*raddeg
+                          +0.0376*raddeg
+                          -0.145*raddeg
+                          -0.145*raddeg
+                          -0.145*raddeg
+                          -0.145*raddeg
+                          -0.145*raddeg
+                          -0.145*raddeg
+; Pitch
+      hdc_pitch = 1.000252
+                  1.000252
+                  1.000252
+                  1.000252
+                  1.000252
+                  1.000252
+                  1.000252
+                  1.000252
+                  1.000252
+                  1.000252
+                  1.000252
+                  1.000252
+; Number of wires per plane
+      hdc_nrwire = 113
+                    52
+                   107
+                   107
+                    52
+                   113
+                   113
+                    52
+                   107
+                   107
+                    52
+                   113
+; X,Y position of center of wire chamber
+; increasing dc2 coordinates decreases dpos histograms.
+; new values according to henk and rolf
+      hdc_xcenter = (1.670 - 0.0155 - 0.020)
+                    (2.758 - 0.0155 + 0.040)
+;      hdc_xcenter = (1.670 - 0.0155)
+;                    (2.758 - 0.0155)
+;      hdc_xcenter = 1.670 + 0.15 + 0.0155
+;                    2.758 + 0.16 + 0.0155
+;  Y CENTER CHANGED TO MATCH OPTICS DATA(offset of 1.1 cm in y)
+; new values included according to henk and rolf
+      hdc_ycenter = (1.443 - 0.1699 - 0.0279 - 0.04)
+                    (2.753 - 0.1699 + 0.0279 + 0.04)
+;      hdc_ycenter = (1.443 - 0.1699 - 0.0279 - 0.035)
+;                    (2.753 - 0.1699 + 0.0279 + 0.035)
+;      hdc_ycenter = (1.443 - 0.1699 - 0.0279)
+;                    (2.753 - 0.1699 + 0.0279)
+
+;      hdc_ycenter = 0.343 + 1.1 - 0.12 + 0.1699 + 0.0279
+;                    1.653 + 1.1 - 0.22 + 0.1699 - 0.0279
+;      hdc_ycenter = 0.343  THESE ARE THE ORIGINAL Y CENTERS FROM SURVEY DATA
+;                    1.653
+;      hdc_xcenter = 0.0
+;                    1.22
+;      hdc_ycenter = 0.0
+;                    1.24
+
+; Wire number of center of wire chamber
+; assume 1st wire of 1st dc of a set is closest to edge where counting starts
+       hdc_central_wire = 57.257, 26.240, 54.001, 53.999, 26.760 , 56.743
+                          57.244, 26.242, 53.998, 54.002, 26.758 , 56.756
+
+;       hdc_central_wire = 57.25, 26.245, 54.0, 54.0, 26.755 , 56.75
+;                          57.24, 26.245, 54.0, 54.0, 26.755 , 56.76
+;       hdc_central_wire = 57.25, 26.25, 54.0, 54.0, 26.75 , 56.75
+;                          57.24, 26.25, 54.0, 54.0, 26.75 , 56.76
+; hdc_chamber_planes    array giving the chamber number for each plane
+      hdc_chamber_planes = 1
+                           1
+                           1
+                           1
+                           1
+                           1
+                           2
+                           2
+                           2
+                           2
+                           2
+                           2
+; The hms readout numbers some planes in reverse order.
+; The following array is a flag on the order number.
+; If hdc_wire_counting(plane) = 0
+;  the wire center is at (wire - hdc_central_wire) * pitch
+; If hdc_wire_counting(plane) = 1
+;  the wire center is at ( hdc_nrwire + 1 - wire - hdc_central_wire) * pitch
+        hdc_wire_counting = 1
+                            1
+                            0
+                            1
+                            0
+                            0
+                            1
+                            1
+                            0
+                            1
+                            0
+                            0
+; The velocity correction is the distance from the center of the wire divided
+; by the velocity of propagation times hdc_drifttime_sign(pln).  +/-1
+; for disc. card at +/- coord. (i.e. top = -x direction, so top readout is +1)
+       hdc_drifttime_sign = -1
+                            -1
+                            -1
+                            -1
+                            -1
+                            -1
+                            -1
+                            -1
+                            -1
+                            -1
+                            -1
+                            -1
diff --git a/examples/PARAM/52949/hdc_offsets.param b/examples/PARAM/52949/hdc_offsets.param
new file mode 100644
index 0000000..a5561b2
--- /dev/null
+++ b/examples/PARAM/52949/hdc_offsets.param
@@ -0,0 +1,125 @@
+; cable id's for HMS Drift Chambers
+; array is 113,12 (wires,planes) but most planes have less than 113 wires)
+
+hdc_card_no=
+; Plane 1, wires 1-113, 16 per card (+one extra wire)
+              1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
+              2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2
+              3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3
+              4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
+              5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5
+              6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6
+              7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
+             12
+; plane 2, wires 1-52, 13 per card
+              8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8
+              9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9
+             10,10,10,10,10,10,10,10,10,10,10,10,10
+             11,11,11,11,11,11,11,11,11,11,11,11,11
+             -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
+             -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
+             -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
+             -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
+; plane 3, wires 1-107, 15 or 16 per card (12 has one x wire)
+             12,12,12,12,12,12,12,12,12,12,12,12,12,12
+             13,13,13,13,13,13,13,13,13,13,13,13,13,13,13
+             14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14
+             15,15,15,15,15,15,15,15,15,15,15,15,15,15,15
+             16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16
+             17,17,17,17,17,17,17,17,17,17,17,17,17,17,17
+             18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18
+             -1,-1,-1,-1,-1,-1
+; plane 4, wires 1-107, 15 or 16 per card (19 has one x' wire)
+             19,19,19,19,19,19,19,19,19,19,19,19,19,19
+             20,20,20,20,20,20,20,20,20,20,20,20,20,20,20
+             21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21
+             22,22,22,22,22,22,22,22,22,22,22,22,22,22,22
+             23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23
+             24,24,24,24,24,24,24,24,24,24,24,24,24,24,24
+             25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
+             -1,-1,-1,-1,-1,-1
+; plane 5, wires 1-52, 13 per card
+             26,26,26,26,26,26,26,26,26,26,26,26,26
+             27,27,27,27,27,27,27,27,27,27,27,27,27
+             28,28,28,28,28,28,28,28,28,28,28,28,28
+             29,29,29,29,29,29,29,29,29,29,29,29,29
+             -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
+             -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
+             -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
+             -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
+; Plane 6, wires 1-113, 16 per card (+one extra wire)
+             30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30
+             31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31
+             32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32
+             33,33,33,33,33,33,33,33,33,33,33,33,33,33,33,33
+             34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34
+             35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35
+             36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36
+             19
+; Chamber 2
+; Plane 7, wires 1-113, 16 per card (+one extra wire)
+             37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37
+             38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38
+             39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39
+             40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40
+             41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41
+             42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42
+             43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43
+             48
+; plane 8, wires 1-52, 13 per card
+             44,44,44,44,44,44,44,44,44,44,44,44,44
+             45,45,45,45,45,45,45,45,45,45,45,45,45
+             46,46,46,46,46,46,46,46,46,46,46,46,46
+             47,47,47,47,47,47,47,47,47,47,47,47,47
+             -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
+             -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
+             -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
+             -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
+; plane 9, wires 1-107, 15 or 16 per card (48 has one x wire)
+             48,48,48,48,48,48,48,48,48,48,48,48,48,48
+             49,49,49,49,49,49,49,49,49,49,49,49,49,49,49
+             50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50
+             51,51,51,51,51,51,51,51,51,51,51,51,51,51,51
+             52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52
+             53,53,53,53,53,53,53,53,53,53,53,53,53,53,53
+             54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54
+             -1,-1,-1,-1,-1,-1
+; plane 10, wires 1-107, 15 or 16 per card (55 has one x' wire)
+             55,55,55,55,55,55,55,55,55,55,55,55,55,55
+             56,56,56,56,56,56,56,56,56,56,56,56,56,56,56
+             57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57
+             58,58,58,58,58,58,58,58,58,58,58,58,58,58,58
+             59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59
+             60,60,60,60,60,60,60,60,60,60,60,60,60,60,60
+             61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61
+             -1,-1,-1,-1,-1,-1
+; plane 11, wires 1-52, 13 per card
+             62,62,62,62,62,62,62,62,62,62,62,62,62
+             63,63,63,63,63,63,63,63,63,63,63,63,63
+             64,64,64,64,64,64,64,64,64,64,64,64,64
+             65,65,65,65,65,65,65,65,65,65,65,65,65
+             -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
+             -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
+             -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
+             -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
+; Plane 12, wires 1-113, 16 per card (+one extra wire)
+             66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66
+             67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67
+             68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68
+             69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69
+             70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70
+             71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71
+             72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72
+             55
+;
+;       Cable Delays on a per/card basys
+;
+hdc_card_delay =  0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+                  0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+                  0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+                  0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+                  0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+                  0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+                  0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+                  0, 0
+
diff --git a/examples/PARAM/52949/hdeadwires.param b/examples/PARAM/52949/hdeadwires.param
new file mode 100644
index 0000000..9d8b527
--- /dev/null
+++ b/examples/PARAM/52949/hdeadwires.param
@@ -0,0 +1,10 @@
+; list of dead wires in the HMS (plane,wire).  Dead means <20% efficiency.
+hdc_num_deadwires = 6
+
+hdc_deadwire_plane =  2,   6,   6,   7,   9,  10
+
+hdc_deadwire_num =   43,  18,  60,  97,  30,   8
+
+; rough efficiency  22%,  3%, .4%,  0%,  0%,  7%
+
+; pln9,wire99 is HOT (used to be that 9/#100 was DEAD)?
diff --git a/examples/PARAM/52949/hdebug.param b/examples/PARAM/52949/hdebug.param
new file mode 100644
index 0000000..5049718
--- /dev/null
+++ b/examples/PARAM/52949/hdebug.param
@@ -0,0 +1,117 @@
+; hms tracking code debug flags. 
+; when these flags are non-zero, dump routines are called to 
+; print out the data banks for each event.
+;
+;  hluno     fortran lun for output
+      hluno = 66
+; hdebugdumptof           Dump timing information for fitting offsets
+      hdebugdumptof = 0
+; hdebugdumpcal           Dump calorimeter information for fitting gains
+      hdebugdumpcal = 0
+; number of pedestal events required to overwrite orig. peds.
+  hhodo_min_peds = 500
+  hcal_min_peds  = 500
+  hcer_min_peds  = 500
+  haero_min_peds  = 500
+  hmisc_min_peds  = 500
+
+; DEBUGGING OUTPUT FLAGS
+; ----------------------
+; hdebugprintrawdc        Dump HMS_RAW_DC Bank
+      hdebugprintrawdc = 0
+; hdebugprintdecodeddc    Dump HMS_DECODED_DC BAnk
+      hdebugprintdecodeddc = 0
+; hdebugflagpsi               Dump calculated coordinate positions
+      hdebugflagpsi =  0
+; hdebugflaggeoemtry          Dump calculated geometrical parameters
+      hdebugflaggeometry = 0
+; hdebugflagpr                Dump intermediate pattern recognition results
+      hdebugflagpr = 0
+; hdebugflagstubchisq         Dump chi2 of left-right fits
+      hdebugstubchisq = 0
+; hdebugflagstubs             Dump stub fit       
+      hdebugflagstubs = 0
+; hdebuglinkstubs             Dump linked hits
+      hdebuglinkstubs = 0
+; hdebugtrackprint            Dump focal plane track fit results
+      hdebugtrackprint = 0
+; hdebugtartrackprint         Dump tracks at target
+      hdebugtartrackprint = 0
+; tof debuging 
+;
+;  hdebugprintscinraw         Dump HMS_RAW_SCIN
+    hdebugprintscinraw = 0
+;  hdebugprintscindec         Dump HMS_DECODED_SCIN
+    hdebugprintscindec = 0
+;  hdebugprinttoftracks       Dump  hms_scin_tof
+    hdebugprinttoftracks = 0
+;  hdebugprinttracktests      Dump HMS_TRACK_TESTS
+    hdebugprinttracktests = 0
+;
+;  hms calorimeter debug flags
+;  hlun_dbg_cal                lun
+   hlun_dbg_cal    = hluno
+;  hdbg_raw_cal        call h_prt_cal_raw
+   hdbg_raw_cal = 0
+;  hdbg_sparsified_cal call h_prt_cal_sparsified
+   hdbg_sparsified_cal = 0
+;  hdbg_decoded_cal    call h_prt_cal_decoded
+   hdbg_decoded_cal = 0
+;  hdbg_clusters_cal   call h_prt_cal_clusters
+   hdbg_clusters_cal = 0
+;  hdbg_tracks_cal     call h_prt_cal_tracks
+   hdbg_tracks_cal = 0
+;  hdbg_tests_cal      call h_prt_cal_tests    HMS_TRACK_TESTS
+   hdbg_tests_cal = 0
+;
+;  hard wired histograms. If these flags .ne. 0 then the histogram
+;     blocks are filled
+;
+; hturnon_scin_raw_hist       Histogram HMS raw hodoscope data (each block)
+  hturnon_scin_raw_hist = 1
+; hturnon_decoded_dc_hist     Histogram HMS_DECODED_DC
+  hturnon_decoded_dc_hist = 1
+; hturnon_focal_plane_hist    Histogram HMS_FOCAL_PLANE 
+  hturnon_focal_plane_hist = 1
+; hturnon_target_hist         HISTOGRAM HMS_TARGET
+  hturnon_target_hist = 1
+;
+; Bypass paramters to bypass code elementes in h_reconstruction
+;      Stored in hmsbypass_switches.cmn
+;      Code element is bypassed if switch .ne. 0
+; hbypass_trans_dc         bypass h_trans_dc
+  hbypass_trans_dc   = 0 
+; hbypass_track            bypass h_track
+  hbypass_track      = 0
+; hbypass_targ_trans       bypass h_targ_trans
+  hbypass_targ_trans = 0
+; hbypass_dc_eff           bypass h_dc_eff and h_dc_eff_shutdown
+  hbypass_dc_eff     = 0
+; hbypass_track_eff        bypass h_tracking efficiency code
+  hbypass_track_eff  = 0
+; hbypass_track_eff_files  bypass h_tracking efficiency output files
+  hbypass_track_eff_files  = 1
+
+; hbypass_trans_scin       bypass h_trans_scin
+  hbypass_trans_scin = 0
+; hbypass_tof              bypass h_tof
+  hbypass_tof        = 0
+; hbypass_scin_eff         bypass h_scin_eff and h_scin_eff_shutdown
+  hbypass_scin_eff   = 0
+
+; hbypass_trans_cer        bypass h_trans_cer
+  hbypass_trans_cer  = 0
+; hbypass_cer              bypass h_cer
+  hbypass_cer        = 0
+; hbypass_cer_eff          bypass h_cer_eff and h_cer_eff_shutdown
+  hbypass_cer_eff    = 0
+
+; hbypass_trans_cal        bypass h_trans_cal
+  hbypass_trans_cal  = 0
+; hbypass_cal              bypass h_cal
+  hbypass_cal        = 0
+; hbypass_cal_eff          bypass h_cal_eff and h_cal_eff_shutdown
+  hbypass_cal_eff    = 0
+
+; hbypass_physics          bypass h_physics
+  hbypass_physics    = 0
diff --git a/examples/PARAM/52949/hhodo.param.vt b/examples/PARAM/52949/hhodo.param.vt
new file mode 100644
index 0000000..39dc74b
--- /dev/null
+++ b/examples/PARAM/52949/hhodo.param.vt
@@ -0,0 +1,185 @@
+; hstart_time_center  center of allowed time window                             
+   hstart_time_center = 32.                                                     
+; hstart_time_slop    1/2 width of time window                                  
+   hstart_time_slop = 25.                                                       
+; hscin_tdc_min       minimum tdc value in hms scin                             
+    hscin_tdc_min = 0                                                           
+; hscin_tdc_max       maximum allowed tdc value                                 
+   hscin_tdc_max = 4000                                                         
+; hscin_tdc_to_time   scin tdc time per channel                                 
+   hscin_tdc_to_time = 0.0259                                                   
+ new variable for picking good hits for tof fitting
+; this should not be set tight until you are ready to fit
+; tof and you figured out good values
+   htof_tolerance = 100.0
+;                                                                               
+; hms_tof_params                                                                
+; hnum_scin_counters, hhodo_zpos, hhodo_center_coord, hhodo_width               
+; are all calculated within h_init_scin                                         
+;    hhodo_pos_coord and hhodo_neg_coord are not yet used                       
+;                                                                               
+     hhodo_slop     =    2.,  2.,  4.,  4.                                      
+;                                                                               
+     hhodo_vel_light =  14.0,14.8,15.5,15.8                                     
+                        14.0,14.8,15.5,15.8                                     
+                        14.0,14.8,15.5,15.8                                     
+                        14.0,14.8,15.5,15.8                                     
+                        14.0,14.8,15.5,15.8                                     
+                        14.0,14.8,15.5,15.8                                     
+                        14.0,14.8,15.5,15.8                                     
+                        14.0,14.8,15.5,15.8                                     
+                        14.0,14.8,15.5,15.8                                     
+                        14.0,14.8,15.5,15.8                                     
+                        14.0,14.8,15.5,15.8                                     
+                        14.0,14.8,15.5,15.8                                     
+                        14.0,14.8,15.5,15.8                                     
+                        14.0,14.8,15.5,15.8                                     
+                        14.0,14.8,15.5,15.8                                     
+                        14.0,14.8,15.5,15.8                                     
+;                                                                               
+      hhodo_pos_sigma = .3,.3,.3,.3,.3,.3,.3,.3                                 
+                        .3,.3,.3,.3,.3,.3,.3,.3                                 
+                        .3,.3,.3,.3,.3,.3,.3,.3                                 
+                        .3,.3,.3,.3,.3,.3,.3,.3                                 
+                        .3,.3,.3,.3,.3,.3,.3,.3                                 
+                        .3,.3,.3,.3,.3,.3,.3,.3                                 
+                        .3,.3,.3,.3,.3,.3,.3,.3                                 
+                        .3,.3,.3,.3,.3,.3,.3,.3                                 
+;                                                                               
+      hhodo_neg_sigma = .3,.3,.3,.3,.3,.3,.3,.3                                 
+                        .3,.3,.3,.3,.3,.3,.3,.3                                 
+                        .3,.3,.3,.3,.3,.3,.3,.3                                 
+                        .3,.3,.3,.3,.3,.3,.3,.3                                 
+                        .3,.3,.3,.3,.3,.3,.3,.3                                 
+                        .3,.3,.3,.3,.3,.3,.3,.3                                 
+                        .3,.3,.3,.3,.3,.3,.3,.3                                 
+                        .3,.3,.3,.3,.3,.3,.3,.3                                 
+                                                                                
+  hhodo_pos_minph = 125,135,125,120                                             
+                    125,135,125,120                                             
+                    125,135,125,120                                             
+                    125,135,125,120                                             
+                    125,135,125,120                                             
+                    125,135,125,120                                             
+                    125,135,125,120                                             
+                    125,135,125,120                                             
+                    125,135,125,120                                             
+                    125,135,125,120                                             
+                    125,135,125,120                                             
+                    125,135,125,120                                             
+                    125,135,125,120                                             
+                    125,135,125,120                                             
+                    125,135,125,120                                             
+                    125,135,125,120                                             
+                                                                                
+  hhodo_neg_minph = 125,135,125,120                                             
+                    125,135,125,120                                             
+                    125,135,125,120                                             
+                    125,135,125,120                                             
+                    125,135,125,120                                             
+                    125,135,125,120                                             
+                    125,135,125,120                                             
+                    125,135,125,120                                             
+                    125,135,125,120                                             
+                    125,135,125,120                                             
+                    125,135,125,120                                             
+                    125,135,125,120                                             
+                    125,135,125,120                                             
+                    125,135,125,120                                             
+                    125,135,125,120                                             
+                    125,135,125,120                                             
+  hhodo_pos_phc_coeff = -1.45,-1.1,-1.,-1.2                                     
+                        -1.45,-1.1,-1.,-1.2                                     
+                        -1.45,-1.1,-1.,-1.2                                     
+                        -1.45,-1.1,-1.,-1.2                                     
+                        -1.45,-1.1,-1.,-1.2                                     
+                        -1.45,-1.1,-1.,-1.2                                     
+                        -1.45,-1.1,-1.,-1.2                                     
+                        -1.45,-1.1,-1.,-1.2                                     
+                        -1.45,-1.1,-1.,-1.2                                     
+                        -1.45,-1.1,-1.,-1.2                                     
+                        -1.45,-1.1,-1.,-1.2                                     
+                        -1.45,-1.1,-1.,-1.2                                     
+                        -1.45,-1.1,-1.,-1.2                                     
+                        -1.45,-1.1,-1.,-1.2                                     
+                        -1.45,-1.1,-1.,-1.2                                     
+                        -1.45,-1.1,-1.,-1.2                                     
+                                                                                
+  hhodo_neg_phc_coeff = -1.3,-1.1,-1.2,-1.4                                     
+                        -1.3,-1.1,-1.2,-1.4                                     
+                        -1.3,-1.1,-1.2,-1.4                                     
+                        -1.3,-1.1,-1.2,-1.4                                     
+                        -1.3,-1.1,-1.2,-1.4                                     
+                        -1.3,-1.1,-1.2,-1.4                                     
+                        -1.3,-1.1,-1.2,-1.4                                     
+                        -1.3,-1.1,-1.2,-1.4                                     
+                        -1.3,-1.1,-1.2,-1.4                                     
+                        -1.3,-1.1,-1.2,-1.4                                     
+                        -1.3,-1.1,-1.2,-1.4                                     
+                        -1.3,-1.1,-1.2,-1.4                                     
+                        -1.3,-1.1,-1.2,-1.4                                     
+                        -1.3,-1.1,-1.2,-1.4                                     
+                        -1.3,-1.1,-1.2,-1.4                                     
+                        -1.3,-1.1,-1.2,-1.4                                     
+                                                                                
+                                                                                
+; csa 9/8/98 -- I had to hand-twaddle a few of the values                       
+; based on (relative) offsets of older hhodo.param                              
+                                                                                
+                                                                                
+hhodo_pos_time_offset =   6.7992,   0.0000,  -7.1126,   4.7475
+                         -1.1436,   0.4026,  -0.1443,   8.8108
+                          5.1911,   1.7935,  -7.0357,   7.7590
+                          5.6115,   0.1231,  -4.3477,  12.8552
+                          1.2354,  -6.4896,   8.6617,   9.3857
+                          1.8675,  -0.3651,  -4.7731,   7.9034
+                          6.4738,  -1.0463,   1.1786,   8.9740
+                          4.5395,   2.3368,  -4.4623,   4.5968
+                          2.6241,  -2.4480,  -6.4964,   6.2390
+                          4.2056,   0.0000,  -0.8924,  -1.2482
+                          6.1303,   0.0000,  -7.9503,   0.0000
+                          5.5326,   0.0000,  -0.3564,   0.0000
+                          4.3238,   0.0000,   0.8133,   0.0000
+                          1.7467,   0.0000,   1.9021,   0.0000
+                          4.1333,   0.0000,  -5.4523,   0.0000
+                          0.9416,   0.0000,   1.0158,   0.0000
+hhodo_neg_time_offset =  -2.1515,   0.0000,   2.5771,  11.2323
+                         -1.6547,  -2.2888,  10.1063,  13.3595
+                         -3.8050,  -4.1933,   3.4133,  15.0118
+                          0.7925,  -1.9592,  10.9311,  15.1057
+                         -1.2621,  -4.6538,   2.3474,  10.2752
+                         -2.9459,   1.2711,   9.6479,   7.8567
+                          1.2439,  -3.4946,   3.7283,  10.7897
+                         -4.8205,   1.1743,   8.5908,  11.1753
+                         -6.3324,  -5.2290,   0.2444,  14.7184
+                          1.8168,   0.0000,  11.2387,  15.5869
+                          0.4240,   0.0000,   8.2657,   0.0000
+                         -0.9945,   0.0000,   9.2381,   0.0000
+                         -2.3217,   0.0000,   5.1855,   0.0000
+                         -5.1166,   0.0000,  10.0781,   0.0000
+                          0.2537,   0.0000,   6.2455,   0.0000
+                          7.0554,   0.0000,  12.8714,   0.0000
+                                                                                
+;                                                                               
+hhodo_pos_ped_limit = 1000,1000,1000,1000,1000,1000,1000,1000                   
+                      1000,1000,1000,1000,1000,1000,1000,1000                   
+                      1000,1000,1000,1000,1000,1000,1000,1000                   
+                      1000,1000,1000,1000,1000,1000,1000,1000                   
+                      1000,1000,1000,1000,1000,1000,1000,1000                   
+                      1000,1000,1000,1000,1000,1000,1000,1000                   
+                      1000,1000,1000,1000,1000,1000,1000,1000                   
+                      1000,1000,1000,1000,1000,1000,1000,1000                   
+;                                                                               
+hhodo_neg_ped_limit = 1000,1000,1000,1000,1000,1000,1000,1000                   
+                      1000,1000,1000,1000,1000,1000,1000,1000                   
+                      1000,1000,1000,1000,1000,1000,1000,1000                   
+                      1000,1000,1000,1000,1000,1000,1000,1000                   
+                      1000,1000,1000,1000,1000,1000,1000,1000                   
+                      1000,1000,1000,1000,1000,1000,1000,1000                   
+                      1000,1000,1000,1000,1000,1000,1000,1000                   
+                      1000,1000,1000,1000,1000,1000,1000,1000                   
+; use htofusinginvadc=1 if want invadc_offset
+;  invadc_linear, and invadc_adc to be used
+htofusinginvadc=0
+
+                                                                                
diff --git a/examples/PARAM/52949/hhodo.pos b/examples/PARAM/52949/hhodo.pos
new file mode 100644
index 0000000..2e37fd0
--- /dev/null
+++ b/examples/PARAM/52949/hhodo.pos
@@ -0,0 +1,88 @@
+      hpathlength_central = 2500
+; Z positions of hodoscopes
+      hscin_1x_zpos =  (89.14-11.31)
+      hscin_1y_zpos =  (108.83-11.31)
+      hscin_2x_zpos =  (310.13-11.31)
+      hscin_2y_zpos =  (329.82-11.31)
+      hscin_1x_dzpos = 2.12
+      hscin_1y_dzpos = 2.12
+      hscin_2x_dzpos = 2.12
+      hscin_2y_dzpos = 2.12
+      hscin_1x_size = 8.0
+      hscin_1y_size = 8.0
+      hscin_2x_size = 8.0
+      hscin_2y_size = 8.0
+      hscin_1x_spacing = 7.5
+      hscin_1y_spacing = 7.5
+      hscin_2x_spacing = 7.5
+      hscin_2y_spacing = 7.5
+; Number of hodoscope paddles per layer
+      hscin_1x_nr = 16
+      hscin_1y_nr = 10
+      hscin_2x_nr = 16
+      hscin_2y_nr = 10
+; X,Y positions of hodoscope paddles
+      hscin_1x_left  =  37.750
+      hscin_1x_right = -37.750
+      hscin_1x_offset=  -1.3
+      hscin_1x_center= -56.250
+                       -48.750
+                       -41.250
+                       -33.750
+                       -26.250
+                       -18.750
+                       -11.250
+                        -3.750
+                         3.750
+                        11.250
+                        18.750
+                        26.250
+                        33.750
+                        41.250
+                        48.750
+                        56.250
+      hscin_1y_top   = -60.250
+      hscin_1y_bot   =  60.250
+      hscin_1y_offset=  -1.3
+      hscin_1y_center=  33.750
+                        26.250
+                        18.750
+                        11.250
+                         3.750
+                        -3.750
+                       -11.250
+                       -18.750
+                       -26.250
+                       -33.750
+      hscin_2x_left  =  37.750
+      hscin_2x_right = -37.750
+      hscin_2x_offset=  -0.6
+      hscin_2x_center= -56.250
+                       -48.750
+                       -41.250
+                       -33.750
+                       -26.250
+                       -18.750
+                       -11.250
+                        -3.750
+                         3.750
+                        11.250
+                        18.750
+                        26.250
+                        33.750
+                        41.250
+                        48.750
+                        56.250
+      hscin_2y_top   = -60.250
+      hscin_2y_bot   =  60.250
+      hscin_2y_offset=  -2.4
+      hscin_2y_center=  33.750
+                        26.250
+                        18.750
+                        11.250
+                         3.750
+                        -3.750
+                       -11.250
+                       -18.750
+                       -26.250
+                       -33.750
diff --git a/examples/PARAM/52949/hms.driftmap.vt.52949 b/examples/PARAM/52949/hms.driftmap.vt.52949
new file mode 100644
index 0000000..d5d90b5
--- /dev/null
+++ b/examples/PARAM/52949/hms.driftmap.vt.52949
@@ -0,0 +1,175 @@
+; Lookup table
+;number of bins in Meek's time to distance lookup table
+hdriftbins=138
+;number of 1st bin in Meek's table in ns
+hdrift1stbin=-24
+;bin size in ns of Meek's table
+hdriftbinsz=2
+hwc1x1fract=0.0000,0.0001,0.0001,0.0002,0.0002,0.0003,0.0003,0.0004
+0.0005,0.0006,0.0007,0.0008,0.0009,0.0011,0.0013,0.0015,0.0019,0.0027
+0.0038,0.0056,0.0087,0.0138,0.0212,0.0309,0.0423,0.0554,0.0697,0.0853
+0.1022,0.1201,0.1384,0.1581,0.1781,0.1987,0.2200,0.2417,0.2637,0.2863
+0.3088,0.3318,0.3544,0.3769,0.3993,0.4219,0.4444,0.4669,0.4888,0.5107
+0.5325,0.5543,0.5757,0.5972,0.6182,0.6393,0.6595,0.6796,0.6995,0.7191
+0.7382,0.7569,0.7750,0.7929,0.8099,0.8266,0.8422,0.8571,0.8706,0.8831
+0.8946,0.9055,0.9156,0.9247,0.9332,0.9410,0.9480,0.9546,0.9606,0.9662
+0.9709,0.9754,0.9793,0.9826,0.9854,0.9879,0.9897,0.9914,0.9928,0.9939
+0.9947,0.9953,0.9959,0.9965,0.9969,0.9972,0.9975,0.9977,0.9980,0.9982
+0.9984,0.9985,0.9986,0.9988,0.9988,0.9990,0.9991,0.9992,0.9993,0.9994
+0.9994,0.9995,0.9995,0.9996,0.9996,0.9996,0.9997,0.9997,0.9997,0.9997
+0.9998,0.9998,0.9998,0.9998,0.9998,0.9999,0.9999,0.9999,0.9999,0.9999
+0.9999,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000
+hwc1y1fract=0.0000,0.0001,0.0001,0.0001,0.0002,0.0002,0.0002,0.0003
+0.0003,0.0004,0.0004,0.0005,0.0006,0.0008,0.0010,0.0012,0.0017,0.0025
+0.0038,0.0061,0.0104,0.0175,0.0276,0.0408,0.0571,0.0754,0.0952,0.1165
+0.1384,0.1614,0.1845,0.2080,0.2315,0.2549,0.2786,0.3018,0.3247,0.3479
+0.3706,0.3928,0.4148,0.4366,0.4583,0.4795,0.5006,0.5214,0.5419,0.5623
+0.5825,0.6026,0.6225,0.6423,0.6619,0.6818,0.7011,0.7200,0.7388,0.7571
+0.7751,0.7926,0.8096,0.8258,0.8414,0.8561,0.8701,0.8828,0.8946,0.9054
+0.9150,0.9238,0.9320,0.9390,0.9455,0.9513,0.9564,0.9612,0.9654,0.9692
+0.9728,0.9760,0.9789,0.9815,0.9838,0.9856,0.9874,0.9888,0.9901,0.9912
+0.9923,0.9932,0.9939,0.9946,0.9951,0.9956,0.9961,0.9965,0.9969,0.9972
+0.9975,0.9978,0.9980,0.9982,0.9984,0.9986,0.9987,0.9989,0.9990,0.9991
+0.9992,0.9993,0.9994,0.9995,0.9995,0.9996,0.9996,0.9997,0.9997,0.9997
+0.9998,0.9998,0.9998,0.9998,0.9999,0.9999,0.9999,0.9999,0.9999,0.9999
+0.9999,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000
+hwc1u1fract=0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0001,0.0001
+0.0001,0.0001,0.0001,0.0001,0.0002,0.0002,0.0003,0.0004,0.0007,0.0013
+0.0026,0.0055,0.0108,0.0194,0.0312,0.0457,0.0623,0.0806,0.0999,0.1202
+0.1415,0.1638,0.1860,0.2089,0.2316,0.2545,0.2774,0.3004,0.3229,0.3456
+0.3680,0.3908,0.4128,0.4349,0.4565,0.4777,0.4988,0.5197,0.5403,0.5609
+0.5812,0.6012,0.6212,0.6410,0.6605,0.6798,0.6987,0.7180,0.7364,0.7547
+0.7726,0.7902,0.8071,0.8233,0.8388,0.8536,0.8672,0.8799,0.8915,0.9022
+0.9115,0.9202,0.9278,0.9348,0.9411,0.9470,0.9526,0.9575,0.9621,0.9665
+0.9705,0.9742,0.9775,0.9804,0.9829,0.9850,0.9868,0.9884,0.9898,0.9910
+0.9920,0.9928,0.9936,0.9943,0.9949,0.9954,0.9959,0.9963,0.9966,0.9970
+0.9973,0.9976,0.9978,0.9980,0.9982,0.9984,0.9985,0.9987,0.9988,0.9989
+0.9990,0.9991,0.9992,0.9993,0.9994,0.9994,0.9995,0.9995,0.9996,0.9996
+0.9997,0.9997,0.9997,0.9998,0.9998,0.9998,0.9998,0.9999,0.9999,0.9999
+0.9999,0.9999,0.9999,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000
+hwc1v1fract=0.0000,0.0000,0.0000,0.0000,0.0001,0.0001,0.0001,0.0001
+0.0001,0.0002,0.0002,0.0002,0.0003,0.0003,0.0004,0.0006,0.0009,0.0016
+0.0031,0.0058,0.0107,0.0192,0.0308,0.0454,0.0621,0.0808,0.1007,0.1217
+0.1434,0.1654,0.1878,0.2105,0.2331,0.2558,0.2784,0.3009,0.3237,0.3462
+0.3682,0.3905,0.4120,0.4341,0.4555,0.4764,0.4976,0.5184,0.5391,0.5596
+0.5801,0.6000,0.6198,0.6397,0.6591,0.6785,0.6980,0.7173,0.7362,0.7548
+0.7729,0.7907,0.8078,0.8243,0.8402,0.8552,0.8691,0.8820,0.8936,0.9040
+0.9135,0.9220,0.9297,0.9367,0.9431,0.9489,0.9541,0.9591,0.9635,0.9677
+0.9716,0.9750,0.9783,0.9810,0.9834,0.9855,0.9874,0.9890,0.9903,0.9915
+0.9926,0.9934,0.9941,0.9947,0.9953,0.9957,0.9962,0.9965,0.9969,0.9972
+0.9974,0.9977,0.9979,0.9981,0.9983,0.9984,0.9986,0.9987,0.9988,0.9990
+0.9991,0.9992,0.9993,0.9994,0.9994,0.9995,0.9995,0.9996,0.9996,0.9997
+0.9997,0.9997,0.9998,0.9998,0.9998,0.9998,0.9999,0.9999,0.9999,0.9999
+0.9999,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000
+hwc1y2fract=0.0000,0.0000,0.0000,0.0000,0.0001,0.0001,0.0001,0.0001
+0.0001,0.0001,0.0002,0.0002,0.0002,0.0003,0.0004,0.0007,0.0011,0.0021
+0.0040,0.0074,0.0132,0.0216,0.0329,0.0468,0.0632,0.0815,0.1011,0.1225
+0.1446,0.1673,0.1904,0.2143,0.2375,0.2607,0.2840,0.3071,0.3298,0.3528
+0.3752,0.3971,0.4190,0.4410,0.4628,0.4846,0.5053,0.5261,0.5466,0.5673
+0.5872,0.6074,0.6272,0.6469,0.6662,0.6854,0.7043,0.7231,0.7413,0.7598
+0.7773,0.7949,0.8118,0.8279,0.8432,0.8575,0.8711,0.8837,0.8951,0.9053
+0.9147,0.9231,0.9307,0.9376,0.9438,0.9495,0.9547,0.9596,0.9639,0.9681
+0.9717,0.9750,0.9779,0.9805,0.9829,0.9848,0.9865,0.9880,0.9893,0.9905
+0.9916,0.9925,0.9933,0.9940,0.9947,0.9952,0.9957,0.9962,0.9965,0.9969
+0.9973,0.9975,0.9978,0.9980,0.9982,0.9984,0.9985,0.9987,0.9989,0.9990
+0.9991,0.9992,0.9993,0.9994,0.9994,0.9995,0.9996,0.9996,0.9997,0.9997
+0.9997,0.9997,0.9998,0.9998,0.9998,0.9999,0.9999,0.9999,0.9999,0.9999
+0.9999,0.9999,0.9999,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000
+hwc1x2fract=0.0000,0.0000,0.0000,0.0001,0.0001,0.0001,0.0001,0.0002
+0.0002,0.0003,0.0003,0.0004,0.0005,0.0006,0.0008,0.0011,0.0017,0.0028
+0.0047,0.0080,0.0133,0.0208,0.0308,0.0422,0.0554,0.0700,0.0858,0.1025
+0.1206,0.1393,0.1592,0.1795,0.2005,0.2220,0.2439,0.2661,0.2886,0.3108
+0.3336,0.3564,0.3790,0.4013,0.4233,0.4457,0.4682,0.4904,0.5123,0.5342
+0.5555,0.5772,0.5985,0.6195,0.6404,0.6609,0.6814,0.7012,0.7212,0.7401
+0.7589,0.7771,0.7948,0.8116,0.8279,0.8437,0.8581,0.8715,0.8840,0.8957
+0.9064,0.9163,0.9252,0.9335,0.9413,0.9483,0.9549,0.9607,0.9661,0.9709
+0.9752,0.9792,0.9826,0.9855,0.9878,0.9897,0.9913,0.9927,0.9937,0.9946
+0.9954,0.9960,0.9965,0.9969,0.9972,0.9975,0.9977,0.9979,0.9981,0.9983
+0.9985,0.9986,0.9987,0.9988,0.9989,0.9990,0.9991,0.9992,0.9993,0.9993
+0.9994,0.9995,0.9995,0.9996,0.9996,0.9996,0.9997,0.9997,0.9997,0.9998
+0.9998,0.9998,0.9998,0.9998,0.9998,0.9999,0.9999,0.9999,0.9999,0.9999
+0.9999,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000
+hwc2x1fract=0.0001,0.0001,0.0002,0.0002,0.0003,0.0004,0.0005,0.0006
+0.0008,0.0010,0.0012,0.0014,0.0016,0.0021,0.0028,0.0041,0.0069,0.0119
+0.0191,0.0288,0.0403,0.0533,0.0678,0.0835,0.0999,0.1171,0.1352,0.1539
+0.1733,0.1935,0.2140,0.2350,0.2565,0.2785,0.3007,0.3228,0.3450,0.3673
+0.3896,0.4125,0.4350,0.4576,0.4801,0.5030,0.5252,0.5475,0.5698,0.5914
+0.6130,0.6344,0.6553,0.6764,0.6972,0.7179,0.7381,0.7575,0.7769,0.7958
+0.8139,0.8310,0.8474,0.8625,0.8765,0.8892,0.9008,0.9113,0.9205,0.9292
+0.9368,0.9440,0.9505,0.9565,0.9622,0.9674,0.9721,0.9763,0.9799,0.9832
+0.9860,0.9884,0.9904,0.9918,0.9932,0.9942,0.9950,0.9956,0.9962,0.9966
+0.9970,0.9974,0.9977,0.9979,0.9981,0.9983,0.9985,0.9986,0.9988,0.9989
+0.9990,0.9991,0.9992,0.9993,0.9994,0.9994,0.9995,0.9995,0.9995,0.9996
+0.9996,0.9997,0.9997,0.9997,0.9998,0.9998,0.9998,0.9998,0.9998,0.9999
+0.9999,0.9999,0.9999,0.9999,0.9999,0.9999,0.9999,0.9999,0.9999,1.0000
+1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000
+hwc2y1fract=0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0001,0.0001
+0.0001,0.0001,0.0001,0.0002,0.0002,0.0002,0.0003,0.0004,0.0006,0.0011
+0.0021,0.0042,0.0082,0.0153,0.0258,0.0396,0.0562,0.0754,0.0967,0.1193
+0.1428,0.1670,0.1909,0.2151,0.2392,0.2632,0.2869,0.3104,0.3344,0.3577
+0.3805,0.4031,0.4250,0.4469,0.4682,0.4896,0.5107,0.5315,0.5522,0.5724
+0.5926,0.6129,0.6331,0.6529,0.6726,0.6922,0.7115,0.7305,0.7490,0.7675
+0.7853,0.8027,0.8195,0.8354,0.8507,0.8654,0.8792,0.8918,0.9034,0.9138
+0.9231,0.9315,0.9388,0.9451,0.9510,0.9562,0.9609,0.9651,0.9689,0.9723
+0.9754,0.9783,0.9807,0.9828,0.9847,0.9864,0.9878,0.9891,0.9903,0.9914
+0.9923,0.9931,0.9938,0.9944,0.9949,0.9954,0.9959,0.9963,0.9966,0.9969
+0.9973,0.9975,0.9977,0.9979,0.9981,0.9983,0.9985,0.9986,0.9988,0.9989
+0.9990,0.9991,0.9992,0.9993,0.9994,0.9994,0.9995,0.9996,0.9996,0.9997
+0.9997,0.9998,0.9998,0.9998,0.9999,0.9999,0.9999,0.9999,0.9999,0.9999
+1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000
+hwc2u1fract=0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0001,0.0001
+0.0001,0.0001,0.0001,0.0002,0.0002,0.0003,0.0004,0.0005,0.0009,0.0019
+0.0042,0.0094,0.0188,0.0315,0.0476,0.0664,0.0872,0.1095,0.1325,0.1561
+0.1801,0.2041,0.2281,0.2519,0.2757,0.2990,0.3222,0.3453,0.3678,0.3899
+0.4119,0.4341,0.4556,0.4766,0.4975,0.5186,0.5393,0.5597,0.5796,0.5994
+0.6193,0.6391,0.6585,0.6778,0.6971,0.7159,0.7345,0.7528,0.7709,0.7888
+0.8061,0.8230,0.8390,0.8546,0.8690,0.8827,0.8951,0.9061,0.9161,0.9249
+0.9328,0.9396,0.9458,0.9514,0.9562,0.9608,0.9649,0.9687,0.9721,0.9753
+0.9782,0.9806,0.9829,0.9848,0.9866,0.9882,0.9894,0.9905,0.9916,0.9924
+0.9931,0.9938,0.9943,0.9949,0.9954,0.9958,0.9961,0.9965,0.9968,0.9971
+0.9973,0.9976,0.9978,0.9980,0.9982,0.9984,0.9986,0.9987,0.9989,0.9990
+0.9991,0.9992,0.9993,0.9993,0.9994,0.9995,0.9996,0.9996,0.9997,0.9997
+0.9997,0.9998,0.9998,0.9998,0.9998,0.9999,0.9999,0.9999,0.9999,0.9999
+0.9999,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000
+hwc2v1fract=0.0000,0.0000,0.0000,0.0000,0.0000,0.0001,0.0001,0.0001
+0.0001,0.0002,0.0002,0.0002,0.0003,0.0004,0.0005,0.0007,0.0010,0.0017
+0.0032,0.0065,0.0131,0.0235,0.0372,0.0542,0.0733,0.0947,0.1164,0.1394
+0.1622,0.1857,0.2091,0.2328,0.2560,0.2793,0.3025,0.3253,0.3477,0.3703
+0.3922,0.4141,0.4355,0.4566,0.4778,0.4986,0.5189,0.5396,0.5598,0.5801
+0.6002,0.6199,0.6393,0.6589,0.6780,0.6969,0.7159,0.7343,0.7529,0.7711
+0.7888,0.8059,0.8226,0.8388,0.8544,0.8687,0.8820,0.8941,0.9051,0.9147
+0.9233,0.9310,0.9377,0.9438,0.9493,0.9543,0.9590,0.9631,0.9669,0.9704
+0.9737,0.9767,0.9793,0.9818,0.9838,0.9856,0.9872,0.9886,0.9898,0.9909
+0.9919,0.9927,0.9934,0.9940,0.9945,0.9951,0.9955,0.9959,0.9963,0.9967
+0.9970,0.9973,0.9976,0.9978,0.9980,0.9982,0.9984,0.9986,0.9987,0.9989
+0.9990,0.9991,0.9992,0.9993,0.9994,0.9995,0.9995,0.9996,0.9996,0.9997
+0.9997,0.9998,0.9998,0.9998,0.9999,0.9999,0.9999,0.9999,0.9999,0.9999
+0.9999,0.9999,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000
+hwc2y2fract=0.0000,0.0000,0.0000,0.0000,0.0000,0.0001,0.0001,0.0001
+0.0001,0.0001,0.0002,0.0002,0.0002,0.0003,0.0004,0.0005,0.0007,0.0013
+0.0023,0.0045,0.0088,0.0163,0.0271,0.0410,0.0578,0.0769,0.0977,0.1203
+0.1436,0.1676,0.1916,0.2161,0.2403,0.2638,0.2876,0.3108,0.3342,0.3572
+0.3804,0.4032,0.4254,0.4470,0.4686,0.4898,0.5111,0.5318,0.5525,0.5731
+0.5936,0.6138,0.6339,0.6536,0.6735,0.6929,0.7122,0.7309,0.7495,0.7679
+0.7860,0.8037,0.8205,0.8368,0.8524,0.8667,0.8803,0.8929,0.9044,0.9146
+0.9240,0.9320,0.9394,0.9458,0.9516,0.9569,0.9614,0.9656,0.9694,0.9728
+0.9759,0.9787,0.9812,0.9833,0.9850,0.9867,0.9882,0.9894,0.9906,0.9916
+0.9925,0.9932,0.9939,0.9945,0.9950,0.9955,0.9959,0.9964,0.9967,0.9970
+0.9973,0.9976,0.9978,0.9979,0.9981,0.9983,0.9984,0.9986,0.9987,0.9989
+0.9990,0.9991,0.9992,0.9993,0.9994,0.9995,0.9995,0.9996,0.9996,0.9997
+0.9997,0.9998,0.9998,0.9998,0.9998,0.9999,0.9999,0.9999,0.9999,0.9999
+0.9999,0.9999,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000
+hwc2x2fract=0.0000,0.0000,0.0001,0.0001,0.0001,0.0002,0.0002,0.0003
+0.0003,0.0004,0.0005,0.0006,0.0007,0.0008,0.0010,0.0012,0.0017,0.0027
+0.0042,0.0071,0.0121,0.0198,0.0299,0.0422,0.0564,0.0724,0.0892,0.1078
+0.1270,0.1471,0.1677,0.1893,0.2112,0.2336,0.2564,0.2794,0.3021,0.3253
+0.3481,0.3711,0.3937,0.4163,0.4389,0.4611,0.4829,0.5048,0.5266,0.5482
+0.5697,0.5904,0.6112,0.6321,0.6523,0.6727,0.6927,0.7125,0.7317,0.7508
+0.7695,0.7877,0.8050,0.8222,0.8385,0.8539,0.8682,0.8814,0.8936,0.9047
+0.9147,0.9239,0.9322,0.9399,0.9468,0.9531,0.9588,0.9640,0.9690,0.9732
+0.9770,0.9803,0.9832,0.9858,0.9879,0.9897,0.9910,0.9923,0.9934,0.9942
+0.9949,0.9956,0.9961,0.9965,0.9969,0.9972,0.9975,0.9978,0.9980,0.9982
+0.9984,0.9985,0.9987,0.9988,0.9989,0.9990,0.9991,0.9992,0.9993,0.9994
+0.9994,0.9995,0.9995,0.9996,0.9996,0.9997,0.9997,0.9997,0.9998,0.9998
+0.9998,0.9998,0.9998,0.9999,0.9999,0.9999,0.9999,0.9999,0.9999,0.9999
+1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000
diff --git a/examples/PARAM/52949/hmsflags.param b/examples/PARAM/52949/hmsflags.param
new file mode 100644
index 0000000..382ed6d
--- /dev/null
+++ b/examples/PARAM/52949/hmsflags.param
@@ -0,0 +1,52 @@
+; Offset in the spectrometer momentum.
+  hmomentum_factor = 0.000 ; leave 0 so it will have no effect
+                           ; use hpcentral_offset if one needs to offset central momentum
+;
+; The hdelta_offset,htheta_offset,hphi_offset effect the
+; reconstructed target quantities. Used in h_targ_trans.f 
+; For transport x is in the dispersive direction with + down
+;               y is in the horizontal + towards small angles.
+;               z is along the central optics axis.
+; In transport coordinates phi = hyptar = dy/dz and theta = hxptar = dx/dz 
+;    but for unknown reasons the yp offset is named  htheta_offset
+;    and  the xp offset is named  hphi_offset
+; Do not to change these values, since these are the zero order
+;  CMOP matrix elements. If you do change then your hms sieve
+;  plots will be screwed up.
+  hdelta_offset = 0.       ; (%)   hdelta_tar = hdelta_tar + hdelta_offset
+  htheta_offset = 4.83e-5  ; (rad) hyp_tar = hyp_tar + htheta_offset
+  hphi_offset   = -4.73e-3 ; (rad) hxp_tar = hxp_tar + hphi_offset
+;
+
+;saturation correction flag
+  genable_hms_satcorr = 2000 ;(0=disabled) - h_satcorr.f
+                          ; a correction to hsdelta event by event
+                          ; for a problem in setting Q3 current.
+                          ; There was an unknown zero offset in the Q3 current.
+                          ; The magnet setting code field00.f partially 
+                          ; fixes this problem. T. Horn in 2003 determined
+                          ; the corrections to delta.
+                          ; Data taken with fields set by field99.f or earlier should set to 1999.
+                          ; Data taken with fields set by field00.f or later should set to 2000.
+; central field  correction
+  genable_hms_fieldcorr = 1 ; (1=disabled) - h_fieldcorr.f 
+                            ; Need to enable for experiments before Jan 2002 .
+			    ; experiments using field02 and field03 should disable. 
+;
+; The following offsets are applied to the central kinematic variables
+;  in h_apply_offsets.f  . These might be modified by an experiment
+;  after doing calibration with elastic ep.
+; The values below are from T. Horn 2003 analysis
+  hpcentral_offset = -0.25   ; sets hpcentral = hpcentral * ( 1. + hpcentral_offset / 100. )
+		    ; experiments earlier than April 2003 
+                    ; should use  about -0.3 which is the best
+                    ; estimate based on several previous experiments.
+  hthetacentral_offset = 0.0002 ; (rad) 
+                         ;htheta_lab=htheta_lab + hthetacentral_offset/degree 
+; This offset is determined from elastic ep data.
+; Must be added to ssxptar when used in calculating lab angles.
+; Example is in h_physics.f
+;
+  h_oopcentral_offset = 0.0011  ; (rad)
+
+
diff --git a/examples/PARAM/52949/htracking.param b/examples/PARAM/52949/htracking.param
new file mode 100644
index 0000000..99b502a
--- /dev/null
+++ b/examples/PARAM/52949/htracking.param
@@ -0,0 +1,94 @@
+; hms pattern recognition and tracking code parameters
+; hmax_pr_hits is the maximum number of decoded hits allowed in a chamber for
+;              pattern recognition to proceed. This protexts against unusual
+;              kami kaze events which hang the analyzer to a long time.
+;
+        hmax_pr_hits =    35, 35
+; maximum number of possible focal plane tracks, must be <= 20
+        hntracks_max_fp = 10
+; if h_remove_sppt_if_one_y_plane=1 then remove space point if space point
+;    contains only one y plane.
+; Recommend h_remove_sppt_if_one_y_plane=0.  
+        h_remove_sppt_if_one_y_plane=0
+; hminhit(i)   minimum number of hits in each space point (one for each chamber)
+	hmin_hit =     5, 5
+; hmin_combos(i) minimum number of pairs in each space point ( one per chamber)
+; should be 3/3 for 4/6 tracking, and 4/4 for 5/6 tracking (JRA)
+	hmin_combos = 4, 4 
+; hspace_point_criterion(i) minimum separation of distinct space points
+; recommended value for hspace_point_criterion ( based on meeting
+; Feb 2003) 
+       hspace_point_criterion = 1.0, 1.0
+
+        hstub_max_xpdiff = .05
+;
+; The following four criteria are applied to the stub fit results at the
+; focal plane position to link stubs to tracks
+; hxt_track_criterion  
+; hyt_track_criterion
+; hxpt_track_criterion
+; hypt_track_criterion
+; recommended value for hspace_point_criterion ( based on meeting
+; Feb 2003) 
+       hxt_track_criterion  = 10.
+       hyt_track_criterion  = 4.
+       hxpt_track_criterion = 0.2
+       hypt_track_criterion = 0.5
+;
+; hsingle_stub            If .ne. 0 make a track of each single stub
+  hsingle_stub = 0
+; turn on/off small angle approximation to left/right decision for y
+  hSmallAngleApprox = 1
+
+; Crude track selection criteria in h_physics
+; hsel_chi2_fpperdegmax   maximum chi2 per degree of freedom for track
+  hsel_chi2_fpperdegmax = 2000000.
+; hsel_dedx1min           minimum dedx to chose best track in scin 1
+  hsel_dedx1min = -100000
+; hsel_dedx1max           maximum dedx to chose best track in scin 1
+  hsel_dedx1max = 1000000.
+; hsel_betamin            minimum track beta to chose best track 
+  hsel_betamin  = -100000
+; hsel_betamax            maximum track beta to chose best track 
+  hsel_betamax  = 100000.
+; hsel_etmin              minimum track et to chose best track 
+  hsel_etmin = 0.05
+; hsel_etmax              maximum track et to chose best track 
+  hsel_etmax = 100000.
+; hsel_ndegreesmin        minimum number of degrees of freedom for track
+  hsel_ndegreesmin = 1
+
+
+; hstat_maxchisq          chisquared limit for tracks used to measure hodo. eff.
+  hstat_maxchisq = 10.
+; hsel_using_scin         uses scintillator for track selection
+  hsel_using_scin = 1
+; hstat_slop              distance from center of scin. to count as expecting hit
+  hstat_slop = 2.
+; hstat_mineff            warning level for scin. effic.
+  hstat_mineff = .95
+; hstat_cal_maxchisq      chisquared limit for tracks used to measure cal. eff.
+  hstat_cal_maxchisq = 10.
+; hstat_cal_slop          distance from center of block to count as expecting hit
+  hstat_cal_slop = 2.
+; hcer_min_eff            warning level for cerenkov effic.
+  hcer_min_eff = .98
+; hcer_threshold          threshold for good hit (for measureing effic.)
+  hcer_threshold = 0.5
+; hdc_min_eff             warning level for dc raw effic.(1 per plane)
+  hdc_min_eff = .96,.98,.96,.98,.98,.94
+                .96,.98,.98,.98,.98,.96
+; hdc_min_wire_eff        warning level for wire effic, measured using tracking
+  hdc_min_wire_eff = .85
+; hdc_min_plane_eff        warning level for plane effic, measured using tracking
+  hdc_min_plane_eff = .95,.95,.95,.95,.95,.95
+                      .95,.95,.95,.95,.95,.95
+;Derek added this for scintillator based fiducial cuts.  Everything from
+;loscin to hiscin inclusive will be included as "good" scintillator hits.
+  hxloscin  = 4, 4
+  hxhiscin  = 13, 13
+  hyloscin  = 4, 4
+  hyhiscin  = 7, 7
+;  htrack_eff_test_scin_planes is the number of planes nec needed to 
+;  set sweet spot to true. 4 is extra clean, 3 is good enough for e-'s.
+  htrack_eff_test_num_scin_planes = 3
diff --git a/examples/PARAM/52949/scal.param.vt.52843 b/examples/PARAM/52949/scal.param.vt.52843
new file mode 100644
index 0000000..c0ec9ee
--- /dev/null
+++ b/examples/PARAM/52949/scal.param.vt.52843
@@ -0,0 +1,58 @@
+; Slop in x position.  Allowed distance between track and edge of block (in cm)
+; probably too tight djm scal_slop = 7.5
+scal_slop = 10.0
+
+scal_pos_cal_const =0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001
+                    0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001
+                    0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001
+                    0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001
+
+scal_neg_cal_const =0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001
+                    0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001
+                    0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001
+                    0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001
+
+scal_pos_gain_ini=1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000
+                  1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000
+                  1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000
+                  1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000
+
+scal_neg_gain_ini=1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000
+                  1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000
+                  1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000
+                  1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000
+
+scal_pos_gain_cur=1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000
+                  1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000
+                  1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000
+                  1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000
+
+scal_neg_gain_cur=1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000
+                  1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000
+                  1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000
+                  1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000
+
+
+
+; Calibration constants for run   52843,   2166 events processed p=1.2
+
+scal_pos_gain_cor= 0.913, 0.238, 0.526, 0.307, 0.293, 0.383, 0.509, 0.570, 0.327, 0.494, 0.940,
+                   0.399, 0.601, 0.296, 0.398, 0.419, 0.192, 0.634, 0.514, 0.674, 0.368, 0.821,
+                   0.546, 0.727, 0.922, 0.685, 0.655, 0.624, 1.129, 0.793, 0.838, 0.768, 0.905,
+                   0.735, 0.876, 0.821, 1.022, 0.885, 0.965, 1.015, 0.783, 1.096, 0.788, 1.110,
+scal_neg_gain_cor= 0.126, 0.661, 0.610, 0.532, 0.626, 0.454, 0.554, 0.513, 0.603, 0.781, 0.173,
+                   0.829, 0.300, 0.596, 0.513, 0.551, 0.788, 0.563, 0.314, 0.698, 0.463, 0.486,
+                   0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000,
+                   0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000,
+
+scal_pos_ped_limit =1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000
+                    1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000
+                    1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000
+                    1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000
+
+scal_neg_ped_limit =1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000
+                    1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000
+                    1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000
+                    1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000
+
+
diff --git a/examples/PARAM/52949/scal.pos b/examples/PARAM/52949/scal.pos
new file mode 100644
index 0000000..4289ec1
--- /dev/null
+++ b/examples/PARAM/52949/scal.pos
@@ -0,0 +1,72 @@
+; neglect extra tubes for now
+scal_num_neg_columns = 2
+
+; Z position of front of shower counter layers
+      scal_1pr_zpos = (282.0+31.01)
+      scal_2ta_zpos = (293.0+31.01)
+      scal_3ta_zpos = (304.0+31.01)
+      scal_4ta_zpos = (315.0+31.01)
+; Thickness of shower counter blocks, blocks are 10 * 10 * 70 cm^3
+      scal_1pr_thick = 10.0
+      scal_2ta_thick = 10.0
+      scal_3ta_thick = 10.0
+      scal_4ta_thick = 10.0
+; Number of shower counter blocks per layer
+      scal_1pr_nr = 11
+      scal_2ta_nr = 11
+      scal_3ta_nr = 11
+      scal_4ta_nr = 11
+; X,Y positions of shower counter blocks
+      scal_1pr_left  =  35.0
+      scal_1pr_right = -35.0
+      scal_1pr_top   = (-55.0-5.64)
+                       (-45.0-5.64)
+                       (-35.0-5.64)
+                       (-25.0-5.64)
+                       (-15.0-5.64)
+                       ( -5.0-5.64)
+                       (  5.0-5.64)
+                       ( 15.0-5.64)
+                       ( 25.0-5.64)
+                       ( 35.0-5.64)
+                       ( 45.0-5.64)
+      scal_2ta_left  =  35.0
+      scal_2ta_right = -35.0
+      scal_2ta_top   = (-55.0-5.64)
+                       (-45.0-5.64)
+                       (-35.0-5.64)
+                       (-25.0-5.64)
+                       (-15.0-5.64)
+                       ( -5.0-5.64)
+                       (  5.0-5.64)
+                       ( 15.0-5.64)
+                       ( 25.0-5.64)
+                       ( 35.0-5.64)
+                       ( 45.0-5.64)
+      scal_3ta_left  =  35.0
+      scal_3ta_right = -35.0
+      scal_3ta_top   = (-55.0-5.64)
+                       (-45.0-5.64)
+                       (-35.0-5.64)
+                       (-25.0-5.64)
+                       (-15.0-5.64)
+                       ( -5.0-5.64)
+                       (  5.0-5.64)
+                       ( 15.0-5.64)
+                       ( 25.0-5.64)
+                       ( 35.0-5.64)
+                       ( 45.0-5.64)
+      scal_4ta_left  =  35.0
+      scal_4ta_right = -35.0
+      scal_4ta_top   = (-55.0-5.64)
+                       (-45.0-5.64)
+                       (-35.0-5.64)
+                       (-25.0-5.64)
+                       (-15.0-5.64)
+                       ( -5.0-5.64)
+                       (  5.0-5.64)
+                       ( 15.0-5.64)
+                       ( 25.0-5.64)
+                       ( 35.0-5.64)
+                       ( 45.0-5.64)
+
diff --git a/examples/PARAM/52949/scer.param.vt b/examples/PARAM/52949/scer.param.vt
new file mode 100644
index 0000000..6f9666e
--- /dev/null
+++ b/examples/PARAM/52949/scer.param.vt
@@ -0,0 +1,23 @@
+;Values for Peter's new Cerenkov (BC 12/20/04)
+scer_width = -3000, -3000, -30, -30
+
+scer_adc_to_npe = -1/19.6819, 1/19.6819, 1/999999.9, 1/999999.9
+
+scer_chi2max = 50.
+scer_beta_min = 0.8
+scer_beta_max = 1.2
+scer_et_min = .95
+scer_et_max = 2.0
+
+scer_mirror_zpos = 180
+
+scer_region =    7,   7,  -15,  -15,   7.
+                 0,   0,   -8,    8,   0.
+                 0,   0,    0,    0,   0.
+                 0,   0,    0,    0,   0.
+                45,  45,   25,   25,  45.
+                15,  15,   10,   10,  15.
+               .15, .15,  .15,  .15,  .15
+               .05, .05,  .05,  .05,  .05
+
+scer_ped_limit =  1000,1000,1000,1000
diff --git a/examples/PARAM/52949/sdc.param.vt.53000 b/examples/PARAM/52949/sdc.param.vt.53000
new file mode 100644
index 0000000..7185a8b
--- /dev/null
+++ b/examples/PARAM/52949/sdc.param.vt.53000
@@ -0,0 +1,55 @@
+;---------------------------------------------------------------------
+; SOS_TRACKING
+; CTP parameter file containing all tracking parameters for the SOS
+;----------------------------------------------------------------------
+; Names of each wire plane
+;      sdc_plane_names = 'sos1u1'
+;                        'sos1u2'
+;                        'sos1x1'
+;                        'sos1x2'
+;                        'sos1v1'
+;                        'sos1v2'
+;                        'sos2u1'
+;                        'sos2u2'
+;                        'sos2x1'
+;                        'sos2x2'
+;                        'sos2v1'
+;                        'sos2v2'
+; sigma of wire chamber resolution for each plane
+      sdc_sigma = 0.020
+                  0.020
+                  0.020
+                  0.020
+                  0.020
+                  0.020
+                  0.020
+                  0.020
+                  0.020
+                  0.020
+                  0.020
+                  0.020
+; sos dc tdc minimum tdc value array allowed for a good hit
+    sdc_tdc_min_win = 2600, 2600, 2600, 2600, 2600, 2600
+                      2600, 2600, 2600, 2600, 2600, 2600
+; sos dc tdc maximum tdc value array allowed for a good hit
+    sdc_tdc_max_win = 3200, 3200, 3200, 3200, 3200, 3200
+                      3200, 3200, 3200, 3200, 3200, 3200
+; sos drift chamber tdc's time per channel
+        sdc_tdc_time_per_channel = 0.5
+; sos zero time for drift chambers	!DECREASING this number moves the sdtime plots to LOWER time.
+       sdc_plane_time_zero = (1440-10+26+86+30+2+4)
+                             (1440-9.5+22+90+30+4)
+                             (1440-9.25+22+94+30+4-2)
+                             (1440-12+28+84+30+4+2)
+                             (1440-11+24+86+30+2+2+4)
+                             (1440-11+26+86+30+4)
+                             (1440-11.5+24+86+30+6)
+                             (1440-14+22+90+30+4)
+                             (1440-13.5+22+84+30+4)
+                             (1440-13.5+24+74+30+4+2)
+                             (1440-11.5+22+82+30+4)
+                             (1440-13.25+24+80+30+4)
+; Dave Abbott's wire velocity correction
+sdc_wire_velocity = 13.0
+sdc_central_time = 2.8,2.8,1.5,1.5,2.8,2.8
+                   2.8,2.8,1.5,1.5,2.8,2.8
diff --git a/examples/PARAM/52949/sdc.pos b/examples/PARAM/52949/sdc.pos
new file mode 100644
index 0000000..015bb09
--- /dev/null
+++ b/examples/PARAM/52949/sdc.pos
@@ -0,0 +1,216 @@
+; Number of planes installed in SOS detector setup
+      sdc_num_planes = 12
+; Number of chambers installed in SOS detector setup
+      sdc_num_chambers = 2
+; Z positions of various planes in SOS chambers
+; sdc_n_zpos is the surveyed Z position of the center of chamber n.
+      sdc_1_zpos = (-24.76+31.01)
+      sdc_2_zpos = ( 24.76+31.01)
+;      sdc_3_zpos =(247.50+31.01)
+      sdc_zpos   = sdc_1_zpos - 1.5875
+                   sdc_1_zpos - 0.9525
+                   sdc_1_zpos - 0.3175
+                   sdc_1_zpos + 0.3175
+                   sdc_1_zpos + 0.9525
+                   sdc_1_zpos + 1.5875
+                   sdc_2_zpos - 1.5875
+                   sdc_2_zpos - 0.9525
+                   sdc_2_zpos - 0.3175
+                   sdc_2_zpos + 0.3175
+                   sdc_2_zpos + 0.9525
+                   sdc_2_zpos + 1.5875
+; Angle alpha of wires in wire chamber planes (.051,.045 degrees roll in dc1,2)
+      sdc_alpha_angle = ( 30-.051)*raddeg
+                        ( 30-.051)*raddeg
+                        ( 90-.051)*raddeg
+                        ( 90-.051)*raddeg
+                        (150-.051)*raddeg
+                        (150-.051)*raddeg
+                        ( 30-.045)*raddeg
+                        ( 30-.045)*raddeg
+                        ( 90-.045)*raddeg
+                        ( 90-.045)*raddeg
+                        (150-.045)*raddeg
+                        (150-.045)*raddeg
+; Angle beta of wires in wire chamber planes
+      sdc_beta_angle =   -0.052*raddeg
+                         -0.052*raddeg
+                         -0.052*raddeg
+                         -0.052*raddeg
+                         -0.052*raddeg
+                         -0.052*raddeg
+                         -0.182*raddeg
+                         -0.182*raddeg
+                         -0.182*raddeg
+                         -0.182*raddeg
+                         -0.182*raddeg
+                         -0.182*raddeg
+; Angle gamma of wires in wire chamber planes
+      sdc_gamma_angle = -0.070*raddeg
+                        -0.070*raddeg
+                        -0.070*raddeg
+                        -0.070*raddeg
+                        -0.070*raddeg
+                        -0.070*raddeg
+                        -0.257*raddeg
+                        -0.257*raddeg
+                        -0.257*raddeg
+                        -0.257*raddeg
+                        -0.257*raddeg
+                        -0.257*raddeg
+; Pitch
+      sdc_pitch = 1.0000
+                  1.0000
+                  1.0000
+                  1.0000
+                  1.0000
+                  1.0000
+                  1.0000
+                  1.0000
+                  1.0000
+                  1.0000
+                  1.0000
+                  1.0000
+; Number of wires per plane
+      sdc_nrwire = 48
+                   48
+                   64
+                   64
+                   48
+                   48
+                   48
+                   48
+                   64
+                   64
+                   48
+                   48
+; X,Y position of center of wire chamber
+; The given value is subtracted from the position of the wire (i.e.
+; the sign is opposite of the actual center position of the chamber).
+; Increasing dc2 coordinates increases dpos histograms.
+; Values are from jan17, 1996 survey memo.  values ARE corrected for
+; 18 degree (optical axis) vs 17.85 degree (survey axis) discrepensy.
+      sdc_xcenter = (8.488-3.982)
+                    (-1.822+1.825+0.35)
+      sdc_ycenter =(+0.007+.388+0.2)
+                   (-0.197+0.379+0.2)
+;;      sdc_xcenter = 8.488
+;;                   -1.822
+;;      sdc_ycenter =+0.007
+;;                   -0.197
+;
+;  sdc_ycenter(2) was -.197 from survey.  -.087 is DD's correction 
+;   based on (e,e'p) data (centering Em,Pm).
+;
+
+; Wire number of center of wire chamber
+; Note the convention : x : low number =  -x , u,v : low number = "-x"
+; x1 and x2, u1 and u2, v1 and v2 are offset by half a cell length
+; assume 1st wire of 1st dc of a set is closest to edge where counting starts
+      sdc_central_wire = (24.75+.008+.0019)
+                         (24.25-.008+.0064)
+                         (32.75-.001-.0105)
+                         (32.25+.001+.0021)
+                         (24.25+.003+.0019)
+                         (24.75-.003+.0075)
+                         (24.75-.001-.0019)
+                         (24.25+.001-.0078+.0120)
+                         (32.75+.002-.0104-.0067)
+                         (32.25-.002-.0007-.0053)
+                         (24.25-.003-.0008-.0015)
+                         (24.75+.003-.0081+.0131)
+; with shifts to make resiudals line up with each other.
+;      sdc_central_wire = (24.75+.008)
+;                         (24.25-.008)
+;                         32.75
+;                         32.25
+;                         (24.25+.002)
+;                         (24.75-.002)
+;                         24.75
+;                         24.25
+;                         (32.75+.003)
+;                         (32.25-.003)
+;                         (24.25-.003)
+;                         (24.75+.003)
+; nov95 online values
+;      sdc_central_wire = (24.75+.008)
+;                         (24.25-.008)
+;                         (32.75-.009)
+;                         (32.25+.009)
+;                         24.25
+;                         24.75
+;                         (24.75-.005)
+;                         (24.25+.005)
+;                         32.75
+;                         32.25
+;                         (24.25-.006)
+;                         (24.75+.006)
+; s_chamber_planes    array giving the chamber number for each plane
+      sdc_chamber_planes = 1
+                           1
+                           1
+                           1
+                           1
+                           1
+                           2
+                           2
+                           2
+                           2
+                           2
+                           2
+; The hms readout numbers some planes in reverse order.
+; I (SAW) think that the SOS readout numbers are always in forward order
+; The following array is a flag on the order number.
+; If sdc_wire_counting(plane) = 0
+;  the wire center is at (wire - sdc_central_wire) * pitch
+; If sdc_wire_counting(plane) = 1
+;  the wire center is at ( sdc_nrwire + 1 - wire - sdc_central_wire) * pitch
+        sdc_wire_counting = 1
+                            0
+                            1
+                            0
+                            0
+                            1
+                            1
+                            0
+                            1
+                            0
+                            0
+                            1
+; The velocity correction is the distance from the center of the wire divided
+; by the velocity of propagation times sdc_drifttime_sign(pln).  +/-1
+; for disc. card at +/- coord. (i.e. top = -x direction, so top readout is +1)
+;
+; THESE ARE NOTHING BUT BAD GUESSES AT THE MOMENT!!!!
+;
+       sdc_drifttime_sign =  +1
+                             -1
+                             -1
+                             +1
+                             +1
+                             -1
+                             +1
+                             -1
+                             -1
+                             +1
+                             +1
+                             -1
+; Names of each wire plane
+;      sdc_plane_names = 'sos1u1'
+;                        'sos1u2'
+;                        'sos1x1'
+;                        'sos1x2'
+;                        'sos1v1'
+;                        'sos1v2'
+;                        'sos2u1'
+;                        'sos2u2'
+;                        'sos2x1'
+;                        'sos2x2'
+;                        'sos2v1'
+;                        'sos2v2'
+;                        'sos3u1'
+;                        'sos3u2'
+;                        'sos3x1'
+;                        'sos3x2'
+;                        'sos3v1'
+;                        'sos3v2'
diff --git a/examples/PARAM/52949/sdc_offsets.param b/examples/PARAM/52949/sdc_offsets.param
new file mode 100644
index 0000000..596e780
--- /dev/null
+++ b/examples/PARAM/52949/sdc_offsets.param
@@ -0,0 +1,71 @@
+; cable id's for SOS Drift Chambers
+; array is 64,12 (wires,planes)), but u and v planes have only 48/64 used.
+
+sdc_card_no=
+; Plane 1, wires 1-48, 16 per card
+              1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
+              2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2
+              3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3
+             -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
+; Plane 2, wires 1-48, 16 per card
+              4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
+              5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5
+              6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6
+             -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
+; Plane 3, wires 1-64, 16 per card
+              7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
+              8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8
+              9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9
+             10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10
+; Plane 4, wires 1-64, 16 per card
+             11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11
+             12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12
+             13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13
+             14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14
+; Plane 5, wires 1-48, 16 per card
+             15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15
+             16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16
+             17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17
+             -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
+; Plane 6, wires 1-48, 16 per card
+             18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18
+             19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19
+             20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20
+             -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
+; Plane 1, wires 1-48, 16 per card
+             21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21
+             22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22
+             23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23
+             -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
+; Plane 2, wires 1-48, 16 per card
+             24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24
+             25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
+             26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26
+             -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
+; Plane 3, wires 1-64, 16 per card
+             27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27
+             28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28
+             29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29
+             30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30
+; Plane 4, wires 1-64, 16 per card
+             31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31
+             32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32
+             33,33,33,33,33,33,33,33,33,33,33,33,33,33,33,33
+             34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34
+; Plane 5, wires 1-48, 16 per card
+             35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35
+             36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36
+             37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37
+             -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
+; Plane 6, wires 1-48, 16 per card
+             38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38
+             39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39
+             40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40
+             -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
+;
+;       Cable Delays on a per/card basys
+;
+sdc_card_delay =  0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+                  0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+                  0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+                  0, 0, 0, 0, 0, 0, 0, 0, 0, 0
diff --git a/examples/PARAM/52949/sdebug.param b/examples/PARAM/52949/sdebug.param
new file mode 100644
index 0000000..285818c
--- /dev/null
+++ b/examples/PARAM/52949/sdebug.param
@@ -0,0 +1,122 @@
+; sos tracking code debug flags.
+; when these flags are non-zero, dump routines are called to
+; print out the data banks for each event.
+;
+;  sluno     fortran lun for output
+      sluno = 6
+; sdebugdumptof           Dump timing information for fitting offsets
+      sdebugdumptof = 0
+; sdebugdumpcal           Dump calorimeter information for fitting gains
+      sdebugdumpcal = 0
+; number of pedestal events required to overwrite orig. peds.
+  shodo_min_peds = 500
+  scal_min_peds  = 500
+  scer_min_peds  = 500
+  saer_min_peds = 500
+  sluc_min_peds = 500
+
+
+; DEBUGGING OUTPUT FLAGS
+; ----------------------
+; sdebugprintrawdc        Dump SDC_RAW_DC bank
+      sdebugprintrawdc = 0
+; sdebugprintdecodeddc    DUMP SDC_DECODED_DC bank
+      sdebugprintdecodeddc = 0
+; sdebugflagpsi               Dump calculated coordinate positions
+      sdebugflagpsi =  0
+; sdebugflaggeoemtry          Dump calculated geometrical parameters
+      sdebugflaggeometry = 0
+; sdebugflagpr                Dump intermediate pattern recognition results
+      sdebugflagpr = 0
+; sdebugflagstubchisq         Dump chi2 of left-right fits
+      sdebugstubchisq = 0
+; sdebugflagstubs             Dump stub fit results
+      sdebugflagstubs = 0
+; sdebuglinkstubs             Dump link stub results
+      sdebuglinkstubs = 0
+; sdebugtrackprint            Dump focal plane track fit results
+      sdebugtrackprint = 0
+; sdebugtartrackprint         Dump tracks at target
+      sdebugtartrackprint = 0
+; tof debuging
+;
+;  sdebugprintscinraw         Dump SOS_RAW_SCIN
+    sdebugprintscinraw = 0
+;  sdebugprintscindec         Dump SOS_DECODED_SCIN
+    sdebugprintscindec = 0
+;  sdebugprinttoftracks       Dump  sos_scin_tof
+    sdebugprinttoftracks = 0
+;  sdebugprinttracktests      Dump SOS_TRACK_TESTS
+    sdebugprinttracktests = 0
+;
+;
+;  sos calorimeter debug flags
+;  slun_dbg_cal        lun for output
+   slun_dbg_cal   = sluno
+;  sdbg_raw_cal        call s_prt_cal_raw
+   sdbg_raw_cal = 0
+;  sdbg_sparsified_cal call s_prt_cal_sparsified
+   sdbg_sparsified_cal = 0
+;  sdbg_decoded_cal    call s_prt_cal_decoded
+   sdbg_decoded_cal = 0
+;  sdbg_clusters_cal   call s_prt_cal_clusters
+   sdbg_clusters_cal = 0
+;  sdbg_tracks_cal     call s_prt_cal_tracks
+   sdbg_tracks_cal = 0
+;  sdbg_tests_cal      call s_prt_cal_tests    SOS_TRACK_TESTS
+   sdbg_tests_cal = 0
+;
+;  hard wired histograms. If these flags .ne. 0 then the histogram
+;     blocks are filled
+;
+; sturnon_scin_raw_hist       Histogram SOS raw hodoscope data (all blocks)
+  sturnon_scin_raw_hist = 1
+; sturnon_decoded_dc_hist     Histogram SOS_DECODED_DC
+  sturnon_decoded_dc_hist = 1
+; sturnon_focal_plane_hist    Histogram SOS_FOCAL_PLANE
+  sturnon_focal_plane_hist = 1
+; sturnon_target_hist         HISTOGRAM SOS_TARGET
+  sturnon_target_hist = 1
+;
+; Bypass paramters to bypass code elementes in s_reconstruction
+;      Stored in sosbypass_switches.cmn
+;      Code element is bypassed if switch .ne. 0
+; sbypass_trans_dc         bypass s_trans_dc
+  sbypass_trans_dc   = 0
+; sbypass_track            bypass s_track
+  sbypass_track      = 0
+; sbypass_targ_trans       bypass s_targ_trans
+  sbypass_targ_trans = 0
+; sbypass_dc_eff           bypass s_dc_eff and s_dc_eff_shutdown
+  sbypass_dc_eff     = 0
+; sbypass_track_eff        bypass s_tracking efficiency code
+  sbypass_track_eff  = 0
+; sbypass_track_eff_files  bypass s_tracking efficiency output files
+  sbypass_track_eff_files  = 1
+
+; sbypass_trans_scin       bypass s_trans_scin
+  sbypass_trans_scin = 0
+; sbypass_tof              bypass s_tof
+  sbypass_tof        = 0
+; sbypass_scin_eff         bypass s_scin_eff and s_scin_eff_shutdown
+  sbypass_scin_eff   = 0
+
+; sbypass_trans_cer        bypass s_trans_cer
+  sbypass_trans_cer  = 0
+; sbypass_cer              bypass s_cer, (a dummy routine)
+  sbypass_cer        = 1
+; sbypass_cer_eff          bypass s_cer_eff and s_cer_eff_shutdown
+  sbypass_cer_eff    = 0
+
+; sbypass_aero              bypass s_aero
+  sbypass_aero        = 0
+
+; sbypass_trans_cal        bypass s_trans_cal
+  sbypass_trans_cal  = 0
+; sbypass_cal              bypass s_cal
+  sbypass_cal        = 0
+; sbypass_cal_eff          bypass s_cal_eff and s_cal_eff_shutdown
+  sbypass_cal_eff    = 0
+
+; sbypass_physics          bypass s_physics
+  sbypass_physics    = 0
diff --git a/examples/PARAM/52949/shodo.param.vt b/examples/PARAM/52949/shodo.param.vt
new file mode 100644
index 0000000..3d367ac
--- /dev/null
+++ b/examples/PARAM/52949/shodo.param.vt
@@ -0,0 +1,190 @@
+; sstart_time_center  center of allowed time window                             
+   sstart_time_center = 32.                                                     
+; sstart_time_slop    1/2 width of time window                                  
+   sstart_time_slop = 25.                                                       
+; sscin_tdc_min       minimum tdc value in sos scin                             
+   sscin_tdc_min = 0                                                            
+; sscin_tdc_max       maximum allowed tdc value                                 
+;   sscin_tdc_max = 9000                                                        
+; 19.08.1999 At suggestion of Mack, reduce to 4000 to get rid of                
+; bad beta values.                                                              
+                                                                                
+   sscin_tdc_max = 4000                                                         
+ ; sscin_tdc_to_time   scin tdc time per channel                                
+   sscin_tdc_to_time = 0.0247                     ; Monte Carlo Value           
+                                                                                
+;;; All the following taken from hhodo.param                                    
+; sos_tof_params                                                                
+; snum_scin_counters, shodo_zpos, shodo_center_coord, shodo_width               
+; are all calculated within s_init_scin                                         
+;    shodo_pos_coord and shodo_neg_coord are not yet used                       
+;                                                                               
+     shodo_slop     =    2.,  2.,  4.,  4.                                      
+;                                                                               
+     shodo_vel_light =  14.5,14.5,14.5,14.5                                     
+                        14.5,14.5,14.5,14.5                                     
+                        14.5,14.5,14.5,14.5                                     
+                        14.5,14.5,14.5,14.5                                     
+                        14.5,14.5,14.5,14.5                                     
+                        14.5,14.5,14.5,14.5                                     
+                        14.5,14.5,14.5,14.5                                     
+                        14.5,14.5,14.5,14.5                                     
+                        14.5,14.5,14.5,14.5                                     
+                        14.5,14.5,14.5,14.5                                     
+                        14.5,14.5,14.5,14.5                                     
+                        14.5,14.5,14.5,14.5                                     
+                        14.5,14.5,14.5,14.5                                     
+                        14.5,14.5,14.5,14.5                                     
+                        14.5,14.5,14.5,14.5                                     
+                        14.5,14.5,14.5,14.5                                     
+;                                                                               
+      shodo_pos_sigma = .3,.3,.3,.3,.3,.3,.3,.3                                 
+                        .3,.3,.3,.3,.3,.3,.3,.3                                 
+                        .3,.3,.3,.3,.3,.3,.3,.3                                 
+                        .3,.3,.3,.3,.3,.3,.3,.3                                 
+                        .3,.3,.3,.3,.3,.3,.3,.3                                 
+                        .3,.3,.3,.3,.3,.3,.3,.3                                 
+                        .3,.3,.3,.3,.3,.3,.3,.3                                 
+                        .3,.3,.3,.3,.3,.3,.3,.3                                 
+;                                                                               
+      shodo_neg_sigma = .3,.3,.3,.3,.3,.3,.3,.3                                 
+                        .3,.3,.3,.3,.3,.3,.3,.3                                 
+                        .3,.3,.3,.3,.3,.3,.3,.3                                 
+                        .3,.3,.3,.3,.3,.3,.3,.3                                 
+                        .3,.3,.3,.3,.3,.3,.3,.3                                 
+                        .3,.3,.3,.3,.3,.3,.3,.3                                 
+                        .3,.3,.3,.3,.3,.3,.3,.3                                 
+                        .3,.3,.3,.3,.3,.3,.3,.3                                 
+                                                                                
+                                                                                
+  shodo_pos_minph = 145,160,130,145                                             
+                    145,160,130,145                                             
+                    145,160,130,145                                             
+                    145,160,130,145                                             
+                    145,160,130,145                                             
+                    145,160,130,145                                             
+                    145,160,130,145                                             
+                    145,160,130,145                                             
+                    145,160,130,145                                             
+                    145,160,130,145                                             
+                    145,160,130,145                                             
+                    145,160,130,145                                             
+                    145,160,130,145                                             
+                    145,160,130,145                                             
+                    145,160,130,145                                             
+                    145,160,130,145                                             
+                                                                                
+  shodo_neg_minph = 145,160,130,145                                             
+                    145,160,130,145                                             
+                    145,160,130,145                                             
+                    145,160,130,145                                             
+                    145,160,130,145                                             
+                    145,160,130,145                                             
+                    145,160,130,145                                             
+                    145,160,130,145                                             
+                    145,160,130,145                                             
+                    145,160,130,145                                             
+                    145,160,130,145                                             
+                    145,160,130,145                                             
+                    145,160,130,145                                             
+                    145,160,130,145                                             
+                    145,160,130,145                                             
+                    145,160,130,145                                             
+                                                                                
+;  shodo_pos_phc_coeff = -.9,-.764,-.9,-.952                                    
+;  shodo_pos_phc_coeff = -.9,-.820,-.95,-1.0                                    
+;  shodo_pos_phc_coeff = -1.1,-1.2,-1.0,-1.1                                    
+  shodo_pos_phc_coeff = -1.2,-1.0,-1.0,-1.0                                     
+                        -1.2,-1.0,-1.0,-1.0                                     
+                        -1.2,-1.0,-1.0,-1.0                                     
+                        -1.2,-1.0,-1.0,-1.0                                     
+                        -1.2,-1.0,-1.0,-1.0                                     
+                        -1.2,-1.0,-1.0,-1.0                                     
+                        -1.2,-1.0,-1.0,-1.0                                     
+                        -1.2,-1.0,-1.0,-1.0                                     
+                        -1.2,-1.0,-1.0,-1.0                                     
+                        -1.2,-1.0,-1.0,-1.0                                     
+                        -1.2,-1.0,-1.0,-1.0                                     
+                        -1.2,-1.0,-1.0,-1.0                                     
+                        -1.2,-1.0,-1.0,-1.0                                     
+                        -1.2,-1.0,-1.0,-1.0                                     
+                        -1.2,-1.0,-1.0,-1.0                                     
+                        -1.2,-1.0,-1.0,-1.0                                     
+                                                                                
+;  shodo_neg_phc_coeff = -.9,-.764,-.9,-.952                                    
+;  shodo_neg_phc_coeff = -.9,-.820,-.95,-1.0                                    
+;  shodo_neg_phc_coeff = -1.1,-1.2,-1.0,-101                                    
+  shodo_neg_phc_coeff = -1.2,-1.0,-1.0,-1.0                                     
+                        -1.2,-1.0,-1.0,-1.0                                     
+                        -1.2,-1.0,-1.0,-1.0                                     
+                        -1.2,-1.0,-1.0,-1.0                                     
+                        -1.2,-1.0,-1.0,-1.0                                     
+                        -1.2,-1.0,-1.0,-1.0                                     
+                        -1.2,-1.0,-1.0,-1.0                                     
+                        -1.2,-1.0,-1.0,-1.0                                     
+                        -1.2,-1.0,-1.0,-1.0                                     
+                        -1.2,-1.0,-1.0,-1.0                                     
+                        -1.2,-1.0,-1.0,-1.0                                     
+                        -1.2,-1.0,-1.0,-1.0                                     
+                        -1.2,-1.0,-1.0,-1.0                                     
+                        -1.2,-1.0,-1.0,-1.0                                     
+                        -1.2,-1.0,-1.0,-1.0                                     
+                        -1.2,-1.0,-1.0,-1.0                                     
+                                                                                
+                                                                                
+;order = 1x, 1y, 2x, 2y?       Yes.                                             
+;                                                                               
+;i changed s2x pos, 6th from bottom (11), from -34.4628 to -33.4628             
+                                                                                
+shodo_pos_time_offset = -11.1561,  -8.2512, -20.8399, -22.1478
+                         -4.9220,  -6.1990, -17.2972, -20.6541
+                         -6.5630,  -6.5562, -17.2113, -25.0076
+                          2.0654,  -5.2586, -21.0289, -23.7117
+                         -2.3622,  -2.7236, -16.4206, -23.6527
+                         -1.7189,  -3.5400, -19.5546, -25.5267
+                         -5.8419,  -9.0256, -20.5453, -20.3712
+                         -3.0988,  -7.5451, -18.7901, -19.9287
+                         -1.5768,  -4.2217, -21.4121, -19.8550
+                          0.0000,  -1.9975, -17.1522,   0.0000
+                          0.0000,   0.0000, -18.5695,  -1.9975
+                          0.0000,   0.0000, -17.0718,   0.0000
+                          0.0000,   0.0000, -22.3547,   0.0000
+                          0.0000,   0.0000, -14.7852,   0.0000
+                          0.0000,   0.0000, -18.4089,   0.0000
+                          0.0000,   0.0000, -10.5723,   0.0000
+shodo_neg_time_offset =  -4.3414,  -4.2570,   5.1140, -22.1772
+                          3.9469,  -7.2221, -12.6892, -23.5859
+                          6.2738,  -5.4030,  -3.5626, -21.8087
+                         -1.2458,  -4.2156, -12.7788, -22.9824
+                          2.3585,  -1.7379,  -8.9527, -17.2679
+                          6.4054,  -6.1500, -15.9257, -24.4995
+                          4.7343,  -5.9226,  -2.0483, -19.6460
+                          8.0788,  -1.1443, -16.5313, -18.6606
+                          1.9380,  -4.3016,  -2.5992, -24.3681
+                          0.0000,  -1.9975, -17.5387,   0.0000
+                          0.0000,   0.0000,  -0.7155,   0.0000
+                          0.0000,   0.0000, -14.6707,  -1.9975
+                          0.0000,   0.0000,  -1.2884,   0.0000
+                          0.0000,   0.0000, -10.0645,   0.0000
+                          0.0000,   0.0000,   0.9972,   0.0000
+                          0.0000,   0.0000,  -9.2349,   0.0000
+                                                                                
+;                                                                               
+  shodo_pos_ped_limit = 1000,1000,1000,1000,1000,1000,1000,1000                 
+                        1000,1000,1000,1000,1000,1000,1000,1000                 
+                        1000,1000,1000,1000,1000,1000,1000,1000                 
+                        1000,1000,1000,1000,1000,1000,1000,1000                 
+                        1000,1000,1000,1000,1000,1000,1000,1000                 
+                        1000,1000,1000,1000,1000,1000,1000,1000                 
+                        1000,1000,1000,1000,1000,1000,1000,1000                 
+                        1000,1000,1000,1000,1000,1000,1000,1000                 
+;                                                                               
+  shodo_neg_ped_limit = 1000,1000,1000,1000,1000,1000,1000,1000                 
+                        1000,1000,1000,1000,1000,1000,1000,1000                 
+                        1000,1000,1000,1000,1000,1000,1000,1000                 
+                        1000,1000,1000,1000,1000,1000,1000,1000                 
+                        1000,1000,1000,1000,1000,1000,1000,1000                 
+                        1000,1000,1000,1000,1000,1000,1000,1000                 
+                        1000,1000,1000,1000,1000,1000,1000,1000                 
+                        1000,1000,1000,1000,1000,1000,1000,1000                 
+                                                                                
diff --git a/examples/PARAM/52949/shodo.pos b/examples/PARAM/52949/shodo.pos
new file mode 100644
index 0000000..48a656a
--- /dev/null
+++ b/examples/PARAM/52949/shodo.pos
@@ -0,0 +1,103 @@
+      spathlength_central = 750
+; Z positions of hodoscopes
+      sscin_1y_zpos = ( 42.6+31.01)
+      sscin_1x_zpos = ( 66.1+31.01+0.9)
+      sscin_2y_zpos = (218.5+31.01-1.4)
+      sscin_2x_zpos = (242.0+31.01+17.8-1.4)
+      sscin_1x_dzpos = 1.12
+      sscin_1y_dzpos = 1.12
+      sscin_2x_dzpos = 1.12
+      sscin_2y_dzpos = 1.12
+; Sizes of hodoscope paddles
+      sscin_1x_size = 7.303
+      sscin_1y_size = 4.445
+      sscin_2x_size = 7.303
+      sscin_2y_size = 4.445
+      sscin_1x_spacing = 7.025
+      sscin_1y_spacing = 4.050
+      sscin_2x_spacing = 7.025
+      sscin_2y_spacing = 4.050
+; Number of hodoscope paddles per layer
+      sscin_1x_nr =  9
+      sscin_1y_nr =  9
+      sscin_2x_nr = 16
+      sscin_2y_nr =  9
+; X,Y positions of hodoscope paddles
+      sscin_1x_left  =  23.5
+      sscin_1x_right = -23.5
+      sscin_1x_offset=   -0.25
+      sscin_1x_center= -28.100
+                       -21.075
+                       -14.050
+                        -7.025
+                         0.000
+                         7.025
+                        14.050
+                        21.075
+                        28.100
+      sscin_1y_top   = -36.8
+      sscin_1y_bot   =  36.8
+; increasing offset moves "delta y" histogram move to larger y.
+      sscin_1y_offset=   0.0
+
+      sscin_1y_center=  16.20
+                        12.15
+                         8.10
+                         4.05
+                         0.00
+                        -4.05
+                        -8.10
+                       -12.15
+                       -16.20
+      sscin_2x_left  =  34.00
+      sscin_2x_right = -34.00
+      sscin_2x_offset=   4.57
+      sscin_2x_center=  -55.700
+                        -48.675
+                        -41.650
+                        -34.625
+                        -27.600
+                        -20.575
+                        -13.550
+                         -6.525
+                          0.500
+                          7.525
+                         14.550
+                         21.575
+                         28.600
+                         35.625
+                         42.650
+                         49.675
+
+
+;                       -60.25   ; Values from old variable "top"
+;                       -52.75
+;                       -45.25
+;                       -37.75
+;                       -30.25
+;                       -22.75
+;                       -15.25
+;                        -7.75
+;                        -0.25
+;                         7.25
+;                        14.75
+;                        22.25
+;                        29.75
+;                        37.25
+;                        44.75
+;                        52.25
+
+
+      sscin_2y_top   = -57.15
+      sscin_2y_bot   =  57.15
+; increasing offset moves "delta y" histogram move to larger y.
+      sscin_2y_offset=   0.8
+      sscin_2y_center=  16.20
+                        12.15
+                         8.10
+                         4.05
+                         0.00
+                        -4.05
+                        -8.10
+                       -12.15
+                       -16.20
diff --git a/examples/PARAM/52949/sos.driftmap.vt.52930 b/examples/PARAM/52949/sos.driftmap.vt.52930
new file mode 100644
index 0000000..48e7049
--- /dev/null
+++ b/examples/PARAM/52949/sos.driftmap.vt.52930
@@ -0,0 +1,175 @@
+; Lookup table
+;number of bins in Meek's time to distance lookup table
+sdriftbins=138
+;number of 1st bin in Meek's table in ns
+sdrift1stbin=-24
+;bin size in ns of Meek's table
+sdriftbinsz=2
+swc1u1fract=0.0003,0.0006,0.0009,0.0012,0.0015,0.0018,0.0022,0.0026
+0.0029,0.0032,0.0035,0.0038,0.0042,0.0049,0.0057,0.0072,0.0095,0.0129
+0.0180,0.0244,0.0322,0.0415,0.0517,0.0638,0.0781,0.0936,0.1097,0.1280
+0.1483,0.1701,0.1922,0.2155,0.2397,0.2644,0.2902,0.3157,0.3421,0.3675
+0.3944,0.4199,0.4453,0.4718,0.4963,0.5215,0.5461,0.5696,0.5930,0.6155
+0.6377,0.6585,0.6787,0.6985,0.7179,0.7375,0.7552,0.7728,0.7906,0.8071
+0.8229,0.8390,0.8542,0.8679,0.8804,0.8915,0.9015,0.9106,0.9184,0.9256
+0.9317,0.9371,0.9420,0.9464,0.9507,0.9542,0.9573,0.9601,0.9630,0.9653
+0.9679,0.9701,0.9722,0.9739,0.9758,0.9773,0.9787,0.9801,0.9813,0.9824
+0.9832,0.9842,0.9849,0.9856,0.9862,0.9867,0.9873,0.9880,0.9884,0.9888
+0.9893,0.9897,0.9902,0.9906,0.9910,0.9915,0.9918,0.9921,0.9925,0.9928
+0.9931,0.9934,0.9937,0.9941,0.9947,0.9950,0.9952,0.9956,0.9959,0.9963
+0.9965,0.9968,0.9971,0.9972,0.9975,0.9977,0.9980,0.9984,0.9987,0.9989
+0.9991,0.9993,0.9995,0.9997,0.9999,0.9999,1.0000,1.0000,1.0000,1.0000
+swc1u2fract=0.0002,0.0006,0.0008,0.0011,0.0014,0.0018,0.0022,0.0026
+0.0030,0.0033,0.0036,0.0039,0.0042,0.0045,0.0050,0.0058,0.0070,0.0087
+0.0118,0.0163,0.0223,0.0295,0.0377,0.0481,0.0609,0.0742,0.0887,0.1057
+0.1244,0.1442,0.1652,0.1879,0.2111,0.2351,0.2608,0.2867,0.3121,0.3379
+0.3641,0.3902,0.4150,0.4403,0.4653,0.4908,0.5151,0.5382,0.5612,0.5847
+0.6064,0.6286,0.6504,0.6704,0.6900,0.7098,0.7294,0.7480,0.7666,0.7845
+0.8015,0.8188,0.8340,0.8479,0.8627,0.8752,0.8872,0.8976,0.9069,0.9151
+0.9223,0.9289,0.9347,0.9399,0.9448,0.9491,0.9529,0.9562,0.9593,0.9623
+0.9648,0.9671,0.9691,0.9712,0.9731,0.9750,0.9765,0.9779,0.9792,0.9803
+0.9815,0.9825,0.9835,0.9842,0.9850,0.9859,0.9865,0.9872,0.9876,0.9881
+0.9886,0.9891,0.9897,0.9900,0.9904,0.9908,0.9911,0.9915,0.9918,0.9922
+0.9926,0.9932,0.9936,0.9939,0.9942,0.9945,0.9948,0.9951,0.9954,0.9957
+0.9958,0.9959,0.9962,0.9965,0.9968,0.9972,0.9975,0.9978,0.9981,0.9983
+0.9986,0.9988,0.9991,0.9994,0.9996,0.9997,0.9999,1.0000,1.0000,1.0000
+swc1x1fract=0.0002,0.0004,0.0008,0.0009,0.0011,0.0013,0.0015,0.0018
+0.0021,0.0024,0.0026,0.0029,0.0033,0.0037,0.0042,0.0049,0.0058,0.0074
+0.0107,0.0144,0.0207,0.0285,0.0378,0.0480,0.0607,0.0748,0.0913,0.1094
+0.1286,0.1499,0.1715,0.1943,0.2181,0.2425,0.2673,0.2929,0.3185,0.3434
+0.3678,0.3929,0.4177,0.4434,0.4680,0.4919,0.5156,0.5388,0.5626,0.5858
+0.6083,0.6303,0.6509,0.6706,0.6897,0.7089,0.7287,0.7484,0.7662,0.7831
+0.8000,0.8166,0.8329,0.8481,0.8628,0.8765,0.8884,0.8995,0.9088,0.9173
+0.9247,0.9310,0.9370,0.9419,0.9468,0.9509,0.9548,0.9584,0.9614,0.9638
+0.9665,0.9690,0.9711,0.9730,0.9746,0.9762,0.9777,0.9790,0.9801,0.9812
+0.9822,0.9830,0.9839,0.9846,0.9854,0.9861,0.9867,0.9874,0.9879,0.9885
+0.9889,0.9895,0.9898,0.9902,0.9907,0.9910,0.9915,0.9919,0.9922,0.9925
+0.9928,0.9931,0.9934,0.9937,0.9941,0.9943,0.9946,0.9949,0.9953,0.9955
+0.9959,0.9962,0.9964,0.9967,0.9969,0.9972,0.9976,0.9977,0.9979,0.9981
+0.9983,0.9985,0.9987,0.9991,0.9992,0.9993,0.9995,0.9997,0.9999,1.0000
+swc1x2fract=0.0003,0.0006,0.0009,0.0012,0.0015,0.0018,0.0021,0.0025
+0.0027,0.0030,0.0032,0.0037,0.0041,0.0048,0.0057,0.0074,0.0097,0.0135
+0.0176,0.0233,0.0300,0.0385,0.0489,0.0610,0.0749,0.0902,0.1067,0.1253
+0.1448,0.1653,0.1873,0.2102,0.2341,0.2586,0.2832,0.3086,0.3343,0.3597
+0.3860,0.4122,0.4373,0.4632,0.4891,0.5140,0.5391,0.5630,0.5857,0.6086
+0.6300,0.6511,0.6721,0.6917,0.7121,0.7308,0.7502,0.7684,0.7862,0.8032
+0.8191,0.8352,0.8500,0.8642,0.8770,0.8885,0.8992,0.9082,0.9170,0.9243
+0.9312,0.9368,0.9421,0.9471,0.9513,0.9551,0.9585,0.9617,0.9646,0.9672
+0.9695,0.9715,0.9735,0.9752,0.9766,0.9780,0.9794,0.9804,0.9816,0.9824
+0.9833,0.9841,0.9848,0.9853,0.9860,0.9867,0.9872,0.9879,0.9884,0.9888
+0.9892,0.9896,0.9900,0.9904,0.9908,0.9913,0.9915,0.9919,0.9922,0.9925
+0.9930,0.9934,0.9938,0.9942,0.9945,0.9949,0.9953,0.9955,0.9959,0.9961
+0.9965,0.9968,0.9970,0.9972,0.9975,0.9977,0.9980,0.9983,0.9984,0.9986
+0.9989,0.9992,0.9995,0.9996,0.9998,0.9999,1.0000,1.0000,1.0000,1.0000
+swc1v1fract=0.0003,0.0006,0.0008,0.0012,0.0015,0.0019,0.0021,0.0024
+0.0027,0.0031,0.0035,0.0040,0.0043,0.0049,0.0056,0.0069,0.0088,0.0119
+0.0165,0.0227,0.0299,0.0386,0.0493,0.0610,0.0746,0.0891,0.1053,0.1241
+0.1445,0.1648,0.1861,0.2087,0.2333,0.2575,0.2830,0.3087,0.3344,0.3612
+0.3881,0.4143,0.4389,0.4642,0.4898,0.5151,0.5397,0.5641,0.5879,0.6102
+0.6317,0.6520,0.6728,0.6932,0.7131,0.7321,0.7507,0.7690,0.7866,0.8044
+0.8210,0.8359,0.8508,0.8643,0.8772,0.8889,0.8994,0.9087,0.9171,0.9245
+0.9311,0.9367,0.9419,0.9463,0.9507,0.9543,0.9576,0.9605,0.9633,0.9659
+0.9682,0.9704,0.9722,0.9741,0.9756,0.9770,0.9784,0.9796,0.9809,0.9819
+0.9828,0.9837,0.9847,0.9854,0.9862,0.9870,0.9875,0.9881,0.9885,0.9891
+0.9896,0.9901,0.9905,0.9910,0.9913,0.9916,0.9920,0.9924,0.9928,0.9931
+0.9935,0.9938,0.9940,0.9943,0.9946,0.9950,0.9953,0.9955,0.9959,0.9963
+0.9966,0.9968,0.9972,0.9974,0.9977,0.9980,0.9982,0.9986,0.9988,0.9991
+0.9993,0.9995,0.9997,0.9999,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000
+swc1v2fract=0.0002,0.0004,0.0009,0.0012,0.0015,0.0018,0.0022,0.0025
+0.0028,0.0032,0.0035,0.0040,0.0043,0.0048,0.0054,0.0063,0.0083,0.0109
+0.0148,0.0198,0.0264,0.0340,0.0440,0.0559,0.0698,0.0840,0.1000,0.1183
+0.1380,0.1587,0.1807,0.2035,0.2277,0.2523,0.2784,0.3023,0.3278,0.3530
+0.3794,0.4062,0.4309,0.4571,0.4822,0.5079,0.5316,0.5552,0.5783,0.6019
+0.6246,0.6465,0.6674,0.6866,0.7064,0.7247,0.7443,0.7625,0.7805,0.7978
+0.8145,0.8303,0.8454,0.8599,0.8726,0.8844,0.8953,0.9042,0.9126,0.9202
+0.9265,0.9326,0.9379,0.9428,0.9469,0.9507,0.9539,0.9570,0.9603,0.9628
+0.9654,0.9679,0.9700,0.9719,0.9736,0.9755,0.9770,0.9784,0.9797,0.9808
+0.9820,0.9830,0.9840,0.9848,0.9854,0.9862,0.9869,0.9875,0.9880,0.9885
+0.9890,0.9893,0.9897,0.9901,0.9904,0.9908,0.9913,0.9917,0.9921,0.9925
+0.9928,0.9932,0.9936,0.9938,0.9942,0.9944,0.9948,0.9951,0.9954,0.9956
+0.9959,0.9962,0.9965,0.9968,0.9972,0.9975,0.9978,0.9980,0.9984,0.9986
+0.9989,0.9990,0.9993,0.9995,0.9997,0.9999,1.0000,1.0000,1.0000,1.0000
+swc2u1fract=0.0003,0.0004,0.0006,0.0008,0.0011,0.0014,0.0016,0.0019
+0.0023,0.0025,0.0027,0.0032,0.0034,0.0038,0.0042,0.0046,0.0055,0.0073
+0.0109,0.0157,0.0218,0.0296,0.0395,0.0499,0.0634,0.0788,0.0953,0.1139
+0.1328,0.1539,0.1753,0.1990,0.2233,0.2479,0.2729,0.2982,0.3240,0.3493
+0.3758,0.4000,0.4259,0.4503,0.4749,0.4997,0.5229,0.5458,0.5676,0.5900
+0.6115,0.6331,0.6535,0.6740,0.6946,0.7143,0.7334,0.7525,0.7710,0.7883
+0.8050,0.8223,0.8380,0.8534,0.8691,0.8821,0.8939,0.9048,0.9144,0.9223
+0.9291,0.9354,0.9413,0.9463,0.9511,0.9550,0.9589,0.9623,0.9651,0.9678
+0.9702,0.9725,0.9743,0.9764,0.9782,0.9799,0.9812,0.9826,0.9835,0.9845
+0.9855,0.9866,0.9875,0.9882,0.9888,0.9895,0.9899,0.9903,0.9907,0.9911
+0.9916,0.9920,0.9922,0.9926,0.9930,0.9933,0.9936,0.9939,0.9941,0.9945
+0.9946,0.9949,0.9952,0.9955,0.9958,0.9961,0.9964,0.9966,0.9967,0.9970
+0.9973,0.9975,0.9977,0.9979,0.9981,0.9983,0.9985,0.9988,0.9990,0.9992
+0.9993,0.9995,0.9997,0.9998,0.9999,1.0000,1.0000,1.0000,1.0000,1.0000
+swc2u2fract=0.0003,0.0006,0.0009,0.0011,0.0013,0.0016,0.0019,0.0022
+0.0025,0.0028,0.0031,0.0033,0.0037,0.0042,0.0046,0.0054,0.0066,0.0085
+0.0121,0.0173,0.0233,0.0315,0.0408,0.0523,0.0655,0.0802,0.0962,0.1150
+0.1347,0.1562,0.1783,0.2008,0.2245,0.2495,0.2744,0.2998,0.3252,0.3511
+0.3766,0.4014,0.4260,0.4522,0.4767,0.5012,0.5246,0.5472,0.5693,0.5918
+0.6134,0.6347,0.6555,0.6760,0.6967,0.7166,0.7353,0.7538,0.7717,0.7896
+0.8059,0.8224,0.8377,0.8532,0.8672,0.8798,0.8914,0.9018,0.9113,0.9196
+0.9268,0.9329,0.9384,0.9436,0.9482,0.9524,0.9563,0.9595,0.9623,0.9652
+0.9678,0.9701,0.9725,0.9743,0.9763,0.9780,0.9795,0.9809,0.9822,0.9836
+0.9846,0.9856,0.9865,0.9872,0.9881,0.9887,0.9894,0.9900,0.9905,0.9909
+0.9913,0.9918,0.9922,0.9925,0.9928,0.9932,0.9935,0.9939,0.9943,0.9945
+0.9947,0.9950,0.9953,0.9956,0.9959,0.9962,0.9965,0.9967,0.9969,0.9971
+0.9974,0.9976,0.9978,0.9979,0.9982,0.9983,0.9985,0.9988,0.9989,0.9992
+0.9994,0.9995,0.9997,0.9998,0.9999,0.9999,1.0000,1.0000,1.0000,1.0000
+swc2x1fract=0.0002,0.0003,0.0005,0.0007,0.0009,0.0012,0.0015,0.0017
+0.0019,0.0022,0.0024,0.0027,0.0030,0.0034,0.0037,0.0042,0.0053,0.0076
+0.0114,0.0164,0.0230,0.0321,0.0425,0.0559,0.0713,0.0874,0.1053,0.1244
+0.1453,0.1671,0.1904,0.2138,0.2379,0.2626,0.2880,0.3134,0.3387,0.3635
+0.3898,0.4143,0.4396,0.4637,0.4877,0.5117,0.5354,0.5587,0.5817,0.6041
+0.6259,0.6462,0.6672,0.6861,0.7055,0.7247,0.7439,0.7620,0.7804,0.7972
+0.8143,0.8301,0.8461,0.8608,0.8747,0.8879,0.8991,0.9100,0.9185,0.9266
+0.9339,0.9400,0.9456,0.9504,0.9546,0.9586,0.9621,0.9651,0.9680,0.9707
+0.9729,0.9752,0.9771,0.9787,0.9802,0.9817,0.9830,0.9844,0.9854,0.9864
+0.9872,0.9879,0.9887,0.9893,0.9900,0.9904,0.9909,0.9913,0.9917,0.9920
+0.9924,0.9928,0.9931,0.9934,0.9937,0.9940,0.9944,0.9946,0.9949,0.9952
+0.9955,0.9958,0.9960,0.9963,0.9966,0.9968,0.9969,0.9971,0.9973,0.9975
+0.9977,0.9979,0.9981,0.9983,0.9985,0.9987,0.9989,0.9991,0.9993,0.9995
+0.9997,0.9999,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000
+swc2x2fract=0.0003,0.0005,0.0007,0.0009,0.0012,0.0015,0.0017,0.0020
+0.0023,0.0026,0.0028,0.0031,0.0035,0.0038,0.0042,0.0049,0.0062,0.0086
+0.0124,0.0181,0.0260,0.0356,0.0472,0.0604,0.0755,0.0926,0.1114,0.1316
+0.1528,0.1752,0.1988,0.2231,0.2482,0.2736,0.2986,0.3234,0.3485,0.3740
+0.3994,0.4241,0.4486,0.4723,0.4957,0.5198,0.5425,0.5660,0.5881,0.6100
+0.6308,0.6520,0.6720,0.6924,0.7125,0.7307,0.7488,0.7666,0.7842,0.8018
+0.8182,0.8336,0.8491,0.8628,0.8764,0.8891,0.9004,0.9107,0.9196,0.9272
+0.9336,0.9400,0.9452,0.9502,0.9544,0.9582,0.9618,0.9644,0.9672,0.9698
+0.9724,0.9748,0.9766,0.9785,0.9803,0.9815,0.9828,0.9840,0.9849,0.9858
+0.9870,0.9880,0.9887,0.9894,0.9899,0.9906,0.9911,0.9916,0.9921,0.9925
+0.9928,0.9932,0.9936,0.9939,0.9942,0.9944,0.9947,0.9950,0.9953,0.9955
+0.9959,0.9962,0.9965,0.9968,0.9970,0.9973,0.9976,0.9978,0.9980,0.9982
+0.9985,0.9987,0.9990,0.9992,0.9993,0.9995,0.9998,0.9998,0.9999,1.0000
+1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000
+swc2v1fract=0.0002,0.0004,0.0007,0.0008,0.0011,0.0013,0.0016,0.0018
+0.0022,0.0025,0.0027,0.0030,0.0033,0.0036,0.0040,0.0045,0.0054,0.0072
+0.0103,0.0149,0.0206,0.0278,0.0366,0.0478,0.0604,0.0752,0.0912,0.1092
+0.1283,0.1490,0.1710,0.1948,0.2179,0.2425,0.2677,0.2934,0.3202,0.3454
+0.3710,0.3971,0.4227,0.4478,0.4730,0.4979,0.5215,0.5450,0.5682,0.5898
+0.6132,0.6347,0.6550,0.6756,0.6962,0.7152,0.7330,0.7526,0.7705,0.7881
+0.8045,0.8209,0.8363,0.8516,0.8660,0.8794,0.8920,0.9027,0.9126,0.9207
+0.9279,0.9339,0.9398,0.9449,0.9495,0.9537,0.9576,0.9609,0.9642,0.9672
+0.9697,0.9719,0.9739,0.9758,0.9777,0.9792,0.9807,0.9822,0.9833,0.9845
+0.9858,0.9867,0.9876,0.9885,0.9892,0.9897,0.9903,0.9909,0.9913,0.9917
+0.9921,0.9925,0.9930,0.9932,0.9937,0.9940,0.9943,0.9946,0.9950,0.9953
+0.9956,0.9958,0.9961,0.9964,0.9966,0.9969,0.9970,0.9973,0.9975,0.9978
+0.9980,0.9983,0.9984,0.9986,0.9988,0.9990,0.9992,0.9994,0.9995,0.9997
+0.9998,0.9999,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000
+swc2v2fract=0.0003,0.0005,0.0008,0.0011,0.0014,0.0017,0.0021,0.0023
+0.0026,0.0030,0.0033,0.0037,0.0040,0.0044,0.0048,0.0058,0.0072,0.0100
+0.0142,0.0202,0.0277,0.0370,0.0483,0.0618,0.0772,0.0943,0.1129,0.1334
+0.1548,0.1765,0.2008,0.2243,0.2486,0.2732,0.2983,0.3233,0.3499,0.3751
+0.4002,0.4256,0.4508,0.4746,0.4984,0.5220,0.5460,0.5690,0.5898,0.6111
+0.6320,0.6528,0.6725,0.6925,0.7121,0.7307,0.7492,0.7669,0.7837,0.8005
+0.8178,0.8339,0.8496,0.8639,0.8780,0.8898,0.9007,0.9104,0.9191,0.9264
+0.9328,0.9387,0.9438,0.9483,0.9525,0.9562,0.9600,0.9633,0.9659,0.9690
+0.9714,0.9736,0.9756,0.9772,0.9788,0.9804,0.9818,0.9831,0.9843,0.9853
+0.9861,0.9871,0.9880,0.9889,0.9896,0.9902,0.9907,0.9913,0.9917,0.9921
+0.9924,0.9928,0.9932,0.9935,0.9938,0.9942,0.9945,0.9948,0.9950,0.9953
+0.9956,0.9958,0.9961,0.9964,0.9966,0.9969,0.9973,0.9976,0.9980,0.9981
+0.9983,0.9985,0.9987,0.9989,0.9991,0.9993,0.9994,0.9995,0.9997,0.9999
+1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000
diff --git a/examples/PARAM/52949/sosflags.param b/examples/PARAM/52949/sosflags.param
new file mode 100644
index 0000000..b6044a5
--- /dev/null
+++ b/examples/PARAM/52949/sosflags.param
@@ -0,0 +1,42 @@
+; Offset in the spectrometer momentum.
+  smomentum_factor = 0.000 ; leave 0 so it will have no effect
+                           ; use spcentral_offset if one needs to offset central momentum
+;
+; The sdelta_offset,stheta_offset,sphi_offset effect the
+; reconstructed target quantities. Used in s_targ_trans.f 
+; For transport x is in the dispersive direction with + down
+;               y is in the horizontal + towards large angles.
+;               z is along the central optics axis.
+; In transport coordinates phi = syptar = dy/dz and theta = sxptar = dx/dz 
+;    but for unknown reasons the yp offset is named  stheta_offset
+;    and  the xp offset is named  sphi_offset
+; Do not to change these values, since these are the zero order
+;  CMOP matrix elements. If you do change then your soss sieve
+;  plots will be screwed up.
+  sdelta_offset = 0.       ; (%) sdelta_tar = sdelta_tar + sdelta_offset
+  stheta_offset = 0.  	   ; (rad) syp_tar = syp_tar + stheta_offset
+  sphi_offset   = 0.       ; (rad) sxp_tar = sxp_tar + sphi_offset
+
+;saturation correction enable
+   genable_sos_satcorr = 1 ;(0=disabled) - STRACKING/s_satcorr.f
+                           ; event by event correction to ssdelta
+;central field saturation  correction enable
+   genable_sos_fieldcorr = 2003 ;(0=disabled) - ENGINE/s_fieldcorr.f
+;  genable_sos_fieldcorr = 2003 means using  C. Xu's parametrization 
+;  genable_sos_fieldcorr = 1999 means using  J. Volmer's parametrization
+;  either one determines sosp0corr which effects spcentral =   spcentral*(1+sosp0corr/100.)
+;
+; The following offsets are applied to the central kinematic variables
+;  in s_apply_offsets.f  . These might be modified by an experiment
+;  after doing calibration with elastic ep
+;
+  spcentral_offset = 0.0 ; sets  spcentral = spcentral * ( 1. + spcentral_offset / 100. )
+  sthetacentral_offset = 0.00 ; (rad)
+                       ;stheta_lab=stheta_lab + sthetacentral_offset/degree
+; This offset is determined from elastic ep data.
+; Must be added to ssxptar when used in calculating lab angles.
+; Example is in s_physics.f
+; 
+  s_oopcentral_offset = 0.0032  ; (rad)
+
+
diff --git a/examples/PARAM/52949/stracking.param b/examples/PARAM/52949/stracking.param
new file mode 100644
index 0000000..6005ea7
--- /dev/null
+++ b/examples/PARAM/52949/stracking.param
@@ -0,0 +1,76 @@
+; sos pattern recognition and tracking code parameters
+; sminhit(i)   minimum number of hits in each space point (one for each chamber)
+; smin_combos(i) minimum number of pairs in each space point ( one per chamber)
+; sspace_point_criterion(i) minimum separation of distinct space points
+;
+	smax_pr_hits = 25, 25
+        smin_hit =      5, 5
+        smin_combos =   6, 6
+        sspace_point_criterion = 1.2, 1.2 
+;
+; The following four criteria are applied to the stub fit results at the
+; focal plane position to link stubs to tracks
+; sxt_track_criterion  
+; syt_track_criterion
+; sxpt_track_criterion
+; sypt_track_criterion
+       sxt_track_criterion  = 100.
+       syt_track_criterion  = 20.
+       sxpt_track_criterion = 1.0
+       sypt_track_criterion = 1.0
+; ssingle_stub            If .ne. 0 make a track of all single stubs
+  ssingle_stub = 0
+; turn on/off small angle approximation to left/right decision for y
+  sSmallAngleApprox = 1
+;
+; Crude track selection criteria in s_physics
+; ssel_chi2_fpperdegmax   maximum chi2 per degree of freedom for track
+  ssel_chi2_fpperdegmax = 9999999.
+; ssel_dedx1min           minimum dedx to chose best track in scin 1
+  ssel_dedx1min = -1000000.
+; ssel_dedx1max           maximum dedx to chose best track in scin 1
+  ssel_dedx1max = 1000000.
+; ssel_betamin            minimum track beta to chose best track 
+  ssel_betamin  = -1000000.
+; ssel_betamax            maximum track beta to chose best track 
+  ssel_betamax  = 1000000.
+; ssel_etmin              minimum track et to chose best track 
+  ssel_etmin = -1000000.
+; ssel_etmax              maximum track et to chose best track 
+  ssel_etmax = 1000000.
+; ssel_ndegreesmin        minimum number of degrees of freedom for track
+  ssel_ndegreesmin = 1
+
+; ssel_using_scin         uses scintillator for track selection
+  ssel_using_scin = 1
+
+; sstat_maxchisq          chisquared limit for tracks used to measure hodo. eff.
+  sstat_maxchisq = 10.
+; sstat_slop              distance from center of scin. to count as expecting hit
+;              must be < 2 cm. since s1y and s2y scins. are only +/- 2cm in size.
+  sstat_slop = 1.
+; sstat_mineff            warning level for scin. effic.
+  sstat_mineff = .95
+; sstat_cal_maxchisq      chisquared limit for tracks used to measure cal. eff.
+  sstat_cal_maxchisq = 10.
+; sstat_cal_slop          distance from center of block to count as expecting hit
+  sstat_cal_slop = 2.
+; scer_min_eff            warning level for cerenkov effic.
+  scer_min_eff = .90
+; scer_threshold          threshold for good hit (for measureing effic.)
+  scer_threshold = 0.5
+; sdc_min_eff             warning level for dc raw effic.(1 per plane)
+  sdc_min_eff = .96,.96,.96,.96,.96,.96
+                .96,.96,.96,.96,.96,.96
+; sdc_min_wire_eff        warning level for wire effic, measured using tracking
+  sdc_min_wire_eff = .85
+; sdc_min_plane_eff       warning level for plane effic, measured using tracking
+  sdc_min_plane_eff = .95,.95,.95,.95,.95,.95
+                      .95,.95,.95,.95,.95,.95
+  sxloscin  = 2, 3
+  sxhiscin  = 8, 14
+  syloscin  = 2, 2
+  syhiscin  = 8, 8
+;  strack_eff_test_scin_planes is the number of planes nec needed to 
+;  set sweet spot to true. 4 is extra clean, 3 is good enough for e-'s.
+  strack_eff_test_num_scin_planes = 4
diff --git a/examples/hodtest_mkj.C b/examples/hodtest_mkj.C
index 73c9458..64c47cd 100644
--- a/examples/hodtest_mkj.C
+++ b/examples/hodtest_mkj.C
@@ -1,11 +1,9 @@
-
 void hodtest_mkj(Int_t RunNumber=50017, Int_t MaxEventToReplay=5000) {
 
   //
   //  Steering script to test hodoscope decoding
   //
   
-  //Int_t RunNumber=52949;
   if (RunNumber == 50017) {
     char* RunFileNamePattern="daq04_%d.log.0";
   } else {
@@ -18,6 +16,7 @@ void hodtest_mkj(Int_t RunNumber=50017, Int_t MaxEventToReplay=5000) {
 
   // g_ctp_parm_filename and g_decode_map_filename should now be defined
 
+
   gHcParms->Load(gHcParms->GetString("g_ctp_parm_filename"));
 
   // Constants not in ENGINE PARAM files that we want to be
@@ -70,10 +69,10 @@ void hodtest_mkj(Int_t RunNumber=50017, Int_t MaxEventToReplay=5000) {
                                 // include scaler or control events
 
   // Define the analysis parameters
-  analyzer->SetCountMode( 0 );
+  analyzer->SetCountMode( 0 );   //Mark's modification
   analyzer->SetEvent( event );
   analyzer->SetOutFile(Form("hodtest_%05d.root",RunNumber));
-  analyzer->SetOdefFile("output_mkj.def");
+  analyzer->SetOdefFile(Form("output_%d.def",RunNumber));
   analyzer->SetCutFile("hodtest_cuts_mkj.def");        // optional
   
   // File to record cuts accounting information
diff --git a/examples/output_52949.def b/examples/output_52949.def
new file mode 100644
index 0000000..a59a141
--- /dev/null
+++ b/examples/output_52949.def
@@ -0,0 +1,190 @@
+# See $ANALYZER/examples/output_example.def for examples
+#
+block H.dc.*
+block H.hod.*
+block H.cal.*
+block H.aero.*
+block g.evtyp
+
+# TDC spectra
+TH1F hfptime1x ' HMS s1x fptime' H.hod.1x.fptime 80 0. 80.
+TH1F hfptime1y ' HMS s1y fptime' H.hod.1y.fptime 80 0. 80.
+TH1F hfptime2x ' HMS s2x fptime' H.hod.2x.fptime 80 0. 80.
+TH1F hfptime2y ' HMS s2y fptime' H.hod.2y.fptime 80 0. 80.
+# TDC hits per paddle
+TH1F hpostdc1 'HMS s1x+ TDC hits' H.hod.1x.postdchits 16 0.5 16.5
+TH1F hnegtdc1 'HMS s1x- TDC hits' H.hod.1x.negtdchits 16 0.5 16.5
+TH1F hpostdc2 'HMS s1y+ TDC hits' H.hod.1y.postdchits 10 0.5 10.5
+TH1F hnegtdc2 'HMS s1y- TDC hits' H.hod.1y.negtdchits 10 0.5 10.5
+TH1F hpostdc3 'HMS s2x+ TDC hits' H.hod.2x.postdchits 16 0.5 16.5
+TH1F hnegtdc3 'HMS s2x- TDC hits' H.hod.2x.negtdchits 16 0.5 16.5
+TH1F hpostdc4 'HMS s2y+ TDC hits' H.hod.2y.postdchits 10 0.5 10.5
+TH1F hnegtdc4 'HMS s2y- TDC hits' H.hod.2y.negtdchits 10 0.5 10.5
+
+# ADC hits per paddle
+TH1F hposadc1 'HMS s1x+ ADC hits' H.hod.1x.posadchits 16 0.5 16.5
+TH1F hnegadc1 'HMS s1x- ADC hits' H.hod.1x.negadchits 16 0.5 16.5
+TH1F hposadc2 'HMS s1y+ ADC hits' H.hod.1y.posadchits 10 0.5 10.5
+TH1F hnegadc2 'HMS s1y- ADC hits' H.hod.1y.negadchits 10 0.5 10.5
+TH1F hposadc3 'HMS s2x+ ADC hits' H.hod.2x.posadchits 16 0.5 16.5
+TH1F hnegadc3 'HMS s2x- ADC hits' H.hod.2x.negadchits 16 0.5 16.5
+TH1F hposadc4 'HMS s2y+ ADC hits' H.hod.2y.posadchits 10 0.5 10.5
+TH1F hnegadc4 'HMS s2y- ADC hits' H.hod.2y.negadchits 10 0.5 10.5
+
+# ADC hits per Calorimeter layer
+TH1F chposadc1 'HMS Cal A+ ADC hits' H.cal.1pr.posadchits 13 0.5 13.5
+TH1F chnegadc1 'HMS Cal A- ADC hits' H.cal.1pr.negadchits 13 0.5 13.5
+TH1F chposadc2 'HMS Cal B+ ADC hits' H.cal.2ta.posadchits 13 0.5 13.5
+TH1F chnegadc2 'HMS Cal B- ADC hits' H.cal.2ta.negadchits 13 0.5 13.5
+TH1F chposadc3 'HMS Cal C+ ADC hits' H.cal.3ta.posadchits 13 0.5 13.5
+TH1F chposadc4 'HMS Cal D+ ADC hits' H.cal.4ta.posadchits 13 0.5 13.5
+
+# Deposited Energies per Calorimeter layer
+TH1F edep1 'HMS Cal A Edep' H.cal.1pr.eplane 100 -0.1 0.811
+TH1F edep2 'HMS Cal B Edep' H.cal.2ta.eplane 100 -0.1 0.811
+TH1F edep3 'HMS Cal C Edep' H.cal.3ta.eplane 100 -0.1 0.811
+TH1F edep4 'HMS Cal D Edep' H.cal.4ta.eplane 100 -0.1 0.811
+
+# Number of sparsified hits in the Calorimeter.
+TH1F nhits 'HMS Cal sparsified hits' H.cal.nhits 53 -0.5 52.5
+
+# Number of hit clusters in the Calorimeter.
+TH1F nclust 'HMS Cal number of clusters' H.cal.nclust 11 -0.5 10.5
+
+# Multiplicity of the largest cluster in the Calorimeter.
+TH1F mult 'HMS Cal size of largest cluster' H.cal.mult 21 -0.5 20.5
+
+# Energy deposited in the largest cluster.
+TH1F emax 'HMS Cal Max Clust. Edep' H.cal.emax 200 -0.1 1.622
+
+# Preshower Energy from the largest cluster.
+TH1F eprmax 'HMS PrSh Max Clust. Edep' H.cal.eprmax 100 -0.1 0.811
+
+# X coordinate the largest cluster.
+TH1F xmax 'HMS Cal Max Clust. X' H.cal.xmax 150 -75. 75.
+
+#Calorimeter ADC channels
+TH1F hcaladc_A1p 'HMS Cal ADC A1p - PED' H.cal.1pr.apos_p[0] 150 50 500
+TH1F hcaladc_A2p 'HMS Cal ADC A2p - PED' H.cal.1pr.apos_p[1] 150 50 500
+TH1F hcaladc_A3p 'HMS Cal ADC A3p - PED' H.cal.1pr.apos_p[2] 150 50 500
+TH1F hcaladc_A4p 'HMS Cal ADC A4p - PED' H.cal.1pr.apos_p[3] 150 50 500
+TH1F hcaladc_A5p 'HMS Cal ADC A5p - PED' H.cal.1pr.apos_p[4] 150 50 500
+TH1F hcaladc_A6p 'HMS Cal ADC A6p - PED' H.cal.1pr.apos_p[5] 150 50 500
+TH1F hcaladc_A7p 'HMS Cal ADC A7p - PED' H.cal.1pr.apos_p[6] 150 50 500
+TH1F hcaladc_A8p 'HMS Cal ADC A8p - PED' H.cal.1pr.apos_p[7] 150 50 500
+TH1F hcaladc_A9p 'HMS Cal ADC A9p - PED' H.cal.1pr.apos_p[8] 150 50 500
+TH1F hcaladc_A10p 'HMS Cal ADC A10p - PED' H.cal.1pr.apos_p[9] 150 50 500
+TH1F hcaladc_A11p 'HMS Cal ADC A11p - PED' H.cal.1pr.apos_p[10] 150 50 500
+TH1F hcaladc_A12p 'HMS Cal ADC A12p - PED' H.cal.1pr.apos_p[11] 150 50 500
+TH1F hcaladc_A13p 'HMS Cal ADC A13p - PED' H.cal.1pr.apos_p[12] 150 50 500
+TH1F hcaladc_B1p 'HMS Cal ADC B1p - PED' H.cal.2ta.apos_p[0] 150 50 500
+TH1F hcaladc_B2p 'HMS Cal ADC B2p - PED' H.cal.2ta.apos_p[1] 150 50 500
+TH1F hcaladc_B3p 'HMS Cal ADC B3p - PED' H.cal.2ta.apos_p[2] 150 50 500
+TH1F hcaladc_B4p 'HMS Cal ADC B4p - PED' H.cal.2ta.apos_p[3] 150 50 500
+TH1F hcaladc_B5p 'HMS Cal ADC B5p - PED' H.cal.2ta.apos_p[4] 150 50 500
+TH1F hcaladc_B6p 'HMS Cal ADC B6p - PED' H.cal.2ta.apos_p[5] 150 50 500
+TH1F hcaladc_B7p 'HMS Cal ADC B7p - PED' H.cal.2ta.apos_p[6] 150 50 500
+TH1F hcaladc_B8p 'HMS Cal ADC B8p - PED' H.cal.2ta.apos_p[7] 150 50 500
+TH1F hcaladc_B9p 'HMS Cal ADC B9p - PED' H.cal.2ta.apos_p[8] 150 50 500
+TH1F hcaladc_B10p 'HMS Cal ADC B10p - PED' H.cal.2ta.apos_p[9] 150 50 500
+TH1F hcaladc_B11p 'HMS Cal ADC B11p - PED' H.cal.2ta.apos_p[10] 150 50 500
+TH1F hcaladc_B12p 'HMS Cal ADC B12p - PED' H.cal.2ta.apos_p[11] 150 50 500
+TH1F hcaladc_B13p 'HMS Cal ADC B13p - PED' H.cal.2ta.apos_p[12] 150 50 500
+
+TH1F hcaladc_C1p 'HMS Cal ADC C1p - PED' H.cal.3ta.apos_p[0] 150 50 500
+TH1F hcaladc_C2p 'HMS Cal ADC C2p - PED' H.cal.3ta.apos_p[1] 150 50 500
+TH1F hcaladc_C3p 'HMS Cal ADC C3p - PED' H.cal.3ta.apos_p[2] 150 50 500
+TH1F hcaladc_C4p 'HMS Cal ADC C4p - PED' H.cal.3ta.apos_p[3] 150 50 500
+TH1F hcaladc_C5p 'HMS Cal ADC C5p - PED' H.cal.3ta.apos_p[4] 150 50 500
+TH1F hcaladc_C6p 'HMS Cal ADC C6p - PED' H.cal.3ta.apos_p[5] 150 50 500
+TH1F hcaladc_C7p 'HMS Cal ADC C7p - PED' H.cal.3ta.apos_p[6] 150 50 500
+TH1F hcaladc_C8p 'HMS Cal ADC C8p - PED' H.cal.3ta.apos_p[7] 150 50 500
+TH1F hcaladc_C9p 'HMS Cal ADC C9p - PED' H.cal.3ta.apos_p[8] 150 50 500
+TH1F hcaladc_C10p 'HMS Cal ADC C10p - PED' H.cal.3ta.apos_p[9] 150 50 500
+TH1F hcaladc_C11p 'HMS Cal ADC C11p - PED' H.cal.3ta.apos_p[10] 150 50 500
+TH1F hcaladc_C12p 'HMS Cal ADC C12p - PED' H.cal.3ta.apos_p[11] 150 50 500
+TH1F hcaladc_C13p 'HMS Cal ADC C13p - PED' H.cal.3ta.apos_p[12] 150 50 500
+
+TH1F hcaladc_D1p 'HMS Cal ADC D1p - PED' H.cal.4ta.apos_p[0] 150 50 500
+TH1F hcaladc_D2p 'HMS Cal ADC D2p - PED' H.cal.4ta.apos_p[1] 150 50 500
+TH1F hcaladc_D3p 'HMS Cal ADC D3p - PED' H.cal.4ta.apos_p[2] 150 50 500
+TH1F hcaladc_D4p 'HMS Cal ADC D4p - PED' H.cal.4ta.apos_p[3] 150 50 500
+TH1F hcaladc_D5p 'HMS Cal ADC D5p - PED' H.cal.4ta.apos_p[4] 150 50 500
+TH1F hcaladc_D6p 'HMS Cal ADC D6p - PED' H.cal.4ta.apos_p[5] 150 50 500
+TH1F hcaladc_D7p 'HMS Cal ADC D7p - PED' H.cal.4ta.apos_p[6] 150 50 500
+TH1F hcaladc_D8p 'HMS Cal ADC D8p - PED' H.cal.4ta.apos_p[7] 150 50 500
+TH1F hcaladc_D9p 'HMS Cal ADC D9p - PED' H.cal.4ta.apos_p[8] 150 50 500
+TH1F hcaladc_D10p 'HMS Cal ADC D10p - PED' H.cal.4ta.apos_p[9] 150 50 500
+TH1F hcaladc_D11p 'HMS Cal ADC D11p - PED' H.cal.4ta.apos_p[10] 150 50 500
+TH1F hcaladc_D12p 'HMS Cal ADC D12p - PED' H.cal.4ta.apos_p[11] 150 50 500
+TH1F hcaladc_D13p 'HMS Cal ADC D13p - PED' H.cal.4ta.apos_p[12] 150 50 500
+
+TH1F hcaladc_A1n 'HMS Cal ADC A1n - PED' H.cal.1pr.aneg_p[0] 150 50 500
+TH1F hcaladc_A2n 'HMS Cal ADC A2n - PED' H.cal.1pr.aneg_p[1] 150 50 500
+TH1F hcaladc_A3n 'HMS Cal ADC A3n - PED' H.cal.1pr.aneg_p[2] 150 50 500
+TH1F hcaladc_A4n 'HMS Cal ADC A4n - PED' H.cal.1pr.aneg_p[3] 150 50 500
+TH1F hcaladc_A5n 'HMS Cal ADC A5n - PED' H.cal.1pr.aneg_p[4] 150 50 500
+TH1F hcaladc_A6n 'HMS Cal ADC A6n - PED' H.cal.1pr.aneg_p[5] 150 50 500
+TH1F hcaladc_A7n 'HMS Cal ADC A7n - PED' H.cal.1pr.aneg_p[6] 150 50 500
+TH1F hcaladc_A8n 'HMS Cal ADC A8n - PED' H.cal.1pr.aneg_p[7] 150 50 500
+TH1F hcaladc_A9n 'HMS Cal ADC A9n - PED' H.cal.1pr.aneg_p[8] 150 50 500
+TH1F hcaladc_A10n 'HMS Cal ADC A10n - PED' H.cal.1pr.aneg_p[9] 150 50 500
+TH1F hcaladc_A11n 'HMS Cal ADC A11n - PED' H.cal.1pr.aneg_p[10] 150 50 500
+TH1F hcaladc_A12n 'HMS Cal ADC A12n - PED' H.cal.1pr.aneg_p[11] 150 50 500
+TH1F hcaladc_A13n 'HMS Cal ADC A13n - PED' H.cal.1pr.aneg_p[12] 150 50 500
+
+TH1F hcaladc_B1n 'HMS Cal ADC B1n - PED' H.cal.2ta.aneg_p[0] 150 50 500
+TH1F hcaladc_B2n 'HMS Cal ADC B2n - PED' H.cal.2ta.aneg_p[1] 150 50 500
+TH1F hcaladc_B3n 'HMS Cal ADC B3n - PED' H.cal.2ta.aneg_p[2] 150 50 500
+TH1F hcaladc_B4n 'HMS Cal ADC B4n - PED' H.cal.2ta.aneg_p[3] 150 50 500
+TH1F hcaladc_B5n 'HMS Cal ADC B5n - PED' H.cal.2ta.aneg_p[4] 150 50 500
+TH1F hcaladc_B6n 'HMS Cal ADC B6n - PED' H.cal.2ta.aneg_p[5] 150 50 500
+TH1F hcaladc_B7n 'HMS Cal ADC B7n - PED' H.cal.2ta.aneg_p[6] 150 50 500
+TH1F hcaladc_B8n 'HMS Cal ADC B8n - PED' H.cal.2ta.aneg_p[7] 150 50 500
+TH1F hcaladc_B9n 'HMS Cal ADC B9n - PED' H.cal.2ta.aneg_p[8] 150 50 500
+TH1F hcaladc_B10n 'HMS Cal ADC B10n - PED' H.cal.2ta.aneg_p[9] 150 50 500
+TH1F hcaladc_B11n 'HMS Cal ADC B11n - PED' H.cal.2ta.aneg_p[10] 150 50 500
+TH1F hcaladc_B12n 'HMS Cal ADC B12n - PED' H.cal.2ta.aneg_p[11] 150 50 500
+TH1F hcaladc_B13n 'HMS Cal ADC B13n - PED' H.cal.2ta.aneg_p[12] 150 50 500
+
+# Can we use variables for the constants.  In CTP we used hdc_nwire(i)
+#
+TH1F hdc1x1_wm 'HDC 1X1 Wiremap' H.dc.1x1.tdchits 113 0.5 113.5
+TH1F hdc1y1_wm 'HDC 1Y1 Wiremap' H.dc.1y1.tdchits 52 0.5 52.5
+TH1F hdc1u1_wm 'HDC 1U1 Wiremap' H.dc.1u1.tdchits 107 0.5 107.5
+TH1F hdc1v1_wm 'HDC 1V1 Wiremap' H.dc.1v1.tdchits 107 0.5 107.5
+TH1F hdc1y2_wm 'HDC 1Y2 Wiremap' H.dc.1y2.tdchits 52 0.5 52.5
+TH1F hdc1x2_wm 'HDC 1X2 Wiremap' H.dc.1x2.tdchits 113 0.5 113.5
+TH1F hdc2x1_wm 'HDC 2X1 Wiremap' H.dc.2x1.tdchits 113 0.5 113.5
+TH1F hdc2y1_wm 'HDC 2Y1 Wiremap' H.dc.2y1.tdchits 52 0.5 52.5
+TH1F hdc2u1_wm 'HDC 2U1 Wiremap' H.dc.2u1.tdchits 107 0.5 107.5
+TH1F hdc2v1_wm 'HDC 2V1 Wiremap' H.dc.2v1.tdchits 107 0.5 107.5
+TH1F hdc2y2_wm 'HDC 2Y2 Wiremap' H.dc.2y2.tdchits 52 0.5 52.5
+TH1F hdc2x2_wm 'HDC 2X2 Wiremap' H.dc.2x2.tdchits 113 0.5 113.5
+#
+TH1F ddist_hdc1x1 'HDC 1X1 Drift Dis' H.dc.1x1.dist 30 -0.1 0.6
+TH1F ddist_hdc1y1 'HDC 1Y1 Drift Dis' H.dc.1y1.dist 30 -0.1 0.6
+TH1F ddist_hdc1u1 'HDC 1U1 Drift Dis' H.dc.1u1.dist 30 -0.1 0.6
+TH1F ddist_hdc1v1 'HDC 1V1 Drift Dis' H.dc.1v1.dist 30 -0.1 0.6
+TH1F ddist_hdc1y2 'HDC 1Y2 Drift Dis' H.dc.1y2.dist 30 -0.1 0.6
+TH1F ddist_hdc1x2 'HDC 1X2 Drift Dis' H.dc.1x2.dist 30 -0.1 0.6
+TH1F ddist_hdc2x1 'HDC 2X1 Drift Dis' H.dc.2x1.dist 30 -0.1 0.6
+TH1F ddist_hdc2y1 'HDC 2Y1 Drift Dis' H.dc.2y1.dist 30 -0.1 0.6
+TH1F ddist_hdc2u1 'HDC 2U1 Drift Dis' H.dc.2u1.dist 30 -0.1 0.6
+TH1F ddist_hdc2v1 'HDC 2V1 Drift Dis' H.dc.2v1.dist 30 -0.1 0.6
+TH1F ddist_hdc2y2 'HDC 2Y2 Drift Dis' H.dc.2y2.dist 30 -0.1 0.6
+TH1F ddist_hdc2x2 'HDC 2X2 Drift Dis' H.dc.2x2.dist 30 -0.1 0.6
+#
+TH1F dtime_hdc1x1 'HDC 1X1 Drift Time' H.dc.1x1.time 200 -100 300
+TH1F dtime_hdc1y1 'HDC 1Y1 Drift Time' H.dc.1y1.time 200 -100 300
+TH1F dtime_hdc1u1 'HDC 1U1 Drift Time' H.dc.1u1.time 200 -100 300
+TH1F dtime_hdc1v1 'HDC 1V1 Drift Time' H.dc.1v1.time 200 -100 300
+TH1F dtime_hdc1y2 'HDC 1Y2 Drift Time' H.dc.1y2.time 200 -100 300
+TH1F dtime_hdc1x2 'HDC 1X2 Drift Time' H.dc.1x2.time 200 -100 300
+TH1F dtime_hdc2x1 'HDC 2X1 Drift Time' H.dc.2x1.time 200 -100 300
+TH1F dtime_hdc2y1 'HDC 2Y1 Drift Time' H.dc.2y1.time 200 -100 300
+TH1F dtime_hdc2u1 'HDC 2U1 Drift Time' H.dc.2u1.time 200 -100 300
+TH1F dtime_hdc2v1 'HDC 2V1 Drift Time' H.dc.2v1.time 200 -100 300
+TH1F dtime_hdc2y2 'HDC 2Y2 Drift Time' H.dc.2y2.time 200 -100 300
+TH1F dtime_hdc2x2 'HDC 2X2 Drift Time' H.dc.2x2.time 200 -100 300
+
diff --git a/src/THcShower.cxx b/src/THcShower.cxx
index 8d580a1..060d725 100644
--- a/src/THcShower.cxx
+++ b/src/THcShower.cxx
@@ -612,9 +612,14 @@ Int_t THcShower::CoarseProcess( TClonesArray&  ) //tracks
 
   if (fNclust != 0) {
 
-    THcShowerCluster* MaxCluster;
+    //    THcShowerCluster* MaxCluster;
+    //    for (UInt_t i=0; i!=fNclust; i++) {
+
+    THcShowerCluster* MaxCluster =  (*ClusterList).ListedCluster(0);
+    fE = (*MaxCluster).clE();
+
+    for (UInt_t i=1; i<fNclust; i++) {
 
-    for (UInt_t i=0; i!=fNclust; i++) {
 
       THcShowerCluster* cluster = (*ClusterList).ListedCluster(i);
 
diff --git a/src/THcShower.h b/src/THcShower.h
index 5094d06..88270bf 100644
--- a/src/THcShower.h
+++ b/src/THcShower.h
@@ -28,14 +28,14 @@ public:
   
   virtual Int_t      ApplyCorrections( void );
 
-  //  Int_t GetNHits() const { return fNhit; }
+  Int_t GetNHits() const { return fNhits; }
   
   Int_t GetNTracks() const { return fTrackProj->GetLast()+1; }
   const TClonesArray* GetTrackHits() const { return fTrackProj; }
 
   Int_t GetNBlocks(Int_t NLayer) const { return fNBlocks[NLayer];}
 
-  //  friend class THaScCalib; not needed?
+  //  friend class THaScCalib; not needed for now.
 
   Int_t GetPedLimit(Int_t NBlock, Int_t NLayer, Int_t Side) {
     if (Side!=0&&Side!=1) {
@@ -69,93 +69,61 @@ public:
 
   THcShower();  // for ROOT I/O
 
-protected:
+ protected:
 
-  Int_t fAnalyzePedestals;
+  Int_t fAnalyzePedestals;   // Flag for pedestal analysis.
 
-  // ADC signal limits for pedestal calculations.
-  Int_t* fShPosPedLimit;
+  Int_t* fShPosPedLimit;     // [fNtotBlocks] ADC limits for pedestal calc.-s.
   Int_t* fShNegPedLimit;
 
-  Int_t fShMinPeds;   //Min.number of events to analize/update pedestals.
+  Int_t fShMinPeds;          // Min.number of events to analyze pedestals.
 
-  // Calibration constants
-  Double_t* fPosGain;
+  Double_t* fPosGain;        // [fNtotBlocks] Gain constants from calibration
   Double_t* fNegGain;
 
   // Per-event data
 
-  Int_t fNhits;    // Number of hits
-  Double_t** fA;    // Raw ADC amplitudes
-  Double_t** fA_p;  // Ped-subtracted ADC amplitudes
-  Double_t** fA_c;  // Calibrated ADC amplitudes
-  Double_t fAsum_p; // Sum of ped-subtracted ADCs
-  Double_t fAsum_c; // Sum of calibrated ADCs
-  Int_t fNclust;   // Number of clusters
-  Double_t fE;      // Energy (MeV) of largest cluster
-  Double_t fEpr;    // Preshower Energy (MeV) of largest cluster
-  Double_t fX;      // x-position (cm) of largest cluster
-  Double_t fZ;      // z-position (cm) of largest cluster
-  Int_t fMult;     // Multiplicity of largest cluster
-  Int_t fNblk;     // Number of blocks in main cluster
-  Double_t* fEblk;  // Energies of blocks in main cluster
-  Double_t fTRX;    // track x-position in det plane"
-  Double_t fTRY;    // track y-position in det plane",
+  Int_t fNhits;              // Total number of hits
+  Int_t fNclust;             // Number of clusters
+  Double_t fE;               // Energy (MeV) of the largest cluster
+  Double_t fEpr;             // Preshower Energy (MeV) of the largest cluster
+  Double_t fX;               // x-position (cm) of the largest cluster
+  Double_t fZ;               // z-position (cm) of the largest cluster
+  Int_t fMult;               // # of hits in the largest cluster
+  //  Int_t fNblk;      // Number of blocks in main cluster
+  //  Double_t* fEblk;  // Energies of blocks in main cluster
+  //  Double_t fTRX;    // track x-position in det plane"
+  //  Double_t fTRY;    // track y-position in det plane",
 
   // Potential Hall C parameters.  Mostly here for demonstration
 
   char** fLayerNames;
-  Int_t fNLayers;
-  //  Int_t fNRows;             fNBlocks is used instead
-  Double_t* fNLayerZPos;	// Z position of front of shower counter layers
-  Double_t* BlockThick;		// Thickness of shower counter blocks, blocks
-  Int_t* fNBlocks;              // Number of shower counter blocks per layer
+  Int_t fNLayers;               // Number of layers in the calorimeter
+  Double_t* fNLayerZPos;	// Z positions of fronts of layers
+  Double_t* BlockThick;		// Thickness of blocks
+  Int_t* fNBlocks;              // [fNLayers] number of blocks per layer
   Int_t fNtotBlocks;            // Total number of shower counter blocks
-  Double_t** XPos;		//X,Y,Z positions of shower counter blocks
+  Double_t** XPos;		// [fNLayers] X,Y,Z positions of blocks
   Double_t* YPos;
   Double_t* ZPos;
-  Int_t fNegCols; //number of columns with PMTTs on the negative side only.
-  Double_t fSlop;               //Track to cluster vertical slop distance.
-  Int_t fvTest;                 //fiducial volume test flag
+  Int_t fNegCols;               // # of columns with neg. side PMTs only.
+  Double_t fSlop;               // Track to cluster vertical slop distance.
+  Int_t fvTest;                 // fiducial volume test flag for tracking
 
-  THcShowerPlane** fPlanes; // List of plane objects
+  THcShowerPlane** fPlanes;     // [fNLayers] Shower Plane objects
 
-  TClonesArray*  fTrackProj;  // projection of track onto scintillator plane
-                              // and estimated match to TOF paddle
-
-  // Useful derived quantities
-  // double tan_angle, sin_angle, cos_angle;
-  
-  //  static const char NDEST = 2;
-  //  struct DataDest {
-  //    Int_t*    nthit;
-  //    Int_t*    nahit;
-  //    Double_t*  tdc;
-  //    Double_t*  tdc_c;
-  //    Double_t*  adc;
-  //    Double_t*  adc_p;
-  //    Double_t*  adc_c;
-  //    Double_t*  offset;
-  //    Double_t*  ped;
-  //    Double_t*  gain;
-  //  } fDataDest[NDEST];     // Lookup table for decoder
+  TClonesArray*  fTrackProj;    // projection of track onto plane
 
   void           ClearEvent();
   void           DeleteArrays();
   virtual Int_t  ReadDatabase( const TDatime& date );
   virtual Int_t  DefineVariables( EMode mode = kDefine );
 
-  //  enum ESide { kLeft = 0, kRight = 1 };
-  
-  //  virtual  Double_t TimeWalkCorrection(const Int_t& paddle,
-  //				       const ESide side);
-
   void Setup(const char* name, const char* description);
 
-  ClassDef(THcShower,0)   // Generic hodoscope class
+  ClassDef(THcShower,0)         // Generic class
 };
 
-////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
 
 #endif
- 
diff --git a/src/THcShowerCluster.h b/src/THcShowerCluster.h
index f6804b4..6516a40 100644
--- a/src/THcShowerCluster.h
+++ b/src/THcShowerCluster.h
@@ -21,9 +21,6 @@ class THcShowerCluster : THcShowerHitList {
       delete *i;
       *i = 0;
     }
-    //    purge(THcShowerHitList::);
-    //    THcShowerHitList::clear();
-    //    cout << "THcShowerCluster object destructed" << endl;
   }
 
   // Add a hit to the cluster hit list
@@ -44,7 +41,10 @@ class THcShowerCluster : THcShowerHitList {
     (*(THcShowerHitList::begin()+num))->show();
   }
 
-  //X coordinate of cluster's center of gravity.
+  // X coordinate of cluster's center of gravity,
+  // calculated as a weighted by hit energies average.
+  // Put X out of the calorimeter (-75 cm), if there is no energy deposition
+  // in the cluster.
   //
   Double_t clX() {
     Double_t x_sum=0.;
@@ -58,7 +58,10 @@ class THcShowerCluster : THcShowerHitList {
     return (Etot != 0. ? x_sum/Etot : -75.);
   }
 
-  //Z coordinate for a cluster, calculated as a weighted by energy average.
+  // Z coordinate of cluster's center of gravity,
+  // calculated as a weighted by hit energies average.
+  // Put Z out of the calorimeter (0 cm), if there is no energy deposition
+  // in the cluster.
   //
   Double_t clZ() {
     Double_t z_sum=0.;
@@ -69,7 +72,7 @@ class THcShowerCluster : THcShowerHitList {
       Etot += (*it)->hitE();
     }
     //    cout << "z_sum=" << z_sum << "  Etot=" << Etot << endl;
-    return z_sum/Etot;
+    return (Etot != 0. ? z_sum/Etot : 0.);
   }
 
   //Energy depostion in a cluster
@@ -95,7 +98,7 @@ class THcShowerCluster : THcShowerHitList {
     return Epr;
   }
 
-  //Cluster size.
+  //Cluster size (number of hits in the cluster).
   //
   UInt_t clSize() {
     return THcShowerHitList::size();
@@ -105,13 +108,13 @@ class THcShowerCluster : THcShowerHitList {
 
 //-----------------------------------------------------------------------------
 
-//Alias for cluster container and for its iterator
+//Alias for container of clusters and for its iterator
 //
 typedef vector<THcShowerCluster*> THcShClusterList;
 typedef THcShClusterList::iterator THcShClusterIt;
 
 //List of clusters
-
+//
 class THcShowerClusterList : private THcShClusterList {
 
  public:
@@ -126,9 +129,6 @@ class THcShowerClusterList : private THcShClusterList {
       delete *i;
       *i = 0;
     }
-    //    purge(THcShClusterList);
-    //    THcShClusterList::clear();
-    //    cout << "THcShowerClusterList object destroyed" << endl;
   }
 
   //Put a cluster in the cluster list
@@ -153,7 +153,7 @@ class THcShowerClusterList : private THcShClusterList {
 
 void ClusterHits(THcShowerHitList HitList) {
 
-//Cluster hits from the HitList. The resultant hit clusters are saved
+// Cluster hits from the HitList. The resultant clusters of hits are saved
 //in the ClusterList.
 
   while (HitList.size() != 0) {
@@ -174,9 +174,9 @@ void ClusterHits(THcShowerHitList HitList) {
 
 	  if ((**i).isNeighbour((*cluster).ClusteredHit(k))) {
 
-	    (*cluster).grow(*i);          //If hit i is neighbouring a hit
+	    (*cluster).grow(*i);          //If the hit #i is neighbouring a hit
 	    HitList.erase(i);             //in the cluster, then move it
-	                                  //into cluster.
+	                                  //into the cluster.
 	    clustered = true;
 	  }
 
@@ -188,10 +188,9 @@ void ClusterHits(THcShowerHitList HitList) {
 
     }                                     //while clustered
 
-    //    (*ClusterList).grow(cluster);  //Put the cluster in the cluster list
-    grow(cluster);        //Put the cluster in the cluster list
+    grow(cluster);                        //Put the cluster in the cluster list
 
-  }                                       //while hit_list not exhausted
+  }                                       //While hit_list not exhausted
 
 }
 
diff --git a/src/THcShowerHit.h b/src/THcShowerHit.h
index edf8ac0..f1d9308 100644
--- a/src/THcShowerHit.h
+++ b/src/THcShowerHit.h
@@ -1,7 +1,7 @@
 #ifndef ROOT_THcShowerHit
 #define ROOT_THcShowerHit
 
-// HMS calorimeter hit, version 2
+// HMS calorimeter hits, version 2
 
 #include <vector>
 #include <iterator>
@@ -9,16 +9,16 @@
 
 using namespace std;
 
-class THcShowerHit {           //HMS calorimeter hit class
+class THcShowerHit {       //HMS calorimeter hit class
 
  private:
-  UInt_t fCol, fRow; //hit colomn and row
-  Double_t fX, fZ;            //hit X (vert.) and Z (along spect.axis) coordinates
-  Double_t fE;                 //hit energy deposition
+  UInt_t fCol, fRow;       //hit colomn and row
+  Double_t fX, fZ;         //hit X (vert.) and Z (along spect.axis) coordinates
+  Double_t fE;             //hit energy deposition
 
  public:
 
-  THcShowerHit() {             //default constructor
+  THcShowerHit() {         //default constructor
   fCol=fRow=0;
   fX=fZ=0.;
   fE=0.;
@@ -57,6 +57,9 @@ class THcShowerHit {           //HMS calorimeter hit class
     return fE;
   }
 
+  // Decide if a hit is neighbouring the current hit.
+  // Two hits are neighbours if share a side or a corner.
+  //
   bool isNeighbour(THcShowerHit* hit1) {      //Is hit1 neighbouring this hit?
     Int_t dRow = fRow-(*hit1).fRow;
     Int_t dCol = fCol-(*hit1).fCol;
@@ -73,17 +76,9 @@ class THcShowerHit {           //HMS calorimeter hit class
 };
 
 
-typedef vector<THcShowerHit*> THcShowerHitList;      //alias for hit container
-typedef THcShowerHitList::iterator THcShowerHitIt;   //and for its iterator
-
-//Purge sequence container of pointers. Found in Echel, v.2, p.253.
+// Container (collection) of hits and its iterator.
 //
-template<class Seq> void purge(Seq& c) {
-  typename Seq::iterator i;
-  for(i = c.begin(); i != c.end(); i++) {
-    delete *i;
-    *i = 0;
-  }
-}
+typedef vector<THcShowerHit*> THcShowerHitList;
+typedef THcShowerHitList::iterator THcShowerHitIt;
 
 #endif
diff --git a/src/THcShowerPlane.cxx b/src/THcShowerPlane.cxx
index b9ffc2b..d579a85 100644
--- a/src/THcShowerPlane.cxx
+++ b/src/THcShowerPlane.cxx
@@ -310,7 +310,7 @@ Int_t THcShowerPlane::AccumulatePedestals(TClonesArray* rawhits, Int_t nexthit)
   Int_t ihit = nexthit;
   while(ihit < nrawhits) {
     THcRawShowerHit* hit = (THcRawShowerHit *) rawhits->At(ihit);
-    //cout << "fPlane =  " << hit->fPlane << " Limit = " << fPlaneNum << endl;
+    //cout << "fPlane =  " << hit->fPlane << " Limit = " << fLayerNum << endl;
     if(hit->fPlane > fLayerNum) {
       break;
     }
diff --git a/src/THcShowerPlane.h b/src/THcShowerPlane.h
index ce4f256..9f2467c 100644
--- a/src/THcShowerPlane.h
+++ b/src/THcShowerPlane.h
@@ -5,7 +5,7 @@
 //                         
 // THcShowerPlane
 //
-// A Hall C scintillator plane
+// A Hall C Shower plane
 //
 // May want to later inherit from a THcPlane class if there are similarities
 // in what a plane is shared with other detector types (shower, etc.)
@@ -88,42 +88,35 @@ class THcShowerPlane : public THaSubDetector {
 
  protected:
 
-  Double_t*   fA_Pos;         // [fNelem] Array of ADC amplitudes of blocks
-  Double_t*   fA_Neg;         // [fNelem] Array of ADC amplitudes of blocks
-  Double_t*   fA_Pos_p;	     // [fNelem] Array of pedestal subtracted ADC amplitudes
-  Double_t*   fA_Neg_p;	     // [fNelem] Array of pedestal subtracted ADC amplitudes
+  Double_t*   fA_Pos;         // [fNelem] ADC amplitudes of blocks
+  Double_t*   fA_Neg;
+  Double_t*   fA_Pos_p;	      // [fNelem] pedestal subtracted ADC amplitudes
+  Double_t*   fA_Neg_p;
 
-  Double_t* fEpos;     // [fNelem] Array of energy depositions seen by positive PMTs
-  Double_t* fEneg;     // [fNelem] Array of energy depositions seen by negative PMTs
-  Double_t* fEmean;    // [fNelem] Array of mean energy depositions (pos + neg)
-  Double_t  fEplane;   // Energy deposition per plane
+  Double_t* fEpos;     // [fNelem] energy depositions seen by positive PMTs
+  Double_t* fEneg;     // [fNelem] energy depositions seen by negative PMTs
+  Double_t* fEmean;    // [fNelem] mean energy depositions (pos + neg)
+  Double_t  fEplane;   // Energy deposition in the plane
 
-  TClonesArray* fPosADCHits;
-  TClonesArray* fNegADCHits;
+  TClonesArray* fPosADCHits;    // List of positive ADC hits
+  TClonesArray* fNegADCHits;    // List of negative ADC hits
 
-  Int_t fLayerNum;
+  Int_t fLayerNum;		// Layer # 1-4
 
-  Int_t fPlaneNum;		/* Which plane am I 1-4 */
-  Int_t fNPedestalEvents;	/* Number of pedestal events */
+  Int_t fNPedestalEvents;	/* Pedestal event counter */
   Int_t fMinPeds;		/* Only analyze/update if num events > */
   Int_t *fPosPedSum;		/* Accumulators for pedestals */
   Int_t *fPosPedSum2;
-  Int_t *fPosPedLimit;
-  Int_t *fPosPedCount;
+  Int_t *fPosPedLimit;          // Analyze pedestal if ADC signal < PedLimit
+  Int_t *fPosPedCount;          // [fNelem] counter of pedestal analysis
   Int_t *fNegPedSum;
   Int_t *fNegPedSum2;
-  Int_t *fNegPedLimit;
-  Int_t *fNegPedCount;
-
-  //  Double_t *fPosPed;
-  //  Double_t *fPosSig;
-  //  Double_t *fPosThresh;
-  //  Double_t *fNegPed;
-  //  Double_t *fNegSig;
-  //  Double_t *fNegThresh;
-  Float_t *fPosPed;      //To be consistent with Engine
-  Float_t *fPosSig;
-  Float_t *fPosThresh;
+  Int_t *fNegPedLimit;          // Analyze pedestal if ADC signal < PedLimit
+  Int_t *fNegPedCount;          // [fNelem] counter of pedestal analysis
+
+  Float_t *fPosPed;             // [fNelem] pedestal positions
+  Float_t *fPosSig;             // [fNelem] pedestal rms-s
+  Float_t *fPosThresh;          // [fNelem] ADC thresholds
   Float_t *fNegPed;
   Float_t *fNegSig;
   Float_t *fNegThresh;
-- 
GitLab