HyperPlot
v1
Bin and visualise multidimensional datasets
|
HyperPlot, Author: Sam Harnew, sam.h , Date: Dec 2015 arne w@gma il.c om
Binning Algorithms:
Binning Algorithm Options:
Definition at line 53 of file HyperHistogram.h.
#include <HyperHistogram.h>
Public Member Functions | |
HyperHistogram (const HyperCuboid &binningRange, const HyperPointSet &points, HyperBinningAlgorithms::Alg alg=HyperBinningAlgorithms::MINT, AlgOption opt0=AlgOption::Empty(), AlgOption opt1=AlgOption::Empty(), AlgOption opt2=AlgOption::Empty(), AlgOption opt3=AlgOption::Empty(), AlgOption opt4=AlgOption::Empty(), AlgOption opt5=AlgOption::Empty(), AlgOption opt6=AlgOption::Empty(), AlgOption opt7=AlgOption::Empty(), AlgOption opt8=AlgOption::Empty(), AlgOption opt9=AlgOption::Empty()) | |
HyperHistogram (const BinningBase &binning) | |
HyperHistogram (TString filename, TString option="MEMRES READ") | |
HyperHistogram (std::vector< TString > filename) | |
HyperHistogram (TString targetFilename, std::vector< TString > filename) | |
HyperHistogram (const HyperHistogram &other) | |
HyperHistogram & | operator= (const HyperHistogram &other) |
int | getDimension () const |
void | setNames (HyperName names) |
HyperName | getNames () const |
int | fill (const HyperPoint &coords, double weight) |
int | fill (const HyperPoint &coords) |
void | fill (const HyperPointSet &points) |
virtual void | merge (const HistogramBase &other) |
void | merge (TString filenameother) |
int | estimateCapacity (std::vector< TString > filename, TString binningType) |
void | project (TH1D *histogram, const HyperCuboid &cuboid, double content, int dimension) const |
void | project (TH1D *histogram, const HyperVolume &hyperVolume, double content, int dimension) const |
TH1D | project (int dim=0, int bins=100, TString name="projection") const |
void | drawProjection (TString path, int dim=0, int bins=100) const |
void | drawAllProjections (TString path, int bins) const |
void | compareProjection (TString path, int dim, const HyperHistogram &other, int bins=100) const |
void | compareAllProjections (TString path, const HyperHistogram &other, int bins=100) const |
HyperHistogram | slice (std::vector< int > sliceDims, const HyperPoint &slicePoint) const |
std::vector< HyperHistogram > | slice (std::vector< int > sliceDims, const HyperPointSet &slicePoints) const |
void | draw2DSlice (TString path, int sliceDimX, int sliceDimY, const HyperPoint &slicePoint) const |
void | draw2DSliceSet (TString path, int sliceDimX, int sliceDimY, int sliceSetDim, int nSlices, const HyperPoint &slicePoint) const |
void | draw2DSliceSet (TString path, int sliceDimX, int sliceDimY, int nSlices, const HyperPoint &slicePoint) const |
void | draw2DSliceSet (TString path, int nSlices, const HyperPoint &slicePoint) const |
void | drawRandom2DSlice (TString path, TRandom *random=gRandom) const |
HyperCuboid | getLimits () const |
const BinningBase & | getBinning () const |
virtual double | getVal (const HyperPoint &point) const |
std::vector< double > | getVal (const HyperPointSet &points) const |
virtual double | getBinVolume (int bin) const |
void | save (TString filename) |
TString | getBinningType (TString filename) |
void | load (TString filename, TString option="MEMRES READ") |
void | loadEmpty (TString filename, TString option="MEMRES READ", TString binningType="HyperBinning") |
void | setContentsFromFunc (const HyperFunction &func) |
void | printFull () const |
void | saveToTxtFile (TString filename) const |
void | draw (TString path) |
void | drawDensity (TString path) |
void | mergeBinsWithSameContent () |
virtual | ~HyperHistogram () |
Public Member Functions inherited from HistogramBase | |
HistogramBase (int nBins) | |
virtual | ~HistogramBase () |
int | checkBinNumber (int bin) const |
void | resetBinContents (int nBins) |
void | fillBase (int binNum, double weight) |
void | setBinContent (int bin, double val) |
void | setBinError (int bin, double val) |
double | getBinContent (int bin) const |
double | getBinError (int bin) const |
int | getNBins () const |
void | divide (const HistogramBase &other) |
void | multiply (const HistogramBase &other) |
void | add (const HistogramBase &other) |
void | minus (const HistogramBase &other) |
void | pulls (const HistogramBase &other) |
void | drawPullHistogram (const HistogramBase &other, TString name, int nBins=50, double pmLimits=3.5) const |
double | chi2 (const HistogramBase &other) const |
double | pvalue (const HistogramBase &other, int ndof=-1) const |
double | integral () const |
double | integralError () const |
void | randomiseWithinErrors (int seed) |
double | getMin () const |
double | getMax () const |
void | setMin (double min) |
void | setMax (double max) |
double | getMinDensity () const |
double | getMaxDensity () const |
void | setMinDensity (double min) |
void | setMaxDensity (double max) |
void | saveBase () |
void | saveBase (TString filename) |
void | loadBase (TString filename) |
void | normalise (double area=1.0) |
double | getFrequencyDensity (int bin) const |
void | reserveCapacity (int nElements) |
void | makeFrequencyDensity () |
void | print () |
Public Member Functions inherited from HyperFunction | |
HyperFunction () | |
HyperFunction (const HyperCuboid &limits) | |
void | reweightDataset (HyperPointSet &points) |
void | setFuncLimits (const HyperCuboid &limits) |
const HyperCuboid & | getFuncLimits () const |
TH2D | make2DFuncSlice (TString name, int sliceDimX, int sliceDimY, const HyperPoint &slicePoint, int nbins=100) const |
void | draw2DFuncSlice (TString path, int sliceDimX, int sliceDimY, const HyperPoint &slicePoint, int nbins=100) const |
void | draw2DFuncSliceSet (TString path, int sliceDimX, int sliceDimY, int sliceSetDim, int nSlices, const HyperPoint &slicePoint, int nbins=100) const |
void | draw2DFuncSliceSet (TString path, int sliceDimX, int sliceDimY, int nSlices, const HyperPoint &slicePoint, int nbins=100) const |
void | draw2DFuncSliceSet (TString path, int nSlices, const HyperPoint &slicePoint, int nbins=100) const |
double | getDifference (const HyperFunction &other, const HyperPoint &point) |
void | fillCorrelations (TH2D &hist, const HyperFunction &other, const HyperPointSet &points) |
virtual | ~HyperFunction () |
Protected Member Functions | |
HyperHistogram () | |
Protected Attributes | |
BinningBase * | _binning |
Protected Attributes inherited from HistogramBase | |
int | _nBins |
std::vector< double > | _binContents |
std::vector< double > | _sumW2 |
double | _min |
double | _max |
double | _minDensity |
double | _maxDensity |
|
protected |
Private constructor
Definition at line 238 of file HyperHistogram.cpp.
HyperHistogram::HyperHistogram | ( | const HyperCuboid & | binningRange, |
const HyperPointSet & | points, | ||
HyperBinningAlgorithms::Alg | alg = HyperBinningAlgorithms::MINT , |
||
AlgOption | opt0 = AlgOption::Empty() , |
||
AlgOption | opt1 = AlgOption::Empty() , |
||
AlgOption | opt2 = AlgOption::Empty() , |
||
AlgOption | opt3 = AlgOption::Empty() , |
||
AlgOption | opt4 = AlgOption::Empty() , |
||
AlgOption | opt5 = AlgOption::Empty() , |
||
AlgOption | opt6 = AlgOption::Empty() , |
||
AlgOption | opt7 = AlgOption::Empty() , |
||
AlgOption | opt8 = AlgOption::Empty() , |
||
AlgOption | opt9 = AlgOption::Empty() |
||
) |
Constuctor that adaptively bins the HyperPointSet provided, within the limits provided, and using the specified binning algorithm. Additionally, binning options can be selected which are passed to the binning algorithm.
Binning Algorithms:
Binning Algorithm Options:
Definition at line 48 of file HyperHistogram.cpp.
HyperHistogram::HyperHistogram | ( | const BinningBase & | binning | ) |
The most basic constructor - just pass anything that is derrived from BinningBase
Definition at line 9 of file HyperHistogram.cpp.
HyperHistogram::HyperHistogram | ( | TString | filename, |
TString | option = "MEMRES READ" |
||
) |
Load a HyperHistogram from filename. If
Definition at line 109 of file HyperHistogram.cpp.
HyperHistogram::HyperHistogram | ( | std::vector< TString > | filename | ) |
Load an array of HyperHistograms from different files and merge them into a memory resident HyperBinning
Definition at line 131 of file HyperHistogram.cpp.
HyperHistogram::HyperHistogram | ( | TString | targetFilename, |
std::vector< TString > | filename | ||
) |
Load an array of HyperHistograms from different files and merge them into a disk resident HyperBinning stored at 'targetFilename'
Definition at line 160 of file HyperHistogram.cpp.
|
virtual |
Destructor
Definition at line 1221 of file HyperHistogram.cpp.
void HyperHistogram::compareAllProjections | ( | TString | path, |
const HyperHistogram & | other, | ||
int | bins = 100 |
||
) | const |
Definition at line 1045 of file HyperHistogram.cpp.
void HyperHistogram::compareProjection | ( | TString | path, |
int | dim, | ||
const HyperHistogram & | other, | ||
int | bins = 100 |
||
) | const |
Definition at line 1033 of file HyperHistogram.cpp.
void HyperHistogram::draw | ( | TString | path | ) |
Draw the HyperHistogram - the drawing class used depends on the dimensionality of the data. This just plots the raw bin contents, not the frequency density.
Definition at line 591 of file HyperHistogram.cpp.
void HyperHistogram::drawAllProjections | ( | TString | path, |
int | bins | ||
) | const |
Definition at line 1021 of file HyperHistogram.cpp.
void HyperHistogram::drawDensity | ( | TString | path | ) |
Draw the frequency density of the HyperHistogram
Definition at line 613 of file HyperHistogram.cpp.
void HyperHistogram::drawProjection | ( | TString | path, |
int | dim = 0 , |
||
int | bins = 100 |
||
) | const |
Definition at line 1009 of file HyperHistogram.cpp.
int HyperHistogram::fill | ( | const HyperPoint & | coords, |
double | weight | ||
) |
Fill the HyperHistogram with a HyperPoint and aspecified weight
Definition at line 262 of file HyperHistogram.cpp.
int HyperHistogram::fill | ( | const HyperPoint & | coords | ) |
Fill the HyperHistogram with a HyperPoint. If the HyperPoint has a weight, use it.
Definition at line 273 of file HyperHistogram.cpp.
void HyperHistogram::fill | ( | const HyperPointSet & | points | ) |
Add a HyperPointSet to the HyperHistogram - if any of the HyperPoints are weighted, they will be used.
Definition at line 315 of file HyperHistogram.cpp.
|
inline |
get the HyperVolumeBinning
Definition at line 137 of file HyperHistogram.h.
TString HyperHistogram::getBinningType | ( | TString | filename | ) |
Get binning type from file
Definition at line 1139 of file HyperHistogram.cpp.
|
virtual |
Get the volume of a HyperVolume bin
Reimplemented from HistogramBase.
Definition at line 1214 of file HyperHistogram.cpp.
HyperCuboid HyperHistogram::getLimits | ( | ) | const |
Get the limits of the histogram
Definition at line 327 of file HyperHistogram.cpp.
HyperName HyperHistogram::getNames | ( | ) | const |
Get the HyperName (mainly used for axis labels)
Definition at line 251 of file HyperHistogram.cpp.
|
virtual |
Get the bin content where the given HyperPoint lies
Implements HyperFunction.
Definition at line 283 of file HyperHistogram.cpp.
std::vector< double > HyperHistogram::getVal | ( | const HyperPointSet & | points | ) | const |
Get the bin content for each HyperPoint in a HyperPointSet
Definition at line 293 of file HyperHistogram.cpp.
void HyperHistogram::load | ( | TString | filename, |
TString | option = "MEMRES READ" |
||
) |
Load the HyperHistogram from a TFile
Definition at line 1163 of file HyperHistogram.cpp.
|
virtual |
Merge two HyperHistograms
Reimplemented from HistogramBase.
Definition at line 335 of file HyperHistogram.cpp.
void HyperHistogram::merge | ( | TString | filenameother | ) |
Merge this histogram with another in a file
Definition at line 371 of file HyperHistogram.cpp.
void HyperHistogram::printFull | ( | ) | const |
Print all info about the HyperHistogram
Definition at line 638 of file HyperHistogram.cpp.
void HyperHistogram::project | ( | TH1D * | histogram, |
const HyperCuboid & | cuboid, | ||
double | content, | ||
int | dimension | ||
) | const |
Definition at line 653 of file HyperHistogram.cpp.
void HyperHistogram::project | ( | TH1D * | histogram, |
const HyperVolume & | hyperVolume, | ||
double | content, | ||
int | dimension | ||
) | const |
Definition at line 689 of file HyperHistogram.cpp.
TH1D HyperHistogram::project | ( | int | dim = 0 , |
int | bins = 100 , |
||
TString | name = "projection" |
||
) | const |
Definition at line 986 of file HyperHistogram.cpp.
void HyperHistogram::save | ( | TString | filename | ) |
Save the HyperHistogram to a TFile
Definition at line 1055 of file HyperHistogram.cpp.
void HyperHistogram::saveToTxtFile | ( | TString | filename | ) | const |
Save the HyperHistogram to a .txt file
Definition at line 1077 of file HyperHistogram.cpp.
void HyperHistogram::setContentsFromFunc | ( | const HyperFunction & | func | ) |
Set the bin contents of the histogram using parsed function. Will set bin errors to zero and use bin centers for evaluating function
Definition at line 384 of file HyperHistogram.cpp.
void HyperHistogram::setNames | ( | HyperName | names | ) |
Set the HyperName (mainly used for axis labels)
Definition at line 246 of file HyperHistogram.cpp.
HyperHistogram HyperHistogram::slice | ( | std::vector< int > | sliceDims, |
const HyperPoint & | slicePoint | ||
) | const |
Take a slice of the HyperHistogram and return it as HyperHistogram. The slice is taken in the given slice dimesions i.e. if we had a 5D space with dims [0 1 2 3 4] we could slice through dimensions 2 3 and 4 to return a 2D histogram in 0 vs. 1. The slice in dimensions 2 3 and 4 is taken from the given slicePoint
Definition at line 719 of file HyperHistogram.cpp.
|
protected |
The HyperVolumeBinning used for the HyperHistogram
Definition at line 57 of file HyperHistogram.h.