diff --git a/src/THcHodoscopeHit.cxx b/src/THcHodoscopeHit.cxx index cfd7064a01951ed549af927c2411e698514639a7..fc9b115a18b11fdfc97b7a752470dc29ee1d1fd3 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 caee95af3f624f7f85baf5c30f45341a6121ca73..5b624e814c86366cbbdb178448fc0ffa0c6d33d3 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