From 2b03efaf472dab9322818f67683a7a34b896356d Mon Sep 17 00:00:00 2001 From: "Stephen A. Wood" <saw@jlab.org> Date: Thu, 15 Mar 2012 11:27:08 -0400 Subject: [PATCH] THcHodoscopHit compiles --- src/THcHodoscopeHit.cxx | 14 +++++++++----- src/THcHodoscopeHit.h | 16 +++++++++++----- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/src/THcHodoscopeHit.cxx b/src/THcHodoscopeHit.cxx index cfd7064..fc9b115 100644 --- a/src/THcHodoscopeHit.cxx +++ b/src/THcHodoscopeHit.cxx @@ -10,21 +10,22 @@ #include "THcHodoscopeHit.h" -ClassImp(ThcHodoscopeHit) +using namespace std; -void SetData(Int_t signal, Int_t data) { + +void THcHodoscopeHit::SetData(Int_t signal, Int_t data) { if(signal==1) { fADC_pos = data; } else if (signal==2) { - fADC_net = data; + fADC_neg = data; } else if(signal==3) { fADC_pos = data; } else if (signal==4) { - fADC_net = data; + fADC_neg = data; } } -Int_t GetData(Int_t signal) { +Int_t THcHodoscopeHit::GetData(Int_t signal) { if(signal==1) { return(fADC_pos); } else if (signal==2) { @@ -34,6 +35,9 @@ Int_t GetData(Int_t signal) { } else if (signal==4) { return(fADC_neg); } + return(-1); // Actually should throw exception } ////////////////////////////////////////////////////////////////////////// +ClassImp(THcHodoscopeHit) + diff --git a/src/THcHodoscopeHit.h b/src/THcHodoscopeHit.h index caee95a..5b624e8 100644 --- a/src/THcHodoscopeHit.h +++ b/src/THcHodoscopeHit.h @@ -1,16 +1,22 @@ #ifndef ROOT_THcHodoscopeHit #define ROOT_THcHodoscopeHit +// Should we have a generic hit object that we inherit from? (A template, +// whatever that is?) + #include "TObject.h" class THcHodoscopeHit : public TObject { public: - THcHodoscopeHit(Int_t plane, Int_t counter) : - fPlane(plane), fCounter(counter), fADC_pos(-1), fADC_net(-1), - fTDC_pos(-1), fTDC_net(-1) {} - virtual ~THcHodosscopeHit() {} + THcHodoscopeHit(Int_t plane, Int_t counter) : + fPlane(plane), fCounter(counter), fADC_pos(-1), fADC_neg(-1), + fTDC_pos(-1), fTDC_neg(-1) {} + virtual ~THcHodoscopeHit() {} + + void SetData(Int_t signal, Int_t data); + Int_t GetData(Int_t signal); Int_t fPlane; Int_t fCounter; @@ -24,7 +30,7 @@ class THcHodoscopeHit : public TObject { private: - ClassDef(THaHodoscopeHit, 0); + ClassDef(THcHodoscopeHit, 0); // Hodoscope hit class }; #endif -- GitLab