Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooParamBinning.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Project: RooFit *
3 * Package: RooFitCore *
4 * File: $Id$
5 * Authors: *
6 * WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu *
7 * DK, David Kirkby, UC Irvine, dkirkby@uci.edu *
8 * *
9 * Copyright (c) 2000-2005, Regents of the University of California *
10 * and Stanford University. All rights reserved. *
11 * *
12 * Redistribution and use in source and binary forms, *
13 * with or without modification, are permitted according to the terms *
14 * listed in LICENSE (http://roofit.sourceforge.net/license.txt) *
15 *****************************************************************************/
16#ifndef ROO_PARAM_BINNING
17#define ROO_PARAM_BINNING
18
19#include "Rtypes.h"
20#include "RooAbsBinning.h"
21#include "RooRealVar.h"
22#include "RooListProxy.h"
23
25public:
26
27 RooParamBinning(const char* name=nullptr) ;
28 RooParamBinning(RooAbsReal& xlo, RooAbsReal& xhi, Int_t nBins, const char* name=nullptr) ;
29 RooParamBinning(const RooParamBinning& other, const char* name=nullptr) ;
30 RooAbsBinning* clone(const char* name=nullptr) const override { return new RooParamBinning(*this,name?name:GetName()) ; }
31 ~RooParamBinning() override ;
32
33 void setRange(double xlo, double xhi) override ;
34
35 Int_t numBoundaries() const override { return _nbins + 1 ; }
36 void binNumbers(double const * x, int * bins, std::size_t n, int coef) const override;
37
38 double lowBound() const override { return xlo()->getVal() ; }
39 double highBound() const override { return xhi()->getVal() ; }
40
41 double binCenter(Int_t bin) const override ;
42 double binWidth(Int_t bin) const override ;
43 double binLow(Int_t bin) const override ;
44 double binHigh(Int_t bin) const override ;
45
46 double averageBinWidth() const override { return _binw ; }
47 double* array() const override ;
48
49 void printMultiline(std::ostream &os, Int_t content, bool verbose=false, TString indent="") const override ;
50
51 void insertHook(RooAbsRealLValue&) const override ;
52 void removeHook(RooAbsRealLValue&) const override ;
53
54 bool isShareable() const override { return false ; } // parameterized binning cannot be shared across instances
55 bool isParameterized() const override { return true ; } // binning is parameterized, range will need special handling in integration
56 RooAbsReal* lowBoundFunc() const override { return xlo() ; }
57 RooAbsReal* highBoundFunc() const override { return xhi() ; }
58
59protected:
60
61 mutable double* _array = nullptr; //! do not persist
62 mutable RooAbsReal* _xlo = nullptr; //!
63 mutable RooAbsReal* _xhi = nullptr; //!
65 double _binw = 0;
66 mutable RooListProxy* _lp = nullptr; //
67 mutable RooAbsArg* _owner = nullptr; //
68
69 RooAbsReal* xlo() const { return _lp ? ((RooAbsReal*)_lp->at(0)) : _xlo ; }
70 RooAbsReal* xhi() const { return _lp ? ((RooAbsReal*)_lp->at(1)) : _xhi ; }
71
72 ClassDefOverride(RooParamBinning,3) // Binning specification with ranges parameterized by external RooAbsReal functions
73};
74
75#endif
#define ClassDefOverride(name, id)
Definition Rtypes.h:346
static void indent(ostringstream &buf, int indent_level)
char name[80]
Definition TGX11.cxx:110
Common abstract base class for objects that represent a value and a "shape" in RooFit.
Definition RooAbsArg.h:77
Abstract base class for RooRealVar binning definitions.
Abstract base class for objects that represent a real value that may appear on the left hand side of ...
Abstract base class for objects that represent a real value and implements functionality common to al...
Definition RooAbsReal.h:59
double getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
Definition RooAbsReal.h:103
RooAbsArg * at(Int_t idx) const
Return object at given index, or nullptr if index is out of range.
Definition RooArgList.h:110
Implementation of RooAbsBinning that constructs a binning with a range definition that depends on ext...
RooAbsReal * xhi() const
Int_t numBoundaries() const override
RooListProxy * _lp
RooAbsArg * _owner
double lowBound() const override
~RooParamBinning() override
Destructor.
RooAbsReal * _xhi
void insertHook(RooAbsRealLValue &) const override
Hook function called by RooAbsRealLValue when this binning is inserted as binning for into given owne...
double * array() const override
Return array of bin boundaries.
double binCenter(Int_t bin) const override
Return the central value of the 'i'-th fit bin.
double binHigh(Int_t bin) const override
Return the high edge of the 'i'-th fit bin.
double binLow(Int_t bin) const override
Return the low edge of the 'i'-th fit bin.
void binNumbers(double const *x, int *bins, std::size_t n, int coef) const override
Return the fit bin index for the current value.
double binWidth(Int_t bin) const override
Return average bin width.
bool isShareable() const override
If true (default), the range definition can be shared across clones of a RooRealVar.
double highBound() const override
bool isParameterized() const override
Interface function.
double averageBinWidth() const override
RooAbsReal * _xlo
do not persist
void printMultiline(std::ostream &os, Int_t content, bool verbose=false, TString indent="") const override
Print details of binning.
void removeHook(RooAbsRealLValue &) const override
Hook function called by RooAbsRealLValue when this binning is removed as binning for into given owner...
void setRange(double xlo, double xhi) override
Adjust range by adjusting values of external RooAbsReal values Only functional when external represen...
RooAbsBinning * clone(const char *name=nullptr) const override
RooAbsReal * xlo() const
RooAbsReal * lowBoundFunc() const override
Return pointer to RooAbsReal parameterized lower bound, if any.
RooAbsReal * highBoundFunc() const override
Return pointer to RooAbsReal parameterized upper bound, if any.
const char * GetName() const override
Returns name of object.
Definition TNamed.h:47
Basic string class.
Definition TString.h:139
Double_t x[n]
Definition legend1.C:17
const Int_t n
Definition legend1.C:16