ROOT
6.06/09
Reference Guide
|
<- TKDTreeBinning - A class providing multidimensional binning ->
The class implements multidimensional binning by constructing a TKDTree inner structure from the data which is used as the bins. The bins are retrieved as two double*, one for the minimum bin edges, the other as the maximum bin edges. For one dimension one of these is enough to correctly define the bins. For the multidimensional case both minimum and maximum ones are necessary for the bins to be well defined. The bin edges of d-dimensional data is a d-tet of the bin's thresholds. For example if d=3 the minimum bin edges of bin b is of the form of the following array: {xbmin, ybmin, zbmin}. You also have the possibility to sort the bins by their density.
Details of usage can be found in $ROOTSYS/tutorials/math/kdTreeBinning.C
and more information on the embedded TKDTree documentation.
Definition at line 31 of file TKDTreeBinning.h.
Public Types | |
enum | { kAdjustBinEdges = BIT(14) } |
Public Types inherited from TObject | |
enum | EStatusBits { kCanDelete = BIT(0), kMustCleanup = BIT(3), kObjInCanvas = BIT(3), kIsReferenced = BIT(4), kHasUUID = BIT(5), kCannotPick = BIT(6), kNoContextMenu = BIT(8), kInvalidObject = BIT(13) } |
enum | { kIsOnHeap = 0x01000000, kNotDeleted = 0x02000000, kZombie = 0x04000000, kBitMask = 0x00ffffff } |
enum | { kSingleKey = BIT(0), kOverwrite = BIT(1), kWriteDelete = BIT(2) } |
Public Member Functions | |
TKDTreeBinning (UInt_t dataSize, UInt_t dataDim, Double_t *data, UInt_t nBins=100, bool adjustBinEdges=false) | |
~TKDTreeBinning () | |
void | SetNBins (UInt_t bins) |
void | SortBinsByDensity (Bool_t sortAsc=kTRUE) |
const Double_t * | GetBinsMinEdges () const |
const Double_t * | GetBinsMaxEdges () const |
std::pair< const Double_t *, const Double_t * > | GetBinsEdges () const |
std::pair< const Double_t *, const Double_t * > | GetBinEdges (UInt_t bin) const |
const Double_t * | GetBinMinEdges (UInt_t bin) const |
const Double_t * | GetBinMaxEdges (UInt_t bin) const |
UInt_t | GetNBins () const |
UInt_t | GetDim () const |
UInt_t | GetBinContent (UInt_t bin) const |
TKDTreeID * | GetTree () const |
const Double_t * | GetDimData (UInt_t dim) const |
Double_t | GetDataMin (UInt_t dim) const |
Double_t | GetDataMax (UInt_t dim) const |
Double_t | GetBinDensity (UInt_t bin) const |
Double_t | GetBinVolume (UInt_t bin) const |
const Double_t * | GetBinCenter (UInt_t bin) const |
const Double_t * | GetBinWidth (UInt_t bin) const |
UInt_t | GetBinMaxDensity () const |
UInt_t | GetBinMinDensity () const |
const Double_t * | GetOneDimBinEdges () const |
const Double_t * | SortOneDimBinEdges (Bool_t sortAsc=kTRUE) |
void | FillBinData (ROOT::Fit::BinData &data) const |
UInt_t | FindBin (const Double_t *point) const |
Public Member Functions inherited from TObject | |
TObject () | |
TObject (const TObject &object) | |
TObject copy ctor. More... | |
TObject & | operator= (const TObject &rhs) |
TObject assignment operator. More... | |
virtual | ~TObject () |
TObject destructor. More... | |
virtual void | AppendPad (Option_t *option="") |
Append graphics object to current pad. More... | |
virtual void | Browse (TBrowser *b) |
Browse object. May be overridden for another default action. More... | |
virtual const char * | ClassName () const |
Returns name of class to which the object belongs. More... | |
virtual void | Clear (Option_t *="") |
virtual TObject * | Clone (const char *newname="") const |
Make a clone of an object using the Streamer facility. More... | |
virtual Int_t | Compare (const TObject *obj) const |
Compare abstract method. More... | |
virtual void | Copy (TObject &object) const |
Copy this to obj. More... | |
virtual void | Delete (Option_t *option="") |
Delete this object. More... | |
virtual Int_t | DistancetoPrimitive (Int_t px, Int_t py) |
Computes distance from point (px,py) to the object. More... | |
virtual void | Draw (Option_t *option="") |
Default Draw method for all objects. More... | |
virtual void | DrawClass () const |
Draw class inheritance tree of the class to which this object belongs. More... | |
virtual TObject * | DrawClone (Option_t *option="") const |
Draw a clone of this object in the current pad. More... | |
virtual void | Dump () const |
Dump contents of object on stdout. More... | |
virtual void | Execute (const char *method, const char *params, Int_t *error=0) |
Execute method on this object with the given parameter string, e.g. More... | |
virtual void | Execute (TMethod *method, TObjArray *params, Int_t *error=0) |
Execute method on this object with parameters stored in the TObjArray. More... | |
virtual void | ExecuteEvent (Int_t event, Int_t px, Int_t py) |
Execute action corresponding to an event at (px,py). More... | |
virtual TObject * | FindObject (const char *name) const |
Must be redefined in derived classes. More... | |
virtual TObject * | FindObject (const TObject *obj) const |
Must be redefined in derived classes. More... | |
virtual Option_t * | GetDrawOption () const |
Get option used by the graphics system to draw this object. More... | |
virtual UInt_t | GetUniqueID () const |
Return the unique object id. More... | |
virtual const char * | GetName () const |
Returns name of object. More... | |
virtual const char * | GetIconName () const |
Returns mime type name of object. More... | |
virtual Option_t * | GetOption () const |
virtual char * | GetObjectInfo (Int_t px, Int_t py) const |
Returns string containing info about the object at position (px,py). More... | |
virtual const char * | GetTitle () const |
Returns title of object. More... | |
virtual Bool_t | HandleTimer (TTimer *timer) |
Execute action in response of a timer timing out. More... | |
virtual ULong_t | Hash () const |
Return hash value for this object. More... | |
virtual Bool_t | InheritsFrom (const char *classname) const |
Returns kTRUE if object inherits from class "classname". More... | |
virtual Bool_t | InheritsFrom (const TClass *cl) const |
Returns kTRUE if object inherits from TClass cl. More... | |
virtual void | Inspect () const |
Dump contents of this object in a graphics canvas. More... | |
virtual Bool_t | IsFolder () const |
Returns kTRUE in case object contains browsable objects (like containers or lists of other objects). More... | |
virtual Bool_t | IsEqual (const TObject *obj) const |
Default equal comparison (objects are equal if they have the same address in memory). More... | |
virtual Bool_t | IsSortable () const |
Bool_t | IsOnHeap () const |
Bool_t | IsZombie () const |
virtual Bool_t | Notify () |
This method must be overridden to handle object notification. More... | |
virtual void | ls (Option_t *option="") const |
The ls function lists the contents of a class on stdout. More... | |
virtual void | Paint (Option_t *option="") |
This method must be overridden if a class wants to paint itself. More... | |
virtual void | Pop () |
Pop on object drawn in a pad to the top of the display list. More... | |
virtual void | Print (Option_t *option="") const |
This method must be overridden when a class wants to print itself. More... | |
virtual Int_t | Read (const char *name) |
Read contents of object with specified name from the current directory. More... | |
virtual void | RecursiveRemove (TObject *obj) |
Recursively remove this object from a list. More... | |
virtual void | SaveAs (const char *filename="", Option_t *option="") const |
Save this object in the file specified by filename. More... | |
virtual void | SavePrimitive (std::ostream &out, Option_t *option="") |
Save a primitive as a C++ statement(s) on output stream "out". More... | |
virtual void | SetDrawOption (Option_t *option="") |
Set drawing option for object. More... | |
virtual void | SetUniqueID (UInt_t uid) |
Set the unique object id. More... | |
virtual void | UseCurrentStyle () |
Set current style settings in this object This function is called when either TCanvas::UseCurrentStyle or TROOT::ForceStyle have been invoked. More... | |
virtual Int_t | Write (const char *name=0, Int_t option=0, Int_t bufsize=0) |
Write this object to the current directory. More... | |
virtual Int_t | Write (const char *name=0, Int_t option=0, Int_t bufsize=0) const |
Write this object to the current directory. More... | |
void * | operator new (size_t sz) |
void * | operator new[] (size_t sz) |
void * | operator new (size_t sz, void *vp) |
void * | operator new[] (size_t sz, void *vp) |
void | operator delete (void *ptr) |
Operator delete. More... | |
void | operator delete[] (void *ptr) |
Operator delete []. More... | |
void | SetBit (UInt_t f, Bool_t set) |
Set or unset the user status bits as specified in f. More... | |
void | SetBit (UInt_t f) |
void | ResetBit (UInt_t f) |
Bool_t | TestBit (UInt_t f) const |
Int_t | TestBits (UInt_t f) const |
void | InvertBit (UInt_t f) |
virtual void | Info (const char *method, const char *msgfmt,...) const |
Issue info message. More... | |
virtual void | Warning (const char *method, const char *msgfmt,...) const |
Issue warning message. More... | |
virtual void | Error (const char *method, const char *msgfmt,...) const |
Issue error message. More... | |
virtual void | SysError (const char *method, const char *msgfmt,...) const |
Issue system error message. More... | |
virtual void | Fatal (const char *method, const char *msgfmt,...) const |
Issue fatal error message. More... | |
void | AbstractMethod (const char *method) const |
Use this method to implement an "abstract" method that you don't want to leave purely abstract. More... | |
void | MayNotUse (const char *method) const |
Use this method to signal that a method (defined in a base class) may not be called in a derived class (in principle against good design since a child class should not provide less functionality than its parent, however, sometimes it is necessary). More... | |
void | Obsolete (const char *method, const char *asOfVers, const char *removedFromVers) const |
Use this method to declare a method obsolete. More... | |
Private Member Functions | |
TKDTreeBinning (TKDTreeBinning &bins) | |
TKDTreeBinning | operator= (TKDTreeBinning &bins) |
void | SetData (Double_t *data) |
void | SetTreeData () |
void | SetBinsEdges () |
void | SetBinMinMaxEdges (Double_t *binEdges) |
void | SetCommonBinEdges (Double_t *binEdges) |
void | SetBinsContent () |
void | ReadjustMinBinEdges (Double_t *binEdges) |
void | ReadjustMaxBinEdges (Double_t *binEdges) |
Private Attributes | |
Double_t ** | fData |
std::vector< Double_t > | fBinMinEdges |
std::vector< Double_t > | fBinMaxEdges |
std::vector< UInt_t > | fIndices |
TKDTreeID * | fDataBins |
UInt_t | fNBins |
UInt_t | fDim |
UInt_t | fDataSize |
std::vector< std::pair< Double_t, Double_t > > | fDataThresholds |
std::vector< std::vector< std::pair< Bool_t, Bool_t > > > | fCheckedBinEdges |
std::vector< std::map< Double_t, std::vector< UInt_t > > > | fCommonBinEdges |
Bool_t | fIsSorted |
Bool_t | fIsSortedAsc |
std::vector< UInt_t > | fBinsContent |
Friends | |
struct | CompareAsc |
struct | CompareDesc |
Additional Inherited Members | |
Static Public Member Functions inherited from TObject | |
static Long_t | GetDtorOnly () |
Return destructor only flag. More... | |
static void | SetDtorOnly (void *obj) |
Set destructor only flag. More... | |
static Bool_t | GetObjectStat () |
Get status of object stat flag. More... | |
static void | SetObjectStat (Bool_t stat) |
Turn on/off tracking of objects in the TObjectTable. More... | |
Protected Member Functions inherited from TObject | |
void | MakeZombie () |
virtual void | DoError (int level, const char *location, const char *fmt, va_list va) const |
Interface to ErrorHandler (protected). More... | |
#include <TKDTreeBinning.h>
anonymous enum |
Enumerator | |
---|---|
kAdjustBinEdges |
Definition at line 65 of file TKDTreeBinning.h.
|
private |
TKDTreeBinning::TKDTreeBinning | ( | UInt_t | dataSize, |
UInt_t | dataDim, | ||
Double_t * | data, | ||
UInt_t | nBins = 100 , |
||
bool | adjustBinEdges = false |
||
) |
Definition at line 63 of file TKDTreeBinning.cxx.
TKDTreeBinning::~TKDTreeBinning | ( | ) |
Definition at line 87 of file TKDTreeBinning.cxx.
void TKDTreeBinning::FillBinData | ( | ROOT::Fit::BinData & | data | ) | const |
Definition at line 557 of file TKDTreeBinning.cxx.
Definition at line 567 of file TKDTreeBinning.cxx.
Referenced by testkdTreeBinning().
Definition at line 497 of file TKDTreeBinning.cxx.
Referenced by testkdTreeBinning().
Definition at line 373 of file TKDTreeBinning.cxx.
Referenced by FillBinData(), GetBinDensity(), and testkdTreeBinning().
Definition at line 418 of file TKDTreeBinning.cxx.
Referenced by FillBinData(), operator()(), and testkdTreeBinning().
Definition at line 350 of file TKDTreeBinning.cxx.
Referenced by GetBinCenter(), GetBinVolume(), and GetBinWidth().
UInt_t TKDTreeBinning::GetBinMaxDensity | ( | ) | const |
Definition at line 527 of file TKDTreeBinning.cxx.
Referenced by testkdTreeBinning().
Definition at line 337 of file TKDTreeBinning.cxx.
Referenced by FillBinData(), GetBinEdges(), and testkdTreeBinning().
UInt_t TKDTreeBinning::GetBinMinDensity | ( | ) | const |
Definition at line 542 of file TKDTreeBinning.cxx.
Referenced by testkdTreeBinning().
Definition at line 324 of file TKDTreeBinning.cxx.
Referenced by FillBinData(), GetBinEdges(), and testkdTreeBinning().
Definition at line 315 of file TKDTreeBinning.cxx.
const Double_t * TKDTreeBinning::GetBinsMaxEdges | ( | ) | const |
Definition at line 306 of file TKDTreeBinning.cxx.
Referenced by GetBinsEdges(), and testkdTreeBinning().
const Double_t * TKDTreeBinning::GetBinsMinEdges | ( | ) | const |
Definition at line 297 of file TKDTreeBinning.cxx.
Referenced by GetBinsEdges(), and testkdTreeBinning().
Definition at line 431 of file TKDTreeBinning.cxx.
Referenced by FillBinData(), and GetBinDensity().
Definition at line 512 of file TKDTreeBinning.cxx.
Definition at line 409 of file TKDTreeBinning.cxx.
Referenced by testkdTreeBinning().
Definition at line 400 of file TKDTreeBinning.cxx.
Referenced by testkdTreeBinning().
UInt_t TKDTreeBinning::GetDim | ( | ) | const |
Definition at line 368 of file TKDTreeBinning.cxx.
Referenced by testkdTreeBinning().
Definition at line 391 of file TKDTreeBinning.cxx.
UInt_t TKDTreeBinning::GetNBins | ( | ) | const |
Definition at line 363 of file TKDTreeBinning.cxx.
Referenced by testkdTreeBinning().
const double * TKDTreeBinning::GetOneDimBinEdges | ( | ) | const |
Definition at line 446 of file TKDTreeBinning.cxx.
TKDTreeID * TKDTreeBinning::GetTree | ( | ) | const |
Definition at line 383 of file TKDTreeBinning.cxx.
|
private |
Definition at line 278 of file TKDTreeBinning.cxx.
Referenced by SetBinsEdges().
Definition at line 249 of file TKDTreeBinning.cxx.
Referenced by SetBinsEdges().
Definition at line 216 of file TKDTreeBinning.cxx.
Referenced by SetBinsEdges().
|
private |
Definition at line 191 of file TKDTreeBinning.cxx.
Referenced by SetNBins().
|
private |
Definition at line 200 of file TKDTreeBinning.cxx.
Referenced by SetNBins().
Definition at line 228 of file TKDTreeBinning.cxx.
Referenced by SetBinsEdges().
Definition at line 176 of file TKDTreeBinning.cxx.
Referenced by TKDTreeBinning().
Definition at line 93 of file TKDTreeBinning.cxx.
Referenced by TKDTreeBinning().
|
private |
Definition at line 185 of file TKDTreeBinning.cxx.
Referenced by SetNBins().
Definition at line 123 of file TKDTreeBinning.cxx.
Referenced by testkdTreeBinning().
Definition at line 459 of file TKDTreeBinning.cxx.
|
friend |
Definition at line 47 of file TKDTreeBinning.h.
Referenced by GetBinMaxDensity(), GetBinMinDensity(), and SortBinsByDensity().
|
friend |
Definition at line 49 of file TKDTreeBinning.h.
Referenced by SortBinsByDensity().
|
private |
Definition at line 35 of file TKDTreeBinning.h.
Referenced by GetBinMaxEdges(), GetBinsMaxEdges(), SetBinMinMaxEdges(), SortBinsByDensity(), and SortOneDimBinEdges().
|
private |
Definition at line 34 of file TKDTreeBinning.h.
Referenced by GetBinMinEdges(), GetBinsMinEdges(), GetOneDimBinEdges(), SetBinMinMaxEdges(), SortBinsByDensity(), and SortOneDimBinEdges().
|
private |
Definition at line 46 of file TKDTreeBinning.h.
Referenced by GetBinContent(), SetBinsContent(), SortBinsByDensity(), and SortOneDimBinEdges().
Definition at line 42 of file TKDTreeBinning.h.
Referenced by ReadjustMaxBinEdges(), ReadjustMinBinEdges(), and SetBinsEdges().
Definition at line 43 of file TKDTreeBinning.h.
Referenced by ReadjustMinBinEdges(), SetBinsEdges(), and SetCommonBinEdges().
|
private |
Definition at line 33 of file TKDTreeBinning.h.
Referenced by GetDimData(), SetData(), SetTreeData(), TKDTreeBinning(), and ~TKDTreeBinning().
|
private |
Definition at line 37 of file TKDTreeBinning.h.
Referenced by FillBinData(), FindBin(), GetBinEdges(), GetBinMaxEdges(), GetBinMinEdges(), GetBinsEdges(), GetBinsMaxEdges(), GetBinsMinEdges(), GetTree(), SetBinsContent(), SetBinsEdges(), SetNBins(), SetTreeData(), and ~TKDTreeBinning().
|
private |
Definition at line 40 of file TKDTreeBinning.h.
Referenced by SetBinsContent(), SetData(), and SetNBins().
Definition at line 41 of file TKDTreeBinning.h.
Referenced by GetDataMax(), GetDataMin(), and SetData().
|
private |
Definition at line 39 of file TKDTreeBinning.h.
Referenced by FillBinData(), GetBinCenter(), GetBinMaxEdges(), GetBinMinEdges(), GetBinVolume(), GetBinWidth(), GetDataMax(), GetDataMin(), GetDim(), GetDimData(), GetOneDimBinEdges(), ReadjustMaxBinEdges(), ReadjustMinBinEdges(), SetBinMinMaxEdges(), SetBinsEdges(), SetCommonBinEdges(), SetData(), SetNBins(), SetTreeData(), SortBinsByDensity(), and SortOneDimBinEdges().
|
private |
Definition at line 36 of file TKDTreeBinning.h.
Referenced by FindBin(), SortBinsByDensity(), and SortOneDimBinEdges().
|
private |
Definition at line 44 of file TKDTreeBinning.h.
Referenced by FindBin(), GetBinMaxDensity(), GetBinMinDensity(), SortBinsByDensity(), and SortOneDimBinEdges().
|
private |
Definition at line 45 of file TKDTreeBinning.h.
Referenced by GetBinMaxDensity(), GetBinMinDensity(), SortBinsByDensity(), and SortOneDimBinEdges().
|
private |
Definition at line 38 of file TKDTreeBinning.h.
Referenced by FillBinData(), GetBinCenter(), GetBinContent(), GetBinDensity(), GetBinEdges(), GetBinMaxDensity(), GetBinMaxEdges(), GetBinMinDensity(), GetBinMinEdges(), GetBinVolume(), GetBinWidth(), GetNBins(), ReadjustMaxBinEdges(), ReadjustMinBinEdges(), SetBinMinMaxEdges(), SetBinsContent(), SetBinsEdges(), SetCommonBinEdges(), SetNBins(), SortBinsByDensity(), and SortOneDimBinEdges().