diff --git a/.gitignore b/.gitignore
index 0ff14c0882f43c840985a33da4e58e7329640266..fc9aaa797d8e539dc53e68a3cdd90477b6392a40 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,10 +1,18 @@
 *~
+ROOTfiles
 ROOTfiles/*
+ROOTfiles.old/*
+bck/*
 #*
 hcana
 raw
 .root_history
-*/data_files/*
-*/root_files/*
+CALIBRATION/*/data_files/*
+CALIBRATION/*/root_files/*
 HISTOGRAMS/*
 REPORT_OUTPUT/*
+log/*
+full_hms.sh
+full_shms.sh
+onlineGUI/Config/kpp_*
+run_*
\ No newline at end of file
diff --git a/CALIBRATION/.gitignore b/CALIBRATION/.gitignore
deleted file mode 100644
index a9da3531dad97cca6e7b465e53f6663be3666fdb..0000000000000000000000000000000000000000
--- a/CALIBRATION/.gitignore
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# Ignore file for calorimeter calibration code
-#
-
-# Debug files
-*.deb
-# Monte Carlo results
-*.r
-*.pdf
-*.cal_data
-*.raw_data
-*.root
-# Parameter files generated by calibration
-*.param
-hms_dc_calib/data_files
-*.d
-hms_dc_calib/scripts/*.txt
-
diff --git a/DBASE/standard.kinematics b/DBASE/standard.kinematics
index defaf2c4cef622549f0a9b178a7b06a084003d7b..a539138594aa9d40beceb53f86b50bb1f088715c 100644
--- a/DBASE/standard.kinematics
+++ b/DBASE/standard.kinematics
@@ -1,9 +1,9 @@
 1-99999
-gpbeam=6.
+gpbeam=6.4
 gtarg_num = 1
 htheta_lab = 15.
 ptheta_lab = 15.
-hpcentral = 2.
-ppcentral = 2.
+hpcentral = 3.
+ppcentral = 3.
 hpartmass = 0.00051099
 ppartmass = 0.00051099
diff --git a/DEF-files/SHMS/GEN/pstackana.def b/DEF-files/SHMS/GEN/pstackana.def
index d21a983e58dab73bde9432723bf7c1239c974431..b09264d388aa8492643bb5a693fac44614b1883b 100644
--- a/DEF-files/SHMS/GEN/pstackana.def
+++ b/DEF-files/SHMS/GEN/pstackana.def
@@ -15,6 +15,14 @@ TH1F pngcer_occu 'SHMS Noble Gas Cherenkov Occupancy; Counter Number; Number of
 TH2F pngcer_ped_vs_cntr 'SHMS Noble Gas Cherenkov Pulse Pedestal vs. Counter Number; Counter Number;  Pulse Pedestal / 1 ADC Unit' P.ngcer.adcCounter P.ngcer.adcPed 4 0.5 4.5 1000 0 1000
 TH2F pngcer_pi_vs_cntr 'SHMS Noble Gas Cherenkov Pulse Integral vs. Counter Number; Counter Number;  Pulse Integral / 10 ADC Units' P.ngcer.adcCounter P.ngcer.adcPulseInt 4 0.5 4.5 4000 0 40000
 TH2F pngcer_amp_vs_cntr 'SHMS Noble Gas Cherenkov Pulse Amplitude vs. Counter Number; Counter Number;  Pulse Amplitude / 1 ADC Unit' P.ngcer.adcCounter P.ngcer.adcPulseAmp 4 0.5 4.5 4100 0 4100
+TH1F pngcer_pmt1_adc  'SHMS NG Cherenkov PMT 1 ; ADC (chan) ; Counts' P.ngcer.adc_p[0] 2000 0. 20000. P.ngcer.adc_hit[0]==1
+TH1F pngcer_pmt2_adc  'SHMS NG Cherenkov PMT 2 ; ADC (chan) ; Counts' P.ngcer.adc_p[1] 2000 0. 20000. P.ngcer.adc_hit[1]==1
+TH1F pngcer_pmt3_adc  'SHMS NG Cherenkov PMT 3 ; ADC (chan) ; Counts' P.ngcer.adc_p[2] 2000 0. 20000. P.ngcer.adc_hit[2]==1
+TH1F pngcer_pmt4_adc  'SHMS NG Cherenkov PMT 4 ; ADC (chan) ; Counts' P.ngcer.adc_p[3] 2000 0. 20000. P.ngcer.adc_hit[3]==1
+TH1F pngcer_pmt1_nphe 'SHMS NG Cherenkov PMT 1 ; N_Phe ; Counts' P.ngcer.npe[0] 80 0. 40. P.ngcer.adc_hit[0]==1
+TH1F pngcer_pmt2_nphe 'SHMS NG Cherenkov PMT 2 ; N_Phe ; Counts' P.ngcer.npe[1] 80 0. 40. P.ngcer.adc_hit[1]==1
+TH1F pngcer_pmt3_nphe 'SHMS NG Cherenkov PMT 3 ; N_Phe ; Counts' P.ngcer.npe[2] 80 0. 40. P.ngcer.adc_hit[2]==1
+TH1F pngcer_pmt4_nphe 'SHMS NG Cherenkov PMT 4 ; N_Phe ; Counts' P.ngcer.npe[3] 80 0. 40. P.ngcer.adc_hit[3]==1
 
 # Drift Chambers
 TH1F pdc_ref1  'SHMS DC Reference Time Slot 6 Channel 79; Raw TDC Time (TDC Clicks); Counts / 10 TDC Clicks;' T.shms.pDCREF1_tdcTime  200 12000 14000
@@ -147,6 +155,16 @@ TH2F phgcer_ped_vs_cntr 'SHMS Heavy Gas Cherenkov Pulse Pedestal vs. Counter Num
 TH2F phgcer_pi_vs_cntr 'SHMS Heavy Gas Cherenkov Pulse Integral vs. Counter Number; Counter Number;  Pulse Integral / 10 ADC Units' P.hgcer.adcCounter P.hgcer.adcPulseInt 4 0.5 4.5 4000 0 40000
 TH2F phgcer_amp_vs_cntr 'SHMS Heavy Gas Cherenkov Pulse Amplitude vs. Counter Number; Counter Number;  Pulse Amplitude / 1 ADC Unit' P.hgcer.adcCounter P.hgcer.adcPulseAmp 4 0.5 4.5 4100 0 4100
 
+TH1F phgcer_pmt1_adc  'SHMS HG Cherenkov PMT 1 ; ADC (chan) ; Counts' P.hgcer.adc_p[0] 2000 0. 20000. P.hgcer.adc_hit[0]==1
+TH1F phgcer_pmt2_adc  'SHMS HG Cherenkov PMT 2 ; ADC (chan) ; Counts' P.hgcer.adc_p[1] 2000 0. 20000. P.hgcer.adc_hit[1]==1
+TH1F phgcer_pmt3_adc  'SHMS HG Cherenkov PMT 3 ; ADC (chan) ; Counts' P.hgcer.adc_p[2] 2000 0. 20000. P.hgcer.adc_hit[2]==1
+TH1F phgcer_pmt4_adc  'SHMS HG Cherenkov PMT 4 ; ADC (chan) ; Counts' P.hgcer.adc_p[3] 2000 0. 20000. P.hgcer.adc_hit[3]==1
+TH1F phgcer_pmt1_nphe 'SHMS HG Cherenkov PMT 1 ; N_Phe ; Counts' P.hgcer.npe[0] 80 0. 40. P.hgcer.adc_hit[0]==1
+TH1F phgcer_pmt2_nphe 'SHMS HG Cherenkov PMT 2 ; N_Phe ; Counts' P.hgcer.npe[1] 80 0. 40. P.hgcer.adc_hit[1]==1
+TH1F phgcer_pmt3_nphe 'SHMS HG Cherenkov PMT 3 ; N_Phe ; Counts' P.hgcer.npe[2] 80 0. 40. P.hgcer.adc_hit[2]==1
+TH1F phgcer_pmt4_nphe 'SHMS HG Cherenkov PMT 4 ; N_Phe ; Counts' P.hgcer.npe[3] 80 0. 40. P.hgcer.adc_hit[3]==1
+TH1F phgcer_nphe 'SHMS HG Cherenkov Sum ; N_Phe ; Counts' P.hgcer.npe[3] 80 0. 40.  P.hgcer.adc_hit[0]==1||P.hgcer.adc_hit[1]==1||P.hgcer.adc_hit[2]==1||P.hgcer.adc_hit[3]==1
+
 # Aerogel
 TH1F paero_pos_occu 'SHMS Aero+ Occupancy; Counter Number; Number of Entries' P.aero.posAdcCounter 7 0.5 7.5
 TH2F paero_pos_ped_vs_cntr 'SHMS Aero+ Pulse Pedestal vs. Counter Number; Counter Number;  Pulse Pedestal / 1 ADC Unit' P.aero.posAdcCounter P.aero.posAdcPed 7 0.5 7.5 1000 0 1000
diff --git a/DEF-files/SHMS/GEN/pstackana_report.def b/DEF-files/SHMS/GEN/pstackana_report.def
index 5051b57366f00fdbc750bd0f8b0f9f7bac5e48ab..8eb0a8a1885d09f541c15ff03aa4aada7b98e0e9 100644
--- a/DEF-files/SHMS/GEN/pstackana_report.def
+++ b/DEF-files/SHMS/GEN/pstackana_report.def
@@ -16,14 +16,16 @@ TH2F pngcer_ped_vs_cntr 'SHMS Noble Gas Cherenkov Pulse Pedestal vs. Counter Num
 TH2F pngcer_pi_vs_cntr 'SHMS Noble Gas Cherenkov Pulse Integral vs. Counter Number; Counter Number;  Pulse Integral / 10 ADC Units' P.ngcer.adcCounter P.ngcer.adcPulseInt 4 0.5 4.5 4000 0 40000
 TH2F pngcer_amp_vs_cntr 'SHMS Noble Gas Cherenkov Pulse Amplitude vs. Counter Number; Counter Number;  Pulse Amplitude / 1 ADC Unit' P.ngcer.adcCounter P.ngcer.adcPulseAmp 4 0.5 4.5 4100 0 4100
 
-TH1F pngcer_pmt1_adc  'SHMS NG Cherenkov PMT 1 ; ADC (chan) ; Counts' P.ngcer.adc_p[0] 1000 0. 100000. P.ngcer.adc_hit[0]==1
-TH1F pngcer_pmt2_adc  'SHMS NG Cherenkov PMT 2 ; ADC (chan) ; Counts' P.ngcer.adc_p[1] 1000 0. 100000. P.ngcer.adc_hit[1]==1
-TH1F pngcer_pmt3_adc  'SHMS NG Cherenkov PMT 3 ; ADC (chan) ; Counts' P.ngcer.adc_p[2] 1000 0. 100000. P.ngcer.adc_hit[2]==1
-TH1F pngcer_pmt4_adc  'SHMS NG Cherenkov PMT 4 ; ADC (chan) ; Counts' P.ngcer.adc_p[3] 1000 0. 100000. P.ngcer.adc_hit[3]==1
-TH1F pngcer_pmt1_nphe 'SHMS NG Cherenkov PMT 1 ; N_Phe ; Counts' P.ngcer.npe[0] 500 0. 100. P.ngcer.adc_hit[0]==1
-TH1F pngcer_pmt2_nphe 'SHMS NG Cherenkov PMT 2 ; N_Phe ; Counts' P.ngcer.npe[1] 500 0. 100. P.ngcer.adc_hit[1]==1
-TH1F pngcer_pmt3_nphe 'SHMS NG Cherenkov PMT 3 ; N_Phe ; Counts' P.ngcer.npe[2] 500 0. 100. P.ngcer.adc_hit[2]==1
-TH1F pngcer_pmt4_nphe 'SHMS NG Cherenkov PMT 4 ; N_Phe ; Counts' P.ngcer.npe[3] 500 0. 100. P.ngcer.adc_hit[3]==1
+TH1F pngcer_pmt1_adc  'SHMS NG Cherenkov PMT 1 ; ADC (chan) ; Counts' P.ngcer.adc_p[0] 1000 0. 50000. P.ngcer.adc_hit[0]==1&&P.gtr.beta>0.5
+TH1F pngcer_pmt2_adc  'SHMS NG Cherenkov PMT 2 ; ADC (chan) ; Counts' P.ngcer.adc_p[1] 1000 0. 50000. P.ngcer.adc_hit[1]==1&&P.gtr.beta>0.5
+TH1F pngcer_pmt3_adc  'SHMS NG Cherenkov PMT 3 ; ADC (chan) ; Counts' P.ngcer.adc_p[2] 1000 0. 50000. P.ngcer.adc_hit[2]==1&&P.gtr.beta>0.5
+TH1F pngcer_pmt4_adc  'SHMS NG Cherenkov PMT 4 ; ADC (chan) ; Counts' P.ngcer.adc_p[3] 1000 0. 50000. P.ngcer.adc_hit[3]==1&&P.gtr.beta>0.5
+TH1F pngcer_pmt1_nphe 'SHMS NG Cherenkov PMT 1 ; N_Phe ; Counts' P.ngcer.npe[0] 50 0. 50. P.ngcer.adc_hit[0]==1&&P.gtr.beta>0.5
+TH1F pngcer_pmt2_nphe 'SHMS NG Cherenkov PMT 2 ; N_Phe ; Counts' P.ngcer.npe[1] 50 0. 50. P.ngcer.adc_hit[1]==1&&P.gtr.beta>0.5
+TH1F pngcer_pmt3_nphe 'SHMS NG Cherenkov PMT 3 ; N_Phe ; Counts' P.ngcer.npe[2] 50 0. 50. P.ngcer.adc_hit[2]==1&&P.gtr.beta>0.5
+TH1F pngcer_pmt4_nphe 'SHMS NG Cherenkov PMT 4 ; N_Phe ; Counts' P.ngcer.npe[3] 50 0. 50. P.ngcer.adc_hit[3]==1&&P.gtr.beta>0.5
+
+TH1F pngcer_nphe  'SHMS NG Cherenkov ; N_Phe ; Counts' P.ngcer.npe 50 0. 50. P.ngcer.adc_hit[3]==1&&P.gtr.beta>0.5
 
 # Drift Chambers
 TH1F pdc_ref1  'SHMS DC Reference Time Slot 6 Channel 79; Raw TDC Time (TDC Clicks); Counts / 10 TDC Clicks;' T.shms.pDCREF1_tdcTime  200 12000 14000
@@ -140,14 +142,14 @@ TH2F phgcer_ped_vs_cntr 'SHMS Heavy Gas Cherenkov Pulse Pedestal vs. Counter Num
 TH2F phgcer_pi_vs_cntr 'SHMS Heavy Gas Cherenkov Pulse Integral vs. Counter Number; Counter Number;  Pulse Integral / 10 ADC Units' P.hgcer.adcCounter P.hgcer.adcPulseInt 4 0.5 4.5 4000 0 40000
 TH2F phgcer_amp_vs_cntr 'SHMS Heavy Gas Cherenkov Pulse Amplitude vs. Counter Number; Counter Number;  Pulse Amplitude / 1 ADC Unit' P.hgcer.adcCounter P.hgcer.adcPulseAmp 4 0.5 4.5 4100 0 4100
 
-TH1F phgcer_pmt1_adc  'SHMS HG Cherenkov PMT 1 ; ADC (chan) ; Counts' P.hgcer.adc_p[0] 1000 0. 100000. P.hgcer.adc_hit[0]==1
-TH1F phgcer_pmt2_adc  'SHMS HG Cherenkov PMT 2 ; ADC (chan) ; Counts' P.hgcer.adc_p[1] 1000 0. 100000. P.hgcer.adc_hit[1]==1
-TH1F phgcer_pmt3_adc  'SHMS HG Cherenkov PMT 3 ; ADC (chan) ; Counts' P.hgcer.adc_p[2] 1000 0. 100000. P.hgcer.adc_hit[2]==1
-TH1F phgcer_pmt4_adc  'SHMS HG Cherenkov PMT 4 ; ADC (chan) ; Counts' P.hgcer.adc_p[3] 1000 0. 100000. P.hgcer.adc_hit[3]==1
-TH1F phgcer_pmt1_nphe 'SHMS HG Cherenkov PMT 1 ; N_Phe ; Counts' P.hgcer.npe[0] 500 0. 100. P.hgcer.adc_hit[0]==1
-TH1F phgcer_pmt2_nphe 'SHMS HG Cherenkov PMT 2 ; N_Phe ; Counts' P.hgcer.npe[1] 500 0. 100. P.hgcer.adc_hit[1]==1
-TH1F phgcer_pmt3_nphe 'SHMS HG Cherenkov PMT 3 ; N_Phe ; Counts' P.hgcer.npe[2] 500 0. 100. P.hgcer.adc_hit[2]==1
-TH1F phgcer_pmt4_nphe 'SHMS HG Cherenkov PMT 4 ; N_Phe ; Counts' P.hgcer.npe[3] 500 0. 100. P.hgcer.adc_hit[3]==1
+TH1F phgcer_pmt1_adc  'SHMS HG Cherenkov PMT 1 ; ADC (chan) ; Counts' P.hgcer.adc_p[0] 1000 0. 100000. P.hgcer.adc_hit[0]==1&&P.gtr.beta>0.5
+TH1F phgcer_pmt2_adc  'SHMS HG Cherenkov PMT 2 ; ADC (chan) ; Counts' P.hgcer.adc_p[1] 1000 0. 100000. P.hgcer.adc_hit[1]==1&&P.gtr.beta>0.5
+TH1F phgcer_pmt3_adc  'SHMS HG Cherenkov PMT 3 ; ADC (chan) ; Counts' P.hgcer.adc_p[2] 1000 0. 100000. P.hgcer.adc_hit[2]==1&&P.gtr.beta>0.5
+TH1F phgcer_pmt4_adc  'SHMS HG Cherenkov PMT 4 ; ADC (chan) ; Counts' P.hgcer.adc_p[3] 1000 0. 100000. P.hgcer.adc_hit[3]==1&&P.gtr.beta>0.5
+TH1F phgcer_pmt1_nphe 'SHMS HG Cherenkov PMT 1 ; N_Phe ; Counts' P.hgcer.npe[0] 500 0. 100. P.hgcer.adc_hit[0]==1&&P.gtr.beta>0.5
+TH1F phgcer_pmt2_nphe 'SHMS HG Cherenkov PMT 2 ; N_Phe ; Counts' P.hgcer.npe[1] 500 0. 100. P.hgcer.adc_hit[1]==1&&P.gtr.beta>0.5
+TH1F phgcer_pmt3_nphe 'SHMS HG Cherenkov PMT 3 ; N_Phe ; Counts' P.hgcer.npe[2] 500 0. 100. P.hgcer.adc_hit[2]==1&&P.gtr.beta>0.5
+TH1F phgcer_pmt4_nphe 'SHMS HG Cherenkov PMT 4 ; N_Phe ; Counts' P.hgcer.npe[3] 500 0. 100. P.hgcer.adc_hit[3]==1&&P.gtr.beta>0.5
 
 # Aerogel
 TH1F paero_pos_occu 'SHMS Aero+ Occupancy; Counter Number; Number of Entries' P.aero.posAdcCounter 7 0.5 7.5
diff --git a/PARAM/SHMS/HGCER/phgcer.param b/PARAM/SHMS/HGCER/phgcer.param
index ba309ddc77b1219ed865b769bb630ab307d7dd3d..460386ebe78dfcfeabeb9ba071698fb76baac9f7 100644
--- a/PARAM/SHMS/HGCER/phgcer.param
+++ b/PARAM/SHMS/HGCER/phgcer.param
@@ -3,8 +3,10 @@ phgcer_tot_pmts = 4
 
 phgcer_width = 50, 50,50, 50
 
-phgcer_adc_to_npe = 1/8895., 1/5293.,1/8000., 1/10000.
+;phgcer_adc_to_npe = 1/128.8, 1/130.6,1/128.99, 1/128.99
 
+; Garth H. gain calibration from run 486, March 9 2017
+phgcer_adc_to_npe = 1/436., 1/393., 1/364., 1/372.
 
 phgcer_chi2max = 50.
 phgcer_beta_min = 0.8
diff --git a/PARAM/SHMS/HODO/phodo.param b/PARAM/SHMS/HODO/phodo.param
index aaa4ea23e27aeadd3a2f975899bc5eff71706323..d48b22b4f7d31b1653806b348e045c63d89cd39f 100644
--- a/PARAM/SHMS/HODO/phodo.param
+++ b/PARAM/SHMS/HODO/phodo.param
@@ -1,4 +1,4 @@
-pcosmicflag=1
+pcosmicflag=0
 ; for now manually set hte FADC mode
 ;  1 == Use the pulse int - pulse ped
 ;  2 == Use the sample integral - known ped
diff --git a/PARAM/SHMS/NGCER/pngcer.param b/PARAM/SHMS/NGCER/pngcer.param
index 8f1eedc99902dbffd010989db3f47960005534f0..10eab8d97bb1abe6cb9c629929c829c41b6558fe 100644
--- a/PARAM/SHMS/NGCER/pngcer.param
+++ b/PARAM/SHMS/NGCER/pngcer.param
@@ -3,7 +3,7 @@ pngcer_tot_pmts = 4
 
 pngcer_width = 50, 50,50, 50
 
-pngcer_adc_to_npe = 1/5000., 1/5000., 1/5000., 1/5000.
+pngcer_adc_to_npe = 1/1000., 1/1000., 1/1000., 1/1000.
 
 
 pngcer_chi2max = 50.
diff --git a/SCRIPTS/HMS/hhodo_analysis.C b/SCRIPTS/HMS/MACROS/hhodo_analysis.C
similarity index 100%
rename from SCRIPTS/HMS/hhodo_analysis.C
rename to SCRIPTS/HMS/MACROS/hhodo_analysis.C
diff --git a/SCRIPTS/SHMS/MACROS/shw_pshw.C b/SCRIPTS/SHMS/MACROS/shw_pshw.C
new file mode 100644
index 0000000000000000000000000000000000000000..83391c60de2f189d00bd2d4ecd9219df1b5216cb
--- /dev/null
+++ b/SCRIPTS/SHMS/MACROS/shw_pshw.C
@@ -0,0 +1,152 @@
+void shw_pshw() {
+  cout << "Hello." << endl << endl;
+
+  const Int_t nPreShowerBlocks = 14;
+  const Int_t nShowerBlocks = 224;
+
+  Double_t preShowerNeg_adc2GeV[nPreShowerBlocks] = {
+    1.0/466.2, 1.0/514.7, 1.0/325.5, 1.0/247.8,
+    1.0/322.0, 1.0/176.2, 1.0/161.9, 1.0/197.7,
+    1.0/269.9, 1.0/241.6, 1.0/193.7, 1.0/337.5,
+    1.0/237.3, 1.0/82.0
+  };
+  Double_t preShowerPos_adc2GeV[nPreShowerBlocks] = {
+    1.0/411.2, 1.0/378.6, 1.0/357.9, 1.0/254.8,
+    1.0/315.6, 1.0/331.0, 1.0/264.6, 1.0/305.4,
+    1.0/149.8, 1.0/380.6, 1.0/183.1, 1.0/206.5,
+    1.0/139.8, 1.0/163.1
+  };
+  Double_t shower_adc2GeV = 0.0005;
+
+
+  TFile F("../ROOTfiles/shms_replay_488_-1.root");
+  TTree* T = F.Get("T");
+
+
+  Int_t nTracks;
+  Double_t track_x[1000];
+  Double_t track_y[1000];
+  Double_t track_xp[1000];
+  Double_t track_yp[1000];
+
+  T->SetBranchAddress("Ndata.P.dc.x", &nTracks);
+  T->SetBranchAddress("P.dc.x", track_x);
+  T->SetBranchAddress("P.dc.y", track_y);
+  T->SetBranchAddress("P.dc.xp", track_xp);
+  T->SetBranchAddress("P.dc.yp", track_yp);
+
+  Int_t nPreShower;
+  Double_t preShower_posAdcC[1000];
+  Double_t preShower_posAdcPI[1000];
+
+  T->SetBranchAddress("Ndata.P.cal.pr.posAdcCounter", &nPreShower);
+  T->SetBranchAddress("P.cal.pr.posAdcCounter", preShower_posAdcC);
+  T->SetBranchAddress("P.cal.pr.posAdcPulseInt", preShower_posAdcPI);
+
+  Int_t nShower;
+  Double_t shower_C[1000];
+  Double_t shower_PI[1000];
+
+  T->SetBranchAddress("Ndata.P.cal.fly.adcCounter", &nShower);
+  T->SetBranchAddress("P.cal.fly.adcCounter", shower_C);
+  T->SetBranchAddress("P.cal.fly.adcPulseInt", shower_PI);
+
+  Int_t nNGC;
+  Double_t NGC_C[1000];
+  Double_t NGC_PI[1000];
+
+  T->SetBranchAddress("Ndata.P.ngcer.adcCounter", &nNGC);
+  T->SetBranchAddress("P.ngcer.adcCounter", NGC_C);
+  T->SetBranchAddress("P.ngcer.adcPulseInt", NGC_PI);
+
+
+  TH2D* s_ps = new TH2D("s_ps", "s_ps", 100, -1, 30, 100, -1, 20);
+  s_ps->SetTitle("");
+  TH2D* s_ps_e = new TH2D("s_ps_e", "s_ps_e", 100, -1, 30, 100, -1, 20);
+  TH2D* s_ps_pi = new TH2D("s_ps_pi", "s_ps_pi", 100, -1, 30, 100, -1, 20);
+
+
+  Long64_t nEvents = T->GetEntries();
+  //for (Long64_t iEvent; iEvent<100000; ++iEvent) {
+  for (Long64_t iEvent; iEvent<nEvents; ++iEvent) {
+    if ((iEvent+1)%1000 == 0) cout << "Event: " << iEvent+1 << endl;
+    T->GetEntry(iEvent);
+
+    if (nTracks!=1 || fabs(track_x[0] + track_xp[0]*330 + 9)>9 || fabs(track_y[0] + track_yp[0]*330 - 9)>9) continue;
+
+    bool electron=false;
+    for (Int_t iC=0; iC<nNGC; ++iC) {
+      if (NGC_PI[iC] > 4500) {
+	electron = true;
+	continue;
+      }
+    }
+
+    bool pion=true;
+    for (Int_t iC=0; iC<nNGC; ++iC) {
+      if (NGC_PI[iC] > 3500) {
+	pion = false;
+	continue;
+      }
+    }
+
+    Double_t preShower_energy = 0.0;
+    for (Int_t iPS=0; iPS<nPreShower; ++iPS) {
+      Int_t psc = preShower_posAdcC[iPS];
+      if (psc==6 || psc==7) {
+	preShower_energy += preShower_posAdcPI[iPS] * preShowerPos_adc2GeV[psc-1];
+      }
+    }
+
+    Double_t shower_energy = 0.0;
+    for (Int_t iS=0; iS<nShower; ++iS) {
+      Int_t sc = shower_C[iS];
+      if (sc==87 || sc==88 || sc==103 || sc==104) {
+	shower_energy += shower_PI[iS] * shower_adc2GeV;
+      }
+    }
+
+    s_ps->Fill(preShower_energy, shower_energy);
+    if (electron) s_ps_e->Fill(preShower_energy, shower_energy);
+    if (pion) s_ps_pi->Fill(preShower_energy, shower_energy);
+
+  }
+
+
+  gStyle->SetOptStat(0);
+
+  s_ps->GetXaxis()->SetTitle("pre-shower energy");
+  s_ps->GetYaxis()->SetTitle("shower energy");
+  s_ps->SetMarkerColor(1);
+
+  s_ps_e->GetXaxis()->SetTitle("pre-shower energy");
+  s_ps_e->GetYaxis()->SetTitle("shower energy");
+  s_ps_e->SetMarkerColor(2);
+
+  s_ps_pi->GetXaxis()->SetTitle("pre-shower energy");
+  s_ps_pi->GetYaxis()->SetTitle("shower energy");
+  s_ps_pi->SetMarkerColor(3);
+
+
+  TCanvas* c1 = new TCanvas("c1", "c1", 800, 600);
+  c1->cd();
+
+
+  s_ps->Draw();
+  s_ps_e->Draw("same");
+  //s_ps_pi->Draw("same");
+  c1->Print("shw_pshw.png");
+
+  c1->SetLogz();
+
+  s_ps->Draw("colz");
+  c1->Print("shw_pshw_all.png");
+
+  s_ps_e->Draw("colz");
+  c1->Print("shw_pshw_e.png");
+
+  s_ps_pi->Draw("colz");
+  c1->Print("shw_pshw_pi.png");
+
+  cout << endl << "Bye." << endl;
+}
diff --git a/SCRIPTS/SHMS/replay_shms.C b/SCRIPTS/SHMS/replay_shms.C
index b5c23b700e471e157d317e80943bfe333ef9c267..1be01de60b45bca86dcfe9e5cc8682a342b06e07 100644
--- a/SCRIPTS/SHMS/replay_shms.C
+++ b/SCRIPTS/SHMS/replay_shms.C
@@ -17,7 +17,7 @@ void replay_shms(Int_t RunNumber=0, Int_t MaxEvent=0) {
 
   // Create file name patterns.
   const char* RunFileNamePattern = "raw/shms_all_%05d.dat";
-  const char* ROOTFileNamePattern = "ROOTfiles/shms_replay_%d.root";
+  const char* ROOTFileNamePattern = "ROOTfiles/shms_replay_%d_%d.root";
   // Add variables to global list.
   gHcParms->Define("gen_run_number", "Run Number", RunNumber);
   gHcParms->AddString("g_ctp_database_filename", "DBASE/standard.database");
@@ -103,7 +103,7 @@ void replay_shms(Int_t RunNumber=0, Int_t MaxEvent=0) {
   run->Print();
 
   // Define the analysis parameters
-  TString ROOTFileName = Form(ROOTFileNamePattern, RunNumber);
+  TString ROOTFileName = Form(ROOTFileNamePattern, RunNumber, MaxEvent);
   analyzer->SetCountMode(2);    // 0 = counter is # of physics triggers
                                 // 1 = counter is # of all decode reads
                                 // 2 = counter is event number
diff --git a/SCRIPTS/SHMS/replay_shms_report.C b/SCRIPTS/SHMS/replay_shms_report.C
index 42549df65af43bcc39b1871d53a63ca45880679c..6f4158c239872a834daf5f8b7ae644804402b10a 100644
--- a/SCRIPTS/SHMS/replay_shms_report.C
+++ b/SCRIPTS/SHMS/replay_shms_report.C
@@ -17,7 +17,7 @@ void replay_shms_report(Int_t RunNumber=0, Int_t MaxEvent=0) {
 
   // Create file name patterns.
   const char* RunFileNamePattern = "raw/shms_all_%05d.dat";
-  const char* ROOTFileNamePattern = "ROOTfiles/shms_replay_%d.root";
+  const char* ROOTFileNamePattern = "ROOTfiles/shms_replay_report_%d.root";
   // Add variables to global list.
   gHcParms->Define("gen_run_number", "Run Number", RunNumber);
   gHcParms->AddString("g_ctp_database_filename", "DBASE/standard.database");
diff --git a/onlineGUI/Config/SHMS/GEN/hallc_onlana.cfg b/onlineGUI/Config/SHMS/GEN/hallc_onlana.cfg
index 914190cfb8e662a3038fa29e9239f0cd68b36a12..70c7a98004e1ef1480ec38830a1ef27e8d69668f 100644
--- a/onlineGUI/Config/SHMS/GEN/hallc_onlana.cfg
+++ b/onlineGUI/Config/SHMS/GEN/hallc_onlana.cfg
@@ -1,4 +1,5 @@
-protorootfile ../ROOTfiles/shms_replay_XXXXX.root
+#protorootfile ../ROOTfiles/shms_replay_XXXXX.root
+protorootfile ../ROOTfiles/shms_replay_XXXXX_50000.root
 guicolor orange
 canvassize 1600 800
 #canvassize 800 800
@@ -8,6 +9,12 @@ pngcer_occu -nostat
 pngcer_ped_vs_cntr -nostat
 pngcer_pi_vs_cntr -nostat
 pngcer_amp_vs_cntr -nostat
+newpage 2 2
+title SHMS Noble Gas Cherenkov NPE
+pngcer_pmt1_nphe
+pngcer_pmt2_nphe
+pngcer_pmt3_nphe
+pngcer_pmt4_nphe
 newpage 4 3
 title SHMS Drift Chamber Reference Times
 pdc_ref1
@@ -152,6 +159,12 @@ phgcer_occu -nostat
 phgcer_ped_vs_cntr -nostat
 phgcer_pi_vs_cntr -nostat
 phgcer_amp_vs_cntr -nostat
+newpage 2 2
+title SHMS Heavy Gas Cherenkov NPE
+phgcer_pmt1_nphe
+phgcer_pmt2_nphe
+phgcer_pmt3_nphe
+phgcer_pmt4_nphe
 newpage 2 2 logz 
 title SHMS Aerogel Positive (Left)
 paero_pos_occu -nostat
@@ -204,4 +217,4 @@ ptrig_p1T_tdc
 ptrig_p2T_tdc
 ptrig_pT1_tdc
 ptrig_pT2_tdc
-ptrig_pT3_tdc
\ No newline at end of file
+ptrig_pT3_tdc
diff --git a/onlineGUI/Macros/kpp_analysis.C b/onlineGUI/Macros/kpp_analysis.C
index e8618f32c46f70dfe861d044e4f6aaff7b0d2ff4..0dd9ab39f0b15958647679e9b302cda729766e7c 100644
--- a/onlineGUI/Macros/kpp_analysis.C
+++ b/onlineGUI/Macros/kpp_analysis.C
@@ -24,6 +24,8 @@ void UserScript() {
   static const UInt_t maxTdcHits = 128;
   static const UInt_t maxAdcHits = 4;
 
+  // static const UInt_t adc_timeOffset = 175;
+
   // static const Double_t pshwr_adc2GeV = 0.001; 
   static const Double_t pshwr_neg_adc2GeV[nneg_pshwr_blks] = {1.0/466.2, 1.0/514.7, 1.0/325.5, 1.0/247.8, 
 							      1.0/322.0, 1.0/176.2, 1.0/161.9, 1.0/197.7, 
@@ -38,8 +40,8 @@ void UserScript() {
   static const Double_t shwr_adc2GeV  = 0.0005;
 
   // static const Double_t hgc_adc2npe = 1./205.;
-  //static const Double_t hgc_adc2npe[nhgc_pmts] = {1.0/8895., 1.0/5293., 1.0/8000., 1.0/10000.};
-  static const Double_t hgc_adc2npe[nhgc_pmts] = {1.0/1750., 1.0/1750., 1.0/1750., 1.0/1750.};
+  static const Double_t hgc_adc2npe[nhgc_pmts] = {1./218., 1./196., 1./182., 1./186.};
+  
 
   // static const Double_t ngc_adc2npe = 1./150.;
   static const Double_t ngc_adc2npe[nngc_pmts] = {1.0/500., 1.0/500., 1.0/500., 1.0/500.};