MINT2
|
#include <HyperBinningMakerPhaseBinning.h>
Public Member Functions | |
HyperBinningMakerPhaseBinning (const HyperCuboid &binningRange, HyperFunction *func) | |
virtual void | makeBinning () |
void | setNumBinPairs (int binpairs) |
void | setBinEdges (std::vector< double > binEdges) |
virtual int | gradientSplitAll () |
~HyperBinningMakerPhaseBinning () | |
Public Member Functions inherited from HyperBinningMaker | |
HyperBinningMaker (const HyperCuboid &binningRange, const HyperPointSet &data) | |
HyperBinningMaker (const HyperBinning &binning, const HyperPointSet &data) | |
void | setBinningDimensions (std::vector< int > dims) |
void | addShadowHyperPointSet (const HyperPointSet &data) |
void | setSeed (int seed) |
void | useSnapToGrid (bool val) |
void | setGridMultiplier (HyperPoint &multipliers) |
void | setGridMultiplier (double multiplier) |
void | useEventWeights (bool val=true) |
void | setMinimumBinContent (double val) |
void | setShadowMinimumBinContent (double val) |
void | setMinimumEdgeLength (double val) |
void | setMinimumEdgeLength (HyperPoint val) |
void | setHyperFunction (HyperFunction *fnc) |
Set the HyperFunction - only used by some binning Algs. More... | |
void | drawAfterEachIteration (TString path) |
void | updateFromExistingHyperBinning (const HyperBinning &binning) |
void | setNames (HyperName names) |
int & | getGlobalVolumeStatus (int volumeNumber) |
int & | getDimensionSpecificVolumeStatus (int volumeNumber, int dimension) |
const int & | getGlobalVolumeStatus (int volumeNumber) const |
const int & | getDimensionSpecificVolumeStatus (int volumeNumber, int dimension) const |
int | getNumContinueBins (int dimension=-1) const |
int | getNumBins () const |
int | getNumHyperVolumes () const |
int | split (int volumeNumber, int dimension, double splitPoint) |
HyperCuboid | splitBelowPoint (int dim, double splitPoint, const HyperCuboid &original, bool noSnapToGrid=false) const |
HyperCuboid | splitAbovePoint (int dim, double splitPoint, const HyperCuboid &original, bool noSnapToGrid=false) const |
double | getSumOfWeights (const HyperPointSet &hyperPointSet) const |
double | getWeight (const HyperPoint &hyperPoint) const |
bool | isValidBinningDimension (int dimension) |
virtual bool | passFunctionCriteria (HyperCuboid &cuboid1, HyperCuboid &cuboid2) |
HyperPointSet | filterHyperPointSet (const HyperPointSet &hyperPointSet, const HyperCuboid &hyperCuboid, bool print=false) const |
void | addBin (const HyperCuboid &hyperCuboid, const HyperPointSet &hyperPointSet, const HyperPointSet &shadowHyperPointSet, int status) |
void | setDimSpecStatusFromMinBinWidths (int volumeNumber) |
void | updateGlobalStatusFromDimSpecific (int volumeNumber) |
bool | snapToGrid (const HyperCuboid &cuboid, int dimension, double &splitCoord) const |
virtual void | startedAlgorithm () |
virtual void | startedIteration () |
void | drawCurrentState (TString path) const |
virtual void | finishedIteration () |
virtual void | finishedAlgorithm () |
HyperBinningMemRes | getHyperVolumeBinning () const |
HyperHistogram * | getHyperBinningHistogram () const |
HyperHistogram * | getShadowHyperBinningHistogram () const |
HyperHistogram * | getRatioHyperBinningHistogram () const |
virtual | ~HyperBinningMaker () |
destructor More... | |
double | countEventsBelowSplitPoint (int binNumber, int dimension, double splitPoint) const |
double | countEventsInHyperCuboid (const HyperPointSet &hyperPointSet, const HyperCuboid &hyperCuboid) const |
double | countShadowEventsBelowSplitPoint (int binNumber, int dimension, double splitPoint) const |
double | findSmartSplitPoint (int binNumber, int dimension, double dataFraction) const |
int | smartSplit (int binNumber, int dimension, double dataFraction) |
int | smartSplitAll (int dimension, double dataFraction) |
int | smartSplitAllRandomise (double dataFraction=0.5) |
int | smartMultiSplit (int binNumber, int dimension, int parts) |
int | smartMultiSplit (int binNumber, int dimension) |
int | smartMultiSplitAll (int dimension) |
double | findSmartSplitPointInt (int binNumber, int dimension, double dataFraction) const |
int | smartSplitInt (int binNumber, int dimension, double dataFraction) |
int | smartSplitAllInt (int dimension, double dataFraction) |
int | splitAll (int dimension, double splitPoint) |
int | splitAllRandomise (double splitPoint=0.5) |
int | likelihoodSplit (int binNumber) |
int | likelihoodSplitAll () |
int | smartLikelihoodSplit (int binNumber) |
int | smartLikelihoodSplitAll () |
void | getSplitToMinNeg2LLH (double &split, double &sig, int binNumber, int dimension, bool useConstraints=true) |
void | getDimWithLargestSplitSignificance (int &dim, double &split, int binNumber, bool useConstraints=true) |
TH1D * | scanSig (int binNumber, int dimension, int nbins, bool useConstraints=true) |
double | neg2LLH (int binNumber, int dimension, double splitPoint, bool useConstraints=true) |
double | nullNeg2LLH (int binNumber) |
Private Member Functions | |
int | splitByCoord (int volumeNumber, int dimension, HyperPoint &coord) |
int | getBinNumFromFunc (HyperPoint &point) |
int | getBinNumFromFuncVal (double phase) |
double | getLowBinBoundary (double phase) |
double | getHighBinBoundary (double phase) |
double | closestBinBoundary (double val) |
HyperPoint | getGrad (HyperPoint &point) |
HyperPoint | getGradPos (HyperPoint &point, double funcValAtPoint) |
double | getSecondDerivative (HyperPoint &point, HyperPoint &vector, double funcValAtPoint, double &deriv) |
int | splitDimFromGrad (int volumeNumber, HyperPoint gradient) |
virtual int | gradientSplit (int binNumber, int &dimension) |
int | systematicSplit (int volumeNumber, int dimension, double valAtCenter, HyperPoint gradient) |
HyperPointSet | getSplitCorners (int volumeNumber) |
HyperPointSet | getSplitFaces (int volumeNumber) |
HyperPointSet | getSplitEdges (int volumeNumber) |
HyperPoint | orderAndTestSplitPoints (HyperPointSet &points, HyperPoint &point, double valAtPoint, HyperPoint gradient) |
int | randomWalkSplit (int volumeNumber, int dimension) |
void | walkOrthogonal (HyperPoint &point, HyperCuboid &walkLimits) |
void | walk (HyperPoint &point, HyperCuboid &walkLimits) |
Private Attributes | |
int | _numBinPairs |
CyclicPhaseBins | _binEdges |
int | _maximumRandWalks |
int | _numWalkers |
double | _walkSizeFrac |
int | _numberOfSystematicSplits |
int | _numberOfGradientSplits |
Additional Inherited Members | |
Static Public Member Functions inherited from HyperBinningMaker | |
static void | setOutputLevel (bool val) |
Protected Attributes inherited from HyperBinningMaker | |
std::vector< HyperCuboid > | _hyperCuboids |
std::vector< std::vector< int > > | _linkedBins |
std::vector< HyperPointSet > | _hyperPointSets |
std::vector< HyperPointSet > | _shadowHyperPointSets |
std::vector< int > | _status |
std::vector< std::vector< int > > | _dimSpecificStatus |
std::vector< int > | _binningDimensions |
bool | _shadowAdded |
bool | _useEventWeights |
double | _minimumBinContent |
double | _shadowMinimumBinContent |
HyperPoint | _minimumEdgeLength |
TRandom * | _random |
bool | _drawAlgorithm |
TString | _drawAlgorithmDir |
int | _iterationNum |
HyperName | _names |
HyperFunction * | _func |
bool | _snapToGrid |
HyperPoint | _gridMultiplier |
Static Protected Attributes inherited from HyperBinningMaker | |
static bool | s_printBinning = true |
HyperPlot, Author: Sam Harnew, sam.h , Date: Dec 2015 arne w@gma il.c om
This algorithm takes a HyperFunction which describes some kind of phase motion i.e. map from R^n -> [-pi, pi]. In the final HyperVolumeBinning, each HyperVolume gets assigned a bin number depending on the phase at that HyperVolume center. The range [ -pi, pi ] is split uniformly into a given number of bin pairs (so total bins = bin pairs x 2 ). The numbering of bins is like so...
[ -pi, pi ] -> [ -_numBinPairs, ..., -1, +1, ... , +_numBinPairs ]
The algorithm tries to split HyperVolumes such that the bin number does not change within the HyperVolumes limits.
Definition at line 38 of file HyperBinningMakerPhaseBinning.h.
HyperBinningMakerPhaseBinning::HyperBinningMakerPhaseBinning | ( | const HyperCuboid & | binningRange, |
HyperFunction * | func | ||
) |
Constructor that initiates the base class HyperBinningMaker
Definition at line 9 of file HyperBinningMakerPhaseBinning.cpp.
HyperBinningMakerPhaseBinning::~HyperBinningMakerPhaseBinning | ( | ) |
Destructor
Definition at line 1021 of file HyperBinningMakerPhaseBinning.cpp.
|
private |
For a given phase, determine the closest bin boundary (as a phase)
Definition at line 183 of file HyperBinningMakerPhaseBinning.cpp.
|
private |
For a given HyperPoint, get the bin number
Definition at line 197 of file HyperBinningMakerPhaseBinning.cpp.
|
private |
For a given phase, get the bin number
Definition at line 163 of file HyperBinningMakerPhaseBinning.cpp.
|
private |
Evaluate the gradient at a given point. Step length is the minimium edge length. Function is evaluated at (x+h and x-h)
Definition at line 203 of file HyperBinningMakerPhaseBinning.cpp.
|
private |
Evaluate the gradient at a given point. Step length is the minimium edge length. Function is evaluated at (x+h) only
Definition at line 230 of file HyperBinningMakerPhaseBinning.cpp.
|
private |
For a given bin, get the upper phase boundary
Definition at line 177 of file HyperBinningMakerPhaseBinning.cpp.
|
private |
For a given bin, get the lower phase boundary
Definition at line 171 of file HyperBinningMakerPhaseBinning.cpp.
|
private |
Evaluate the second and first derivative in a given direction at a given point
Definition at line 255 of file HyperBinningMakerPhaseBinning.cpp.
|
private |
Get a list of all the corners of the volume number given
Definition at line 328 of file HyperBinningMakerPhaseBinning.cpp.
|
private |
Get a list of all the edge centers of the volume number given
Definition at line 444 of file HyperBinningMakerPhaseBinning.cpp.
|
private |
Get a list of all the face centers of the volume number given
Definition at line 395 of file HyperBinningMakerPhaseBinning.cpp.
|
privatevirtual |
The default split method. It uses the gradient of the function to predict where the boundary wetween two bin numbers is. If it fails, it will call the systematic split instead
Definition at line 699 of file HyperBinningMakerPhaseBinning.cpp.
|
virtual |
Definition at line 58 of file HyperBinningMakerPhaseBinning.cpp.
|
virtual |
run the algorithm
Implements HyperBinningMaker.
Definition at line 23 of file HyperBinningMakerPhaseBinning.cpp.
|
private |
See systematicSplit for a full description.
Definition at line 526 of file HyperBinningMakerPhaseBinning.cpp.
|
private |
Do random walk within the HyperVolume to search for a point where the bin number changes. Not really used anymore.
Definition at line 900 of file HyperBinningMakerPhaseBinning.cpp.
void HyperBinningMakerPhaseBinning::setBinEdges | ( | std::vector< double > | binEdges | ) |
set the bin edges - the highest bin edge is the lowest + pi, so only nBinPair edges need to be passed
Definition at line 157 of file HyperBinningMakerPhaseBinning.cpp.
void HyperBinningMakerPhaseBinning::setNumBinPairs | ( | int | binpairs | ) |
set the number of bin pairs (see class description of details)
Definition at line 146 of file HyperBinningMakerPhaseBinning.cpp.
|
private |
Split a HyperVolume in a given dimension at a given coord
Definition at line 136 of file HyperBinningMakerPhaseBinning.cpp.
|
private |
Use the graident at the center of the given volume number to decide what dimension to split in.
Definition at line 295 of file HyperBinningMakerPhaseBinning.cpp.
|
private |
This function looks at the function value at specific points within the HyperVolume. It uses the corners of the HyperVolume, a point in the middle of each face (NPlane), and a point in the middle of each edge. If the bin number changes at any of these points, it will result in the bin being split. To speed things up it uses the gradient at the HyperVolume center to order the points, on which are most liekly to result in a successful split. While looping through the points it estimates the uncertainty of the function estimate (from the graient). If the estimate indicates that the function is more than 5 sigma from a bin split, it will skip that point (and all remaining points since they are ordered)
Definition at line 633 of file HyperBinningMakerPhaseBinning.cpp.
|
private |
Do a random walk in a random dimension (within the walk limits)
Definition at line 113 of file HyperBinningMakerPhaseBinning.cpp.
|
private |
Do a random walk in one dimension (within the walk limits)
Definition at line 92 of file HyperBinningMakerPhaseBinning.cpp.
|
private |
Definition at line 43 of file HyperBinningMakerPhaseBinning.h.
|
private |
Definition at line 45 of file HyperBinningMakerPhaseBinning.h.
|
private |
Definition at line 50 of file HyperBinningMakerPhaseBinning.h.
|
private |
Definition at line 49 of file HyperBinningMakerPhaseBinning.h.
|
private |
Definition at line 42 of file HyperBinningMakerPhaseBinning.h.
|
private |
Definition at line 46 of file HyperBinningMakerPhaseBinning.h.
|
private |
Definition at line 47 of file HyperBinningMakerPhaseBinning.h.