diff --git a/examples/DBASE/test.database b/examples/DBASE/test.database
index d4dae4a85cabfb629f2db613651b56e8804371cb..027c0b474883f86d25b3ae3525fc74f4aa22ec2d 100644
--- a/examples/DBASE/test.database
+++ b/examples/DBASE/test.database
@@ -6,6 +6,8 @@ g_decode_map_filename="MAPS/jun04.map"
 gpbeam    = 4.015
 hpcentral = 2.074
 htheta_lab = 10.99
+spcentral = 1.73
+stheta_lab = -32.32
 hpartmass = 0.13957
 52949
 g_ctp_parm_filename="PARAM/52949/general.param"
diff --git a/examples/PARAM/general.param b/examples/PARAM/general.param
index cd56bb35a271318259ba8474180a965b61431590..2b22217eda85e35a6cd3dca9e8cc11c2a733c521 100644
--- a/examples/PARAM/general.param
+++ b/examples/PARAM/general.param
@@ -28,4 +28,7 @@ raddeg=3.14159265/180
 #include "PARAM/hdriftmap.param"
 #include "PARAM/hcal.param"
 #include "PARAM/hcer.param"
-
+#include "PARAM/shodo.param"
+#include "PARAM/scal.param"
+#include "PARAM/sdc.param"
+#include "PARAM/sdriftmap.param"
diff --git a/examples/PARAM/hcana.param b/examples/PARAM/hcana.param
index 1f9e393f0b67fed0ccc4079beadd84ae881bd61b..47b4766b5526cbf1fd9f0da9393347d6fe98188a 100644
--- a/examples/PARAM/hcana.param
+++ b/examples/PARAM/hcana.param
@@ -4,6 +4,7 @@
 ;
 
 hhodo_num_planes = 4
+hhodo_plane_names = "1x 1y 2x 2y"
 
 hcal_num_layers = 4
 
@@ -16,18 +17,15 @@ hcal_b_cor = 8000.
 hcal_c_cor = 64.36
 hcal_d_cor = 1.66
 
+hcal_layer_names = "1pr 2ta 3ta 4ta"
+
 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"
-
 # The following were defined in REPLAY.PARAM
 h_recon_coeff_filename =    'PARAM/hms_recon_coeff.dat'  ;hms optics matrix
-s_recon_coeff_filename =    'PARAM/sos_recon_coeff.dat'  ;sos optics matrix
 
 # The following are set to zero to replicate historical ENGINE behavior
 # For new analyses they should be set to 1.  If not defined here,
@@ -39,3 +37,43 @@ hdc_fix_lr = 0
 # If 1, don't do the the propagation along the wire each time the hit
 # appears in a space point.  (Which means the correction accumulates)
 hdc_fix_propcorr = 0
+
+# SOS parameters
+shodo_num_planes = 4
+shodo_plane_names = "1x 1y 2x 2y"
+
+scal_num_layers = 4
+
+# Exclusion band width for the calorimeter's fiducial volume.
+# (saw) Don't know what this should be.  Copied it from HMS.
+scal_fv_delta = 5.
+
+# Constants for the coordiante correction of the calorimeter energy depositions
+# (saw) Copied from HMS
+scal_a_cor = 200.
+scal_b_cor = 8000.
+scal_c_cor = 64.36
+scal_d_cor = 1.66
+
+scal_layer_names = "1pr 2ta 3ta 4ta"
+
+# Names of planes so that parameter names can be constructed
+sdc_plane_names = "1u1 1u2 1x1 1x2 1v1 1v2 2u1 2u2 2x1 2x2 2v1 2v2"
+
+# The following were defined in REPLAY.PARAM
+s_recon_coeff_filename =    'PARAM/sos_recon_coeff.dat'  ;sos optics matrix
+
+# Fortran ENGINE only had this as a parameter for HMS.  Need it here
+# because same code used for both spectrometers
+sntracks_max_fp = 10
+
+# The following are set to zero to replicate historical ENGINE behavior
+# For new analyses they should be set to 1.  If not defined here,
+# hcana will default 1, the new and correct behaviour.
+
+# If 1, Let a hit have different L/R assignment for different space points
+# instead of L/R assignment from first sp it appears in.
+sdc_fix_lr = 0
+# If 1, don't do the the propagation along the wire each time the hit
+# appears in a space point.  (Which means the correction accumulates)
+sdc_fix_propcorr = 0
diff --git a/examples/db_run.dat b/examples/db_run.dat
index 3cdedabfb33489f3c1d36bf5614ba103c0539e3d..cf6548c4ee580df5f2a25efd659b1c4afbe46f16 100755
--- a/examples/db_run.dat
+++ b/examples/db_run.dat
@@ -7,5 +7,6 @@
 ebeam           = 4.02187
 H.theta         = 19.99
 H.pcentral      = 2.074
