From 6af1546fa7fd7b3b15a503f782ce5979a49bedce Mon Sep 17 00:00:00 2001 From: "Stephen A. Wood" <saw@jlab.org> Date: Tue, 14 Jan 2014 10:46:18 -0500 Subject: [PATCH] Make data members of raw hit classes private. Friend the detector classes that need access to the private members. May later want to use member functions to access the data. --- src/THcAerogelHit.h | 1 + src/THcCherenkovHit.h | 1 + src/THcHodoscopeHit.h | 6 +++--- src/THcRawDCHit.h | 6 ++++-- src/THcRawShowerHit.h | 6 +++--- 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/THcAerogelHit.h b/src/THcAerogelHit.h index 0c8ac63..c007c84 100644 --- a/src/THcAerogelHit.h +++ b/src/THcAerogelHit.h @@ -6,6 +6,7 @@ class THcAerogelHit : public THcHodoscopeHit { public: + friend class THcAerogel; protected: diff --git a/src/THcCherenkovHit.h b/src/THcCherenkovHit.h index 67ef4c1..de1180c 100644 --- a/src/THcCherenkovHit.h +++ b/src/THcCherenkovHit.h @@ -6,6 +6,7 @@ class THcCherenkovHit : public THcHodoscopeHit { public: + friend class THcCherenkov; protected: diff --git a/src/THcHodoscopeHit.h b/src/THcHodoscopeHit.h index 0bac2d1..853e8f2 100644 --- a/src/THcHodoscopeHit.h +++ b/src/THcHodoscopeHit.h @@ -6,8 +6,9 @@ class THcHodoscopeHit : public THcRawHit { public: + friend class THcScintillatorPlane; - THcHodoscopeHit(Int_t plane=0, Int_t counter=0) : 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) { } @@ -23,13 +24,12 @@ class THcHodoscopeHit : public THcRawHit { // virtual Bool_t IsSortable () const {return kTRUE; } // virtual Int_t Compare(const TObject* obj) const; + protected: Int_t fADC_pos; Int_t fADC_neg; Int_t fTDC_pos; Int_t fTDC_neg; - protected: - private: ClassDef(THcHodoscopeHit, 0); // Hodoscope hit class diff --git a/src/THcRawDCHit.h b/src/THcRawDCHit.h index 4eb2c55..05a6b20 100644 --- a/src/THcRawDCHit.h +++ b/src/THcRawDCHit.h @@ -8,6 +8,8 @@ class THcRawDCHit : public THcRawHit { public: + friend class THcDriftChamberPlane; + friend class THcDC; THcRawDCHit(Int_t plane=0, Int_t counter=0) : THcRawHit(plane, counter), fNHits(0) { @@ -24,10 +26,10 @@ public: virtual Bool_t IsSortable () const {return kTRUE; } virtual Int_t Compare(const TObject* obj) const; - Int_t fNHits; - Int_t fTDC[MAXHITS]; protected: + Int_t fNHits; + Int_t fTDC[MAXHITS]; private: diff --git a/src/THcRawShowerHit.h b/src/THcRawShowerHit.h index 1671ddc..0384295 100644 --- a/src/THcRawShowerHit.h +++ b/src/THcRawShowerHit.h @@ -6,8 +6,9 @@ class THcRawShowerHit : public THcRawHit { public: + friend class THcShowerPlane; - THcRawShowerHit(Int_t plane=0, Int_t counter=0) : THcRawHit(plane, counter), + THcRawShowerHit(Int_t plane=0, Int_t counter=0) : THcRawHit(plane, counter), fADC_pos(-1), fADC_neg(-1){ } THcRawShowerHit& operator=( const THcRawShowerHit& ); @@ -22,11 +23,10 @@ class THcRawShowerHit : public THcRawHit { // virtual Bool_t IsSortable () const {return kTRUE; } // virtual Int_t Compare(const TObject* obj) const; + protected: Int_t fADC_pos; Int_t fADC_neg; - protected: - private: ClassDef(THcRawShowerHit, 0); // Shower hit class -- GitLab