From 60c8bbdc7313c3dfa265c07317cb750dca5f9e22 Mon Sep 17 00:00:00 2001
From: Mark Jones <jones@jlab.org>
Date: Mon, 13 Apr 2015 14:22:03 -0400
Subject: [PATCH] In ProcessHits restore subtraction of the pedestal from the
 raw hit adc value when calculating the ADC corrected time.

---
 src/THcScintillatorPlane.cxx | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/THcScintillatorPlane.cxx b/src/THcScintillatorPlane.cxx
index d4163f5..d51f3d8 100644
--- a/src/THcScintillatorPlane.cxx
+++ b/src/THcScintillatorPlane.cxx
@@ -332,10 +332,12 @@ Int_t THcScintillatorPlane::ProcessHits(TClonesArray* rawhits, Int_t nexthit)
       
       // Do the pulse height correction to the time.  (Position dependent corrections later)
       Double_t timec_pos = hit->fTDC_pos*fScinTdcToTime - fHodoPosPhcCoeff[index]*
-	TMath::Sqrt(TMath::Max(0.0,(hit->fADC_pos/fHodoPosMinPh[index]-1)))
+	TMath::Sqrt(TMath::Max(0.0,
+			       (hit->fADC_pos-fPosPed[index])/fHodoPosMinPh[index]-1.0))
 	- fHodoPosTimeOffset[index];
       Double_t timec_neg = hit->fTDC_neg*fScinTdcToTime - fHodoNegPhcCoeff[index]*
-	TMath::Sqrt(TMath::Max(0.0,(hit->fADC_neg/fHodoNegMinPh[index]-1)))
+	TMath::Sqrt(TMath::Max(0.0,
+			       (hit->fADC_neg-fNegPed[index])/fHodoNegMinPh[index]-1.0))
 	- fHodoNegTimeOffset[index];
 
       // Find hit position using ADCs
-- 
GitLab