00001 // 00002 // CHistogram class 00003 // 00004 // Tetsuo Arisawa 2000/08/28 00005 // for HistoDisplay v.1.64 class 00006 // 00007 // 2000/09/01 T.A 00008 // Version 2.0 00009 // fSubtractHisto is cloned internally. Destructor is ok. 00010 // Version 3.0 00011 // Draw(), Paint() with UpdateTObject in CObject. 00012 // Version 3.1 2000 09/15 00013 // 00014 00015 #ifndef _CHistogram_H_ 00016 #define _CHistogram_H_ 00017 00018 #include "TH1.h" 00019 #include "TObject.h" 00020 #include "CObject.h" 00021 00022 class CHistogram: public CObject { 00023 00024 protected: 00025 TH1 *fSubtractHisto; // histo to be subtracted after reset. 00026 TH1 *fRefHisto; // reference histo. 00027 00028 TH1 *fHistoDrawn; // histo to be drawn. (TH1*)fTObject - fSubtractHisto 00029 00030 virtual void UpdateHisto(); 00031 00032 private: 00033 void free(); 00034 void copy(const CHistogram &chisto); 00035 00036 00037 public: 00038 CHistogram(TH1 *h1, const TObject *inputsource, 00039 TH1 *subtracthisto = 0, TH1 *refhisto = 0 ); 00040 CHistogram(const CHistogram &chisto); 00041 CHistogram(const CObject &cobj); 00042 CHistogram(); 00043 00044 00045 //~CHistogram(); 00046 virtual ~CHistogram(); 00047 00048 00049 TH1* GetSubtractHisto() const { return fSubtractHisto; } 00050 TH1* GetRefHisto() const { return fRefHisto; } 00051 00052 void SetSubtractHisto(TH1* ); 00053 void SetRefHisto(TH1* ); 00054 00055 TH1* SubtractedHisto(); 00056 00057 00058 virtual void Draw( Option_t *option = "" ); 00059 virtual void Paint( Option_t *option = "" ); 00060 00061 TH1* GetHistoDrawn () const { return fHistoDrawn; } 00062 00063 CHistogram & operator=(const CHistogram &chisto); 00064 00065 ClassDef(CHistogram,1) 00066 }; 00067 00068 00069 #endif 00070 00071 00072
1.3.9.1