44 Bool_t useInterpolation, Bool_t fluctuateBins, Bool_t useUpperHalfOnly, Bool_t squareDP) :
46 hist_(hist ? dynamic_cast<TH2*>(hist->Clone()) : 0),
47 minX_(0.0), maxX_(0.0), minY_(0.0), maxY_(0.0), rangeX_(0.0), rangeY_(0.0),
48 binXWidth_(0.0), binYWidth_(0.0),
49 invBinXWidth_(0.0), invBinYWidth_(0.0),
50 nBinsX_(0), nBinsY_(0),
52 useInterpolation_(useInterpolation)
62 TAxis* xAxis = hist_->GetXaxis();
63 minX_ = xAxis->GetXmin();
64 maxX_ = xAxis->GetXmax();
66 TAxis* yAxis = hist_->GetYaxis();
67 minY_ = yAxis->GetXmin();
68 maxY_ = yAxis->GetXmax();
70 nBinsX_ = hist_->GetNbinsX();
71 nBinsY_ = hist_->GetNbinsY();
73 minX_ = getKinematics()->getm13SqMin();
74 maxX_ = getKinematics()->getm13SqMax();
76 minY_ = getKinematics()->getm23SqMin();
77 maxY_ = getKinematics()->getm23SqMax();
83 rangeX_ = maxX_ - minX_;
84 rangeY_ = maxY_ - minY_;
85 if (nBinsX_ > 0) { binXWidth_ = TMath::Abs(rangeX_)/(nBinsX_*1.0); }
86 if (nBinsY_ > 0) { binYWidth_ = TMath::Abs(rangeY_)/(nBinsY_*1.0); }
87 if (binXWidth_ > 1e-10) { invBinXWidth_ = 1.0/binXWidth_; }
88 if (binYWidth_ > 1e-10) { invBinYWidth_ = 1.0/binYWidth_; }
93 this->doBinFluctuation(hist_);
100 this->checkNormalisation();
103 this->calcMaxHeight(hist_);
121 const Double_t axisMin = TMath::Min(
minX_,
minY_ );
122 const Double_t axisMax = TMath::Max(
maxX_,
maxY_ );
123 const Double_t axisRange = axisMax - axisMin;
125 const Double_t dx(1e-3 * axisRange);
126 const Double_t dy(dx);
130 Double_t x(axisMin + dx/2.0);
131 while (x < axisMax) {
132 Double_t y(axisMin + dy/2.0);
133 while (y < axisMax) {
149 }
else if (xBinNo >=
nBinsX_) {
155 }
else if (yBinNo >=
nBinsY_) {
163 Double_t
value =
hist_->GetBinContent(xBinNo+1, yBinNo+1);
194 Bool_t vetoOK(kTRUE);
198 if (vetoOK == kFALSE) {
return 0.0;}
223 Double_t deltax = x - cbinx;
224 Double_t deltay = y - cbiny;
226 Int_t i_adj(0), j_adj(0);
238 Bool_t isXBoundary(kFALSE), isYBoundary(kFALSE);
242 if (i_adj >=
nBinsX_ || i_adj < 0) {isYBoundary = kTRUE;}
243 if (j_adj >=
nBinsY_ || j_adj < 0) {isXBoundary = kTRUE;}
246 if (isXBoundary == kTRUE && isYBoundary == kTRUE) {
250 }
else if (isXBoundary == kTRUE && isYBoundary == kFALSE) {
262 Double_t dx0 = TMath::Abs(x - cbinx);
263 Double_t dx1 = TMath::Abs(cbinx_adj - x);
264 Double_t inter_denom = dx0 + dx1;
269 value = (value1*dx1 + value2*dx0)/inter_denom;
273 }
else if (isYBoundary == kTRUE && isXBoundary == kFALSE) {
285 Double_t dy0 = TMath::Abs(y - cbiny);
286 Double_t dy1 = TMath::Abs(cbiny_adj - y);
287 Double_t inter_denom = dy0 + dy1;
292 value = (value1*dy1 + value2*dy0)/inter_denom;
310 Double_t dx0 = TMath::Abs(x - cbinx);
311 Double_t dx1 = TMath::Abs(cbinx_adj - x);
312 Double_t dy0 = TMath::Abs(y - cbiny);
313 Double_t dy1 = TMath::Abs(cbiny_adj - y);
315 Double_t inter_denom = (dx0 + dx1)*(dy0 + dy1);
322 value = value1*dx1*dy1 + value2*dx0*dy1 + value3*dx1*dy0 + value4*dx0*dy0;
323 value /= inter_denom;
338 const Double_t axisMin = TMath::Min(
minX_,
minY_ );
339 const Double_t axisMax = TMath::Max(
maxX_,
maxY_ );
340 const Double_t axisRange = axisMax - axisMin;
342 const Double_t dx(1e-3 * axisRange);
343 const Double_t dy(dx);
346 Double_t areaNoNorm(0.0);
351 Double_t x(axisMin + dx/2.0);
352 while (x < axisMax) {
353 Double_t y(axisMin + dy/2.0);
354 while (y < axisMax) {
363 Double_t norm = area*dx*dy;
367 std::cout <<
"INFO in Lau2DHistDPPdf::checkNormalisation : Area = " << area <<
", dx = " << dx <<
", dy = " << dy <<
", dx*dy = " << dx*dy << std::endl;
368 std::cout <<
" : Area with no norm = " << areaNoNorm <<
"*dx*dy = " << areaNoNorm*dx*dy << std::endl;
369 std::cout <<
" : The total area of the normalised histogram PDF is " << norm << std::endl;
Double_t minY_
The histogram y-axis minimum.
Bool_t passVeto(const LauKinematics *kinematics) const
Check whether the specified Dalitz plot point passes the vetoes.
Double_t norm_
The histogram normalisation.
Double_t invBinYWidth_
The histogram y-axis inverse bin width.
Double_t maxX_
The histogram x-axis maximum.
Double_t interpolateXYNorm(Double_t x, Double_t y) const
Perform the interpolation and divide by the normalisation.
Abstract base class for defining a variation across a 2D DP based on a histogram. ...
Bool_t withinDPBoundaries(Double_t x, Double_t y) const
Check whether the given co-ordinates are within the kinematic boundary.
Class for defining a 2D DP histogram PDF.
const LauVetoes * getVetoes() const
Get the vetoes object.
Int_t nBinsX_
The number of bins on the x-axis of the histogram.
File containing declaration of Lau2DHistDPPdf class.
Double_t binXWidth_
The histogram x-axis bin width.
File containing declaration of LauKinematics class.
TH2 * hist_
The underlying histogram.
void checkNormalisation()
Check the normalisation calculation.
Double_t minX_
The histogram x-axis minimum.
void getUpperHalf(Double_t &x, Double_t &y) const
If only using the upper half of the (symmetric) DP then transform into the correct half...
virtual ~Lau2DHistDPPdf()
Destructor.
Bool_t useInterpolation_
Control boolean for using the linear interpolation.
File containing LauRandom namespace.
Double_t invBinXWidth_
The histogram x-axis inverse bin width.
Double_t getBinHistValue(Int_t xBinNo, Int_t yBinNo) const
Get the bin content from the histogram.
const LauKinematics * getKinematics() const
Get the kinematics object.
Class for calculating 3-body kinematic quantities.
Double_t value() const
The value of the parameter.
void updateKinematics(Double_t x, Double_t y) const
Update the current co-ordinates in the kinematic space.
File containing declaration of LauVetoes class.
Double_t maxY_
The histogram y-axis maximum.
void calcHistNorm()
Calculate the PDF normalisation.
Double_t binYWidth_
The histogram y-axis bin width.
Int_t nBinsY_
The number of bins on the y-axis of the histogram.
Double_t interpolateXY(Double_t x, Double_t y) const
Perform the interpolation (unnormalised)
Class for defining vetoes within the Dalitz plot.