26 int npoints = points.
size();
28 for (
int i = 0; i < npoints; i++){
32 double val = this->
getVal(point);
36 for (
int w = 0; w < nW; w++){
38 double newW = oldW*val;
57 ERROR_LOG <<
"You need to set the domain of the fuction with setFuncLimits(const HyperCuboid& limits) to draw slices" << std::endl;
60 ERROR_LOG <<
"Your slice point has different dimensions to the function domain" << std::endl;
63 ERROR_LOG <<
"Your slice point in not within the function domain" << std::endl;
72 TH2D hist(name, name, nbins, minX, maxX, nbins, minY, maxY);
74 for (
int i = 1; i <= nbins; i++){
75 for (
int j = 1; j <= nbins; j++){
76 double x = hist.GetXaxis()->GetBinCenter(i);
77 double y = hist.GetYaxis()->GetBinCenter(j);
79 point.
at(sliceDimX) = x;
80 point.
at(sliceDimY) = y;
81 double val =
getVal(point);
82 hist.SetBinContent(i,j,val);
92 TH2D hist =
make2DFuncSlice(
"temp", sliceDimX, sliceDimY, slicePoint, nbins);
94 plotter.
plot(path,
"COLZ");
101 ERROR_LOG <<
"You need to set the domain of the fuction with setFuncLimits(const HyperCuboid& limits) to draw slices" << std::endl;
104 ERROR_LOG <<
"Your slice point has different dimensions to the function domain" << std::endl;
107 ERROR_LOG <<
"Your slice point in not within the function domain" << std::endl;
114 double width = (max - min)/
double(nSlices);
116 for (
int i = 0; i < nSlices; i++){
117 double val = min + width*(i + 0.5);
118 slicePointCp.
at(sliceSetDim) = val;
120 TString uniquePath = path;
121 uniquePath +=
"_sliceNum";
123 draw2DFuncSlice(uniquePath, sliceDimX, sliceDimY, slicePointCp, nbins);
136 if (i == sliceDimX)
continue;
137 if (i == sliceDimY)
continue;
139 TString thsPath = path;
140 thsPath +=
"_scanDim";
157 if (i >= j)
continue;
159 TString thsPath = path;
175 double val =
getVal(point);
176 double valother = other.
getVal(point);
177 return val - valother;
183 for (
unsigned i = 0; i < points.
size(); i++){
185 double valother = other.
getVal(points.
at(i));
186 hist.Fill( val, valother, points.
at(i).
getWeight() );
189 int nBinsX = hist.GetXaxis()->GetNbins();
190 int nBinsY = hist.GetYaxis()->GetNbins();
192 for (
int i = 1; i <= nBinsX; i++){
194 for (
int j = 1; j <= nBinsY; j++){
195 sumY += hist.GetBinContent(i,j);
197 for (
int j = 1; j <= nBinsY; j++){
198 double val = hist.GetBinContent(i,j);
199 val = (val / sumY)*100.0;
200 if (sumY == 0.0) val = 0.0;
201 hist.SetBinContent(i, j, val);
void draw2DFuncSliceSet(TString path, int sliceDimX, int sliceDimY, int sliceSetDim, int nSlices, const HyperPoint &slicePoint, int nbins=100) const
void setWeight(int i, double w)
void addWeight(const double &weight)
TH2D make2DFuncSlice(TString name, int sliceDimX, int sliceDimY, const HyperPoint &slicePoint, int nbins=100) const
void reweightDataset(HyperPointSet &points)
const int & getDimension() const
void draw2DFuncSlice(TString path, int sliceDimX, int sliceDimY, const HyperPoint &slicePoint, int nbins=100) const
const HyperPoint & at(int i) const
double getDifference(const HyperFunction &other, const HyperPoint &point)
const HyperPoint & getHighCorner() const
virtual void plot(TString plotDirectory, TString plotOptions="", TPad *pad=0, double scaleFactor=1.0)
void fillCorrelations(TH2D &hist, const HyperFunction &other, const HyperPointSet &points)
virtual double getVal(const HyperPoint &point) const =0
const double & at(int i) const
const HyperPoint & getLowCorner() const
unsigned int size() const
double getWeight(int i=0) const
void setFuncLimits(const HyperCuboid &limits)
bool inVolume(const HyperPoint &coords) const