File indexing completed on 2025-09-15 09:12:58
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef ROOT_TH1K
0013 #define ROOT_TH1K
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024 #include "TH1.h"
0025
0026 class TH1K : public TH1, public TArrayF {
0027
0028 private:
0029 void Sort();
0030 protected:
0031 Int_t fReady = 0;
0032 Int_t fNIn = 0;
0033 Int_t fKOrd = 3;
0034 Int_t fKCur = 0;
0035
0036 Double_t RetrieveBinContent(Int_t bin) const override { return GetBinContent(bin); }
0037 void UpdateBinContent(Int_t bin, Double_t content) override { fArray[bin] = Float_t (content); }
0038
0039 public:
0040 TH1K();
0041 TH1K(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup,Int_t k=0);
0042
0043
0044
0045 void AddBinContent(Int_t bin) override {++fArray[bin];}
0046
0047
0048
0049 void AddBinContent(Int_t bin, Double_t w) override
0050 { fArray[bin] += Float_t (w); }
0051
0052 void Copy(TObject &obj) const override;
0053 Int_t Fill(Double_t x) override;
0054 Int_t Fill(Double_t x,Double_t w) override{return TH1::Fill(x,w);}
0055 Int_t Fill(const char *name,Double_t w) override{return TH1::Fill(name,w);}
0056 Double_t GetBinContent(Int_t bin) const override;
0057 Double_t GetBinContent(Int_t bin,Int_t) const override {return GetBinContent(bin);}
0058 Double_t GetBinContent(Int_t bin,Int_t,Int_t) const override {return GetBinContent(bin);}
0059
0060 Double_t GetBinError(Int_t bin) const override;
0061 Double_t GetBinError(Int_t bin,Int_t) const override {return GetBinError(bin);}
0062 Double_t GetBinError(Int_t bin,Int_t,Int_t) const override {return GetBinError(bin);}
0063
0064
0065 void Reset(Option_t *option="") override;
0066 void SavePrimitive(std::ostream &out, Option_t *option = "") override;
0067
0068 void SetKOrd(Int_t k){fKOrd=k;}
0069
0070 ClassDefOverride(TH1K,2)
0071 };
0072
0073 #endif