|
Laura++
3.6.0
A maximum likelihood fitting package for performing Dalitz-plot analysis.
|
Go to the documentation of this file.
44 Bool_t useInterpolation,
48 Bool_t useUpperHalfOnly,
51 hist_( hist ? dynamic_cast<TH2*>( hist->Clone() ) : 0 ),
64 useInterpolation_( useInterpolation )
67 std::cerr << "ERROR in Lau2DHistDP constructor : the histogram pointer is null." << std::endl;
68 gSystem->Exit( EXIT_FAILURE );
73 TAxis* xAxis = hist_->GetXaxis();
74 minX_ = static_cast<Double_t >( xAxis->GetXmin() );
75 maxX_ = static_cast<Double_t >( xAxis->GetXmax() );
78 TAxis* yAxis = hist_->GetYaxis();
79 minY_ = static_cast<Double_t >( yAxis->GetXmin() );
80 maxY_ = static_cast<Double_t >( yAxis->GetXmax() );
89 if ( fluctuateBins ) {
92 if ( avEff > 0.0 && avEffError > 0.0 ) {
101 Bool_t useInterpolation,
102 Bool_t fluctuateBins,
105 Bool_t useUpperHalfOnly,
108 hist_( hist ? dynamic_cast<TH2*>( hist->Clone() ) : 0 ),
109 errorHi_( errorHi ? dynamic_cast<TH2*>( errorHi->Clone() ) : 0 ),
110 errorLo_( errorLo ? dynamic_cast<TH2*>( errorLo->Clone() ) : 0 ),
121 useInterpolation_( useInterpolation )
124 std::cerr << "ERROR in Lau2DHistDP constructor : the histogram pointer is null." << std::endl;
125 gSystem->Exit( EXIT_FAILURE );
128 std::cerr << "ERROR in Lau2DHistDP constructor : the upper error histogram pointer is null."
130 gSystem->Exit( EXIT_FAILURE );
133 std::cerr << "ERROR in Lau2DHistDP constructor : the lower error histogram pointer is null."
135 gSystem->Exit( EXIT_FAILURE );
140 TAxis* xAxis = hist_->GetXaxis();
141 minX_ = static_cast<Double_t >( xAxis->GetXmin() );
142 maxX_ = static_cast<Double_t >( xAxis->GetXmax() );
145 TAxis* yAxis = hist_->GetYaxis();
146 minY_ = static_cast<Double_t >( yAxis->GetXmin() );
147 maxY_ = static_cast<Double_t >( yAxis->GetXmax() );
158 std::cerr << "ERROR in Lau2DHistDP constructor : the lower error histogram has a different number of bins to the main histogram."
160 gSystem->Exit( EXIT_FAILURE );
165 std::cerr << "ERROR in Lau2DHistDP constructor : the upper error histogram has a different number of bins to the main histogram."
167 gSystem->Exit( EXIT_FAILURE );
173 if ( static_cast<Double_t >( xAxis->GetXmin() ) != minX_ ||
174 static_cast<Double_t >( xAxis->GetXmax() ) != maxX_ ) {
175 std::cerr << "ERROR in Lau2DHistDP constructor : the lower error histogram has a different x range to the main histogram."
177 gSystem->Exit( EXIT_FAILURE );
180 if ( static_cast<Double_t >( yAxis->GetXmin() ) != minY_ ||
181 static_cast<Double_t >( yAxis->GetXmax() ) != maxY_ ) {
182 std::cerr << "ERROR in Lau2DHistDP constructor : the lower error histogram has a different y range to the main histogram."
184 gSystem->Exit( EXIT_FAILURE );
190 if ( static_cast<Double_t >( xAxis->GetXmin() ) != minX_ ||
191 static_cast<Double_t >( xAxis->GetXmax() ) != maxX_ ) {
192 std::cerr << "ERROR in Lau2DHistDP constructor : the upper error histogram has a different x range to the main histogram."
194 gSystem->Exit( EXIT_FAILURE );
197 if ( static_cast<Double_t >( yAxis->GetXmin() ) != minY_ ||
198 static_cast<Double_t >( yAxis->GetXmax() ) != maxY_ ) {
199 std::cerr << "ERROR in Lau2DHistDP constructor : the upper error histogram has a different y range to the main histogram."
201 gSystem->Exit( EXIT_FAILURE );
204 if ( fluctuateBins ) {
207 if ( avEff > 0.0 && avEffError > 0.0 ) {
230 } else if ( xBinNo >= nBinsX_ ) {
236 } else if ( yBinNo >= nBinsY_ ) {
240 Double_t value = hist_->GetBinContent( xBinNo + 1, yBinNo + 1 );
258 std::cerr << "WARNING in Lau2DHistDP::interpolateXY : Given position is outside the DP boundary, returning 0.0."
290 Double_t deltax = x - cbinx;
291 Double_t deltay = y - cbiny;
293 Int_t i_adj( 0 ), j_adj( 0 );
294 if ( deltax > 0.0 ) {
299 if ( deltay > 0.0 ) {
305 Bool_t isXBoundary( kFALSE ), isYBoundary( kFALSE );
307 Double_t value( 0.0 );
309 if ( i_adj >= nBinsX_ || i_adj < 0 ) {
312 if ( j_adj >= nBinsY_ || j_adj < 0 ) {
317 if ( isXBoundary == kTRUE && isYBoundary == kTRUE ) {
321 } else if ( isXBoundary == kTRUE && isYBoundary == kFALSE ) {
333 Double_t dx0 = TMath::Abs( x - cbinx );
334 Double_t dx1 = TMath::Abs( cbinx_adj - x );
335 Double_t inter_denom = dx0 + dx1;
340 value = ( value1 * dx1 + value2 * dx0 ) / inter_denom;
343 } else if ( isYBoundary == kTRUE && isXBoundary == kFALSE ) {
355 Double_t dy0 = TMath::Abs( y - cbiny );
356 Double_t dy1 = TMath::Abs( cbiny_adj - y );
357 Double_t inter_denom = dy0 + dy1;
362 value = ( value1 * dy1 + value2 * dy0 ) / inter_denom;
379 Double_t dx0 = TMath::Abs( x - cbinx );
380 Double_t dx1 = TMath::Abs( cbinx_adj - x );
381 Double_t dy0 = TMath::Abs( y - cbiny );
382 Double_t dy1 = TMath::Abs( cbiny_adj - y );
384 Double_t inter_denom = ( dx0 + dx1 ) * ( dy0 + dy1 );
391 value = value1 * dx1 * dy1 + value2 * dx0 * dy1 + value3 * dx1 * dy0 + value4 * dx0 * dy0;
392 value /= inter_denom;
Abstract base class for defining a variation across a 2D DP based on a histogram.
File containing LauRandom namespace.
Double_t binYWidth_ The histogram y-axis bin width.
void doBinFluctuation(TH2 *hist) Fluctuate the contents of each histogram bin independently, in accordance with their errors.
Int_t nBinsX_ The number of bins on the x-axis of the histogram.
Double_t interpolateXY(Double_t x, Double_t y) const Perform the interpolation.
Bool_t withinDPBoundaries(Double_t x, Double_t y) const Check whether the given co-ordinates are within the kinematic boundary.
Double_t value() const The value of the parameter.
Double_t rangeY_ The histogram y-axis range.
TH2 * errorHi_ The histogram containing the upper errors.
Double_t minX_ The histogram x-axis minimum.
Double_t minY_ The histogram y-axis minimum.
File containing declaration of Lau2DHistDP class.
void raiseOrLowerBins(TH2 *hist, const Double_t avEff, const Double_t avEffError) Rescale the histogram bin contents based on the desired average efficiency and its uncertainty.
Int_t nBinsY_ The number of bins on the y-axis of the histogram.
File containing declaration of LauDaughters class.
Double_t binXWidth_ The histogram x-axis bin width.
Double_t maxY_ The histogram y-axis maximum.
virtual ~Lau2DHistDP() Destructor.
TH2 * errorLo_ The histogram containing the lower errors.
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.
Double_t rangeX_ The histogram x-axis range.
Lau2DHistDP(const TH2 *hist, const LauDaughters *daughters, Bool_t useInterpolation=kTRUE, Bool_t fluctuateBins=kFALSE, Double_t avEff=-1.0, Double_t avEffError=-1.0, Bool_t useUpperHalfOnly=kFALSE, Bool_t squareDP=kFALSE) Constructor.
TH2 * hist_ The underlying histogram.
Class that defines the particular 3-body decay under study.
Double_t getBinHistValue(Int_t xBinNo, Int_t yBinNo) const Get the raw bin content from the histogram.
Bool_t useInterpolation_ Control boolean for using the linear interpolation.
File containing declaration of LauKinematics class.
Double_t maxX_ The histogram x-axis maximum.
|