From 340d1d0a621636125a777c19a8d1507d4cfd2496 Mon Sep 17 00:00:00 2001
From: "Stephen A. Wood" <saw@jlab.org>
Date: Thu, 5 Dec 2013 15:56:14 -0500
Subject: [PATCH] Changes to control files to analyze SOS data.   general.param
 - include SOS parameter for most devices   hcana.param - add sos versions of
 previous hardwired parameters   db_run.dat - put in an angle and mometum for
 SOS   output.def - include sos detectors in root tree   hodtest.C - Add SOS
 spectrometer and some of its detectors

---
 examples/DBASE/test.database |  2 ++
 examples/PARAM/general.param |  5 +++-
 examples/PARAM/hcana.param   | 48 ++++++++++++++++++++++++++++++++----
 examples/db_run.dat          |  3 ++-
 examples/hodtest.C           |  7 ++++++
 examples/output.def          |  3 +++
 6 files changed, 61 insertions(+), 7 deletions(-)

diff --git a/examples/DBASE/test.database b/examples/DBASE/test.database
index d4dae4a..027c0b4 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 cd56bb3..2b22217 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 1f9e393..47b4766 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 3cdedab..cf6548c 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 b15f529..dcf776a 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 71d516f..da415c8 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
-- 
GitLab