30 Bool_t useInterpolation, Bool_t fluctuateBins, Bool_t useUpperHalfOnly, Bool_t squareDP) :
32 hist_(hist ? dynamic_cast<TH2*>(hist->Clone()) : 0),
33 minX_(0.0), maxX_(0.0), minY_(0.0), maxY_(0.0), rangeX_(0.0), rangeY_(0.0),
34 binXWidth_(0.0), binYWidth_(0.0),
35 invBinXWidth_(0.0), invBinYWidth_(0.0),
36 nBinsX_(0), nBinsY_(0),
38 useInterpolation_(useInterpolation)
48 TAxis* xAxis = hist_->GetXaxis();
49 minX_ = xAxis->GetXmin();
50 maxX_ = xAxis->GetXmax();
52 TAxis* yAxis = hist_->GetYaxis();
53 minY_ = yAxis->GetXmin();
54 maxY_ = yAxis->GetXmax();
56 nBinsX_ = hist_->GetNbinsX();
57 nBinsY_ = hist_->GetNbinsY();
59 minX_ = getKinematics()->getm13SqMin();
60 maxX_ = getKinematics()->getm13SqMax();
62 minY_ = getKinematics()->getm23SqMin();
63 maxY_ = getKinematics()->getm23SqMax();
69 rangeX_ = maxX_ - minX_;
70 rangeY_ = maxY_ - minY_;
71 if (nBinsX_ > 0) { binXWidth_ = TMath::Abs(rangeX_)/(nBinsX_*1.0); }
72 if (nBinsY_ > 0) { binYWidth_ = TMath::Abs(rangeY_)/(nBinsY_*1.0); }
73 if (binXWidth_ > 1e-10) { invBinXWidth_ = 1.0/binXWidth_; }
74 if (binYWidth_ > 1e-10) { invBinYWidth_ = 1.0/binYWidth_; }
79 this->doBinFluctuation(hist_);
86 this->checkNormalisation();
89 this->calcMaxHeight(hist_);
107 const Double_t axisMin = TMath::Min(
minX_,
minY_ );
108 const Double_t axisMax = TMath::Max(
maxX_,
maxY_ );
109 const Double_t axisRange = axisMax - axisMin;
111 const Double_t dx(1e-3 * axisRange);
112 const Double_t dy(dx);
116 Double_t x(axisMin + dx/2.0);
117 while (x < axisMax) {
118 Double_t y(axisMin + dy/2.0);
119 while (y < axisMax) {
135 }
else if (xBinNo >=
nBinsX_) {
141 }
else if (yBinNo >=
nBinsY_) {
149 Double_t
value =
hist_->GetBinContent(xBinNo+1, yBinNo+1);
180 Bool_t vetoOK(kTRUE);
184 if (vetoOK == kFALSE) {
return 0.0;}
209 Double_t deltax = x - cbinx;
210 Double_t deltay = y - cbiny;
212 Int_t i_adj(0), j_adj(0);
224 Bool_t isXBoundary(kFALSE), isYBoundary(kFALSE);
228 if (i_adj >=
nBinsX_ || i_adj < 0) {isYBoundary = kTRUE;}
229 if (j_adj >=
nBinsY_ || j_adj < 0) {isXBoundary = kTRUE;}
232 if (isXBoundary == kTRUE && isYBoundary == kTRUE) {
236 }
else if (isXBoundary == kTRUE && isYBoundary == kFALSE) {
248 Double_t dx0 = TMath::Abs(x - cbinx);
249 Double_t dx1 = TMath::Abs(cbinx_adj - x);
250 Double_t inter_denom = dx0 + dx1;
255 value = (value1*dx1 + value2*dx0)/inter_denom;
259 }
else if (isYBoundary == kTRUE && isXBoundary == kFALSE) {
271 Double_t dy0 = TMath::Abs(y - cbiny);
272 Double_t dy1 = TMath::Abs(cbiny_adj - y);
273 Double_t inter_denom = dy0 + dy1;
278 value = (value1*dy1 + value2*dy0)/inter_denom;
296 Double_t dx0 = TMath::Abs(x - cbinx);
297 Double_t dx1 = TMath::Abs(cbinx_adj - x);
298 Double_t dy0 = TMath::Abs(y - cbiny);
299 Double_t dy1 = TMath::Abs(cbiny_adj - y);
301 Double_t inter_denom = (dx0 + dx1)*(dy0 + dy1);
308 value = value1*dx1*dy1 + value2*dx0*dy1 + value3*dx1*dy0 + value4*dx0*dy0;
309 value /= inter_denom;
324 const Double_t axisMin = TMath::Min(
minX_,
minY_ );
325 const Double_t axisMax = TMath::Max(
maxX_,
maxY_ );
326 const Double_t axisRange = axisMax - axisMin;
328 const Double_t dx(1e-3 * axisRange);
329 const Double_t dy(dx);
332 Double_t areaNoNorm(0.0);
337 Double_t x(axisMin + dx/2.0);
338 while (x < axisMax) {
339 Double_t y(axisMin + dy/2.0);
340 while (y < axisMax) {
349 Double_t norm = area*dx*dy;
353 std::cout <<
"INFO in Lau2DHistDPPdf::checkNormalisation : Area = " << area <<
", dx = " << dx <<
", dy = " << dy <<
", dx*dy = " << dx*dy << std::endl;
354 std::cout <<
" : Area with no norm = " << areaNoNorm <<
"*dx*dy = " << areaNoNorm*dx*dy << std::endl;
355 std::cout <<
" : The total area of the normalised histogram PDF is " << norm << std::endl;
Double_t minY_
The histogram y-axis minimum.
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.
Bool_t passVeto(Double_t &m12Sq, Double_t &m23Sq, Double_t &m13Sq) const
Check whether the specified Dalitz plot point passes the vetoes.
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.