MINT2
Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
AlgOption Class Reference

#include <HyperBinningAlgorithms.h>

Public Types

enum  OptionName {
  EMTPY, START_DIM, BINNING_DIMS, RAND_SEED,
  MIN_BIN_WIDTH, MIN_BIN_CONTENT, MIN_SHADOW_BIN_CONTENT, USE_WEIGHTS,
  USE_SHADOW_DATA, DRAW_ALGORITHM, SNAP_TO_GRID, GRID_MULTIPLIER,
  AXIS_NAMES, FUNC, NUM_BIN_PAIRS, PHASE_BIN_EDGES,
  START_BINNING
}
 

Public Member Functions

bool isEmpty ()
 
OptionName getOptionName ()
 
bool getBoolOpt ()
 
int getIntOpt ()
 
double getDoubleOpt ()
 
TString getStringOpt ()
 
std::vector< int > getIntVectorOpt ()
 
std::vector< double > getDoubleVectorOpt ()
 
HyperPoint getHyperPointOpt ()
 
const HyperPointSetgetHyperPointSetOpt ()
 
HyperName getHyperNameOpt ()
 
HyperFunctiongetFuncOpt ()
 
const HyperBinninggetHyperBinningOpt ()
 
 ~AlgOption ()
 

Static Public Member Functions

static AlgOption Empty ()
 
static AlgOption StartDimension (int dim)
 
static AlgOption BinningDimensions (std::vector< int > dims)
 
static AlgOption RandomSeed (int seed)
 
static AlgOption MinBinWidth (double width)
 
static AlgOption MinBinWidth (HyperPoint widths)
 
static AlgOption MinBinContent (double val)
 
static AlgOption MinShadowBinContent (double val)
 
static AlgOption UseWeights (bool val=true)
 
static AlgOption UseShadowData (const HyperPointSet &data)
 
static AlgOption DrawAlgorithm (TString path)
 
static AlgOption AxisTitles (HyperName name)
 
static AlgOption UseFunction (HyperFunction *func)
 Use this if you want to provide a HyperFunction. More...
 
static AlgOption GridMultiplier (int val)
 
static AlgOption GridMultiplier (HyperPoint val)
 
static AlgOption SnapToGrid (bool val)
 
static AlgOption NumPhaseBinPairs (int val)
 
static AlgOption PhaseBinEdges (std::vector< double > val)
 
static AlgOption StartBinning (const HyperBinning &binning)
 

Private Member Functions

 AlgOption ()
 

Private Attributes

OptionName _optionName
 
bool _bool
 
int _int
 
double _double
 
std::vector< double > _doublevector
 
std::vector< int > _intvector
 
HyperPoint _hyperPoint
 
const HyperPointSet_hyperPointSet
 
TString _string
 
HyperName _hyperName
 
HyperFunction_hyperFunc
 
const HyperBinning_hyperBinning
 

Detailed Description

HyperPlot, Author: Sam Harnew, sam.h.nosp@m.arne.nosp@m.w@gma.nosp@m.il.c.nosp@m.om , Date: Dec 2015

This class allowes binning algorithm options to be passed to a HyperBinningHistogram. An instance of the class can only be made by one of it's static member functions - for instance:

These options are inturpreted by the HyperBinningAlgorithms class, which selects the correct binning algorithm and applies all the options passed to it

Definition at line 35 of file HyperBinningAlgorithms.h.

Member Enumeration Documentation

◆ OptionName

enum containing a list of avalible options one can pass to a binning algorithm

Enumerator
EMTPY 

Empty option

START_DIM 

The dimension to start splitting bins

BINNING_DIMS 

The dimensions that the algorithm is allowed to split

RAND_SEED 

Random seed used by the binning algorithm

MIN_BIN_WIDTH 

Minimum bin width

MIN_BIN_CONTENT 

Minimum bin content

MIN_SHADOW_BIN_CONTENT 

Minimum bin content for shadow events

USE_WEIGHTS 

Use weights for calculating the bin contents

USE_SHADOW_DATA 

Use a show datatset

DRAW_ALGORITHM 

Draw the binning at each iteration of the algorithm

SNAP_TO_GRID 

Ensure all bin edges are on a grid

GRID_MULTIPLIER 

Set the grid multiplier

AXIS_NAMES 

The axis names (that are provided by a HyperName)

FUNC 

Pass a HyperFunction to the binning alg

NUM_BIN_PAIRS 

Set the number of bin pairs in the PhaseBinning algorithm (cisi binning)

PHASE_BIN_EDGES 

Set the bin edges for the phase binning (cisi binning)

START_BINNING 

Rather than stating from some n-dim limits, start from an exisiting binning

Definition at line 41 of file HyperBinningAlgorithms.h.

Constructor & Destructor Documentation

◆ AlgOption()

AlgOption::AlgOption ( )
private

