From 0051e55c8161dd2e75bc88e0c4f813d1aff25b4a Mon Sep 17 00:00:00 2001
From: vardant <tadevosn@jlab.org>
Date: Fri, 15 Sep 2017 04:19:26 +0400
Subject: [PATCH] Add calorimeter efficiency calculations. (#207)

* Add efficiency calculations for the layers of the calorimeters.

* Add efficiency calculation for the Array part of calorimeter.

* Update phgcer_calib.param

@vardant These calibration numbers should be included in hallc_replay/PARAM/SHMS/HGCER/CALIB/KPP_Spring_2017/.  For reference the gain constants for run 464 were phgcer_adc_to_npe = 1/111., 1/118., 1/122., 1/125.

* Update pcal_geom.param

Fix some typos
---
 PARAM/HMS/CER/CUTS/hcer_cuts.param        | 1 -
 PARAM/SHMS/CAL/GEOM/pcal_geom.param       | 8 ++++----
 PARAM/SHMS/HGCER/CALIB/phgcer_calib.param | 2 +-
 TEMPLATES/HMS/STACK/hstackana.template    | 9 +++++++--
 TEMPLATES/SHMS/STACK/pstackana.template   | 7 ++++++-
 5 files changed, 18 insertions(+), 9 deletions(-)

diff --git a/PARAM/HMS/CER/CUTS/hcer_cuts.param b/PARAM/HMS/CER/CUTS/hcer_cuts.param
index 0499602a..f149a61b 100644
--- a/PARAM/HMS/CER/CUTS/hcer_cuts.param
+++ b/PARAM/HMS/CER/CUTS/hcer_cuts.param
@@ -16,7 +16,6 @@ hcer_enorm_max = 1.5
 hcer_dp_min = -20.0
 hcer_dp_max = 25.0
 
-
 ; ADC time window cut values used to select "good" ADC events
 hcer_adcTimeWindowMin = 1500.
 hcer_adcTimeWindowMax = 3500.
diff --git a/PARAM/SHMS/CAL/GEOM/pcal_geom.param b/PARAM/SHMS/CAL/GEOM/pcal_geom.param
index 3ac39558..c4c7f990 100644
--- a/PARAM/SHMS/CAL/GEOM/pcal_geom.param
+++ b/PARAM/SHMS/CAL/GEOM/pcal_geom.param
@@ -21,7 +21,7 @@ pcal_c_cor = 64.36, 64.36	# for positive and negative sides
 pcal_d_cor =  1.66,  1.66
 
 ; Parameters copied from HMS
-; Slop in x possitino.  Allowed distance between track and edge of block
+; Slope in x position.  Allowed distance between track and edge of block
 pcal_slop = 7.5 
 
 pcal_pr_thick = 10.0
@@ -29,8 +29,8 @@ pcal_pr_thick = 10.0
 ; Z Position of from of preshower
 pcal_pr_zpos = 292.64
 
-pcal_pr_left  =  35.0
-pcal_pr_right = -35.0
+pcal_pr_left  =  70.0
+pcal_pr_right = -70.0
 pcal_pr_top   = (-69.0-1.4)
                  (-59.0-1.4)
                  (-49.0-1.4)
@@ -64,4 +64,4 @@ pcal_arr_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,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
\ No newline at end of file
+		     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
diff --git a/PARAM/SHMS/HGCER/CALIB/phgcer_calib.param b/PARAM/SHMS/HGCER/CALIB/phgcer_calib.param
index 2518a4d4..eda81ba9 100644
--- a/PARAM/SHMS/HGCER/CALIB/phgcer_calib.param
+++ b/PARAM/SHMS/HGCER/CALIB/phgcer_calib.param
@@ -1,2 +1,2 @@
 ; Garth H. gain calibration from run 488, June 20 2017
-phgcer_adc_to_npe = 1/546., 1/430., 1/376., 1/477.
\ No newline at end of file
+phgcer_adc_to_npe = 1/546., 1/430., 1/376., 1/477.
diff --git a/TEMPLATES/HMS/STACK/hstackana.template b/TEMPLATES/HMS/STACK/hstackana.template
index 196e4b3a..827cea20 100644
--- a/TEMPLATES/HMS/STACK/hstackana.template
+++ b/TEMPLATES/HMS/STACK/hstackana.template
@@ -29,8 +29,13 @@ hmsDC2y2Planes5	  Counts: {hmsDC2_5hits_y2.npassed} eff : {hmsDC2_6hits_y2.npass
 hmsDC2v1Planes5	  Counts: {hmsDC2_5hits_v1.npassed} eff : {hmsDC2_6hits_v1.npassed/hmsDC2_5hits_v1.npassed}
 hmsDC2y1Planes5	  Counts: {hmsDC2_5hits_y1.npassed} eff : {hmsDC2_6hits_y1.npassed/hmsDC2_5hits_y1.npassed}
 hmsDC2x2Planes5	  Counts: {hmsDC2_5hits_x2.npassed} eff : {hmsDC2_6hits_x2.npassed/hmsDC2_5hits_x2.npassed}
-	       	                      	       
-	       	   	       
+
+HMS Calorimeter Efficiencies
+
+hA	     Counts: {H.cal.stat_trksum1} eff : {H.cal.stat_hitsum1 / H.cal.stat_trksum1}
+hB	     Counts: {H.cal.stat_trksum2} eff : {H.cal.stat_hitsum2 / H.cal.stat_trksum2}
+hC	     Counts: {H.cal.stat_trksum3} eff : {H.cal.stat_hitsum3 / H.cal.stat_trksum3}
+hD	     Counts: {H.cal.stat_trksum4} eff : {H.cal.stat_hitsum4 / H.cal.stat_trksum4}
 
 *****************************
 *HMS TRACKING EFFICIENCIES *
diff --git a/TEMPLATES/SHMS/STACK/pstackana.template b/TEMPLATES/SHMS/STACK/pstackana.template
index 516aff97..e9e762a2 100644
--- a/TEMPLATES/SHMS/STACK/pstackana.template
+++ b/TEMPLATES/SHMS/STACK/pstackana.template
@@ -47,7 +47,12 @@ shmsDC2u2Planes5     Counts: {shmsDC2_5hits_u2.npassed} eff : {shmsDC2_6hits_u2.
 shmsDC2v1Planes5     Counts: {shmsDC2_5hits_v1.npassed} eff : {shmsDC2_6hits_v1.npassed / shmsDC2_5hits_v1.npassed}
 shmsDC2v2Planes5     Counts: {shmsDC2_5hits_v2.npassed} eff : {shmsDC2_6hits_v2.npassed / shmsDC2_5hits_v2.npassed}
 shmsDC2x2Planes5     Counts: {shmsDC2_5hits_x2.npassed} eff : {shmsDC2_6hits_x2.npassed / shmsDC2_5hits_x2.npassed}
-	       	   	       
+
+SHMS Calorimeter Efficiencies
+
+shmsPreShower	     Counts: {P.cal.stat_trksum1} eff : {P.cal.stat_hitsum1 / P.cal.stat_trksum1}
+shmsShowerArray	     Counts: {P.cal.stat_trksum_array} eff : {P.cal.stat_hitsum_array / P.cal.stat_trksum_array}
+
 ******************************
 * SHMS TRACKING EFFICIENCIES *
 ******************************
-- 
GitLab