-
+S.theta         = -32.32
+S.pcentral      = 1.73
 
diff --git a/examples/hodtest.C b/examples/hodtest.C
index b15f5298ddbdcd0a4f614e8642a8f7b71f9e7b73..dcf776a5d6a3e067cd6d3eb4296829624ed51cf0 100644
--- a/examples/hodtest.C
+++ b/examples/hodtest.C
@@ -44,6 +44,13 @@
   THcCherenkov* cherenkov = new THcCherenkov("cher", "Gas Cerenkov" );
   HMS->AddDetector( cherenkov );
 
+  THaApparatus* SOS = new THcHallCSpectrometer("S","SOS");
+  gHaApps->Add( SOS );
+  // Add detectors
+  SOS->AddDetector( new THcHodoscope("hod", "Hodoscope" ));
+  SOS->AddDetector( new THcShower("cal", "Shower" ));
+  SOS->AddDetector( new THcDC("dc", "Drift Chambers" ));
+
   // 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
diff --git a/examples/output.def b/examples/output.def
index 71d516fb5510b038677b300c0f1edd6e499866b8..da415c882be6917b54355d30565d7c7da28644a9 100644
--- a/examples/output.def
+++ b/examples/output.def
@@ -6,6 +6,9 @@ block H.cal.*
 block H.aero.*
 block H.cher.*
 block H.tr.*
+block S.dc.*
+block S.hod.*
+block S.cal.*
 block g.evtyp
 
 # TDC hits per paddle
diff --git a/src/THcDC.cxx b/src/THcDC.cxx
index 9f6cfdae4012bae1b1656b8230499358b3e38348..2342ead8ef47377e38f266f1b0d537494aa94b82 100644
--- a/src/THcDC.cxx
+++ b/src/THcDC.cxx
@@ -68,6 +68,7 @@ THcDC::THcDC(
   // replicate historical ENGINE behavior
   fFixLR = 1;
   fFixPropagationCorrection = 1;
+  fProjectToChamber = 0;  // Use 1 for SOS chambers
 
   fDCTracks = new TClonesArray( "THcDCTrack", 20 );
 }
@@ -88,6 +89,14 @@ void THcDC::Setup(const char* name, const char* description)
     fPrefix[0]='\0';
   }
 
+  // For now, decide chamber style from the spectrometer name.
+  // Should override with a paramter
+  if(fPrefix[0]=='h') {
+    fHMSStyleChambers = 1;
+  } else {
+    fHMSStyleChambers = 0;
+  }
+
   string planenamelist;
   DBRequest list[]={
     {"dc_num_planes",&fNPlanes, kInt},
@@ -247,7 +256,7 @@ Int_t THcDC::ReadDatabase( const TDatime& date )
 
   delete [] fTdcWinMin;  fTdcWinMin = new Int_t [fNPlanes];
   delete [] fTdcWinMax;  fTdcWinMax = new Int_t [fNPlanes];
-  delete [] fCentralTime;  fCentralTime = new Int_t [fNPlanes];
+  delete [] fCentralTime;  fCentralTime = new Double_t [fNPlanes];
   delete [] fNWires;  fNWires = new Int_t [fNPlanes];
   delete [] fNChamber;  fNChamber = new Int_t [fNPlanes]; // Which chamber is this plane
   delete [] fWireOrder;  fWireOrder = new Int_t [fNPlanes]; // Wire readout order
@@ -275,7 +284,7 @@ Int_t THcDC::ReadDatabase( const TDatime& date )
 
     {"dc_tdc_min_win", fTdcWinMin, kInt, fNPlanes},
     {"dc_tdc_max_win", fTdcWinMax, kInt, fNPlanes},
-    {"dc_central_time", fCentralTime, kInt, fNPlanes},
+    {"dc_central_time", fCentralTime, kDouble, fNPlanes},
     {"dc_nrwire", fNWires, kInt, fNPlanes},
     {"dc_chamber_planes", fNChamber, kInt, fNPlanes},
     {"dc_wire_counting", fWireOrder, kInt, fNPlanes},
@@ -526,6 +535,7 @@ Int_t THcDC::FineTrack( TClonesArray& tracks )
 
   return 0;
 }
