Warning, file /include/root/TKDTreeBinning.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 #ifndef ROOT_TKDTreeBinning
0012 #define ROOT_TKDTreeBinning
0013
0014
0015
0016
0017
0018 #include <map>
0019 #include <vector>
0020
0021 #include "TKDTree.h"
0022
0023 namespace ROOT {
0024 namespace Fit {
0025 class BinData;
0026 }
0027 }
0028
0029 class TKDTreeBinning : public TObject {
0030 private:
0031
0032 std::vector<Double_t> fData;
0033 std::vector<Double_t> fBinMinEdges;
0034 std::vector<Double_t> fBinMaxEdges;
0035 std::vector<UInt_t> fIndices;
0036 TKDTreeID* fDataBins;
0037 UInt_t fNBins;
0038 UInt_t fDim;
0039 UInt_t fDataSize;
0040 std::vector<std::pair<Double_t, Double_t> > fDataThresholds;
0041 std::vector<std::vector<std::pair<Bool_t, Bool_t> > > fCheckedBinEdges;
0042 std::vector<std::map<Double_t, std::vector<UInt_t> > > fCommonBinEdges;
0043 Bool_t fIsSorted;
0044 Bool_t fIsSortedAsc;
0045 std::vector<UInt_t> fBinsContent;
0046 struct CompareAsc;
0047 friend struct CompareAsc;
0048 struct CompareDesc;
0049 friend struct CompareDesc;
0050 TKDTreeBinning(TKDTreeBinning& bins);
0051 TKDTreeBinning operator=(TKDTreeBinning& bins);
0052 void SetData(Double_t* data);
0053 void SetData(const std::vector<double> & data);
0054 void SetTreeData();
0055 void SetBinsEdges();
0056 void SetBinMinMaxEdges(Double_t* binEdges);
0057 void SetCommonBinEdges(Double_t* binEdges);
0058 void SetBinsContent();
0059 void ReadjustMinBinEdges(Double_t* binEdges);
0060 void ReadjustMaxBinEdges(Double_t* binEdges);
0061
0062
0063 public:
0064
0065
0066 enum {
0067 kAdjustBinEdges = BIT(14)
0068 };
0069
0070 TKDTreeBinning();
0071 TKDTreeBinning(UInt_t dataSize, UInt_t dataDim, Double_t* data, UInt_t nBins = 100, bool adjustBinEdges = false);
0072 TKDTreeBinning(UInt_t dataSize, UInt_t dataDim, const std::vector<double> & data, UInt_t nBins = 100, bool adjustBinEdges = false);
0073 ~TKDTreeBinning() override;
0074 void SetNBins(UInt_t bins);
0075 void SortBinsByDensity(Bool_t sortAsc = kTRUE);
0076 const Double_t* GetBinsMinEdges() const;
0077 const Double_t* GetBinsMaxEdges() const;
0078 std::pair<const Double_t*, const Double_t*> GetBinsEdges() const;
0079 std::pair<const Double_t*, const Double_t*> GetBinEdges(UInt_t bin) const;
0080 const Double_t* GetBinMinEdges(UInt_t bin) const;
0081 const Double_t* GetBinMaxEdges(UInt_t bin) const;
0082 UInt_t GetNBins() const;
0083 UInt_t GetDim() const;
0084 UInt_t GetBinContent(UInt_t bin) const;
0085 TKDTreeID* GetTree() const;
0086 const Double_t* GetDimData(UInt_t dim) const;
0087 Double_t GetDataMin(UInt_t dim) const;
0088 Double_t GetDataMax(UInt_t dim) const;
0089 Double_t GetBinDensity(UInt_t bin) const;
0090 Double_t GetBinVolume(UInt_t bin) const;
0091 const Double_t* GetBinCenter(UInt_t bin) const;
0092 const Double_t* GetBinWidth(UInt_t bin) const;
0093 UInt_t GetBinMaxDensity() const;
0094 UInt_t GetBinMinDensity() const;
0095 const Double_t* GetOneDimBinEdges() const;
0096 const Double_t* SortOneDimBinEdges(Bool_t sortAsc = kTRUE);
0097 void FillBinData(ROOT::Fit::BinData & data) const;
0098 UInt_t FindBin(const Double_t * point) const;
0099 std::vector<std::vector<Double_t> > GetPointsInBin(UInt_t bin) const;
0100
0101 ClassDefOverride(TKDTreeBinning, 1)
0102
0103 };
0104
0105 #endif
0106