Logo ROOT   6.12/07
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"
23 class TIterator ;
24 
26 public:
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 
60 protected:
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
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:47
virtual Double_t lowBound() const
virtual RooAbsReal * lowBoundFunc() const
RooAbsReal * xhi() const
Double_t getVal(const RooArgSet *set=0) const
Definition: RooAbsReal.h:64
virtual Double_t averageBinWidth() const
virtual void insertHook(RooAbsRealLValue &) const
Hook function called by RooAbsRealLValue when this binning is inserted as binning for into given owne...
Basic string class.
Definition: TString.h:125
virtual void removeHook(RooAbsRealLValue &) const
Hook function called by RooAbsRealLValue when this binning is removed as binning for into given owner...
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
Iterator abstract base class.
Definition: TIterator.h:30
RooParamBinning(const char *name=0)
Default constructor cout << "RooParamBinning(" << this << ") default ctor" << endl ;...
virtual void setRange(Double_t xlo, Double_t xhi)
Adjust range by adjusting values of external RooAbsReal values Only functional when external represen...
Double_t x[n]
Definition: legend1.C:17
RooAbsReal * _xhi
#define ClassDef(name, id)
Definition: Rtypes.h:320
void printMultiline(std::ostream &os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const
Print details of binning.
virtual Bool_t isShareable() const
RooAbsArg * at(Int_t idx) const
Definition: RooArgList.h:84
virtual Int_t numBoundaries() const
RooAbsArg * _owner
virtual RooAbsReal * highBoundFunc() const
virtual Double_t binHigh(Int_t bin) const
Return the high edge of the &#39;i&#39;-th fit bin.
RooAbsReal * xlo() const
Class RooParamBinning is an implementation of RooAbsBinning that constructs a binning with a range de...
RooListProxy is the concrete proxy for RooArgList objects.
Definition: RooListProxy.h:25
const Bool_t kFALSE
Definition: RtypesCore.h:88
virtual ~RooParamBinning()
Destructor.
RooAbsBinning * clone(const char *name=0) const
RooAbsBinning is the abstract base class for RooRealVar binning definitions This class defines the in...
Definition: RooAbsBinning.h:26
double Double_t
Definition: RtypesCore.h:55
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition: RooAbsReal.h:53
virtual Int_t binNumber(Double_t x) const
Return the fit bin index for the current value.
virtual Double_t binWidth(Int_t bin) const
Return average bin width.
virtual Bool_t isParameterized() const
Double_t * _array
RooAbsRealLValue is the common abstract base class for objects that represent a real value that may a...
virtual Double_t highBound() const
virtual Double_t * array() const
Return array of bin boundaries.
RooAbsArg is the common abstract base class for objects that represent a value (of arbitrary type) an...
Definition: RooAbsArg.h:66
RooAbsReal * _xlo
do not persist
const Bool_t kTRUE
Definition: RtypesCore.h:87
RooListProxy * _lp
virtual Double_t binCenter(Int_t bin) const
Return the central value of the &#39;i&#39;-th fit bin.
virtual Double_t binLow(Int_t bin) const
Return the low edge of the &#39;i&#39;-th fit bin.
char name[80]
Definition: TGX11.cxx:109