#ifndef DDataBinning_h #define DDataBinning_h #include #include #include #include #include #include "TObject.h" using namespace std; class DDataBinning : public TObject { //BIN # STARTS AT ZERO!! public: DDataBinning(string locBinningName, const vector& locGridEdges_Primary, const vector& locBinSize_Primary, const vector >& locGridEdges_Secondary, const vector& locBinSize_Secondary); DDataBinning(string locBinningName, const vector& locBinEdges_Primary, const vector >& locBinEdges_Secondary); string dBinningName; /******************** GRID-ONLY (NOT VALID IF GRID CONTRUCTOR NOT USED) *******************/ //grid: primary vector dGridEdges_Primary; //index is group-edge vector dBinSize_Primary; //index is group //grid: secondary vector > dGridEdges_Secondary; //index is group vector dBinSize_Secondary; //index is group //grid: grouping size_t Get_NumBinGroups(void) const; size_t Get_NumPrimaryBins_InGroup(int locGroup) const; size_t Get_NumSecondaryBins_InGroup(int locGroup) const; size_t Get_NumBinsInGroup(int locGroup) const; int Get_BinGroupIndex(double locPrimaryValue) const; int Get_BinGroupIndex(size_t locOverallBinIndex) const; /******************************************************************************************/ double* Create_PrimaryBinArray(int& locSize) const; //full vector dBinEdges_Primary; vector > dBinEdges_Secondary; //get # bins size_t Get_NumPrimaryBins(void) const; size_t Get_NumSecondaryBins_InPrimaryBin(int locPrimaryBin) const; size_t Get_TotalNumBins(void) const; //get bin indices int Get_PrimaryBinIndex(double locPrimaryValue) const; bool Get_BinIndices(double locPrimaryValue, double locSecondaryValue, int& locPrimaryBinIndex, int& locSecondaryBinIndex) const; bool Get_BinIndices(size_t locOverallBinIndex, int& locPrimaryBinIndex, int& locSecondaryBinIndex) const; private: DDataBinning(void){} void Generate_BinningGrid(void); bool Get_BinIndices_Grid(size_t locOverallBinIndex, int& locPrimaryBinIndex, int& locSecondaryBinIndex) const; bool Get_BinIndices_NonGrid(size_t locOverallBinIndex, int& locPrimaryBinIndex, int& locSecondaryBinIndex) const; ClassDef(DDataBinning, 1) }; #endif