diff --git a/podd b/podd index 0397e92a6812595dcb4ff6a13ec665987e26ca1d..3f08eaebe0d0997888a9bf34ba90a211dd608a2d 160000 --- a/podd +++ b/podd @@ -1 +1 @@ -Subproject commit 0397e92a6812595dcb4ff6a13ec665987e26ca1d +Subproject commit 3f08eaebe0d0997888a9bf34ba90a211dd608a2d diff --git a/src/THcHitList.cxx b/src/THcHitList.cxx index 44c79232f6ca44bea097c80ee47a1ecb1748444d..e9527ac756ba7ee33e90800b0ff740782d2ec302 100644 --- a/src/THcHitList.cxx +++ b/src/THcHitList.cxx @@ -2,7 +2,7 @@ ////////////////////////////////////////////////////////////////////////// // -// THcDetectorBase +// THcHitList // // Add hitlist to the Hall A detector base // May not need to inherit from THaDetectorBase since we may end up @@ -10,16 +10,12 @@ // ////////////////////////////////////////////////////////////////////////// -#include "THcDetectorBase.h" -#include "THaEvData.h" -#include "THaDetMap.h" +#include "THcHitList.h" #include "TClonesArray.h" using namespace std; -THcDetectorBase::THcDetectorBase( const char* name, - const char* description ) : - THaDetectorBase(name, description) +THcHitList::THcHitList() { // Normal constructor. @@ -27,14 +23,12 @@ THcDetectorBase::THcDetectorBase( const char* name, } -THcDetectorBase::THcDetectorBase() : THaDetectorBase() { -} - -THcDetectorBase::~THcDetectorBase() { +THcHitList::~THcHitList() { // Destructor } -void THcDetectorBase::InitHitlist(const char *hitclass, Int_t maxhits) { +void THcHitList::InitHitList(THaDetMap* detmap, + const char *hitclass, Int_t maxhits) { // Probably called by ReadDatabase fRawHitList = new TClonesArray(hitclass, maxhits); fRawHitClass = fRawHitList->GetClass(); @@ -43,10 +37,11 @@ void THcDetectorBase::InitHitlist(const char *hitclass, Int_t maxhits) { for(Int_t i=0;i<maxhits;i++) { fRawHitList->New(i); } + + fDetMap = detmap; } - -Int_t THcDetectorBase::Decode( const THaEvData& evdata ) { +Int_t THcHitList::DecodeToHitList( const THaEvData& evdata ) { THcRawHit* rawhit; fRawHitList->Clear("C"); fNRawHits = 0; @@ -98,4 +93,4 @@ Int_t THcDetectorBase::Decode( const THaEvData& evdata ) { return fNRawHits; // Does anything care what is returned } -ClassImp(THcDetectorBase) +ClassImp(THcHitList) diff --git a/src/THcHitList.h b/src/THcHitList.h index 740f7c13f3bf9ac6a958dc01947f738ed98018b8..5e03b0c3229d933dffdd4793b7def9e98df9ba02 100644 --- a/src/THcHitList.h +++ b/src/THcHitList.h @@ -1,8 +1,9 @@ -#ifndef ROOT_THcDetectorBase -#define ROOT_THcDetectorBase +#ifndef ROOT_THcHitList +#define ROOT_THcHitList -#include "THaDetectorBase.h" #include "THcRawHit.h" +#include "THaDetMap.h" +#include "THaEvData.h" #include "TClonesArray.h" @@ -10,24 +11,25 @@ using namespace std; ////////////////////////////////////////////////////////////////////////// // -// THcDetectorBase +// THcHitList // ////////////////////////////////////////////////////////////////////////// //class THaDetMap; -class THcDetectorBase : public THaDetectorBase { +class THcHitList { public: - virtual ~THcDetectorBase(); + virtual ~THcHitList(); - THcDetectorBase(); // only for ROOT I/O - THcDetectorBase( const char* name, const char* description ); + THcHitList(); // only for ROOT I/O + THcHitList( const char* name, const char* description ); - virtual Int_t Decode( const THaEvData& ); - void InitHitlist(const char *hitclass, Int_t maxhits); + virtual Int_t DecodeToHitList( const THaEvData& ); + void InitHitList(THaDetMap* detmap, + const char *hitclass, Int_t maxhits); // This is a list of pointers to hit objects // Instead should we have a list of the actual objects so that we are @@ -38,8 +40,10 @@ class THcDetectorBase : public THaDetectorBase { TClonesArray* fRawHitList; // List of raw hits TClass* fRawHitClass; // Class of raw hit object to use + THaDetMap* fDetMap; + protected: - ClassDef(THcDetectorBase,0) + ClassDef(THcHitList,0) }; #endif diff --git a/src/THcHodoscope.cxx b/src/THcHodoscope.cxx index ad352c6a0ba7a3e7787af45b59c01fcfdc66e065..336557fe08ee26fb545d5e376d0bfd6e8da225b6 100644 --- a/src/THcHodoscope.cxx +++ b/src/THcHodoscope.cxx @@ -479,7 +479,7 @@ Int_t THcHodoscope::Decode( const THaEvData& evdata ) { // Get the hitlist (fRawHitList) for this event - Int_t nhits = THcDetectorBase::Decode(evdata); + Int_t nhits = THcHitList::DecodeToHitList(evdata); return nhits; } diff --git a/src/THcHodoscope.h b/src/THcHodoscope.h index 5f2300656d4519c2fd54b6fd44dc27cebd1eafc7..ee992ba240c2039c371763b2dce6c8409672205f 100644 --- a/src/THcHodoscope.h +++ b/src/THcHodoscope.h @@ -8,11 +8,12 @@ /////////////////////////////////////////////////////////////////////////////// #include "TClonesArray.h" -#include "THcNonTrackingDetector.h" +#include "THaNonTrackingDetector.h" +#include "THcHitList.h" class THaScCalib; -class THcHodoscope : public THcNonTrackingDetector { +class THcHodoscope : public THaNonTrackingDetector, public THcHitList { public: THcHodoscope( const char* name, const char* description = "",