From 4676a6acfc05e6f8346f9decdc35d12913d49927 Mon Sep 17 00:00:00 2001
From: hallc-online <hallc-online@jlab.org>
Date: Mon, 27 Mar 2017 18:22:41 -0400
Subject: [PATCH] Add single track selection in the SHMS calorimeter
 calibration.

---
 CALIBRATION/shms_cal_calib/THcPShowerCalib.h | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/CALIBRATION/shms_cal_calib/THcPShowerCalib.h b/CALIBRATION/shms_cal_calib/THcPShowerCalib.h
index 2666fbea..bb461351 100644
--- a/CALIBRATION/shms_cal_calib/THcPShowerCalib.h
+++ b/CALIBRATION/shms_cal_calib/THcPShowerCalib.h
@@ -100,6 +100,8 @@ class THcPShowerCalib {
   Double_t        P_hgcer_npe[4];
   Double_t        P_tr_beta;
 
+  Double_t        P_cal_nclust;
+
   TBranch* b_P_tr_p;
   TBranch* b_P_pr_apos_p;
   TBranch* b_P_pr_aneg_p;
@@ -113,6 +115,8 @@ class THcPShowerCalib {
   TBranch* b_P_hgcer_npe;
   TBranch* b_P_tr_beta;
 
+  TBranch* b_P_cal_nclust;
+
   // Quantities for calculations of the calibration constants.
 
   Double_t fe0;
@@ -204,6 +208,8 @@ void THcPShowerCalib::Init() {
 
   fTree->SetBranchAddress("P.tr.beta", &P_tr_beta,&b_P_tr_beta);
 
+  fTree->SetBranchAddress("P.cal.nclust", &P_cal_nclust,&b_P_cal_nclust);
+
   // Histogram declarations.
 
   hEunc = new TH1F("hEunc", "Edep/P uncalibrated", 500, 0., 10.);
@@ -321,6 +327,8 @@ bool THcPShowerCalib::ReadShRawTrack(THcPShTrack &trk, UInt_t ientry) {
 
   if (P_tr_n != 1) return 0;
 
+  if (P_cal_nclust != 1) return 0;
+
   bool good_trk =   P_tr_tg_dp > DELTA_MIN &&
 		    P_tr_tg_dp < DELTA_MAX &&
 		    P_tr_x + P_tr_xp*D_CALO_FP > XMIN &&
-- 
GitLab