+//_____________________________________________________________________________
 void THcDC::LinkStubs()
 {
   //     The logic is
@@ -593,7 +603,18 @@ void THcDC::LinkStubs()
 	    Double_t *spstub1=sp1->GetStubP();
 	    Double_t *spstub2=sp2->GetStubP();
 	    Double_t dposx = spstub1[0] - spstub2[0];
-	    Double_t dposy = spstub1[1] - spstub2[1];
+	    Double_t dposy;
+	    if(fProjectToChamber) { // From SOS s_link_stubs
+	      // Since single chamber resolution is ~50mr, and the maximum y`
+	      // angle is about 30mr, use differenece between y AT CHAMBERS, rather
+	      // than at focal plane.  (Project back to chamber, to take out y' uncertainty)
+	      // (Should this be done for SHMS and HMS too?)
+	      Double_t y1=spstub1[1]+fChambers[sp1->fNChamber]->GetZPos()*spstub1[3];
+	      Double_t y2=spstub2[1]+fChambers[sp2->fNChamber]->GetZPos()*spstub2[3];
+	      dposy = y1-y2;
+	    } else {
+	      dposy = spstub1[1] - spstub2[1];
+	    }
 	    Double_t dposxp = spstub1[2] - spstub2[2];
 	    Double_t dposyp = spstub1[3] - spstub2[3];
 	      
@@ -715,9 +736,10 @@ void THcDC::LinkStubs()
   if (fdebuglinkstubs) cout << " End Linkstubs Found " << fNDCTracks << " tracks"<<endl;
 }
 
-// Primary track fitting routine
+//_____________________________________________________________________________
 void THcDC::TrackFit()
 {
+  // Primary track fitting routine
 
   // Number of ray parameters in focal plane.
   const Int_t raycoeffmap[]={4,5,2,3};
diff --git a/src/THcDC.h b/src/THcDC.h
index fb727a90d1464724bf662b328331161f78bf9493..a8d0bfb5af9d0010b38454db12a2a89639ce2de6 100644
--- a/src/THcDC.h
+++ b/src/THcDC.h
@@ -78,6 +78,7 @@ protected:
   Int_t fdebuglinkstubs;
   Int_t fdebugprintdecodeddc;
   Int_t fdebugtrackprint;
+  Int_t fHMSStyleChambers;
 
   Int_t fNDCTracks;
   TClonesArray* fDCTracks;     // Tracks found from stubs (THcDCTrack obj)
@@ -94,6 +95,9 @@ protected:
                                 // propagation along the wire correction for
                                 // each space point a hit occurs in.  Keep a
                                 // separate correction for each space point.
+  Int_t fProjectToChamber;	// If 1, project y position each stub back to it's own
+                                // chamber before comparing y positions in LinkStubs
+                                // Was used for SOS in ENGINE.
 
   // Per-event data
   Int_t fNhits;
@@ -122,7 +126,7 @@ protected:
   // its plane number.  Should we have a Get method for each or 
   Int_t* fTdcWinMin;
   Int_t* fTdcWinMax;
-  Int_t* fCentralTime;
+  Double_t* fCentralTime;
   Int_t* fNWires;		// Number of wires per plane
   Int_t* fNChamber;
   Int_t* fWireOrder;
diff --git a/src/THcDriftChamber.cxx b/src/THcDriftChamber.cxx
index 8c4c7543db1b156b8858cc17dc574bae6a718578..1140b38e6a33918068e1f46e1464209e8488ec98 100644
--- a/src/THcDriftChamber.cxx
+++ b/src/THcDriftChamber.cxx
@@ -65,6 +65,14 @@ void THcDriftChamber::Setup(const char* name, const char* description)
   prefix[0]=tolower(app->GetName()[0]);
   prefix[1]='\0';
 
+  // For now, decide chamber style from the spectrometer name.
+  // Should override with a paramter
+  if(prefix[0]=='h') {
+    fHMSStyleChambers = 1;
+  } else {
+    fHMSStyleChambers = 0;
+  }
+
 }
 
 //_____________________________________________________________________________
