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"
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 { return new RooParamBinning(*this,name?name:GetName()) ; }
32 virtual ~RooParamBinning() ;
33
34 virtual void setRange(Double_t xlo, Double_t xhi) ;
35
36 virtual Int_t numBoundaries() const { return _nbins + 1 ; }
37 virtual Int_t binNumber(Double_t x) const ;
38
39 virtual Double_t lowBound() const { return xlo()->getVal() ; }
40 virtual Double_t highBound() const { return xhi()->getVal() ; }
41
42 virtual Double_t binCenter(Int_t bin) const ;
43 virtual Double_t binWidth(Int_t bin) const ;
44 virtual Double_t binLow(Int_t bin) const ;
45 virtual Double_t binHigh(Int_t bin) const ;
46
47 virtual Double_t averageBinWidth() const { return _binw ; }
48 virtual Double_t* array() const ;
49
50 void printMultiline(std::ostream &os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const ;
51
52 virtual void insertHook(RooAbsRealLValue&) const ;
53 virtual void removeHook(RooAbsRealLValue&) const ;
54
55 virtual Bool_t isShareable() const { return kFALSE ; } // parameterized binning cannot be shared across instances
56 virtual Bool_t isParameterized() const { return kTRUE ; } // binning is parameterized, range will need special handling in integration
57 virtual RooAbsReal* lowBoundFunc() const { return xlo() ; }
58 virtual RooAbsReal* highBoundFunc() const { return xhi() ; }
59
60protected:
61
62 mutable Double_t* _array ; //! do not persist
63 mutable RooAbsReal* _xlo ; //!
64 mutable RooAbsReal* _xhi ; //!
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 ClassDef(RooParamBinning,2) // Binning specification with ranges parameterized by external RooAbsReal functions
74};
75
76#endif
const Bool_t kFALSE
Definition RtypesCore.h:92
double Double_t
Definition RtypesCore.h:59
const Bool_t kTRUE
Definition RtypesCore.h:91
#define ClassDef(name, id)
Definition Rtypes.h:325
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.
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:61
Double_t getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
Definition RooAbsReal.h:91
RooAbsArg * at(Int_t idx) const
Return object at given index, or nullptr if index is out of range.
Definition RooArgList.h:70
RooListProxy is the concrete proxy for RooArgList objects.
Class RooParamBinning is an implementation of RooAbsBinning that constructs a binning with a range de...
RooAbsReal * xhi() const
virtual Double_t lowBound() const
virtual Double_t binWidth(Int_t bin) const
Return average bin width.
RooListProxy * _lp
RooAbsArg * _owner
virtual ~RooParamBinning()
Destructor.
virtual RooAbsReal * lowBoundFunc() const
Return pointer to RooAbsReal parameterized lower bound, if any.
virtual Int_t binNumber(Double_t x) const
Return the fit bin index for the current value.
RooAbsReal * _xhi
virtual Bool_t isShareable() const
If true (default), the range definition can be shared across clones of a RooRealVar.
void printMultiline(std::ostream &os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const
Print details of binning.
virtual Double_t binCenter(Int_t bin) const
Return the central value of the 'i'-th fit bin.
virtual Double_t highBound() const
virtual Double_t binLow(Int_t bin) const
Return the low edge of the 'i'-th fit bin.
virtual void removeHook(RooAbsRealLValue &) const
Hook function called by RooAbsRealLValue when this binning is removed as binning for into given owner...
RooAbsReal * _xlo
do not persist
virtual Int_t numBoundaries() const
virtual void setRange(Double_t xlo, Double_t xhi)
Adjust range by adjusting values of external RooAbsReal values Only functional when external represen...
virtual Double_t averageBinWidth() const
virtual Double_t * array() const
Return array of bin boundaries.
RooAbsReal * xlo() const
virtual RooAbsReal * highBoundFunc() const
Return pointer to RooAbsReal parameterized upper bound, if any.
virtual Double_t binHigh(Int_t bin) const
Return the high edge of the 'i'-th fit bin.
RooAbsBinning * clone(const char *name=0) const
virtual void insertHook(RooAbsRealLValue &) const
Hook function called by RooAbsRealLValue when this binning is inserted as binning for into given owne...
virtual Bool_t isParameterized() const
Interface function.
Iterator abstract base class.
Definition TIterator.h:30
virtual const char * GetName() const
Returns name of object.
Definition TNamed.h:47
Basic string class.
Definition TString.h:136
Double_t x[n]
Definition legend1.C:17