rarBinned Class Reference

RhhBinned PDF builder. More...

#include <rarBinned.hh>

Inheritance diagram for rarBinned:

rarBasePdf rarConfig List of all members.

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)

Detailed Description

RhhBinned PDF builder.

Build Pdf.

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


Constructor & Destructor Documentation

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.

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 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]

Definition at line 69 of file rarBinned.cc.

00070 {
00071 }

rarBinned::rarBinned ( const rarBinned  )  [private]


Member Function Documentation

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


Member Data Documentation

TArrayD* rarBinned::_limits [protected]

Limits of those bins.

Definition at line 54 of file rarBinned.hh.

Referenced by init().

Int_t rarBinned::_nBins [protected]

Number of bins.

Definition at line 53 of file rarBinned.hh.

Referenced by init().

RooAbsReal* rarBinned::_x [protected]

Default obs.

Definition at line 52 of file rarBinned.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