Warning, file /include/root/THStack.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef ROOT_THStack
0013 #define ROOT_THStack
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024 #include "TNamed.h"
0025 #include "TObjArray.h"
0026
0027 #ifdef R__LESS_INCLUDES
0028 class TH1;
0029 class TList;
0030 class TAxis;
0031 #else
0032 #include "TH1.h"
0033 #endif
0034
0035 #include <limits>
0036
0037 class TBrowser;
0038 class TFileMergeInfo;
0039
0040 class THStack : public TNamed {
0041 private:
0042 THStack& operator=(const THStack&) = delete;
0043
0044 protected:
0045 TList *fHists{nullptr};
0046 TObjArray *fStack{nullptr};
0047 TH1 *fHistogram{nullptr};
0048 Double_t fMaximum{-1111};
0049 Double_t fMinimum{-1111};
0050
0051 void BuildStack();
0052
0053 void BuildAndPaint(Option_t *chopt, Bool_t paint);
0054
0055 public:
0056
0057 THStack() {}
0058 THStack(const char *name, const char *title);
0059 THStack(TH1* hist, Option_t *axis="x",
0060 const char *name = nullptr, const char *title = nullptr,
0061 Int_t firstbin = 1, Int_t lastbin = -1,
0062 Int_t firstbin2 = 1, Int_t lastbin2 = -1,
0063 Option_t *proj_option = "", Option_t *draw_option = "");
0064 THStack(const THStack &hstack);
0065 ~THStack() override;
0066 virtual void Add(TH1 *h, Option_t *option="");
0067 void BuildPrimitives(Option_t *chopt = "") { BuildAndPaint(chopt, kFALSE); }
0068 void Browse(TBrowser *b) override;
0069 Int_t DistancetoPrimitive(Int_t px, Int_t py) override;
0070 void Draw(Option_t *chopt="") override;
0071 TH1 *GetHistogram() const;
0072 TList *GetHists() const { return fHists; }
0073 TIter begin() const;
0074 TIter end() const { return TIter::End(); }
0075 Int_t GetNhists() const;
0076 TObjArray *GetStack();
0077 virtual Double_t GetMaximum(Option_t *option = "", Double_t maxval = std::numeric_limits<Double_t>::max());
0078 virtual Double_t GetMinimum(Option_t *option = "", Double_t minval = -std::numeric_limits<Double_t>::max());
0079 TAxis *GetXaxis() const;
0080 TAxis *GetYaxis() const;
0081 TAxis *GetZaxis() const;
0082 void ls(Option_t *option="") const override;
0083 virtual Long64_t Merge(TCollection* li, TFileMergeInfo *info);
0084 virtual void Modified();
0085 void Paint(Option_t *chopt = "") override;
0086 void Print(Option_t *chopt = "") const override;
0087 void RecursiveRemove(TObject *obj) override;
0088 void SavePrimitive(std::ostream &out, Option_t *option = "") override;
0089 virtual void SetHistogram(TH1 *h) { fHistogram = h; }
0090 virtual void SetMaximum(Double_t maximum=-1111);
0091 virtual void SetMinimum(Double_t minimum=-1111);
0092
0093 ClassDefOverride(THStack,2)
0094 };
0095
0096 #endif
0097