The empty constuctor which is private. This means it can only be called from a static member function

Definition at line 5 of file HyperBinningAlgorithms.cpp.

5  :
7  _bool(false),
8  _int(0),
9  _double(0.0),
10  _hyperPoint(0),
11  _hyperPointSet(0),
12  _hyperName(0),
13  _hyperFunc(0)
14 {
15 
16 }
HyperName _hyperName
HyperFunction * _hyperFunc
OptionName _optionName
const HyperPointSet * _hyperPointSet
HyperPoint _hyperPoint

◆ ~AlgOption()

AlgOption::~AlgOption ( )

Definition at line 266 of file HyperBinningAlgorithms.cpp.

266  {
267 
268 }

Member Function Documentation

◆ AxisTitles()

AlgOption AlgOption::AxisTitles ( HyperName  name)
static

Use this if you want to set the axis titles - can also do this later, unless you want axis titles for the DrawAlgorithm() option.

Definition at line 121 of file HyperBinningAlgorithms.cpp.

121  {
122  AlgOption algOption;
123  algOption._optionName = AXIS_NAMES;
124  algOption._hyperName = name;
125  return algOption;
126 }
HyperName _hyperName
OptionName _optionName

◆ BinningDimensions()

AlgOption AlgOption::BinningDimensions ( std::vector< int >  dims)
static

Get the BINNING_DIMS AlgOption, which tells the binning algorithm what dimensions its allowed to split

Definition at line 38 of file HyperBinningAlgorithms.cpp.

38  {
39  AlgOption algOption;
40  algOption._optionName = BINNING_DIMS;
41  algOption._intvector = dims;
42  return algOption;
43 }
std::vector< int > _intvector
OptionName _optionName

◆ DrawAlgorithm()

AlgOption AlgOption::DrawAlgorithm ( TString  path)
static

Use this if you want to draw the HyperBinning after every iteration

Definition at line 112 of file HyperBinningAlgorithms.cpp.

112  {
113  AlgOption algOption;
114  algOption._optionName = DRAW_ALGORITHM;
115  algOption._string = path;
116  return algOption;
117 }
OptionName _optionName

◆ Empty()

AlgOption AlgOption::Empty ( )
static

Get the EMTPY AlgOption, which takes no arguments.

Definition at line 20 of file HyperBinningAlgorithms.cpp.

20  {
21  AlgOption algOption;
22  algOption._optionName = EMTPY;
23  return algOption;
24 }
OptionName _optionName

◆ getBoolOpt()

bool AlgOption::getBoolOpt ( )

Get the boolean option

Definition at line 190 of file HyperBinningAlgorithms.cpp.

190  {
191  return _bool;
192 }

◆ getDoubleOpt()

double AlgOption::getDoubleOpt ( )

Get the double member

Definition at line 202 of file HyperBinningAlgorithms.cpp.

202  {
203  return _double;
204 }

◆ getDoubleVectorOpt()

std::vector< double > AlgOption::getDoubleVectorOpt ( )

Get the std::vector<double> member

Definition at line 221 of file HyperBinningAlgorithms.cpp.

221  {
222  return _doublevector;
223 }
std::vector< double > _doublevector

◆ getFuncOpt()

HyperFunction * AlgOption::getFuncOpt ( )

Definition at line 241 of file HyperBinningAlgorithms.cpp.

241  {
242  return _hyperFunc;
243 }
HyperFunction * _hyperFunc

◆ getHyperBinningOpt()

const HyperBinning * AlgOption::getHyperBinningOpt ( )

Get the HyperBinning member

Definition at line 254 of file HyperBinningAlgorithms.cpp.

254  {
255  return _hyperBinning;
256 }
const HyperBinning * _hyperBinning

◆ getHyperNameOpt()

HyperName AlgOption::getHyperNameOpt ( )

Get the HyperName member

Definition at line 248 of file HyperBinningAlgorithms.cpp.

248  {
249  return _hyperName;
250 }
HyperName _hyperName

◆ getHyperPointOpt()

HyperPoint AlgOption::getHyperPointOpt ( )

Get the HyperPoint member

Definition at line 227 of file HyperBinningAlgorithms.cpp.

227  {
228  return _hyperPoint;
229 }
HyperPoint _hyperPoint

◆ getHyperPointSetOpt()

const HyperPointSet & AlgOption::getHyperPointSetOpt ( )

Get the HyperPointSet member

Definition at line 233 of file HyperBinningAlgorithms.cpp.

233  {
234  if (_hyperPointSet == 0){
235  std::cout << "ERROR: No HyperPointSet hass been passed to AlgOption!" << std::endl;
236  return *(new HyperPointSet(0));
237  }
238  return *_hyperPointSet;
239 }
const HyperPointSet * _hyperPointSet

◆ getIntOpt()

int AlgOption::getIntOpt ( )

