diff --git a/DBASE/general.param b/DBASE/general.param
index a8e9d26f5c17de24595d850a0a5ca71dbf60500a..4132af98959e4b2b59de0af5a1f70eb75b1b01f8 100644
--- a/DBASE/general.param
+++ b/DBASE/general.param
@@ -1,27 +1,39 @@
 #real raddeg
 raddeg=3.14159265/180
-;
-#include "PARAM/hcana.param"
-; hmsflags.param include spectrometer offsets and options.
-#include "PARAM/genflags.param"
-#include "PARAM/hmsflags.param"
 
-#include "PARAM/gdebug.param"
-#include "PARAM/hdebug.param"
-#include "PARAM/htracking.param"
+; General Hall-C parameter files
+#include "PARAM/GEN/genflags.param"
+#include "PARAM/GEN/gdebug.param"
+#include "PARAM/GEN/gtarget.param"
+#include "PARAM/GEN/gbeam.param"
 
-#include "PARAM/gtarget.param"
-#include "PARAM/gbeam.param"
-;  
-#include "PARAM/hdc_offsets.param"
-#include "PARAM/hdc.pos"
-#include "PARAM/hhodo.pos"
-#include "PARAM/hcal.pos"
-#include "PARAM/hhodo.param"
-#include "PARAM/haero.param"
-#include "PARAM/hdc.param"
-#include "PARAM/hdriftmap.param"
-#include "PARAM/hcal.param"
-#include "PARAM/hcer.param"
+; General HMS parameter files
+; Note: hmsflags.param includes spectrometer offsets and options.
+#include "PARAM/HMS/GEN/hcana.param"
+#include "PARAM/HMS/GEN/hdebug.param"
+#include "PARAM/HMS/GEN/hmsflags.param"
+#include "PARAM/HMS/GEN/htracking.param"
 
-#include "PARAM/pdc.param"
+; HMS detector specific paramter files  
+#include "PARAM/HMS/AERO/haero.param"
+#include "PARAM/HMS/CAL/hcal.pos"
+#include "PARAM/HMS/CAL/hcal.param"
+#include "PARAM/HMS/CER/hcer.param"
+#include "PARAM/HMS/DC/hdc_offsets.param"
+#include "PARAM/HMS/DC/hdc.pos"
+#include "PARAM/HMS/DC/hdc.param"
+#include "PARAM/HMS/DC/hdriftmap.param"
+#include "PARAM/HMS/HODO/hhodo.pos"
+#include "PARAM/HMS/HODO/hhodo.param"
+
+; General SHMS parameter files
+; Note: shmsflags.param includes spectrometer offsets and options.
+#include "PARAM/SHMS/GEN/pcana.param"
+#include "PARAM/SHMS/GEN/pdebug.param"
+#include "PARAM/SHMS/GEN/shmsflags.param"
+#include "PARAM/SHMS/GEN/ptracking.param"
+
+; SHMS detector specific paramter files
+#include "PARAM/SHMS/DC/pdc.pos"
+#include "PARAM/SHMS/DC/pdc.param"
+#include "PARAM/SHMS/DC/pdriftmap.param"
diff --git a/DEF-files/hdcana.def b/DEF-files/HMS/DC/hdcana.def
similarity index 100%
rename from DEF-files/hdcana.def
rename to DEF-files/HMS/DC/hdcana.def
diff --git a/DEF-files/hdcana_cuts.def b/DEF-files/HMS/DC/hdcana_cuts.def
similarity index 100%
rename from DEF-files/hdcana_cuts.def
rename to DEF-files/HMS/DC/hdcana_cuts.def
diff --git a/DEF-files/pdcana.def b/DEF-files/SHMS/DC/pdcana.def
similarity index 100%
rename from DEF-files/pdcana.def
rename to DEF-files/SHMS/DC/pdcana.def
diff --git a/DEF-files/pdcana_cuts.def b/DEF-files/SHMS/DC/pdcana_cuts.def
similarity index 100%
rename from DEF-files/pdcana_cuts.def
rename to DEF-files/SHMS/DC/pdcana_cuts.def
diff --git a/MAPS/HMS/db_crate1map.dat b/MAPS/HMS/CRATE/db_crate1map.dat
similarity index 100%
rename from MAPS/HMS/db_crate1map.dat
rename to MAPS/HMS/CRATE/db_crate1map.dat
diff --git a/MAPS/HMS/db_crate3map.dat b/MAPS/HMS/CRATE/db_crate3map.dat
similarity index 100%
rename from MAPS/HMS/db_crate3map.dat
rename to MAPS/HMS/CRATE/db_crate3map.dat
diff --git a/MAPS/HMS/db_crate5map.dat b/MAPS/HMS/CRATE/db_crate5map.dat
similarity index 100%
rename from MAPS/HMS/db_crate5map.dat
rename to MAPS/HMS/CRATE/db_crate5map.dat
diff --git a/MAPS/HMS/haero.map b/MAPS/HMS/DETEC/haero.map
similarity index 94%
rename from MAPS/HMS/haero.map
rename to MAPS/HMS/DETEC/haero.map
index 201d97f6fb8732e824d872e9b5873a64f8a17b89..a31708860b2e0195d722ad0d9576b1080f2920f3 100644
--- a/MAPS/HMS/haero.map
+++ b/MAPS/HMS/DETEC/haero.map
@@ -1,8 +1,8 @@
 !HMS:
-! HAERO_ID= 7             (TDC),ADC
+! HAERO_ID= 12             (TDC),ADC
 
 ROC=1
-detector=7
+detector=12
 
 !F250 modules
 SLOT=16
diff --git a/MAPS/HMS/hcal.map b/MAPS/HMS/DETEC/hcal.map
similarity index 98%
rename from MAPS/HMS/hcal.map
rename to MAPS/HMS/DETEC/hcal.map
index 4eb04b8168ac5f02f5f2d10e8296af8a4ae7954d..33d9b104a2aaca60edcdb2d7f7715acb6a95c714 100644
--- a/MAPS/HMS/hcal.map
+++ b/MAPS/HMS/DETEC/hcal.map
@@ -1,8 +1,8 @@
 !HMS:
-! HCAL_ID= 4              ADC
+! HCAL_ID= 15              ADC
 
 ROC=1
-detector=4
+detector=15
 
 !F250 modules
 SLOT=3
diff --git a/MAPS/HMS/hdc.map b/MAPS/HMS/DETEC/hdc.map
similarity index 99%
rename from MAPS/HMS/hdc.map
rename to MAPS/HMS/DETEC/hdc.map
index a5725b008d2fd8981a69535e80a3646a69770423..74b3017e8ec58ea522b46aa225b78490829fdf66 100644
--- a/MAPS/HMS/hdc.map
+++ b/MAPS/HMS/DETEC/hdc.map
@@ -1,8 +1,8 @@
 !HMS:
-! HDC_ID= 1               TDC
+! HDC_ID= 11               TDC
 
 ROC=3
-detector=1 ! HMS chambers >> detector=11  for SOS chambers
+detector=11 ! HMS chambers 
 
 ! Caen 1190 VME Modules >> DC1
 SLOT=5
diff --git a/MAPS/HMS/hhodo.map b/MAPS/HMS/DETEC/hhodo.map
similarity index 99%
rename from MAPS/HMS/hhodo.map
rename to MAPS/HMS/DETEC/hhodo.map
index 49ec75eee2f7616fe60b0d46bf96087152038160..2a99b3eba24318925084483b6eafc12647ab77b2 100644
--- a/MAPS/HMS/hhodo.map
+++ b/MAPS/HMS/DETEC/hhodo.map
@@ -1,8 +1,8 @@
 !HMS:
-! HSCIN_ID= 2   ADC+,ADC-,TDC+,TDC-
+! HSCIN_ID= 13   ADC+,ADC-,TDC+,TDC-
 
 ROC=1
-detector=2
+detector=13
 
 ! F250 modules
 SLOT=8
diff --git a/MAPS/HMS/htrig.map b/MAPS/HMS/DETEC/htrig.map
similarity index 98%
rename from MAPS/HMS/htrig.map
rename to MAPS/HMS/DETEC/htrig.map
index 17e8ab57469fc69f95ec4ab5c9f913705aa97f12..215b7804d4453f23212ea60324271945a9475dd4 100644
--- a/MAPS/HMS/htrig.map
+++ b/MAPS/HMS/DETEC/htrig.map
@@ -1,5 +1,5 @@
 !HMS:
