Laura++
3.6.0
A maximum likelihood fitting package for performing Dalitz-plot analysis.
|
Go to the documentation of this file.
48 Bool_t useInterpolation,
49 Bool_t fluctuateBins ) :
51 hist_( hist ? dynamic_cast<TH1*>( hist->Clone() ) : 0 ),
52 useInterpolation_( useInterpolation ),
53 fluctuateBins_( fluctuateBins ),
62 hist_->SetDirectory( 0 );
66 TAxis* xAxis = hist_->GetXaxis();
73 std::cerr << "ERROR in Lau1DHistPdf::Lau1DHistPdf : Histogram axis minimum: " << axisMin_
74 << " does not correspond to abscissa minimum: " << this-> getMinAbscissa() << "."
76 gSystem->Exit( EXIT_FAILURE );
79 std::cerr << "ERROR in Lau1DHistPdf::Lau1DHistPdf : Histogram axis maximum: " << axisMax_
80 << " does not correspond to abscissa maximum: " << this-> getMaxAbscissa() << "."
82 gSystem->Exit( EXIT_FAILURE );
87 if ( fluctuateBins ) {
112 Int_t maxBin = hist_->GetMaximumBin();
113 Double_t height = hist_->GetBinContent( maxBin );
126 Double_t area( 0.0 );
134 Double_t norm = area * dx;
141 Double_t area( 0.0 );
142 Double_t areaNoNorm( 0.0 );
154 Double_t norm = area * dx;
156 std::cout << "INFO in Lau1DHistPdf::checkNormalisation : Area = " << area << ", dx = " << dx
158 std::cout << " : Area with no norm = " << areaNoNorm
159 << "*dx = " << areaNoNorm * dx << std::endl;
160 std::cout << " : The total area of the normalised histogram PDF is "
161 << norm << std::endl;
167 if ( ( bin < 1 ) || ( bin > nBins_ ) ) {
170 Double_t value = static_cast<Double_t >( hist_->GetBinContent( bin ) );
173 std::cerr << "WARNING in Lau1DHistPdf::getBinHistValue : Negative bin content set to zero!"
184 Double_t norm = this-> getNorm();
192 gSystem->Exit( EXIT_FAILURE );
196 Double_t abscissa = abscissas[0];
211 Int_t bin = hist_->FindFixBin( x );
220 Double_t cbinx = hist_->GetBinCenter( bin );
223 Double_t deltax = x - cbinx;
226 if ( deltax > 0.0 ) {
232 Bool_t isBoundary( kFALSE );
233 if ( bin_adj > nBins_ || bin_adj < 1 ) {
238 if ( isBoundary == kTRUE ) {
244 Double_t cbinx_adj = hist_->GetBinCenter( bin_adj );
245 Double_t deltax_adj = cbinx_adj - x;
247 Double_t dx0 = TMath::Abs( deltax );
248 Double_t dx1 = TMath::Abs( deltax_adj );
250 Double_t denom = dx0 + dx1;
255 Double_t value = value0 * dx1 + value1 * dx0;
264 for ( Int_t bin( 0 ); bin < nBins_; bin++ ) {
265 Double_t currentContent = hist_->GetBinContent( bin + 1 );
266 Double_t currentError = hist_->GetBinError( bin + 1 );
267 Double_t newContent = random->Gaus( currentContent, currentError );
268 if ( newContent < 0.0 ) {
269 hist_->SetBinContent( bin + 1, 0.0 );
271 hist_->SetBinContent( bin + 1, newContent );
File containing LauRandom namespace.
Class for defining the fit parameter objects.
virtual Double_t getMaxAbscissa() const Retrieve the maximum value of the (primary) abscissa.
Double_t value() const The value of the parameter.
virtual Double_t getMinAbscissa() const Retrieve the minimum value of the (primary) abscissa.
Double_t interpolateNorm(Double_t x) const Perform the interpolation and divide by the normalisation.
Double_t interpolate(Double_t x) const Perform the interpolation (unnormalised)
void doBinFluctuation() Fluctuate the histogram bin contents in accorance with their errors.
std::vector< Double_t > LauAbscissas The type used for containing multiple abscissa values.
virtual void calcPDFHeight(const LauKinematics *kinematics) Calculate the PDF height.
Double_t axisRange_ The histogram axis range.
Bool_t useInterpolation_ Control boolean for using the linear interpolation.
Double_t axisMin_ The histogram axis minimum.
virtual void setNorm(Double_t norm) Set the normalisation factor.
virtual void calcLikelihoodInfo(const LauAbscissas &abscissas) Calculate the likelihood (and intermediate info) for a given abscissa.
virtual ~Lau1DHistPdf() Destructor.
virtual void setUnNormPDFVal(Double_t unNormPDFVal) Set the unnormalised likelihood.
Int_t nBins_ The number of bins in the histogram.
virtual void calcNorm() Calculate the normalisation.
TRandom * randomFun() Access the singleton random number generator with a particular seed.
Class for defining the abstract interface for PDF classes.
TH1 * hist_ The underlying histogram.
void checkNormalisation() Check the normalisation calculation.
Pure abstract base class for defining a parameter containing an R value.
File containing declaration of Lau1DHistPdf class.
Double_t axisMax_ The histogram axis maximum.
virtual void setMaxHeight(Double_t maxHeight) Set the maximum height.
virtual Double_t getNorm() const Retrieve the normalisation factor.
Double_t getBinHistValue(Int_t bin) const Get the bin content from the histogram.
Class for calculating 3-body kinematic quantities.
virtual Bool_t heightUpToDate() const Check if the maximum height of the PDF is up to date.
Lau1DHistPdf(const TString &theVarName, const TH1 *hist, Double_t minAbscissa, Double_t maxAbscissa, Bool_t useInterpolation=kTRUE, Bool_t fluctuateBins=kFALSE) Constructor.
virtual Bool_t checkRange(const LauAbscissas &abscissas) const Check that all abscissas are within their allowed ranges.
|