Get the integer option

Definition at line 196 of file HyperBinningAlgorithms.cpp.

196  {
197  return _int;
198 }

◆ getIntVectorOpt()

std::vector< int > AlgOption::getIntVectorOpt ( )

Get the std::vector<int> member

Definition at line 208 of file HyperBinningAlgorithms.cpp.

208  {
209  return _intvector;
210 }
std::vector< int > _intvector

◆ getOptionName()

AlgOption::OptionName AlgOption::getOptionName ( )

Get the AlgOption::OptionName

Definition at line 184 of file HyperBinningAlgorithms.cpp.

184  {
185  return _optionName;
186 }
OptionName _optionName

◆ getStringOpt()

TString AlgOption::getStringOpt ( )

Get the string member

Definition at line 214 of file HyperBinningAlgorithms.cpp.

214  {
215  return _string;
216 }

◆ GridMultiplier() [1/2]

AlgOption AlgOption::GridMultiplier ( int  val)
static

Definition at line 137 of file HyperBinningAlgorithms.cpp.

137  {
138  AlgOption algOption;
139  algOption._optionName = GRID_MULTIPLIER;
140  algOption._int = val;
141  return algOption;
142 }
OptionName _optionName

◆ GridMultiplier() [2/2]

AlgOption AlgOption::GridMultiplier ( HyperPoint  val)
static

Definition at line 144 of file HyperBinningAlgorithms.cpp.

144  {
145  AlgOption algOption;
146  algOption._optionName = GRID_MULTIPLIER;
147  algOption._hyperPoint = val;
148  return algOption;
149 }
OptionName _optionName
HyperPoint _hyperPoint

◆ isEmpty()

bool AlgOption::isEmpty ( )

Check if the OptionName is EMTPY

Definition at line 261 of file HyperBinningAlgorithms.cpp.

261  {
262  return _optionName == EMTPY;
263 }
OptionName _optionName

◆ MinBinContent()

AlgOption AlgOption::MinBinContent ( double  val)
static

Get the MIN_BIN_CONTENT AlgOption, which tells the binning algorithm the minimum bin content allowed.

Definition at line 74 of file HyperBinningAlgorithms.cpp.

74  {
75  AlgOption algOption;
76  algOption._optionName = MIN_BIN_CONTENT;
77  algOption._double = val;
78  return algOption;
79 }
OptionName _optionName

◆ MinBinWidth() [1/2]

AlgOption AlgOption::MinBinWidth ( double  width)
static

Get the MIN_BIN_WIDTH AlgOption, which tells the binning algorithm the minimum bin width that is allowed for ALL dimensions

Definition at line 56 of file HyperBinningAlgorithms.cpp.

56  {
57  AlgOption algOption;
58  algOption._optionName = MIN_BIN_WIDTH;
59  algOption._double = width;
60  return algOption;
61 }
OptionName _optionName

◆ MinBinWidth() [2/2]

AlgOption AlgOption::MinBinWidth ( HyperPoint  widths)
static

Get the MIN_BIN_WIDTH AlgOption, which tells the binning algorithm the minimum bin width that is allowed for EACH dimension

Definition at line 65 of file HyperBinningAlgorithms.cpp.

65  {
66  AlgOption algOption;
67  algOption._optionName = MIN_BIN_WIDTH;
68  algOption._hyperPoint = widths;
69  return algOption;
70 }
OptionName _optionName
HyperPoint _hyperPoint

◆ MinShadowBinContent()

AlgOption AlgOption::MinShadowBinContent ( double  val)
static

Get the MIN_SHADOW_BIN_CONTENT AlgOption, which tells the binning algorithm the minimum bin content allowed in the shadow dataset.

Definition at line 83 of file HyperBinningAlgorithms.cpp.

83  {
84  AlgOption algOption;
86  algOption._double = val;
87  return algOption;
88 }
OptionName _optionName

◆ NumPhaseBinPairs()

AlgOption AlgOption::NumPhaseBinPairs ( int  val)
static

Definition at line 159 of file HyperBinningAlgorithms.cpp.

159  {
160  AlgOption algOption;
161  algOption._optionName = NUM_BIN_PAIRS;
162  algOption._int = val;
163  return algOption;
164 }
OptionName _optionName

◆ PhaseBinEdges()

AlgOption AlgOption::PhaseBinEdges ( std::vector< double >  val)
static

Definition at line 166 of file HyperBinningAlgorithms.cpp.

166  {
167  AlgOption algOption;
168  algOption._optionName = PHASE_BIN_EDGES;
169  algOption._doublevector = val;
170  return algOption;
171 }
std::vector< double > _doublevector
OptionName _optionName

◆ RandomSeed()

AlgOption AlgOption::RandomSeed ( int  seed)
static

Get the RAND_SEED AlgOption, which tells the binning algorithm what random seed to use (not applicable to all algorithms).

