MINT2
|
#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, TString options="") const |
void | draw2DSliceSet (TString path, int sliceDimX, int sliceDimY, int sliceSetDim, int nSlices, const HyperPoint &slicePoint, TString options="") const |
void | draw2DSliceSet (TString path, int sliceDimX, int sliceDimY, int nSlices, const HyperPoint &slicePoint, TString options="") const |
void | draw2DSliceSet (TString path, int nSlices, const HyperPoint &slicePoint, TString options="") const |
void | drawRandom2DSlice (TString path, TRandom *random=gRandom, TString options="") 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, bool incError=true) const |
void | saveToTxtFileNoLinks (TString filename, bool incError=true) const |
void | draw (TString path, TString options="") |
void | drawDensity (TString path, TString options="") |
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 | clear () |
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 | pulls (const HistogramBase &other1, const HistogramBase &other2) |
void | asymmetry (const HistogramBase &other) |
void | asymmetry (const HistogramBase &other1, const HistogramBase &other2) |
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 | chi2sig (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 |
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.
|
protected |
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.
HyperHistogram::HyperHistogram | ( | const HyperHistogram & | other | ) |
Definition at line 226 of file HyperHistogram.cpp.
|
virtual |
void HyperHistogram::compareAllProjections | ( | TString | path, |
const HyperHistogram & | other, | ||
int | bins = 100 |
||
) | const |
Definition at line 1048 of file HyperHistogram.cpp.
void HyperHistogram::compareProjection | ( | TString | path, |
int | dim, | ||
const HyperHistogram & | other, | ||
int | bins = 100 |
||
) | const |
Definition at line 1036 of file HyperHistogram.cpp.
void HyperHistogram::draw | ( | TString | path, |
TString | options = "" |
||
) |
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 594 of file HyperHistogram.cpp.
void HyperHistogram::draw2DSlice | ( | TString | path, |
int | sliceDimX, | ||
int | sliceDimY, | ||
const HyperPoint & | slicePoint, | ||
TString | options = "" |
||
) | const |
Definition at line 825 of file HyperHistogram.cpp.
void HyperHistogram::draw2DSliceSet | ( | TString | path, |
int | sliceDimX, | ||
int | sliceDimY, | ||
int | sliceSetDim, | ||
int | nSlices, | ||
const HyperPoint & | slicePoint, | ||
TString | options = "" |
||
) | const |
Definition at line 861 of file HyperHistogram.cpp.
void HyperHistogram::draw2DSliceSet | ( | TString | path, |
int | sliceDimX, | ||
int | sliceDimY, | ||
int | nSlices, | ||
const HyperPoint & | slicePoint, | ||
TString | options = "" |
||
) | const |
Definition at line 904 of file HyperHistogram.cpp.
void HyperHistogram::draw2DSliceSet | ( | TString | path, |
int | nSlices, | ||
const HyperPoint & | slicePoint, | ||
TString | options = "" |
||
) | const |
Definition at line 963 of file HyperHistogram.cpp.
void HyperHistogram::drawAllProjections | ( | TString | path, |
int | bins | ||
) | const |
Definition at line 1024 of file HyperHistogram.cpp.
void HyperHistogram::drawDensity | ( | TString | path, |
TString | options = "" |
||
) |
Draw the frequency density of the HyperHistogram
Definition at line 616 of file HyperHistogram.cpp.
void HyperHistogram::drawProjection | ( | TString | path, |
int | dim = 0 , |
||
int | bins = 100 |
||
) | const |
Definition at line 1012 of file HyperHistogram.cpp.
void HyperHistogram::drawRandom2DSlice | ( | TString | path, |
TRandom * | random = gRandom , |
||
TString | options = "" |
||
) | const |
Definition at line 840 of file HyperHistogram.cpp.
int HyperHistogram::estimateCapacity | ( | std::vector< TString > | filename, |
TString | binningType | ||
) |
Definition at line 192 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 | ) |
|
virtual |
Get the volume of a HyperVolume bin
Reimplemented from HistogramBase.
Definition at line 1262 of file HyperHistogram.cpp.
int HyperHistogram::getDimension | ( | ) | const |
Definition at line 705 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 1211 of file HyperHistogram.cpp.
void HyperHistogram::loadEmpty | ( | TString | filename, |
TString | option = "MEMRES READ" , |
||
TString | binningType = "HyperBinning" |
||
) |
Definition at line 1241 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::mergeBinsWithSameContent | ( | ) |
Definition at line 403 of file HyperHistogram.cpp.
HyperHistogram & HyperHistogram::operator= | ( | const HyperHistogram & | other | ) |
Definition at line 95 of file HyperHistogram.cpp.
void HyperHistogram::printFull | ( | ) | const |
Print all info about the HyperHistogram
Definition at line 641 of file HyperHistogram.cpp.
void HyperHistogram::project | ( | TH1D * | histogram, |
const HyperCuboid & | cuboid, | ||
double | content, | ||
int | dimension | ||
) | const |
Definition at line 656 of file HyperHistogram.cpp.
void HyperHistogram::project | ( | TH1D * | histogram, |
const HyperVolume & | hyperVolume, | ||
double | content, | ||
int | dimension | ||
) | const |
Definition at line 692 of file HyperHistogram.cpp.
TH1D HyperHistogram::project | ( | int | dim = 0 , |
int | bins = 100 , |
||
TString | name = "projection" |
||
) | const |
Definition at line 989 of file HyperHistogram.cpp.
void HyperHistogram::save | ( | TString | filename | ) |
Save the HyperHistogram to a TFile
Definition at line 1058 of file HyperHistogram.cpp.
void HyperHistogram::saveToTxtFile | ( | TString | filename, |
bool | incError = true |
||
) | const |
Save the HyperHistogram to a .txt file
Definition at line 1080 of file HyperHistogram.cpp.
void HyperHistogram::saveToTxtFileNoLinks | ( | TString | filename, |
bool | incError = true |
||
) | const |
Definition at line 1148 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 722 of file HyperHistogram.cpp.
std::vector< HyperHistogram > HyperHistogram::slice | ( | std::vector< int > | sliceDims, |
const HyperPointSet & | slicePoints | ||
) | const |
Definition at line 768 of file HyperHistogram.cpp.
|
protected |
The HyperVolumeBinning used for the HyperHistogram
Definition at line 57 of file HyperHistogram.h.