rarPoly Class Reference

RooPolynomial/RooChebychev PDF builder. More...

#include <rarPoly.hh>

Inheritance diagram for rarPoly:

rarBasePdf rarConfig List of all members.

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)

Detailed Description

RooPolynomial/RooChebychev PDF builder.

Build RooPolynomial / RooChebychev Pdf.

Config Directives:
/// 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.


Constructor & Destructor Documentation

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.

Parameters:
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
The default ctor first initializes data members, and then calls init.

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]

Definition at line 70 of file rarPoly.cc.

00071 {
00072 }

rarPoly::rarPoly ( const rarPoly  )  [private]


Member Function Documentation

rarPoly::ClassDef ( rarPoly  ,
 
) [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 }


Member Data Documentation

Int_t rarPoly::_nOrder [protected]

Order of polynomial.

Definition at line 54 of file rarPoly.hh.

Referenced by init().

RooAbsReal* rarPoly::_x [protected]

Default obs.

Definition at line 53 of file rarPoly.hh.

Referenced by init().


The documentation for this class was generated from the following files:
Generated on 30 Oct 2013 for RooRarFit by  doxygen 1.4.7