Definition at line 47 of file HyperBinningAlgorithms.cpp.

47  {
48  AlgOption algOption;
49  algOption._optionName = RAND_SEED;
50  algOption._int = seed;
51  return algOption;
52 }
OptionName _optionName

◆ SnapToGrid()

AlgOption AlgOption::SnapToGrid ( bool  val)
static

Definition at line 151 of file HyperBinningAlgorithms.cpp.

151  {
152  AlgOption algOption;
153  algOption._optionName = SNAP_TO_GRID;
154  algOption._bool = val;
155  return algOption;
156 }
OptionName _optionName

◆ StartBinning()

AlgOption AlgOption::StartBinning ( const HyperBinning binning)
static

Definition at line 173 of file HyperBinningAlgorithms.cpp.

173  {
174  AlgOption algOption;
175  algOption._optionName = START_BINNING;
176  algOption._hyperBinning = &val;
177  return algOption;
178 }
OptionName _optionName
const HyperBinning * _hyperBinning

◆ StartDimension()

AlgOption AlgOption::StartDimension ( int  dim)
static

Get the START_DIM AlgOption, which tells the binning algorithm what dimension to split first (not applicable to all algorithms).

Definition at line 29 of file HyperBinningAlgorithms.cpp.

29  {
30  AlgOption algOption;
31  algOption._optionName = START_DIM;
32  algOption._int = dim;
33  return algOption;
34 }
OptionName _optionName

◆ UseFunction()

AlgOption AlgOption::UseFunction ( HyperFunction func)
static

Use this if you want to provide a HyperFunction.

Definition at line 129 of file HyperBinningAlgorithms.cpp.

129  {
130  AlgOption algOption;
131  algOption._optionName = FUNC;
132  algOption._hyperFunc = func;
133  return algOption;
134 }
HyperFunction * _hyperFunc
OptionName _optionName

◆ UseShadowData()

AlgOption AlgOption::UseShadowData ( const HyperPointSet data)
static

Get the USE_SHADOW_DATA AlgOption, which tells the binning algorithm if it should use the a shadow dataset. This allows each bin to have a specified number of events from both the dataset and the shadow dataset.

Definition at line 102 of file HyperBinningAlgorithms.cpp.

102  {
103  AlgOption algOption;
104  algOption._optionName = USE_SHADOW_DATA;
105  algOption._hyperPointSet = &data;
106  return algOption;
107 }
OptionName _optionName
const HyperPointSet * _hyperPointSet

◆ UseWeights()

AlgOption AlgOption::UseWeights ( bool  val = true)
static

Get the USE_WEIGHTS AlgOption, which tells the binning algorithm if it should use the event weights

Definition at line 92 of file HyperBinningAlgorithms.cpp.

92  {
93  AlgOption algOption;
94  algOption._optionName = USE_WEIGHTS;
95  algOption._bool = val;
96  return algOption;
97 }
OptionName _optionName

Member Data Documentation

◆ _bool

bool AlgOption::_bool
private

boolean option

Definition at line 65 of file HyperBinningAlgorithms.h.

◆ _double

double AlgOption::_double
private

double option

Definition at line 67 of file HyperBinningAlgorithms.h.

◆ _doublevector

std::vector<double> AlgOption::_doublevector
private

vector<double> option

Definition at line 68 of file HyperBinningAlgorithms.h.

◆ _hyperBinning

const HyperBinning* AlgOption::_hyperBinning
private

HyperBinning option

Definition at line 75 of file HyperBinningAlgorithms.h.

◆ _hyperFunc

HyperFunction* AlgOption::_hyperFunc
private

HyperFunction option

Definition at line 74 of file HyperBinningAlgorithms.h.

◆ _hyperName

HyperName AlgOption::_hyperName
private

HyperName option

Definition at line 73 of file HyperBinningAlgorithms.h.

◆ _hyperPoint

HyperPoint AlgOption::_hyperPoint
private

HyperPoint option

Definition at line 70 of file HyperBinningAlgorithms.h.

◆ _hyperPointSet

const HyperPointSet* AlgOption::_hyperPointSet
private

HyperPointSet option

Definition at line 71 of file HyperBinningAlgorithms.h.

◆ _int

int AlgOption::_int
private

integer option

Definition at line 66 of file HyperBinningAlgorithms.h.

◆ _intvector

std::vector<int> AlgOption::_intvector
private

vector<int> option

Definition at line 69 of file HyperBinningAlgorithms.h.

◆ _optionName

OptionName AlgOption::_optionName
private

the option that this particular intstance of the class represents

Definition at line 64 of file HyperBinningAlgorithms.h.

◆ _string

TString AlgOption::_string
private

string option

Definition at line 72 of file HyperBinningAlgorithms.h.


The documentation for this class was generated from the following files: