#include <rarPoly.hh>
Inheritance diagram for rarPoly:
Public Member Functions | |
rarPoly () | |
Trivial ctor. | |
rarPoly (const char *configFile, const char *configSec, const char *configStr, rarDatasets *theDatasets, RooDataSet *theData, const char *name, const char *title) | |
Default ctor. | |
virtual | ~rarPoly () |
Protected Member Functions | |
void | init () |
Initial function called by ctor. | |
Protected Attributes | |
RooAbsReal * | _x |
Default obs. | |
Int_t | _nOrder |
Order of polynomial. | |
Private Member Functions | |
rarPoly (const rarPoly &) | |
ClassDef (rarPoly, 0) |
Build RooPolynomial / RooChebychev Pdf.
/// configStr = Polynomial ["<Optional Title>"] /// configStr = Chebychev ["<Optional Title>"] /// x = AbsReal Def /// nOrder = <orderVal> /// P01 = AbsReal Def /// ... /// P<orderVal> = AbsReal Def
x
is the default observable. nOrder
is an integer representing the order of the polynomial. P01
... P<orderVal>
define all the coeffs. P00
is not needed. All the AbsReal
variables can be RooRealVar
or RooFormulaVar
.
Definition at line 41 of file rarPoly.hh.
rarPoly::rarPoly | ( | ) |
Trivial ctor.
Usually the objects should be created using other ctors.
Definition at line 41 of file rarPoly.cc.
References init().
00042 : rarBasePdf(), 00043 _x(0), _nOrder(1) 00044 { 00045 init(); 00046 }
rarPoly::rarPoly | ( | 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 60 of file rarPoly.cc.
References init().
00063 : rarBasePdf(configFile, configSec, configStr, 00064 theDatasets, theData, name, title), 00065 _x(0), _nOrder(1) 00066 { 00067 init(); 00068 }
rarPoly::~rarPoly | ( | ) | [virtual] |
rarPoly::rarPoly | ( | const rarPoly & | ) | [private] |
rarPoly::ClassDef | ( | rarPoly | , | |
0 | ||||
) | [private] |
void rarPoly::init | ( | ) | [protected, virtual] |
Initial function called by ctor.
init
is called by the ctor. It first creates the parameters by calling createAbsReal, and finally it builds RooPolynomial/RooChebychev PDF with _pdfType being Polynomial/Chebychev, respectively.
Reimplemented from rarBasePdf.
Definition at line 80 of file rarPoly.cc.
References rarBasePdf::_coeffs, _nOrder, rarBasePdf::_params, rarBasePdf::_pdfType, rarBasePdf::_thePdf, _x, rarConfig::createAbsReal(), rarBasePdf::getVarSec(), and rarConfig::readConfStr().
Referenced by rarPoly().
00081 { 00082 cout<<"init of rarPoly for "<<GetName()<<":"<<endl; 00083 00084 // first get its obs 00085 _x=createAbsReal("x", "observable"); assert(_x); 00086 // read in pdf params 00087 _nOrder=atoi(readConfStr("nOrder", "1", getVarSec())); 00088 if (_nOrder<=0) _nOrder=1; 00089 _nOrder++; 00090 for (Int_t i=1; i<_nOrder; i++) { 00091 RooAbsReal *P=createAbsReal(Form("P%02d",i),Form("p_{%d}", i), 00092 0, -10000, +10000); 00093 _coeffs.add(*P); 00094 } 00095 _params.Print("v"); 00096 00097 // create pdf 00098 if ("Chebychev"==_pdfType) { 00099 _thePdf=new RooChebychev(Form("the_%s", GetName()),_pdfType+" "+GetTitle(), 00100 *_x, _coeffs); 00101 } else { // default 00102 _thePdf=new RooPolynomial(Form("the_%s",GetName()),_pdfType+" "+GetTitle(), 00103 *_x, _coeffs); 00104 } 00105 }
Int_t rarPoly::_nOrder [protected] |
RooAbsReal* rarPoly::_x [protected] |