@@ -132,13 +140,16 @@ Int_t THcDriftChamber::ReadDatabase( const TDatime& date )
   prefix[0]=tolower(GetApparatus()->GetName()[0]);
   prefix[1]='\0';
   DBRequest list[]={
-    {"_remove_sppt_if_one_y_plane",&fRemove_Sppt_If_One_YPlane, kInt},
+    {"_remove_sppt_if_one_y_plane",&fRemove_Sppt_If_One_YPlane, kInt,0,1},
     {"dc_wire_velocity", &fWireVelocity, kDouble},
     {"SmallAngleApprox", &fSmallAngleApprox, kInt},
-    {"stub_max_xpdiff", &fStubMaxXPDiff, kDouble},
+    {"stub_max_xpdiff", &fStubMaxXPDiff, kDouble,0,1},
     {"debugflagpr", &fhdebugflagpr, kDouble},
+    {Form("dc_%d_zpos",fChamberNum), &fZPos, kDouble},
     {0}
   };
+  fRemove_Sppt_If_One_YPlane = 0; // Default
+  fStubMaxXPDiff = 0.05;	  // The HMS default.  Not used for SOS.
   gHcParms->LoadParmValues((DBRequest*)&list,prefix);
 
   // Get parameters parent knows about
@@ -303,16 +314,18 @@ Int_t THcDriftChamber::FindSpacePoints( void )
     // We have our space points for this chamber
         if (fhdebugflagpr) cout << fNSpacePoints << " Space Points found" << endl;
     if(fNSpacePoints > 0) {
-      if(fRemove_Sppt_If_One_YPlane == 1) {
-	// The routine is specific to HMS
-	Int_t ndest=DestroyPoorSpacePoints();
-       	if (fhdebugflagpr) cout << ndest << " Poor space points destroyed" << " # of space points = " << fNSpacePoints << endl;
-	// Loop over space points and remove those with less than 4 planes
-	// hit and missing hits in Y,Y' planes
+      if(fHMSStyleChambers) {
+	if(fRemove_Sppt_If_One_YPlane == 1) {
+	  // The routine is specific to HMS
+	  Int_t ndest=DestroyPoorSpacePoints(); // Only for HMS?
+	  if (fhdebugflagpr) cout << ndest << " Poor space points destroyed" << " # of space points = " << fNSpacePoints << endl;
+	  // Loop over space points and remove those with less than 4 planes
+	  // hit and missing hits in Y,Y' planes
+	}
+	//      if(fNSpacePoints == 0) if (fhdebugflagpr) cout << "DestroyPoorSpacePoints() killed SP" << endl;
+	Int_t nadded=SpacePointMultiWire(); // Only for HMS?
+	if (nadded) if (fhdebugflagpr) cout << nadded << " Space Points added with SpacePointMultiWire()" << endl;
       }
-      //      if(fNSpacePoints == 0) if (fhdebugflagpr) cout << "DestroyPoorSpacePoints() killed SP" << endl;
-      Int_t nadded=SpacePointMultiWire();
-      if (nadded) if (fhdebugflagpr) cout << nadded << " Space Points added with SpacePointMultiWire()" << endl;
       ChooseSingleHit();
        	if (fhdebugflagpr) cout << " After choose single hit " << " # of space points = " << fNSpacePoints << endl;
       SelectSpacePoints();
@@ -793,7 +806,7 @@ Int_t THcDriftChamber::SpacePointMultiWire()
 }
 
 //_____________________________________________________________________________
-// HMS Specific?
+// Generic
 void THcDriftChamber::ChooseSingleHit()
 {
   // Look at all hits in a space point.  If two hits are in the same plane,
@@ -955,7 +968,6 @@ UInt_t THcDriftChamber::Count1Bits(UInt_t x)
 }
 
 //_____________________________________________________________________________
-// HMS Specific
 void THcDriftChamber::LeftRight()
 {
   // For each space point,
@@ -999,20 +1011,47 @@ void THcDriftChamber::LeftRight()
       if(pindex == YPlanePInd) hasy2 = ihit;
     }
     nplusminus = 1<<nhits;
-    Int_t smallAngOK = (hasy1>=0) && (hasy2>=0);
-    if(fSmallAngleApprox !=0 && smallAngOK) { // to small Angle L/R for Y,Y' planes
-      if(sp->GetHit(hasy2)->GetPos() <=
-	 sp->GetHit(hasy1)->GetPos()) {
-	plusminusknown[hasy1] = -1;
-	plusminusknown[hasy2] = 1;
-      } else {
-	plusminusknown[hasy1] = 1;
-	plusminusknown[hasy2] = -1;
+    if(fHMSStyleChambers) {
+      Int_t smallAngOK = (hasy1>=0) && (hasy2>=0);
+      if(fSmallAngleApprox !=0 && smallAngOK) { // to small Angle L/R for Y,Y' planes
+	if(sp->GetHit(hasy2)->GetPos() <=
+	   sp->GetHit(hasy1)->GetPos()) {
+	  plusminusknown[hasy1] = -1;
+	  plusminusknown[hasy2] = 1;
+	} else {
+	  plusminusknown[hasy1] = 1;
+	  plusminusknown[hasy2] = -1;
+	}
+	nplusminus = 1<<(nhits-2);
+	if (fhdebugflagpr) cout << " Small angle approx = " << smallAngOK << " " << plusminusknown[hasy1] << endl;
+	if (fhdebugflagpr) cout << "pm =  " << plusminusknown[hasy2] << " " << hasy1 << " " << hasy2 << endl;
+	if (fhdebugflagpr) cout << " Plane index " << YPlaneInd << " " << YPlanePInd << endl;
+      }
+    } else {			// SOS Style
+      if(fSmallAngleApprox !=0) {
+	// Brookhaven style chamber L/R code
+	Int_t npaired=0;
+	for(Int_t ihit1=0;ihit1 < nhits;ihit1++) {
+	  THcDCHit* hit1 = sp->GetHit(ihit1);
+	  Int_t pindex1=hit1->GetPlaneIndex();
+	  if(pindex1==0) { // Odd plane (or even index)
+	    for(Int_t ihit2=0;ihit2<nhits;ihit2++) {
+	      THcDCHit* hit2 = sp->GetHit(ihit2);
+	      if(hit2->GetPlaneIndex()-pindex1 == 1) { // Adjacent plane
+		if(hit2->GetWireNum() <= hit1->GetWireNum()) {
+		  plusminusknown[ihit1] = -1;
+		  plusminusknown[ihit2] = 1;
+		} else {
+		  plusminusknown[ihit1] = 1;
+		  plusminusknown[ihit2] = -1;
+		}
+		npaired+=2;
+	      }
+	    }
+	  }
+	}
+	nplusminus = 1 << (nhits-npaired);
       }
-      nplusminus = 1<<(nhits-2);
-      if (fhdebugflagpr) cout << " Small angle approx = " << smallAngOK << " " << plusminusknown[hasy1] << endl;
-      if (fhdebugflagpr) cout << "pm =  " << plusminusknown[hasy2] << " " << hasy1 << " " << hasy2 << endl;
-      if (fhdebugflagpr) cout << " Plane index " << YPlaneInd << " " << YPlanePInd << endl;
     }
     if(nhits < 2) {
       if (fhdebugflagpr) cout << "THcDriftChamber::LeftRight: numhits-2 < 0" << endl;
@@ -1041,22 +1080,39 @@ void THcDriftChamber::LeftRight()
       if (nplaneshit >= fNPlanes-1) {
 	Double_t chi2 = FindStub(nhits, sp,
 				     plane_list, bitpat, plusminus, stub);
-				     
-	//if(debugging)
-	// Take best chi2 IF x' of the stub agrees with x' as expected from x.
-	// Sometimes an incorrect x' gives a good chi2 for the stub, even though it is
-	// not the correct left/right combination for the real track.
-	// Rotate x'(=stub(3)) to hut coordinates and compare to x' expected from x.
-	// THIS ASSUMES STANDARD HMS TUNE!!!!, for which x' is approx. x/875.
 	if(chi2 < minchi2) {
-	  if(stub[2]*fTanBeta[plane_list[0]]==-1.0) {
-	    if (fhdebugflagpr) cout << "THcDriftChamber::LeftRight() Error 3" << endl;
-	  }
-	  Double_t xp_fit=stub[2]-fTanBeta[plane_list[0]]
-	    /(1+stub[2]*fTanBeta[plane_list[0]]);
-	  // Tune depdendent.  Definitely HMS specific
-	  Double_t xp_expect = sp->GetX()/875.0;
-	  if(TMath::Abs(xp_fit-xp_expect)<fStubMaxXPDiff) {
+	  if(fHMSStyleChambers) { // Perhaps a different flag here
+	    // Take best chi2 IF x' of the stub agrees with x' as expected from x.
+	    // Sometimes an incorrect x' gives a good chi2 for the stub, even though it is
+	    // not the correct left/right combination for the real track.
+	    // Rotate x'(=stub(3)) to hut coordinates and compare to x' expected from x.
+	    // THIS ASSUMES STANDARD HMS TUNE!!!!, for which x' is approx. x/875.
+	    if(stub[2]*fTanBeta[plane_list[0]]==-1.0) {
+	      if (fhdebugflagpr) cout << "THcDriftChamber::LeftRight() Error 3" << endl;
+	    }
+	    Double_t xp_fit=stub[2]-fTanBeta[plane_list[0]]
+	      /(1+stub[2]*fTanBeta[plane_list[0]]);
+	    // Tune depdendent.  Definitely HMS specific
+	    Double_t xp_expect = sp->GetX()/875.0;
+	    if(TMath::Abs(xp_fit-xp_expect)<fStubMaxXPDiff) {
+	      minchi2 = chi2;
+	      for(Int_t ihit=0;ihit<nhits;ihit++) {
+		plusminusbest[ihit] = plusminus[ihit];
+	      }
+	      Double_t *spstub = sp->GetStubP();
+	      for(Int_t i=0;i<4;i++) {
+		spstub[i] = stub[i];
+	      }
+	    } else {		// Record best stub failing angle cut
+	      tmp_minchi2 = chi2;
+	      for(Int_t ihit=0;ihit<nhits;ihit++) {
+		tmp_plusminus[ihit] = plusminus[ihit];
+	      }
+	      for(Int_t i=0;i<4;i++) {
+		tmp_stub[i] = stub[i];
+	      }
+	    }
+	  } else { // Not HMS specific
 	    minchi2 = chi2;
 	    for(Int_t ihit=0;ihit<nhits;ihit++) {
 	      plusminusbest[ihit] = plusminus[ihit];
@@ -1065,17 +1121,9 @@ void THcDriftChamber::LeftRight()
 	    for(Int_t i=0;i<4;i++) {
 	      spstub[i] = stub[i];
 	    }
-	  } else {		// Record best stub failing angle cut
-	    tmp_minchi2 = chi2;
-	    for(Int_t ihit=0;ihit<nhits;ihit++) {
-	      tmp_plusminus[ihit] = plusminus[ihit];
-	    }
-	    for(Int_t i=0;i<4;i++) {
-	      tmp_stub[i] = stub[i];
-	    }
 	  }
 	}
-      } else if (nplaneshit >= fNPlanes-2) { // Two planes missing
+      } else if (nplaneshit >= fNPlanes-2 && !fHMSStyleChambers) { // Two planes missing
 	Double_t chi2 = FindStub(nhits, sp,
 				     plane_list, bitpat, plusminus, stub); 
 	//if(debugging)
@@ -1147,19 +1195,21 @@ void THcDriftChamber::LeftRight()
       }
   // Option to print stubs
 }
-    //    if(fAA3Inv.find(bitpat) != fAAInv.end()) { // Valid hit combination
 //_____________________________________________________________________________
 Double_t THcDriftChamber::FindStub(Int_t nhits, THcSpacePoint *sp,
 				       Int_t* plane_list, UInt_t bitpat,
 				       Int_t* plusminus, Double_t* stub)
 {
   // For a given combination of L/R, fit a stub to the space point
+  // This method does a linear least squares fit of a line to the
+  // hits in an individual chamber.  It assumes that the y slope is 0 
+  // The wire coordinate is calculated by
+  //          wire center + plusminus*(drift distance).
+  // Method is called in a loop over all combinations of plusminus
   Double_t zeros[] = {0.0,0.0,0.0};
-  TVectorD TT; TT.Use(3, zeros);
-  TVectorD dstub; dstub.Use(3, zeros);
+  TVectorD TT; TT.Use(3, zeros); // X, X', Y
   Double_t dpos[nhits];
 
-  // This isn't right.  dpos only goes up to 2.
   for(Int_t ihit=0;ihit<nhits; ihit++) {
     dpos[ihit] = sp->GetHit(ihit)->GetPos()
       + plusminus[ihit]*sp->GetHit(ihit)->GetDist()
@@ -1173,10 +1223,8 @@ Double_t THcDriftChamber::FindStub(Int_t nhits, THcSpacePoint *sp,
   //  if (fhdebugflagpr) cout << TT[0] << " " << TT[1] << " " << TT[2] << endl;
   //  TT->Print();
 
-  //dstub = *(fAA3Inv[bitpat]) * TT;
   TT *= *fAA3Inv[bitpat];
   // if (fhdebugflagpr) cout << TT[0] << " " << TT[1] << " " << TT[2] << endl;
- //  if (fhdebugflagpr) cout << dstub[0] << " " << dstub[1] << " " << dstub[2] << endl;
 
   // Calculate Chi2.  Remember one power of sigma is in fStubCoefs
   stub[0] = TT[0];
diff --git a/src/THcDriftChamber.h b/src/THcDriftChamber.h
index 33eb2458d2d7274240a4ba6397d035e90d1a4e0a..0bae60a352f3a1d14383d49f738b219a75c7dd03 100644
--- a/src/THcDriftChamber.h
+++ b/src/THcDriftChamber.h
@@ -50,6 +50,7 @@ public:
   const TClonesArray* GetTrackHits() const { return fTrackProj; }
   TClonesArray* GetSpacePointsP() const { return(fSpacePoints);}
   Int_t GetChamberNum() const { return fChamberNum;}
+  Double_t GetZPos() const {return fZPos;}
   //  friend class THaScCalib;
 
   THcDriftChamber();  // for ROOT I/O // Why do we need this?
@@ -80,7 +81,9 @@ protected:
   Int_t fSmallAngleApprox;
   Double_t fStubMaxXPDiff;
   Int_t fFixPropagationCorrection;
+  Int_t fHMSStyleChambers;
   Int_t fhdebugflagpr;
+  Double_t fZPos;
   Double_t fXCenter;
   Double_t fYCenter;
   Double_t fSpacePointCriterion;
diff --git a/src/THcHodoscope.cxx b/src/THcHodoscope.cxx
index a0e10ef80e3f0b41def4b55085d1867ffdf19a73..da37a7f4a0c7476093714a8d538cc2632cdc2bfa 100644
--- a/src/THcHodoscope.cxx
+++ b/src/THcHodoscope.cxx
@@ -405,21 +405,22 @@ Int_t THcHodoscope::ReadDatabase( const TDatime& date )
     {"hodo_neg_time_offset",&fHodoNegTimeOffset[0],kDouble,fMaxHodoScin},
     {"hodo_pos_ped_limit",&fHodoPosPedLimit[0],kInt,fMaxHodoScin},
     {"hodo_neg_ped_limit",&fHodoNegPedLimit[0],kInt,fMaxHodoScin},
-    {"tofusinginvadc",&fTofUsingInvAdc,kInt},
+    {"tofusinginvadc",&fTofUsingInvAdc,kInt,0,1},
     {0}
   };
+  fTofUsingInvAdc = 0;		// Default if not defined
   gHcParms->LoadParmValues((DBRequest*)&list,prefix);
   if (fTofUsingInvAdc) {
-  DBRequest list2[]={
-    {"hodo_pos_invadc_offset",&fHodoPosInvAdcOffset[0],kDouble,fMaxHodoScin},
-    {"hodo_neg_invadc_offset",&fHodoNegInvAdcOffset[0],kDouble,fMaxHodoScin},
-    {"hodo_pos_invadc_linear",&fHodoPosInvAdcLinear[0],kDouble,fMaxHodoScin},
-    {"hodo_neg_invadc_linear",&fHodoNegInvAdcLinear[0],kDouble,fMaxHodoScin},
-    {"hodo_pos_invadc_adc",&fHodoPosInvAdcAdc[0],kDouble,fMaxHodoScin},
-    {"hodo_neg_invadc_adc",&fHodoNegInvAdcAdc[0],kDouble,fMaxHodoScin},
-    {0}
-  };
-  gHcParms->LoadParmValues((DBRequest*)&list2,prefix);
+    DBRequest list2[]={
+      {"hodo_pos_invadc_offset",&fHodoPosInvAdcOffset[0],kDouble,fMaxHodoScin},
+      {"hodo_neg_invadc_offset",&fHodoNegInvAdcOffset[0],kDouble,fMaxHodoScin},
+      {"hodo_pos_invadc_linear",&fHodoPosInvAdcLinear[0],kDouble,fMaxHodoScin},
+      {"hodo_neg_invadc_linear",&fHodoNegInvAdcLinear[0],kDouble,fMaxHodoScin},
+      {"hodo_pos_invadc_adc",&fHodoPosInvAdcAdc[0],kDouble,fMaxHodoScin},
+      {"hodo_neg_invadc_adc",&fHodoNegInvAdcAdc[0],kDouble,fMaxHodoScin},
+      {0}
+    };
+    gHcParms->LoadParmValues((DBRequest*)&list2,prefix);
   };
   if (fDebug >=1) {
     cout <<"******* Testing Hodoscope Parameter Reading ***\n";
diff --git a/src/THcShower.cxx b/src/THcShower.cxx
index 21c956e53f6918f0ea2d634796b1e0bb5cfe6b08..67c2ca0ef61d301fdb93e5c0542957b4b7dcdc5a 100644
--- a/src/THcShower.cxx
+++ b/src/THcShower.cxx
@@ -166,7 +166,7 @@ Int_t THcShower::ReadDatabase( const TDatime& date )
     DBRequest list[]={
       {"cal_num_neg_columns", &fNegCols, kInt},
       {"cal_slop", &fSlop, kDouble},
-      {"cal_fv_test", &fvTest, kInt},
+      {"cal_fv_test", &fvTest, kInt,0,1},
       {"cal_fv_delta", &fvDelta, kDouble},
       {"dbg_decoded_cal", &fdbg_decoded_cal, kInt},
       {"dbg_sparsified_cal", &fdbg_sparsified_cal, kInt},
@@ -174,6 +174,7 @@ Int_t THcShower::ReadDatabase( const TDatime& date )
       {"dbg_tracks_cal", &fdbg_tracks_cal, kInt},
       {0}
     };
+    fvTest = 0;			// Default if not defined
     gHcParms->LoadParmValues((DBRequest*)&list, prefix);
   }