From 192d0d310d9d50c5fae6e7e679dd6f47f22af6fb Mon Sep 17 00:00:00 2001 From: "Stephen A. Wood" <saw@jlab.org> Date: Mon, 23 Apr 2012 23:37:32 -0400 Subject: [PATCH] Add default argument values to THcHodoscopeHit and THcRawHit constructors so that they now work in TClonesArray. --- Makefile | 2 +- src/THcHodoscopeHit.h | 6 +++--- src/THcRawHit.cxx | 14 ++------------ src/THcRawHit.h | 24 +++++++++++------------- 4 files changed, 17 insertions(+), 29 deletions(-) diff --git a/Makefile b/Makefile index 60dd174..6fc33b4 100644 --- a/Makefile +++ b/Makefile @@ -166,7 +166,7 @@ install: all cp -p $(USERLIB) $(HOME)/cue/SRC/ana clean: - rm -f *.o *~ $(USERLIB) $(USERDICT).* + rm -f src/*.o *~ $(USERLIB) $(USERDICT).* realclean: clean rm -f *.d diff --git a/src/THcHodoscopeHit.h b/src/THcHodoscopeHit.h index 35a6632..f8ce97b 100644 --- a/src/THcHodoscopeHit.h +++ b/src/THcHodoscopeHit.h @@ -7,7 +7,7 @@ class THcHodoscopeHit : public THcRawHit { public: - THcHodoscopeHit(Int_t plane, Int_t counter) : THcRawHit(plane, counter), + THcHodoscopeHit(Int_t plane=0, Int_t counter=0) : THcRawHit(plane, counter), fADC_pos(-1), fADC_neg(-1), fTDC_pos(-1), fTDC_neg(-1) { } @@ -15,7 +15,7 @@ class THcHodoscopeHit : public THcRawHit { virtual ~THcHodoscopeHit() {} virtual void Clear( Option_t* opt="" ) - { fADC_pos = -1; fADC_neg = -1; fTDC_pos = -1; fTDC_neg = -1; } + { fADC_pos = -1; fADC_neg = -1; fTDC_pos = -1; fTDC_neg = -1; } void SetData(Int_t signal, Int_t data); Int_t GetData(Int_t signal); @@ -32,7 +32,7 @@ class THcHodoscopeHit : public THcRawHit { private: - ClassDef(THcHodoscopeHit, 0) // Hodoscope hit class + ClassDef(THcHodoscopeHit, 0); // Hodoscope hit class }; #endif diff --git a/src/THcRawHit.cxx b/src/THcRawHit.cxx index b9a5090..daa5138 100644 --- a/src/THcRawHit.cxx +++ b/src/THcRawHit.cxx @@ -10,18 +10,8 @@ #include "THcRawHit.h" -THcRawHit::THcRawHit() -{ - // Constructor -} - -THcRawHit::THcRawHit(Int_t plane, Int_t counter) : - fPlane(plane), fCounter(counter) -{ -} - -THcRawHit::~THcRawHit() -{} +//THcRawHit::~THcRawHit() +//{} ClassImp(THcRawHit) diff --git a/src/THcRawHit.h b/src/THcRawHit.h index 1188d26..baec88e 100644 --- a/src/THcRawHit.h +++ b/src/THcRawHit.h @@ -10,19 +10,17 @@ class THcRawHit : public TObject { - public: - THcRawHit(); - virtual ~THcRawHit(); +public: + THcRawHit(Int_t plane=0, Int_t counter=0) : + fPlane(plane), fCounter(counter) {}; + THcRawHit( const THcRawHit& rhs ) : TObject(rhs) {} + THcRawHit& operator=( const THcRawHit& rhs ) + { TObject::operator=(rhs); return *this; }; - THcRawHit(Int_t plane, Int_t counter); - - // THcRawHit( const THcRawHit& rhs ) : TObject(rhs) {} + virtual ~THcRawHit() {} - // THcRawHit& operator=( const THcRawHit& rhs ) - // { TObject::operator=(rhs); return *this; } - - - virtual void Clear( Option_t* opt="" )=0; + // This line causes problem + // virtual void Clear( Option_t* opt="" )=0; // virtual Bool_t operator==( const THcRawHit& ) = 0; // virtual Bool_t operator!=( const THcRawHit& ) = 0; @@ -37,9 +35,9 @@ class THcRawHit : public TObject { Int_t fPlane; Int_t fCounter; -protected: + private: - ClassDef(THcRawHit,0) + ClassDef(THcRawHit,2) // Track ID abstract base class }; #endif -- GitLab