THStack.h

Go to the documentation of this file.
00001 // @(#)root/hist:$Id: THStack.h 28509 2009-05-11 07:19:52Z brun $
00002 // Author: Rene Brun   10/12/2001
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2001, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 
00012 #ifndef ROOT_THStack
00013 #define ROOT_THStack
00014 
00015 
00016 //////////////////////////////////////////////////////////////////////////
00017 //                                                                      //
00018 // THStack                                                              //
00019 //                                                                      //
00020 // A collection of histograms                                           //
00021 //                                                                      //
00022 //////////////////////////////////////////////////////////////////////////
00023 
00024 #ifndef ROOT_TH1
00025 #include "TH1.h"
00026 #endif
00027 #ifndef ROOT_TObjArray
00028 #include "TObjArray.h"
00029 #endif
00030 
00031 
00032 class TBrowser;
00033 
00034 class THStack : public TNamed {
00035 private:
00036    THStack& operator=(const THStack&); // Not implemented
00037 
00038 protected:
00039    TList      *fHists;      //Pointer to array of TH1
00040    TObjArray  *fStack;      //!Pointer to array of sums of TH1
00041    TH1        *fHistogram;  //Pointer to histogram used for drawing axis
00042    Double_t    fMaximum;    //Maximum value for plotting along y
00043    Double_t    fMinimum;    //Minimum value for plotting along y
00044 
00045    void BuildStack();
00046 
00047 public:
00048 
00049    THStack();
00050    THStack(const char *name, const char *title);
00051    THStack(const TH1* hist, Option_t *axis="x",
00052            const char *name=0, const char *title=0,
00053            Int_t firstbin=1, Int_t lastbin=-1,
00054            Int_t firstbin2=1, Int_t lastbin2=-1,
00055            Option_t* proj_option="", Option_t* draw_option="");
00056    THStack(const THStack &hstack);
00057    virtual ~THStack();
00058    virtual void     Add(TH1 *h, Option_t *option="");
00059    virtual void     Browse(TBrowser *b);
00060    virtual Int_t    DistancetoPrimitive(Int_t px, Int_t py);
00061    virtual void     Draw(Option_t *chopt="");
00062    TH1             *GetHistogram() const;
00063    TList           *GetHists()  const { return fHists; }
00064    TObjArray       *GetStack();
00065    virtual Double_t GetMaximum(Option_t *option="");
00066    virtual Double_t GetMinimum(Option_t *option="");
00067    TAxis           *GetXaxis() const;
00068    TAxis           *GetYaxis() const;
00069    virtual void     ls(Option_t *option="") const;
00070    virtual void     Modified();
00071    virtual void     Paint(Option_t *chopt="");
00072    virtual void     Print(Option_t *chopt="") const;
00073    virtual void     RecursiveRemove(TObject *obj);
00074    virtual void     SavePrimitive(ostream &out, Option_t *option = "");
00075    virtual void     SetHistogram(TH1 *h) {fHistogram = h;}
00076    virtual void     SetMaximum(Double_t maximum=-1111); // *MENU*
00077    virtual void     SetMinimum(Double_t minimum=-1111); // *MENU*
00078 
00079    ClassDef(THStack,2)  //A collection of histograms
00080 };
00081 
00082 #endif
00083 

Generated on Tue Jul 5 14:22:53 2011 for ROOT_528-00b_version by  doxygen 1.5.1