From 7d1c128852110f7a771ed192296e2991b9c101c8 Mon Sep 17 00:00:00 2001 From: "Stephen A. Wood" <saw@jlab.org> Date: Fri, 16 Mar 2012 16:52:33 -0400 Subject: [PATCH] More work on raw hits. Now compiles. --- src/THcHodoscopeHit.h | 7 +++---- src/THcRawHit.cxx | 3 +++ src/THcRawHit.h | 11 +++++------ src/THcRawHitList.cxx | 6 +++--- src/THcRawHitList.h | 7 +++++-- 5 files changed, 19 insertions(+), 15 deletions(-) diff --git a/src/THcHodoscopeHit.h b/src/THcHodoscopeHit.h index c49ad21..02081dd 100644 --- a/src/THcHodoscopeHit.h +++ b/src/THcHodoscopeHit.h @@ -1,18 +1,17 @@ #ifndef ROOT_THcHodoscopeHit #define ROOT_THcHodoscopeHit -// Should we have a generic hit object that we inherit from? (A template, -// whatever that is?) - #include "THcRawHit.h" class THcHodoscopeHit : public THcRawHit { public: - THcHodoscopeHit(Int_t plane, Int_t counter) : THcRawHit(plane, counter) + THcHodoscopeHit(Int_t plane, Int_t counter) : THcRawHit(plane, counter), fADC_pos(-1), fADC_neg(-1), fTDC_pos(-1), fTDC_neg(-1) {} + THcHodoscopeHit& operator=( const THcHodoscopeHit& ); + virtual ~THcHodoscopeHit() {} void SetData(Int_t signal, Int_t data); diff --git a/src/THcRawHit.cxx b/src/THcRawHit.cxx index 8143464..211c2f7 100644 --- a/src/THcRawHit.cxx +++ b/src/THcRawHit.cxx @@ -10,6 +10,9 @@ #include "THcRawHit.h" +THcRawHit::~THcRawHit() +{} + ClassImp(THcRawHit) //_____________________________________________________________________________ diff --git a/src/THcRawHit.h b/src/THcRawHit.h index 020fc3c..e9537f1 100644 --- a/src/THcRawHit.h +++ b/src/THcRawHit.h @@ -15,18 +15,17 @@ class THcRawHit : public TObject { public: THcRawHit(Int_t plane, Int_t counter) : fPlane(plane), fCounter(counter) {} - THcRawHit( const THcRawHit& rhs ) : TObject(rhs) {} THcRawHit& operator=( const THcRawHit& rhs ) { TObject::operator=(rhs); return *this; } - virtual ~THcRawHit() {} + virtual ~THcRawHit(); - virtual Bool_t operator==( const THcRawHit& ) = 0; - virtual Bool_t operator!=( const THcRawHit& ) = 0; + // virtual Bool_t operator==( const THcRawHit& ) = 0; + // virtual Bool_t operator!=( const THcRawHit& ) = 0; - virtual void SetData(Int_t signal, Int_t data); - virtual Int_t GetData(Int_t signal); + virtual void SetData(Int_t signal, Int_t data) {}; + virtual Int_t GetData(Int_t signal) = 0; Int_t fPlane; Int_t fCounter; diff --git a/src/THcRawHitList.cxx b/src/THcRawHitList.cxx index b8bccfb..44aafed 100644 --- a/src/THcRawHitList.cxx +++ b/src/THcRawHitList.cxx @@ -2,7 +2,7 @@ ////////////////////////////////////////////////////////////////////////// // -// THcRawHistList +// THcRawHitList // // Class to build raw hit lists from data // @@ -12,7 +12,7 @@ using namespace std; -THcRawHitList::THcRawHitList(const char* classname, Int_t size=1000, Int_t detctorid) { +THcRawHitList::THcRawHitList(const char* classname, Int_t detectorid, Int_t size=1000) { fHits = new TClonesArray(classname, size); fDetectorid = detectorid; } @@ -27,4 +27,4 @@ void THcRawHitList::Clear( Option_t*) } ////////////////////////////////////////////////////////////////////////// -ClassImp(THcRawHistList) +ClassImp(THcRawHitList) diff --git a/src/THcRawHitList.h b/src/THcRawHitList.h index 4a4d980..f68eb43 100644 --- a/src/THcRawHitList.h +++ b/src/THcRawHitList.h @@ -8,12 +8,15 @@ ////////////////////////////////////////////////////////////////////////// #include "TClonesArray.h" +#include "THcRawHit.h" +#include <cassert> class THcRawHitList { public: - + THcRawHitList(const char* classname, Int_t detectorid, Int_t size); + virtual ~THcRawHitList(); TClonesArray* fHits; Int_t fMaxhit; @@ -30,7 +33,7 @@ class THcRawHitList { { assert(i >=0 && i<GetNHits() ); return (THcRawHit*)fHits->UncheckedAt(i);} - + void Clear( Option_t*); private: ClassDef(THcRawHitList, 0); // Raw hit class -- GitLab