#include <rarBinned.hh>
Inheritance diagram for rarBinned:
Public Member Functions | |
rarBinned () | |
Trivial ctor. | |
rarBinned (const char *configFile, const char *configSec, const char *configStr, rarDatasets *theDatasets, RooDataSet *theData, const char *name, const char *title) | |
Default ctor. | |
virtual | ~rarBinned () |
Protected Member Functions | |
void | init () |
Initial function called by ctor. | |
Protected Attributes | |
RooAbsReal * | _x |
Default obs. | |
Int_t | _nBins |
Number of bins. | |
TArrayD * | _limits |
Limits of those bins. | |
Private Member Functions | |
rarBinned (const rarBinned &) | |
ClassDef (rarBinned, 0) |
Build Pdf.
/// configStr = Binned ["<Optional Title>"] /// x = AbsReal Def /// nBins = <binVal> /// limits = <<binVal>+1 points> /// H00 = AbsReal Def /// ... /// H<binVal-1> = AbsReal Def
x
is the default observable. nBins
is the number of bins of the binned function. limits
is a set of <binVal>+1
Double_t's setting the bounds of those bins. H00
... H<binVal-1>
are <binVal>-1
free parameters of the binned function. All the AbsReal
variables can be RooRealVar
or RooFormulaVar
.
Definition at line 40 of file rarBinned.hh.
rarBinned::rarBinned | ( | ) |
Trivial ctor.
Usually the objects should be created using other ctors.
Definition at line 40 of file rarBinned.cc.
References init().
00041 : rarBasePdf(), 00042 _x(0), _nBins(0), _limits(0) 00043 { 00044 init(); 00045 }
rarBinned::rarBinned | ( | const char * | configFile, | |
const char * | configSec, | |||
const char * | configStr, | |||
rarDatasets * | theDatasets, | |||
RooDataSet * | theData, | |||
const char * | name, | |||
const char * | title | |||
) |
Default ctor.
configFile | The config file | |
configSec | The config section | |
configStr | The config string | |
theDatasets | Available datasets | |
theData | Default dataset for this PDF | |
name | The name | |
title | The title |
Definition at line 59 of file rarBinned.cc.
References init().
00062 : rarBasePdf(configFile, configSec, configStr, 00063 theDatasets, theData, name, title), 00064 _x(0), _nBins(0), _limits(0) 00065 { 00066 init(); 00067 }
rarBinned::~rarBinned | ( | ) | [virtual] |
rarBinned::rarBinned | ( | const rarBinned & | ) | [private] |
rarBinned::ClassDef | ( | rarBinned | , | |
0 | ||||
) | [private] |
void rarBinned::init | ( | ) | [protected, virtual] |
Initial function called by ctor.
init
is called by the ctor. It first reads in _nBins and _limits info from its param config section, and creates H00
... H<nBins-1>
parameters by calling createAbsReal, and finally it builds Binned
PDF.
Reimplemented from rarBasePdf.
Definition at line 80 of file rarBinned.cc.
References rarBasePdf::_coeffs, _limits, _nBins, rarBasePdf::_obsSet, rarBasePdf::_params, rarBasePdf::_pdfType, rarBasePdf::_thePdf, _x, rarConfig::createAbsReal(), rarBasePdf::getVarSec(), rarStrParser::nArgs(), and rarConfig::readConfStr().
Referenced by rarBinned().
00081 { 00082 cout<<"init of rarBinned for "<<GetName()<<":"<<endl; 00083 00084 // first get its dependent/observable 00085 _x=createAbsReal("x", "observable"); assert(_x); 00086 RooRealVar *x=(RooRealVar *)RooArgList(_obsSet).at(0); assert(x); 00087 // Config pdf params 00088 _nBins=atoi(readConfStr("nBins", "0", getVarSec())); 00089 if (_nBins<=0) _nBins= // from plotBins 00090 atoi(readConfStr(Form("plotBins_%s", x->GetName()),"0", getVarSec())); 00091 if (_nBins<=0) _nBins=x->getBins(); // get bins from its obs 00092 _limits= new TArrayD(_nBins+1); 00093 // read in limit info 00094 TString limitStr=readConfStr("limits", "", getVarSec()); 00095 rarStrParser limitStrParser=limitStr; 00096 Int_t nLimits=limitStrParser.nArgs(); 00097 if (_nBins+1==nLimits) { 00098 for (Int_t i=0; i<_nBins+1; i++) { 00099 (*_limits)[i]=atof(limitStrParser[i]); 00100 } 00101 } else { // set equal interval 00102 Double_t binned=(x->getMax() - x->getMin())/_nBins; 00103 for (Int_t i=0; i<_nBins+1; i++) { 00104 (*_limits)[i]=x->getMin()+i*binned; 00105 } 00106 } 00107 // set lo and hi limits 00108 //(*_limits)[0]=x->getMin(); 00109 //(*_limits)[_nBins]=x->getMax(); 00110 // read in coeffs 00111 for (Int_t i=0; i<_nBins-1; i++) { 00112 RooAbsReal *H=createAbsReal(Form("H%02d",i),Form("h_{%d}", i),.1,0,1000); 00113 _coeffs.add(*H); 00114 } 00115 _params.Print("v"); 00116 00117 // create pdf 00118 _thePdf= 00119 new RooBinnedPdf(Form("the_%s", GetName()), 00120 _pdfType+" "+GetTitle(), 00121 *_x, _coeffs, *_limits); 00122 }
TArrayD* rarBinned::_limits [protected] |
Int_t rarBinned::_nBins [protected] |
RooAbsReal* rarBinned::_x [protected] |