-! THMS_ID=2    ADC,TDC
+! THMS_ID=10    ADC,TDC
 
 ! Plane = 1 >> ADC Only
 ! Plane = 2 >> TDC Only
diff --git a/MAPS/README b/MAPS/HMS/README
similarity index 100%
rename from MAPS/README
rename to MAPS/HMS/README
diff --git a/MAPS/SHMS/db_crate2map.dat b/MAPS/SHMS/CRATE/db_crate2map.dat
similarity index 100%
rename from MAPS/SHMS/db_crate2map.dat
rename to MAPS/SHMS/CRATE/db_crate2map.dat
diff --git a/MAPS/SHMS/db_crate4map.dat b/MAPS/SHMS/CRATE/db_crate4map.dat
similarity index 100%
rename from MAPS/SHMS/db_crate4map.dat
rename to MAPS/SHMS/CRATE/db_crate4map.dat
diff --git a/MAPS/SHMS/db_crate6map.dat b/MAPS/SHMS/CRATE/db_crate6map.dat
similarity index 100%
rename from MAPS/SHMS/db_crate6map.dat
rename to MAPS/SHMS/CRATE/db_crate6map.dat
diff --git a/MAPS/SHMS/pcal.map b/MAPS/SHMS/DETEC/pcal.map
similarity index 99%
rename from MAPS/SHMS/pcal.map
rename to MAPS/SHMS/DETEC/pcal.map
index 434dd58a3fc52bc15ebb267d84827091c533c983..e833bfbaf21766fe6214d536c59de7d6ae451bfc 100644
--- a/MAPS/SHMS/pcal.map
+++ b/MAPS/SHMS/DETEC/pcal.map
@@ -1,8 +1,8 @@
 !SHMS
-! SCAL_ID=14              ADC
+! SCAL_ID=26              ADC
 
 ROC=4
-detector=14
+detector=26
 
 !F250 modules
 SLOT=3
diff --git a/MAPS/SHMS/pdc.map b/MAPS/SHMS/DETEC/pdc.map
similarity index 99%
rename from MAPS/SHMS/pdc.map
rename to MAPS/SHMS/DETEC/pdc.map
index 3eb191c380e087b9438893b84b6d839f23ce98fe..1125f423bedc9e5db44d9f5953b0a8e05400c570 100644
--- a/MAPS/SHMS/pdc.map
+++ b/MAPS/SHMS/DETEC/pdc.map
@@ -2,7 +2,7 @@
 ! PDC_ID=21               TDC
 
 ROC=6
-detector=21 ! SHMS chambers >> detector=21, 11 for HMS drift chambers
+detector=21 ! SHMS chambers
 
 ! Caen 1190 VME Modules >> DC1
 SLOT=9
