#ifndef TPlot_h #define TPlot_h #include #include //class TH1; class TAxis; class TCanvas; class TString; class TLegend; class TPlot { public: TPlot(TH1* data, TH1* direct, TH1* resolved, bool log_b = true, bool lin_b = true); virtual ~TPlot(); void ShowLinear(bool); void ShowLog(bool); void ShowLegends(unsigned char flags = 1<<0 | 1<<1); void Plot(); void Print(TString const& psname); class BadInstantiated {}; private: //hide copies TPlot& operator= (TPlot const&); TPlot(TPlot const&); //============ protected: std::auto_ptr data_; std::auto_ptr direct_; std::auto_ptr resolved_; std::auto_ptr mcall_; virtual void SetGlobalStyles() const; virtual void SetXaxisStyles(TAxis* xaxis); virtual void SetYaxisStyles(TAxis* yaxis); virtual void SetHistoStyles(); virtual void SetPadStyles(); virtual void SetLegendStyles(TLegend* legend); private: std::auto_ptr canvas_; bool lin; bool log; bool legendlin; Double_t xlegendlin; Double_t ylegendlin; std::auto_ptr linleg_; bool legendlog; Double_t xlegendlog; Double_t ylegendlog; std::auto_ptr logleg_; void reset(); bool plotgood(); TLegend* MakeLegend(Double_t x, Double_t y); }; #endif