Logo ROOT  
Reference Guide
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"
23class TIterator ;
24
26public:
27
28 RooParamBinning(const char* name=0) ;
29 RooParamBinning(RooAbsReal& xlo, RooAbsReal& xhi, Int_t nBins, const char* name=0) ;
30 RooParamBinning(const RooParamBinning& other, const char* name=0) ;
31 RooAbsBinning* clone(const char* name=0) const override { return new RooParamBinning(*this,name?name:GetName()) ; }
32 ~RooParamBinning() override ;
33
34 void setRange(double xlo, double xhi) override ;
35
36 Int_t numBoundaries() const override { return _nbins + 1 ; }
37 Int_t binNumber(double x) const override ;
38
39 double lowBound() const override { return xlo()->getVal() ; }
40 double highBound() const override { return xhi()->getVal() ; }
41
42 double binCenter(Int_t bin) const override ;
43 double binWidth(Int_t bin) const override ;
44 double binLow(Int_t bin) const override ;
45 double binHigh(Int_t bin) const override ;
46
47 double averageBinWidth() const override { return _binw ; }
48 double* array() const override ;
49
50 void printMultiline(std::ostream &os, Int_t content, bool verbose=false, TString indent="") const override ;
51
52 void insertHook(RooAbsRealLValue&) const override ;
53 void removeHook(RooAbsRealLValue&) const override ;
54
55 bool isShareable() const override { return false ; } // parameterized binning cannot be shared across instances
56 bool isParameterized() const override { return true ; } // binning is parameterized, range will need special handling in integration
57 RooAbsReal* lowBoundFunc() const override { return xlo() ; }
58 RooAbsReal* highBoundFunc() const override { return xhi() ; }
59
60protected:
61
62 mutable double* _array ; //! do not persist
63 mutable RooAbsReal* _xlo ; //!
64 mutable RooAbsReal* _xhi ; //!
66 double _binw ;
67 mutable RooListProxy* _lp ; //
68 mutable RooAbsArg* _owner ; //
69
70 RooAbsReal* xlo() const { return _lp ? ((RooAbsReal*)_lp->at(0)) : _xlo ; }
71 RooAbsReal* xhi() const { return _lp ? ((RooAbsReal*)_lp->at(1)) : _xhi ; }
72
73 ClassDefOverride(RooParamBinning,3) // Binning specification with ranges parameterized by external RooAbsReal functions
74};
75
76#endif
#define ClassDefOverride(name, id)
Definition: Rtypes.h:339
static void indent(ostringstream &buf, int indent_level)
char name[80]
Definition: TGX11.cxx:110
RooAbsArg is the common abstract base class for objects that represent a value and a "shape" in RooFi...
Definition: RooAbsArg.h:72
RooAbsBinning is the abstract base class for RooRealVar binning definitions.
Definition: RooAbsBinning.h:26
RooAbsRealLValue is the common abstract base class for objects that represent a real value that may a...
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition: RooAbsReal.h:64
double getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
Definition: RooAbsReal.h:94
RooAbsArg * at(Int_t idx) const
Return object at given index, or nullptr if index is out of range.
Definition: RooArgList.h:110
Class RooParamBinning is an implementation of RooAbsBinning that constructs a binning with a range de...
RooAbsReal * xhi() const
Int_t numBoundaries() const override
RooListProxy * _lp
RooAbsArg * _owner
double lowBound() const override
~RooParamBinning() override
Destructor.
RooAbsReal * _xhi
RooParamBinning(const char *name=0)
Default constructor cout << "RooParamBinning(" << this << ") default ctor" << endl ;.
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.
double binWidth(Int_t bin) const override
Return average bin width.
RooAbsBinning * clone(const char *name=0) const override
bool isShareable() const override
If true (default), the range definition can be shared across clones of a RooRealVar.
double highBound() const override
Int_t binNumber(double x) const override
Return the fit bin index for the current value.
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...
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.
Iterator abstract base class.
Definition: TIterator.h:30
const char * GetName() const override
Returns name of object.
Definition: TNamed.h:47
Basic string class.
Definition: TString.h:136
Double_t x[n]
Definition: legend1.C:17