diff --git a/MAPS/make_cratemap.sh b/MAPS/make_cratemap.sh
index 9c86535536a341848e7fc980d95bbf55390a34ed..e6f96ca636a7667d4ba9a24ddbab1f62a3019e09 100755
--- a/MAPS/make_cratemap.sh
+++ b/MAPS/make_cratemap.sh
@@ -14,10 +14,10 @@ function proceed {
     done
     for crate in "${arr[@]}"; do
 	if ((crate%2 == 1)) && ((crate != 7)); then
-	    (cat ${PWD}/HMS/db_crate${crate}map.dat; echo; echo) >> db_cratemap.dat
+	    (cat ${PWD}/HMS/CRATE/db_crate${crate}map.dat; echo; echo) >> db_cratemap.dat
 	    echo; echo "HMS  Crate ${crate} has been added to db_cratemap.dat"
 	elif ((crate%2 == 0)) || ((crate == 7)); then
-	    (cat ${PWD}/SHMS/db_crate${crate}map.dat; echo; echo) >> db_cratemap.dat
+	    (cat ${PWD}/SHMS/CRATE/db_crate${crate}map.dat; echo; echo) >> db_cratemap.dat
 	    echo; echo "SHMS Crate ${crate} has been added to db_cratemap.dat"
 	    if ((crate == 7)); then echo; fi
 	fi
diff --git a/PARAM/gbeam.param b/PARAM/GEN/gbeam.param
similarity index 100%
rename from PARAM/gbeam.param
rename to PARAM/GEN/gbeam.param
diff --git a/PARAM/gdebug.param b/PARAM/GEN/gdebug.param
similarity index 100%
rename from PARAM/gdebug.param
rename to PARAM/GEN/gdebug.param
diff --git a/PARAM/genflags.param b/PARAM/GEN/genflags.param
similarity index 100%
rename from PARAM/genflags.param
rename to PARAM/GEN/genflags.param
diff --git a/PARAM/gtarget.param b/PARAM/GEN/gtarget.param
similarity index 100%
rename from PARAM/gtarget.param
rename to PARAM/GEN/gtarget.param
diff --git a/PARAM/haero.param b/PARAM/HMS/AERO/haero.param
similarity index 100%
rename from PARAM/haero.param
rename to PARAM/HMS/AERO/haero.param
diff --git a/PARAM/hcal.param b/PARAM/HMS/CAL/hcal.param
similarity index 100%
rename from PARAM/hcal.param
rename to PARAM/HMS/CAL/hcal.param
diff --git a/PARAM/hcal.pos b/PARAM/HMS/CAL/hcal.pos
similarity index 100%
rename from PARAM/hcal.pos
rename to PARAM/HMS/CAL/hcal.pos
diff --git a/PARAM/hcer.param b/PARAM/HMS/CER/hcer.param
similarity index 100%
rename from PARAM/hcer.param
rename to PARAM/HMS/CER/hcer.param
diff --git a/PARAM/hdc.param b/PARAM/HMS/DC/hdc.param
similarity index 100%
rename from PARAM/hdc.param
rename to PARAM/HMS/DC/hdc.param
diff --git a/PARAM/hdc.pos b/PARAM/HMS/DC/hdc.pos
similarity index 100%
rename from PARAM/hdc.pos
rename to PARAM/HMS/DC/hdc.pos
diff --git a/PARAM/hdc_offsets.param b/PARAM/HMS/DC/hdc_offsets.param
similarity index 100%
rename from PARAM/hdc_offsets.param
rename to PARAM/HMS/DC/hdc_offsets.param
diff --git a/PARAM/hdc_test_stand.param b/PARAM/HMS/DC/hdc_test_stand.param
similarity index 100%
rename from PARAM/hdc_test_stand.param
rename to PARAM/HMS/DC/hdc_test_stand.param
diff --git a/PARAM/hdeadwires.param b/PARAM/HMS/DC/hdeadwires.param
similarity index 100%
rename from PARAM/hdeadwires.param
rename to PARAM/HMS/DC/hdeadwires.param
diff --git a/PARAM/hdriftmap.param b/PARAM/HMS/DC/hdriftmap.param
similarity index 100%
rename from PARAM/hdriftmap.param
rename to PARAM/HMS/DC/hdriftmap.param
diff --git a/PARAM/hcana.param b/PARAM/HMS/GEN/hcana.param
similarity index 100%
rename from PARAM/hcana.param
rename to PARAM/HMS/GEN/hcana.param
diff --git a/PARAM/hdebug.param b/PARAM/HMS/GEN/hdebug.param
similarity index 100%
rename from PARAM/hdebug.param
rename to PARAM/HMS/GEN/hdebug.param
diff --git a/PARAM/hmsflags.param b/PARAM/HMS/GEN/hmsflags.param
similarity index 100%
rename from PARAM/hmsflags.param
rename to PARAM/HMS/GEN/hmsflags.param
diff --git a/PARAM/htracking.param b/PARAM/HMS/GEN/htracking.param
similarity index 100%
rename from PARAM/htracking.param
rename to PARAM/HMS/GEN/htracking.param
diff --git a/PARAM/hhodo.param b/PARAM/HMS/HODO/hhodo.param
similarity index 100%
rename from PARAM/hhodo.param
rename to PARAM/HMS/HODO/hhodo.param
diff --git a/PARAM/hhodo.pos b/PARAM/HMS/HODO/hhodo.pos
similarity index 100%
rename from PARAM/hhodo.pos
rename to PARAM/HMS/HODO/hhodo.pos
diff --git a/PARAM/SHMS/DC/pdc.param b/PARAM/SHMS/DC/pdc.param
new file mode 100644
index 0000000000000000000000000000000000000000..56517a04741c12d0786e7a3930ef48dc4aa9edd1
--- /dev/null
+++ b/PARAM/SHMS/DC/pdc.param
@@ -0,0 +1,25 @@
+;---------------------------------------------------------------------
+; SHMS_TRACKING
+; CTP parameter file containing all tracking parameters for the HMS
+;----------------------------------------------------------------------
+
+; sigma of wire chabmer resolution for each plane
+  pdc_sigma = 0.02, 0.02, 0.02, 0.02, 0.02, 0.02 
+  	      0.02, 0.02, 0.02, 0.02, 0.02, 0.02
+
+; tdc window, wide limits for now
+  pdc_tdc_min_win = -55000,-55000,-55000,-55000,-55000,-55000
+  		    -55000,-55000,-55000,-55000,-55000,-55000
+  pdc_tdc_max_win = 55000,55000,55000,55000,55000,55000
+  		    55000,55000,55000,55000,55000,55000
+
+; conversion from tdc lciks to ns
+  pdc_tdc_time_per_channel = -0.10 ; CAEN1190 TDC step size = 100ps
+
+; zero time, decreasing moves sdtime plots to lower time
+  pdc_plane_time_zero = 120.0,120.0,120.0,120.0,120.0,120.0
+  		      	120.0,120.0,120.0,120.0,120.0,120.0
+
+; wire velocity
+  pdc_wire_velocity = 13.0
+  pdc_central_time = 1,1,1,1,1,1,1,1,1,1,1,1
diff --git a/PARAM/SHMS/DC/pdc.param.ori b/PARAM/SHMS/DC/pdc.param.ori
new file mode 100644
index 0000000000000000000000000000000000000000..7d1d76cf442116fbf659ed66afee7b0571919598
--- /dev/null
+++ b/PARAM/SHMS/DC/pdc.param.ori
@@ -0,0 +1,14 @@
+
+ppartmass = 0.139
+phodo_num_planes = 1
+
+; Scintillator parameters
+pref_npaddles = 6
+pref_nsperchan = 0.1
+pref_offset = 0.0
+
+
+
+
+
+
diff --git a/PARAM/pdc.param b/PARAM/SHMS/DC/pdc.param.ori.dnd
similarity index 100%
rename from PARAM/pdc.param
rename to PARAM/SHMS/DC/pdc.param.ori.dnd
diff --git a/PARAM/SHMS/DC/pdc.pos b/PARAM/SHMS/DC/pdc.pos
new file mode 100644
index 0000000000000000000000000000000000000000..99e5299a1203afc50cf2bfca703981bda56d8fda
--- /dev/null
+++ b/PARAM/SHMS/DC/pdc.pos
@@ -0,0 +1,134 @@
+; Number of planes installed in SHMS detector setup
+  pdc_num_planes = 12
+; Number of chambers installed in SHMS detector setup
+  pdc_num_chambers = 2
+
+
+; Z positions of various planes in SHMS chambers
+; Use geometry of previous SOS chambers for now
+
+; pdc_1_zpos = -14.5*2.54
+  pdc_1_zpos = 0 ; Chamber 1, do not try to project to scintillators
+  pdc_2_zpos = 0, 0 ; Chamber 2
+
+; Use geometry of SOS chambers for now
+  pdc_zpos   = pdc_1_zpos - 1.5875
+               pdc_1_zpos - 0.9525
+               pdc_1_zpos - 0.3175
+               pdc_1_zpos + 0.3175
+               pdc_1_zpos + 0.9525
+               pdc_1_zpos + 1.5875
+	       pdc_1_zpos - 1.5875	  
+               pdc_1_zpos - 0.9525
+               pdc_1_zpos - 0.3175
+               pdc_1_zpos + 0.3175
+               pdc_1_zpos + 0.9525
+               pdc_1_zpos + 1.5875
+
+; Angle alpha of wires in wire chamber planes
+  pdc_roll = 0.0 ; SOS chambers had roll as installed
+  pdc_alpha_angle = (30-pdc_roll)*raddeg
+  		    (30-pdc_roll)*raddeg
+  		    (90-pdc_roll)*raddeg
+  		    (90-pdc_roll)*raddeg
+  		    (150-pdc_roll)*raddeg
+  		    (150-pdc_roll)*raddeg
+		    (30-pdc_roll)*raddeg
+  		    (30-pdc_roll)*raddeg
+  		    (90-pdc_roll)*raddeg
+  		    (90-pdc_roll)*raddeg
+  		    (150-pdc_roll)*raddeg
+  		    (150-pdc_roll)*raddeg
+
+  pdc_beta = 0.0
+  pdc_beta_angle = pdc_beta
+                   pdc_beta
+                   pdc_beta
+                   pdc_beta
+                   pdc_beta
+                   pdc_beta
+		   pdc_beta
+                   pdc_beta
+                   pdc_beta
+                   pdc_beta
+                   pdc_beta
+                   pdc_beta
+
+  pdc_gamma = 0.0
+  pdc_gamma_angle = pdc_gamma
+                    pdc_gamma
+                    pdc_gamma
+                    pdc_gamma
+                    pdc_gamma
+                    pdc_gamma
+		    pdc_gamma
+                    pdc_gamma
+                    pdc_gamma
+                    pdc_gamma
+                    pdc_gamma
+                    pdc_gamma
+  pdc_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
+      pdc_nrwire = 107
+                   107
+                   79
+                   79
+                   107
+                   107
+		   107
+                   107
+                   79
+                   79
+                   107
+                   107
+
+; X,Y position of center of wire chamber
+  pdc_xcenter = 0.0, 0.0
+  pdc_ycenter = 0.0, 0.0
+
+; 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
+; (These taken from SOS.  Will be different for SHMS
+      pdc_central_wire = 54.25
+                         53.75
+                         40.25
+                         40.75
+                         54.25
+                         53.75 
+			 53.75
+			 54.25
+			 40.75
+			 40.25
+			 53.75
+			 54.25
+
+;  Chamber # for each plane
+pdc_chamber_planes = 1,1,1,1,1,1,2,2,2,2,2,2  
+
+; Order in which wires are readout
+  pdc_wire_counting = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+; If pdc_wire_counting(plane) = 0
+;  the wire center is at (wire - pdc_central_wire) * pitch
+; If pdc_wire_counting(plane) = 1
+;  the wire center is at ( pdc_nrwire + 1 - wire - pdc_central_wire) * pitch
+
+; The velocity correction is the distance from the center of the wire divided
+; by the velocity of propagation times pdc_drifttime_sign(pln).  +/-1
+; for disc. card at +/- coord. (i.e. top = -x direction, so top readout is +1)
+;
+; These are guesses taken from the SOS Chambers
+;
+  pdc_drifttime_sign = 1, -1, -1, 1, 1, -1,  1, -1, -1, 1, 1, -1
\ No newline at end of file
diff --git a/PARAM/SHMS/DC/pdriftmap.param b/PARAM/SHMS/DC/pdriftmap.param
new file mode 100644
index 0000000000000000000000000000000000000000..d6a16be8bd737052d94cec9f861441a79ae2307c
--- /dev/null
+++ b/PARAM/SHMS/DC/pdriftmap.param
@@ -0,0 +1,177 @@
+; Lookup table
+; Drift map parameters
+pdriftbins = 138
+; Number of 1st bin in table
+pdrift1stbin = -24
+; Bin size in ns
+pdriftbinsz = 2
+; Drift maps simply copied from the SOS chambers
+pwc1u1fract=0.0002,0.0005,0.0009,0.0011,0.0015,0.0018,0.0022,0.0027
+0.0029,0.0033,0.0038,0.0044,0.0048,0.0051,0.0057,0.0070,0.0090,0.0121
+0.0167,0.0217,0.0282,0.0371,0.0467,0.0582,0.0723,0.0873,0.1038,0.1211
+0.1409,0.1609,0.1826,0.2060,0.2302,0.2542,0.2796,0.3043,0.3294,0.3555
+0.3819,0.4085,0.4343,0.4618,0.4890,0.5140,0.5384,0.5635,0.5880,0.6100
+0.6311,0.6522,0.6722,0.6928,0.7120,0.7316,0.7495,0.7684,0.7853,0.8026
+0.8191,0.8334,0.8491,0.8629,0.8771,0.8888,0.8994,0.9089,0.9170,0.9242
+0.9308,0.9364,0.9411,0.9457,0.9496,0.9538,0.9571,0.9602,0.9630,0.9654
+0.9679,0.9698,0.9718,0.9735,0.9750,0.9765,0.9778,0.9791,0.9804,0.9815
+0.9825,0.9833,0.9844,0.9851,0.9855,0.9862,0.9870,0.9874,0.9877,0.9883
+0.9889,0.9893,0.9895,0.9898,0.9901,0.9904,0.9910,0.9918,0.9923,0.9927
+0.9930,0.9935,0.9937,0.9941,0.9943,0.9947,0.9949,0.9952,0.9957,0.9962
+0.9964,0.9966,0.9970,0.9973,0.9975,0.9977,0.9979,0.9982,0.9986,0.9988
+0.9990,0.9991,0.9994,0.9995,0.9998,0.9999,1.0000,1.0000,1.0000,1.0000
+pwc1x1fract=0.0004,0.0006,0.0008,0.0010,0.0012,0.0015,0.0017,0.0021
+0.0025,0.0028,0.0031,0.0033,0.0036,0.0041,0.0045,0.0051,0.0060,0.0075
+0.0104,0.0138,0.0191,0.0265,0.0356,0.0463,0.0596,0.0743,0.0916,0.1114
+0.1316,0.1533,0.1757,0.1988,0.2209,0.2455,0.2689,0.2945,0.3196,0.3437
+0.3697,0.3950,0.4196,0.4448,0.4702,0.4953,0.5186,0.5416,0.5650,0.5877
+0.6099,0.6316,0.6519,0.6719,0.6909,0.7099,0.7277,0.7463,0.7645,0.7821
+0.7979,0.8154,0.8320,0.8477,0.8612,0.8740,0.8865,0.8973,0.9077,0.9161
+0.9234,0.9301,0.9351,0.9406,0.9454,0.9497,0.9531,0.9570,0.9605,0.9631
+0.9660,0.9690,0.9713,0.9728,0.9748,0.9762,0.9775,0.9786,0.9800,0.9807
+0.9818,0.9827,0.9833,0.9843,0.9849,0.9857,0.9861,0.9866,0.9871,0.9877
+0.9883,0.9887,0.9891,0.9895,0.9898,0.9901,0.9907,0.9913,0.9916,0.9918
+0.9921,0.9925,0.9929,0.9931,0.9935,0.9940,0.9944,0.9946,0.9949,0.9952
+0.9956,0.9960,0.9966,0.9968,0.9970,0.9972,0.9974,0.9976,0.9979,0.9980
+0.9984,0.9985,0.9988,0.9990,0.9991,0.9993,0.9996,0.9998,0.9999,1.0000
+pwc1v1fract=0.0002,0.0006,0.0008,0.0011,0.0013,0.0016,0.0019,0.0020
+0.0022,0.0025,0.0030,0.0035,0.0038,0.0042,0.0049,0.0057,0.0076,0.0103
+0.0149,0.0200,0.0273,0.0353,0.0455,0.0574,0.0719,0.0865,0.1045,0.1224
+0.1416,0.1630,0.1844,0.2074,0.2317,0.2555,0.2807,0.3046,0.3298,0.3553
+0.3826,0.4075,0.4316,0.4563,0.4823,0.5065,0.5315,0.5554,0.5781,0.6014
+0.6235,0.6434,0.6643,0.6853,0.7050,0.7238,0.7415,0.7602,0.7787,0.7975
+0.8152,0.8307,0.8456,0.8595,0.8723,0.8851,0.8957,0.9043,0.9126,0.9205
+0.9276,0.9330,0.9383,0.9437,0.9484,0.9521,0.9553,0.9582,0.9607,0.9634
+0.9657,0.9676,0.9701,0.9722,0.9738,0.9755,0.9767,0.9781,0.9794,0.9804
+0.9814,0.9825,0.9835,0.9842,0.9847,0.9853,0.9861,0.9866,0.9871,0.9878
+0.9882,0.9888,0.9891,0.9897,0.9900,0.9903,0.9909,0.9910,0.9917,0.9919
+0.9924,0.9929,0.9937,0.9939,0.9944,0.9948,0.9954,0.9956,0.9961,0.9966
+0.9968,0.9972,0.9974,0.9978,0.9980,0.9981,0.9984,0.9986,0.9989,0.9991
+0.9995,0.9996,0.9998,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000
+pwc1u2fract=0.0003,0.0004,0.0008,0.0011,0.0015,0.0018,0.0021,0.0024
+0.0027,0.0030,0.0033,0.0037,0.0039,0.0043,0.0046,0.0049,0.0059,0.0073
+0.0094,0.0129,0.0184,0.0267,0.0352,0.0446,0.0563,0.0707,0.0863,0.1030
+0.1206,0.1411,0.1629,0.1845,0.2087,0.2325,0.2578,0.2837,0.3091,0.3357
+0.3606,0.3867,0.4119,0.4362,0.4608,0.4857,0.5099,0.5349,0.5587,0.5814
+0.6047,0.6260,0.6480,0.6685,0.6892,0.7099,0.7282,0.7456,0.7643,0.7812
+0.7988,0.8141,0.8309,0.8454,0.8616,0.8738,0.8847,0.8955,0.9049,0.9133
+0.9199,0.9274,0.9341,0.9399,0.9445,0.9489,0.9529,0.9561,0.9593,0.9620
+0.9645,0.9667,0.9689,0.9701,0.9720,0.9740,0.9756,0.9771,0.9785,0.9796
+0.9808,0.9816,0.9823,0.9832,0.9839,0.9846,0.9854,0.9860,0.9867,0.9874
+0.9876,0.9881,0.9885,0.9889,0.9895,0.9900,0.9902,0.9907,0.9910,0.9916
+0.9919,0.9923,0.9927,0.9930,0.9934,0.9937,0.9942,0.9945,0.9949,0.9953
+0.9957,0.9962,0.9965,0.9968,0.9971,0.9973,0.9976,0.9979,0.9981,0.9984
+0.9986,0.9988,0.9989,0.9993,0.9995,0.9998,0.9999,0.9999,1.0000,1.0000
+pwc1x2fract=0.0002,0.0005,0.0008,0.0011,0.0014,0.0017,0.0021,0.0025
+0.0027,0.0031,0.0032,0.0034,0.0040,0.0045,0.0052,0.0065,0.0083,0.0112
+0.0150,0.0200,0.0264,0.0341,0.0435,0.0560,0.0701,0.0862,0.1027,0.1210
+0.1417,0.1628,0.1833,0.2069,0.2301,0.2547,0.2799,0.3062,0.3314,0.3582
+0.3860,0.4141,0.4390,0.4656,0.4903,0.5161,0.5410,0.5649,0.5874,0.6090
+0.6298,0.6507,0.6721,0.6923,0.7117,0.7312,0.7510,0.7706,0.7881,0.8052
+0.8204,0.8360,0.8525,0.8666,0.8793,0.8906,0.9019,0.9103,0.9194,0.9274
+0.9340,0.9397,0.9442,0.9483,0.9523,0.9557,0.9596,0.9625,0.9653,0.9678
+0.9698,0.9718,0.9732,0.9751,0.9768,0.9782,0.9793,0.9804,0.9813,0.9821
+0.9828,0.9834,0.9842,0.9848,0.9852,0.9857,0.9861,0.9864,0.9872,0.9877
+0.9880,0.9886,0.9889,0.9894,0.9898,0.9903,0.9908,0.9915,0.9921,0.9924
+0.9927,0.9930,0.9935,0.9939,0.9943,0.9945,0.9949,0.9952,0.9957,0.9960
+0.9963,0.9965,0.9967,0.9972,0.9975,0.9979,0.9980,0.9985,0.9987,0.9988
+0.9990,0.9991,0.9992,0.9995,0.9997,1.0000,1.0000,1.0000,1.0000,1.0000
+pwc1v2fract=0.0004,0.0006,0.0008,0.0012,0.0013,0.0016,0.0018,0.0021
+0.0024,0.0027,0.0029,0.0032,0.0036,0.0039,0.0043,0.0049,0.0063,0.0080
+0.0113,0.0155,0.0218,0.0300,0.0397,0.0508,0.0645,0.0793,0.0949,0.1135
+0.1343,0.1560,0.1786,0.2019,0.2250,0.2498,0.2756,0.3011,0.3270,0.3526
+0.3778,0.4042,0.4299,0.4570,0.4821,0.5077,0.5311,0.5540,0.5784,0.6010
+0.6219,0.6429,0.6633,0.6830,0.7023,0.7214,0.7403,0.7590,0.7786,0.7948
+0.8118,0.8288,0.8444,0.8587,0.8725,0.8842,0.8946,0.9044,0.9136,0.9208
+0.9264,0.9323,0.9377,0.9428,0.9472,0.9506,0.9541,0.9576,0.9602,0.9635
+0.9656,0.9675,0.9695,0.9715,0.9732,0.9751,0.9768,0.9777,0.9789,0.9802
+0.9809,0.9819,0.9828,0.9835,0.9841,0.9850,0.9858,0.9863,0.9866,0.9870
+0.9875,0.9880,0.9884,0.9888,0.9894,0.9899,0.9901,0.9905,0.9909,0.9912
+0.9917,0.9919,0.9922,0.9926,0.9931,0.9936,0.9941,0.9945,0.9951,0.9954
+0.9959,0.9962,0.9964,0.9967,0.9969,0.9971,0.9975,0.9978,0.9980,0.9983
+0.9986,0.9988,0.9991,0.9995,0.9998,0.9999,0.9999,0.9999,1.0000,1.0000
+
+pwc2u1fract=0.0002,0.0005,0.0009,0.0011,0.0015,0.0018,0.0022,0.0027
+0.0029,0.0033,0.0038,0.0044,0.0048,0.0051,0.0057,0.0070,0.0090,0.0121
+0.0167,0.0217,0.0282,0.0371,0.0467,0.0582,0.0723,0.0873,0.1038,0.1211
+0.1409,0.1609,0.1826,0.2060,0.2302,0.2542,0.2796,0.3043,0.3294,0.3555
+0.3819,0.4085,0.4343,0.4618,0.4890,0.5140,0.5384,0.5635,0.5880,0.6100
+0.6311,0.6522,0.6722,0.6928,0.7120,0.7316,0.7495,0.7684,0.7853,0.8026
+0.8191,0.8334,0.8491,0.8629,0.8771,0.8888,0.8994,0.9089,0.9170,0.9242
+0.9308,0.9364,0.9411,0.9457,0.9496,0.9538,0.9571,0.9602,0.9630,0.9654
+0.9679,0.9698,0.9718,0.9735,0.9750,0.9765,0.9778,0.9791,0.9804,0.9815
+0.9825,0.9833,0.9844,0.9851,0.9855,0.9862,0.9870,0.9874,0.9877,0.9883
+0.9889,0.9893,0.9895,0.9898,0.9901,0.9904,0.9910,0.9918,0.9923,0.9927
+0.9930,0.9935,0.9937,0.9941,0.9943,0.9947,0.9949,0.9952,0.9957,0.9962
+0.9964,0.9966,0.9970,0.9973,0.9975,0.9977,0.9979,0.9982,0.9986,0.9988
+0.9990,0.9991,0.9994,0.9995,0.9998,0.9999,1.0000,1.0000,1.0000,1.0000
+pwc2x1fract=0.0004,0.0006,0.0008,0.0010,0.0012,0.0015,0.0017,0.0021
+0.0025,0.0028,0.0031,0.0033,0.0036,0.0041,0.0045,0.0051,0.0060,0.0075
+0.0104,0.0138,0.0191,0.0265,0.0356,0.0463,0.0596,0.0743,0.0916,0.1114
+0.1316,0.1533,0.1757,0.1988,0.2209,0.2455,0.2689,0.2945,0.3196,0.3437
+0.3697,0.3950,0.4196,0.4448,0.4702,0.4953,0.5186,0.5416,0.5650,0.5877
+0.6099,0.6316,0.6519,0.6719,0.6909,0.7099,0.7277,0.7463,0.7645,0.7821
+0.7979,0.8154,0.8320,0.8477,0.8612,0.8740,0.8865,0.8973,0.9077,0.9161
+0.9234,0.9301,0.9351,0.9406,0.9454,0.9497,0.9531,0.9570,0.9605,0.9631
+0.9660,0.9690,0.9713,0.9728,0.9748,0.9762,0.9775,0.9786,0.9800,0.9807
+0.9818,0.9827,0.9833,0.9843,0.9849,0.9857,0.9861,0.9866,0.9871,0.9877
+0.9883,0.9887,0.9891,0.9895,0.9898,0.9901,0.9907,0.9913,0.9916,0.9918
+0.9921,0.9925,0.9929,0.9931,0.9935,0.9940,0.9944,0.9946,0.9949,0.9952
+0.9956,0.9960,0.9966,0.9968,0.9970,0.9972,0.9974,0.9976,0.9979,0.9980
+0.9984,0.9985,0.9988,0.9990,0.9991,0.9993,0.9996,0.9998,0.9999,1.0000
+pwc2v1fract=0.0002,0.0006,0.0008,0.0011,0.0013,0.0016,0.0019,0.0020
+0.0022,0.0025,0.0030,0.0035,0.0038,0.0042,0.0049,0.0057,0.0076,0.0103
+0.0149,0.0200,0.0273,0.0353,0.0455,0.0574,0.0719,0.0865,0.1045,0.1224
+0.1416,0.1630,0.1844,0.2074,0.2317,0.2555,0.2807,0.3046,0.3298,0.3553
+0.3826,0.4075,0.4316,0.4563,0.4823,0.5065,0.5315,0.5554,0.5781,0.6014
+0.6235,0.6434,0.6643,0.6853,0.7050,0.7238,0.7415,0.7602,0.7787,0.7975
+0.8152,0.8307,0.8456,0.8595,0.8723,0.8851,0.8957,0.9043,0.9126,0.9205
+0.9276,0.9330,0.9383,0.9437,0.9484,0.9521,0.9553,0.9582,0.9607,0.9634
+0.9657,0.9676,0.9701,0.9722,0.9738,0.9755,0.9767,0.9781,0.9794,0.9804
+0.9814,0.9825,0.9835,0.9842,0.9847,0.9853,0.9861,0.9866,0.9871,0.9878
+0.9882,0.9888,0.9891,0.9897,0.9900,0.9903,0.9909,0.9910,0.9917,0.9919
+0.9924,0.9929,0.9937,0.9939,0.9944,0.9948,0.9954,0.9956,0.9961,0.9966
+0.9968,0.9972,0.9974,0.9978,0.9980,0.9981,0.9984,0.9986,0.9989,0.9991
+0.9995,0.9996,0.9998,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000
+pwc2u2fract=0.0003,0.0004,0.0008,0.0011,0.0015,0.0018,0.0021,0.0024
+0.0027,0.0030,0.0033,0.0037,0.0039,0.0043,0.0046,0.0049,0.0059,0.0073
+0.0094,0.0129,0.0184,0.0267,0.0352,0.0446,0.0563,0.0707,0.0863,0.1030
+0.1206,0.1411,0.1629,0.1845,0.2087,0.2325,0.2578,0.2837,0.3091,0.3357
+0.3606,0.3867,0.4119,0.4362,0.4608,0.4857,0.5099,0.5349,0.5587,0.5814
+0.6047,0.6260,0.6480,0.6685,0.6892,0.7099,0.7282,0.7456,0.7643,0.7812
+0.7988,0.8141,0.8309,0.8454,0.8616,0.8738,0.8847,0.8955,0.9049,0.9133
+0.9199,0.9274,0.9341,0.9399,0.9445,0.9489,0.9529,0.9561,0.9593,0.9620
+0.9645,0.9667,0.9689,0.9701,0.9720,0.9740,0.9756,0.9771,0.9785,0.9796
+0.9808,0.9816,0.9823,0.9832,0.9839,0.9846,0.9854,0.9860,0.9867,0.9874
+0.9876,0.9881,0.9885,0.9889,0.9895,0.9900,0.9902,0.9907,0.9910,0.9916
+0.9919,0.9923,0.9927,0.9930,0.9934,0.9937,0.9942,0.9945,0.9949,0.9953
+0.9957,0.9962,0.9965,0.9968,0.9971,0.9973,0.9976,0.9979,0.9981,0.9984
+0.9986,0.9988,0.9989,0.9993,0.9995,0.9998,0.9999,0.9999,1.0000,1.0000
+pwc2x2fract=0.0002,0.0005,0.0008,0.0011,0.0014,0.0017,0.0021,0.0025
+0.0027,0.0031,0.0032,0.0034,0.0040,0.0045,0.0052,0.0065,0.0083,0.0112
+0.0150,0.0200,0.0264,0.0341,0.0435,0.0560,0.0701,0.0862,0.1027,0.1210
+0.1417,0.1628,0.1833,0.2069,0.2301,0.2547,0.2799,0.3062,0.3314,0.3582
+0.3860,0.4141,0.4390,0.4656,0.4903,0.5161,0.5410,0.5649,0.5874,0.6090
+0.6298,0.6507,0.6721,0.6923,0.7117,0.7312,0.7510,0.7706,0.7881,0.8052
+0.8204,0.8360,0.8525,0.8666,0.8793,0.8906,0.9019,0.9103,0.9194,0.9274
+0.9340,0.9397,0.9442,0.9483,0.9523,0.9557,0.9596,0.9625,0.9653,0.9678
+0.9698,0.9718,0.9732,0.9751,0.9768,0.9782,0.9793,0.9804,0.9813,0.9821
+0.9828,0.9834,0.9842,0.9848,0.9852,0.9857,0.9861,0.9864,0.9872,0.9877
+0.9880,0.9886,0.9889,0.9894,0.9898,0.9903,0.9908,0.9915,0.9921,0.9924
+0.9927,0.9930,0.9935,0.9939,0.9943,0.9945,0.9949,0.9952,0.9957,0.9960
+0.9963,0.9965,0.9967,0.9972,0.9975,0.9979,0.9980,0.9985,0.9987,0.9988
+0.9990,0.9991,0.9992,0.9995,0.9997,1.0000,1.0000,1.0000,1.0000,1.0000
+pwc2v2fract=0.0004,0.0006,0.0008,0.0012,0.0013,0.0016,0.0018,0.0021
+0.0024,0.0027,0.0029,0.0032,0.0036,0.0039,0.0043,0.0049,0.0063,0.0080
+0.0113,0.0155,0.0218,0.0300,0.0397,0.0508,0.0645,0.0793,0.0949,0.1135
+0.1343,0.1560,0.1786,0.2019,0.2250,0.2498,0.2756,0.3011,0.3270,0.3526
+0.3778,0.4042,0.4299,0.4570,0.4821,0.5077,0.5311,0.5540,0.5784,0.6010
+0.6219,0.6429,0.6633,0.6830,0.7023,0.7214,0.7403,0.7590,0.7786,0.7948
+0.8118,0.8288,0.8444,0.8587,0.8725,0.8842,0.8946,0.9044,0.9136,0.9208
+0.9264,0.9323,0.9377,0.9428,0.9472,0.9506,0.9541,0.9576,0.9602,0.9635
+0.9656,0.9675,0.9695,0.9715,0.9732,0.9751,0.9768,0.9777,0.9789,0.9802
+0.9809,0.9819,0.9828,0.9835,0.9841,0.9850,0.9858,0.9863,0.9866,0.9870
+0.9875,0.9880,0.9884,0.9888,0.9894,0.9899,0.9901,0.9905,0.9909,0.9912
+0.9917,0.9919,0.9922,0.9926,0.9931,0.9936,0.9941,0.9945,0.9951,0.9954
+0.9959,0.9962,0.9964,0.9967,0.9969,0.9971,0.9975,0.9978,0.9980,0.9983
+0.9986,0.9988,0.9991,0.9995,0.9998,0.9999,0.9999,0.9999,1.0000,1.0000
\ No newline at end of file
diff --git a/PARAM/SHMS/GEN/pcana.param b/PARAM/SHMS/GEN/pcana.param
new file mode 100644
index 0000000000000000000000000000000000000000..d58c0f932043f7bf4a6d48f35a01bb2de71af29b
--- /dev/null
+++ b/PARAM/SHMS/GEN/pcana.param
@@ -0,0 +1,19 @@
+; Parameters we need to keep THcHallCSpectrometer Happy
+p_recon_coeff_filename = ""
+
+ppartmass = 0.139
+phodo_num_planes = 1
+
+; Scintillator parameters
+pref_npaddles = 6
+pref_nsperchan = 0.1
+pref_offset = 0.0
+
+; Names of planes so that parameter names can be constructed
+pdc_plane_names = "1u1 1u2 1x1 1x2 1v1 1v2 2v2 2v1 2x2 2x1 2u2 2u1"
+
+; Compatibility parameters.  Should be zero to precisely mimic ENGINE
+; behavior, but one for more correct behavior
+pdc_fix_lr = 1 ; Let hit have different L/R assignment for different space point
+pdc_fix_propcorr = 1 ; do propagation along wire each time hit appeears
+                     ; in a space point
\ No newline at end of file
diff --git a/PARAM/SHMS/GEN/pdebug.param b/PARAM/SHMS/GEN/pdebug.param
new file mode 100644
index 0000000000000000000000000000000000000000..3e1149e0bdeff19cd00e8f9cdea9e79354095dd1
--- /dev/null
+++ b/PARAM/SHMS/GEN/pdebug.param
@@ -0,0 +1,8 @@
+; Debugging flags - not all these implemented in hcana
+pdebuglinkstubs = 0 ; Dump link stub results
+pdebugprintrawdc = 0 ; Dump PDC_RAW_DC bank
+pdebugprintdecodeddc = 0 ; Dump PDC_DECODED_DC bank
+pdebugflagpr = 0 ; Dump intermediate pattern recognition results
+pdebugflagstubs= 0 ; Dump stub fit results
+pdebugtrackprint = 0 ; Dump focal plane track fit results
+pdebugstubchisq = 0; Dump chi2 of left-right fits
\ No newline at end of file
diff --git a/PARAM/SHMS/GEN/ptracking.param b/PARAM/SHMS/GEN/ptracking.param
new file mode 100644
index 0000000000000000000000000000000000000000..1de167cf8c21af3d7c14a30534d43370bf8c5c6f
--- /dev/null
+++ b/PARAM/SHMS/GEN/ptracking.param
@@ -0,0 +1,36 @@
+; shms pattern recognition and tracking code parameters
+; pmax_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.
+
+; Tracking parameters
+  pmax_pr_hits = 25, 25
+
+; pminhit(i)   minimum number of hits in each space point (one for each chamber)
+pmin_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)
+pmin_combos = 6, 6
+; hspace_point_criterion(i) minimum separation of distinct space points
+; recommended value for hspace_point_criterion ( based on meeting
+; Feb 2003) 
+  pspace_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
+; maximum number of possible focal plane tracks, must be <= 20
+pntracks_max_fp = 10
+
+; The following four criteria are applied to the stub fit results at the
+; focal plane position to link stubs to tracks
+  pntracks_max_fp = 10
+  pxt_track_criterion = 100.0
+  pyt_track_criterion = 2.0
+  pxpt_track_criterion = 1.0
+  pypt_track_criterion = 1.0
+
+; Make a track of all single stubs normally 0
+  psingle_stub = 1 
+
+; No small angle approximation for cosmic ray tests
+  pSmallAngleApprox = 0
\ No newline at end of file
diff --git a/PARAM/SHMS/GEN/shmsflags.param b/PARAM/SHMS/GEN/shmsflags.param
new file mode 100644
index 0000000000000000000000000000000000000000..56ef41f56f18c84b9ac9aefaf73bbe94dd0fd773
--- /dev/null
+++ b/PARAM/SHMS/GEN/shmsflags.param
@@ -0,0 +1,28 @@
+
+; 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.
+
+pdelta_offset = 0.0
+ptheta_offset = 0.0
+pphi_offset = 0.0
+
+; 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.
+
+pthetacentral_offset = 0.0
+p_oopcentral_offset = 0.0
+ppcentral_offset = 0.0
+ppcentral = 0.0
+ptheta_lab = 0.0
+
+
diff --git a/PARAM/thms.param b/PARAM/TRIG/thms.param
similarity index 100%
rename from PARAM/thms.param
rename to PARAM/TRIG/thms.param
diff --git a/SCRIPTS/replay_hdc_test_stand.C b/SCRIPTS/HMS/replay_hdc_test_stand.C
similarity index 81%
rename from SCRIPTS/replay_hdc_test_stand.C
rename to SCRIPTS/HMS/replay_hdc_test_stand.C
index 7091d57b912720f1b00fe7bff4fe567e1eb7cd03..a8bfad8a019642ecc8ff89c740251f41175c3615 100644
--- a/SCRIPTS/replay_hdc_test_stand.C
+++ b/SCRIPTS/HMS/replay_hdc_test_stand.C
@@ -30,12 +30,12 @@ void replay_hdc_test_stand(Int_t RunNumber=0, Int_t MaxEvent=0) {
   gHcParms->Load(gHcParms->GetString("g_ctp_parm_filename"));
 
   // Load params for HMS DC test stand configuration
-  gHcParms->Load("PARAM/hdc_test_stand.param");
+  gHcParms->Load("PARAM/HMS/DC/hdc_test_stand.param");
 
   // Load the Hall C style detector map
   gHcDetectorMap = new THcDetectorMap();
   //gHcDetectorMap->Load(gHcParms->GetString("g_decode_map_filename"));
-  gHcDetectorMap->Load("MAPS/HMS/hdc.map");
+  gHcDetectorMap->Load("MAPS/HMS/DETEC/hdc.map");
 
   // Set up the equipment to be analyzed.
   THaApparatus* HMS = new THcHallCSpectrometer("H", "HMS");
@@ -43,6 +43,19 @@ void replay_hdc_test_stand(Int_t RunNumber=0, Int_t MaxEvent=0) {
   // Add HMS drift chambers
   HMS->AddDetector(new THcDC("dc", "Drift Chambers"));
 
+  // Additional detectors:
+  //HMS->AddDetector(new THcHodoscope("hod", "Hodoscope"));
+  //HMS->AddDetector(new THcShower("cal", "Shower"));
+  //
+  //THcCherenkov* cherenkov = new THcCherenkov("cher", "Gas Cerenkov");
+  //HMS->AddDetector(cherenkov);
+  //THcAerogel* aerogel = new THcAerogel("aero", "Aerogel Cerenkov");
+  //HMS->AddDetector(aerogel);
+  //
+  //THcScalerEvtHandler *hscaler = new THcScalerEvtHandler("HS", "HC scaler event type 0");
+  //hscaler->SetDebugFile("HScaler.txt");
+  //gHaEvtHandlers->Add(hscaler);
+
   // Set up the analyzer - we use the standard one,
   // but this could be an experiment-specific one as well.
   // The Analyzer controls the reading of the data, executes
@@ -77,8 +90,8 @@ void replay_hdc_test_stand(Int_t RunNumber=0, Int_t MaxEvent=0) {
  analyzer->SetEvent(event);
  analyzer->SetCrateMapFileName("MAPS/db_cratemap.dat");
  analyzer->SetOutFile(ROOTFileName.Data());
- analyzer->SetOdefFile("DEF-files/hdcana.def");
- analyzer->SetCutFile("DEF-files/hdcana_cuts.def");    // optional
+ analyzer->SetOdefFile("DEF-files/HMS/DC/hdcana.def");
+ analyzer->SetCutFile("DEF-files/HMS/DC/hdcana_cuts.def");    // optional
 
  // File to record cuts accounting information
  //analyzer->SetSummaryFile("summary_example.log");    // optional
diff --git a/SCRIPTS/replay_pdc_test_stand.C b/SCRIPTS/SHMS/replay_pdc_test_stand.C
similarity index 82%
rename from SCRIPTS/replay_pdc_test_stand.C
rename to SCRIPTS/SHMS/replay_pdc_test_stand.C
index 4f8fbafefc884fb2585abea5c6b6f4c3eb069f56..1cb393425eb347c0739dc288c9136ae66a120909 100644
--- a/SCRIPTS/replay_pdc_test_stand.C
+++ b/SCRIPTS/SHMS/replay_pdc_test_stand.C
@@ -31,7 +31,7 @@ void replay_pdc_test_stand(Int_t RunNumber=0, Int_t MaxEvent=0) {
 
   gHcDetectorMap = new THcDetectorMap();
   //gHcDetectorMap->Load(gHcParms->GetString("g_decode_map_filename"));
-  gHcDetectorMap->Load("MAPS/SHMS/pdc.map");
+  gHcDetectorMap->Load("MAPS/SHMS/DETEC/pdc.map");
 
   // Set up the equipment to be analyzed.
   THaApparatus* SHMS = new THcHallCSpectrometer("P", "SHMS");
@@ -40,6 +40,19 @@ void replay_pdc_test_stand(Int_t RunNumber=0, Int_t MaxEvent=0) {
   // Add SHMS drift chambers
   SHMS->AddDetector(new THcDC("dc", "Drift Chambers"));
 
+  // Additional detectors:
+  //HMS->AddDetector(new THcHodoscope("hod", "Hodoscope"));
+  //HMS->AddDetector(new THcShower("cal", "Shower"));
+  //
+  //THcCherenkov* cherenkov = new THcCherenkov("cher", "Gas Cerenkov");
+  //HMS->AddDetector(cherenkov);
+  //THcAerogel* aerogel = new THcAerogel("aero", "Aerogel Cerenkov");
+  //HMS->AddDetector(aerogel);
+  //
+  //THcScalerEvtHandler *hscaler = new THcScalerEvtHandler("HS", "HC scaler event type 0");
+  //hscaler->SetDebugFile("HScaler.txt");
+  //gHaEvtHandlers->Add(hscaler);
+
   // Set up the analyzer - we use the standard one,
   // but this could be an experiment-specific one as well.
   // The Analyzer controls the reading of the data, executes
@@ -74,8 +87,8 @@ void replay_pdc_test_stand(Int_t RunNumber=0, Int_t MaxEvent=0) {
  analyzer->SetEvent(event);
  analyzer->SetCrateMapFileName("MAPS/db_cratemap.dat");
  analyzer->SetOutFile(ROOTFileName.Data());
- analyzer->SetOdefFile("DEF-files/pdcana.def");
- analyzer->SetCutFile("DEF-files/pdcana_cuts.def");    // optional
+ analyzer->SetOdefFile("DEF-files/SHMS/DC/pdcana.def");
+ analyzer->SetCutFile("DEF-files/SHMS/DC/pdcana_cuts.def");    // optional
 
  // File to record cuts accounting information
  //analyzer->SetSummaryFile("summary_example.log");    // optional
diff --git a/SCRIPTS/hms.C b/SCRIPTS/hms.C
deleted file mode 100644
index 8ea818d21a6fdae7cd84983c6863ef6d12533464..0000000000000000000000000000000000000000
--- a/SCRIPTS/hms.C
+++ /dev/null
@@ -1,104 +0,0 @@
-void replay_hms(Int_t RunNumber=0, Int_t MaxEvent=0) {
-
-  //
-  //
- if(RunNumber == 0) {
-    cout << "Enter a Run Number (-1 to exit): ";
-    cin >> RunNumber;
-    if( RunNumber<=0 ) return;
-  }
-  if(MaxEvent == 0) {
-    cout << "\nNumber of Events to analyze: ";
-    cin >> MaxEvent;
-    if(MaxEvent == 0) {
-      cerr << "...Invalid entry\n";
-      exit;
-    }
-  }
-
-    const char* RunFileNamePattern="raw/test_%d.log.0";
-    const char* ROOTFileNamePattern = "ROOTfiles/hms1190_%d.root";
-    //
-  gHcParms->Define("gen_run_number", "Run Number", RunNumber);
-  gHcParms->AddString("g_ctp_database_filename", "DBASE/standard.database");
-
-  gHcParms->Load(gHcParms->GetString("g_ctp_database_filename"), RunNumber);
-
-  // g_ctp_parm_filename and g_decode_map_filename should now be defined
-
-  gHcParms->Load(gHcParms->GetString("g_ctp_kinematics_filename"), RunNumber);
-  gHcParms->Load(gHcParms->GetString("g_ctp_parm_filename"));
-
-
-
-  // Generate db_cratemap to correspond to map file contents
-  char command[100];
-  sprintf(command,"MAPS/make_cratemap.pl < %s > MAPS/db_cratemap.dat",gHcParms->GetString("g_decode_map_filename"));
-  system(command);
-
-  // Load the Hall C style detector map
-  gHcDetectorMap=new THcDetectorMap();
-  gHcDetectorMap->Load(gHcParms->GetString("g_decode_map_filename"));
-
-  // Set up the equipment to be analyzed.
-
-  THaApparatus* HMS = new THcHallCSpectrometer("H","HMS");
-  gHaApps->Add( HMS );
-
-  //  HMS->AddDetector( new THcHodoscope("hod", "Hodoscope" ));
-  //HMS->AddDetector( new THcShower("cal", "Shower" ));
-  //THcCherenkov* cherenkov = new THcCherenkov("cher", "Gas Cerenkov" );
-  // HMS->AddDetector( cherenkov );
-  HMS->AddDetector( new THcDC("dc", "Drift Chambers" ));
-  //THcAerogel* aerogel = new THcAerogel("aero", "Aerogel Cerenkov" );
-  //HMS->AddDetector( aerogel );
-  //
-  //THcScalerEvtHandler *hscaler = new THcScalerEvtHandler("HS","HC scaler event type 0");
-  //  hscaler->SetDebugFile("HScaler.txt");
-  //gHaEvtHandlers->Add (hscaler);
-  //
-   //
-
-
-  // Set up the analyzer - we use the standard one,
-  // but this could be an experiment-specific one as well.
-  // The Analyzer controls the reading of the data, executes
-  // tests/cuts, loops over Acpparatus's and PhysicsModules,
-  // and executes the output routines.
-  THcAnalyzer* analyzer = new THcAnalyzer;
-
-
-  // A simple event class to be output to the resulting tree.
-  // Creating your own descendant of THaEvent is one way of
-  // defining and controlling the output.
-  THaEvent* event = new THaEvent;
-
-  // Define the run(s) that we want to analyze.
-  // We just set up one, but this could be many.
-  char RunFileName[100];
-  sprintf(RunFileName,RunFileNamePattern,RunNumber);
-  THaRun* run = new THaRun(RunFileName);
-
-  // Eventually need to learn to skip over, or properly analyze
-  // the pedestal events
-  run->SetEventRange(1,MaxEvent);//  Physics Event number, does not
-                                // include scaler or control events
-  run->SetNscan(1);
-  run->SetDataRequired(0x7);
-  run->Print();
-
-  // Define the analysis parameters
-  analyzer->SetCountMode( 2 ); // 0 = counter is # of physics triggers
-			       //1 = counter is # of all decode reads
-                               //2= counter is event number
-  analyzer->SetEvent( event );
-  analyzer->SetOutFile( ROOTFileName.Data() );
-  analyzer->SetOdefFile("Def-files/hdana.def");
-  analyzer->SetCutFile("Def-files/hdana_cuts.def");        // optional
-
-  // File to record cuts accounting information
-  //  analyzer->SetSummaryFile("summary_example.log"); // optional
-
-  analyzer->Process(run);     // start the actual analysis
-  analyzer->PrintReport("TEMPLATES/report.template",Form("REPORT_OUTPUT/replay_both_%05d.report",RunNumber));
-}
diff --git a/SCRIPTS/replay_hms.C b/SCRIPTS/replay_hms.C
deleted file mode 100644
index 6addf57afb90299ba13d80673042dd72edf48255..0000000000000000000000000000000000000000
--- a/SCRIPTS/replay_hms.C
+++ /dev/null
@@ -1,119 +0,0 @@
-void replay_hms(Int_t RunNumber=0, Int_t MaxEvent=0) {
-
-  // Get RunNumber and MaxEvent if not provided.
-  if(RunNumber == 0) {
-    cout << "Enter a Run Number (-1 to exit): ";
-    cin >> RunNumber;
-    if( RunNumber<=0 ) return;
-  }
-  if(MaxEvent == 0) {
-    cout << "\nNumber of Events to analyze: ";
-    cin >> MaxEvent;
-    if(MaxEvent == 0) {
-      cerr << "...Invalid entry\n";
-      exit;
-    }
-  }
-
-  // Create file name patterns.
-  const char* RunFileNamePattern = "raw/test_%d.dat";
-  const char* ROOTFileNamePattern = "ROOTfiles/test_%d.root";
-  // Add variables to global list.
-  gHcParms->Define("gen_run_number", "Run Number", RunNumber);
-  gHcParms->AddString("g_ctp_database_filename", "DBASE/standard.database");
-
-  // Load varibles from files to global list.
-  gHcParms->Load(gHcParms->GetString("g_ctp_database_filename"), RunNumber);
-
-  // g_ctp_parm_filename and g_decode_map_filename should now be defined.
-  gHcParms->Load(gHcParms->GetString("g_ctp_kinematics_filename"), RunNumber);
-  gHcParms->Load(gHcParms->GetString("g_ctp_parm_filename"));
-
-  // Load params for HMS DC test stand configuration
-  gHcParms->Load("PARAM/hdc_test_stand.param");
-
-  // Generate db_cratemap to correspond to map file contents via Pearl script.
-  //char command[100];
-  //sprintf(
-  //  command,
-  //  "MAPS/make_cratemap.pl < %s > MAPS/db_cratemap.dat",
-  //  gHcParms->GetString("g_decode_map_filename")
-  //);
-  //system(command);
-  // Load the Hall C style detector map
-  gHcDetectorMap = new THcDetectorMap();
-  gHcDetectorMap->Load(gHcParms->GetString("g_decode_map_filename"));
-
-
-  // Set up the equipment to be analyzed.
-  THaApparatus* HMS = new THcHallCSpectrometer("H", "HMS");
-  gHaApps->Add(HMS);
-
-  HMS->AddDetector(new THcDC("dc", "Drift Chambers"));
-
-  // Additional detectors:
-  //HMS->AddDetector(new THcHodoscope("hod", "Hodoscope"));
-  //HMS->AddDetector(new THcShower("cal", "Shower"));
-  //
-  //THcCherenkov* cherenkov = new THcCherenkov("cher", "Gas Cerenkov");
-  //HMS->AddDetector(cherenkov);
-  //THcAerogel* aerogel = new THcAerogel("aero", "Aerogel Cerenkov");
-  //HMS->AddDetector(aerogel);
-  //
-  //THcScalerEvtHandler *hscaler = new THcScalerEvtHandler("HS", "HC scaler event type 0");
-  //hscaler->SetDebugFile("HScaler.txt");
-  //gHaEvtHandlers->Add(hscaler);
-
-
-  // Set up the analyzer - we use the standard one,
-  // but this could be an experiment-specific one as well.
-  // The Analyzer controls the reading of the data, executes
-  // tests/cuts, loops over Acpparatus's and PhysicsModules,
-  // and executes the output routines.
-  THcAnalyzer* analyzer = new THcAnalyzer;
-
-  // A simple event class to be output to the resulting tree.
-  // Creating your own descendant of THaEvent is one way of
-  // defining and controlling the output.
-  THaEvent* event = new THaEvent;
-
-  // Define the run(s) that we want to analyze.
-  // We just set up one, but this could be many.
-  char RunFileName[100];
-  sprintf(RunFileName, RunFileNamePattern, RunNumber);
-  THaRun* run = new THaRun(RunFileName);
-
-  // Eventually need to learn to skip over, or properly analyze
-  // the pedestal events
-  run->SetEventRange(1, MaxEvent);    // Physics Event number, does not
-                                      // include scaler or control events.
-  run->SetNscan(1);
-  run->SetDataRequired(0x7);
-  run->Print();
-
-  // Define the analysis parameters
-  TString ROOTFileName = Form(ROOTFileNamePattern, RunNumber);
-  analyzer->SetCountMode(2);    // 0 = counter is # of physics triggers
-                                // 1 = counter is # of all decode reads
-                                // 2 = counter is event number
- analyzer->SetEvent(event);
- analyzer->SetCrateMapFileName("MAPS/db_cratemap.dat");
- analyzer->SetOutFile(ROOTFileName.Data());
-
- // analyzer->SetOdefFile("DEF-files/hdcana.def");
- // analyzer->SetCutFile("DEF-files/hdcana_cuts.def");    // optional
-
- analyzer->SetOdefFile("DEF-files/pdcana.def");
- analyzer->SetCutFile("DEF-files/pdcana_cuts.def");    // optional
-
- // File to record cuts accounting information
- //analyzer->SetSummaryFile("summary_example.log");    // optional
-
-  // Start the actual analysis.
-  analyzer->Process(run);
-  // Create report file from template.
-  //analyzer->PrintReport(    // optional
-  //  "TEMPLATES/dcana.template",
-  //  Form("REPORT_OUTPUT/replay_hms_%05d.report", RunNumber)
-  //);
-}