From de77703f01c1fa25ae5162df7f150b1c1082230e Mon Sep 17 00:00:00 2001
From: "Stephen A. Wood" <saw@jlab.org>
Date: Thu, 19 Apr 2012 13:32:58 -0400
Subject: [PATCH] Print out the hit list after DecodeToHitList to illustrate
 how to get the hits.

---
 src/THcHodoscope.cxx | 7 +++++++
 src/THcHodoscope.h   | 1 +
 2 files changed, 8 insertions(+)

diff --git a/src/THcHodoscope.cxx b/src/THcHodoscope.cxx
index b3c9c93..a65d8fa 100644
--- a/src/THcHodoscope.cxx
+++ b/src/THcHodoscope.cxx
@@ -276,6 +276,13 @@ Int_t THcHodoscope::Decode( const THaEvData& evdata )
   // Get the Hall C style hitlist (fRawHitList) for this event
   Int_t nhits = THcHitList::DecodeToHitList(evdata);
 
+  // fRawHitList is TClones array of THcHodoscopeHit objects
+  for(Int_t ihit = 0; ihit < fNRawHits ; ihit++) {
+    THcHodoscopeHit* hit = (THcHodoscopeHit *) fRawHitList->At(ihit);
+    cout << ihit << ": " << hit->fADC_pos << " " << hit->fADC_neg << " " 
+	 <<  hit->fTDC_pos << " " <<  hit->fTDC_pos << endl;
+  }
+
   return nhits;
 }
 
diff --git a/src/THcHodoscope.h b/src/THcHodoscope.h
index 29c252b..31760f5 100644
--- a/src/THcHodoscope.h
+++ b/src/THcHodoscope.h
@@ -10,6 +10,7 @@
 #include "TClonesArray.h"
 #include "THaNonTrackingDetector.h"
 #include "THcHitList.h"
+#include "THcHodoscopeHit.h"
 
 class THaScCalib;
 
-- 
GitLab