rarBifurGauss Class Reference

BifurGauss PDF builder. More...

#include <rarBifurGauss.hh>

Inheritance diagram for rarBifurGauss:

rarBasePdf rarConfig List of all members.

Public Member Functions

 rarBifurGauss ()
 Trivial ctor.
 rarBifurGauss (const char *configFile, const char *configSec, const char *configStr, rarDatasets *theDatasets, RooDataSet *theData, const char *name, const char *title)
 Default ctor.
virtual ~rarBifurGauss ()

Protected Member Functions

void init ()
 Initial function called by ctor.

Protected Attributes

RooAbsReal * _x
 Default obs.
Int_t _parSymLevel
 parSymLevel
RooAbsReal * _peak
 Pdf mean.
RooAbsReal * _sigL
 Left side sigma.
RooAbsReal * _sigR
 Right side sigma.

Private Member Functions

 rarBifurGauss (const rarBifurGauss &)
 ClassDef (rarBifurGauss, 0)

Detailed Description

BifurGauss PDF builder.

Build RooBifurGauss Pdf

Config Directives:
/// configStr = BifurGauss ["<Optional Title>"]
/// configStr = BGGauss ["<Optional Title>"]
/// parSymLevel = <0|1|2|3>
/// x = AbsReal Def
/// peak = AbsReal Def
/// sigL = AbsReal Def
/// sigR = AbsReal Def
/// mean = AbsReal Def
/// rms = AbsReal Def
/// asym = AbsReal Def
If parSymLevel = 0, use the default BifurGauss; mean, rms, and asym are not required. If parSymLevel = 1, use lowest-order mapping; if = 2, keep O(A^2, A^3) terms also; if = 3, take asym to mean 3rd moment. With parSymLevel > 0, mean, rms, and asym are used; peak, sigL, and sigR are hard-coded to the corresponding RooFormulaVar. x is the default observable. Pdf type BifurGauss and BGGauss are interchangeable, with the only difference being that if parSymLevel not specified, the default value of it for BifurGauss is 0, while that for BGGauss is 1. All the AbsReal variables can be RooRealVar or RooFormulaVar.

Definition at line 50 of file rarBifurGauss.hh.


Constructor & Destructor Documentation

rarBifurGauss::rarBifurGauss (  ) 

Trivial ctor.

Usually the objects should be created using other ctors.

Definition at line 41 of file rarBifurGauss.cc.

References init().

00042   : rarBasePdf(),
00043     _x(0), _parSymLevel(0), _peak(0), _sigL(0), _sigR(0)
00044 {
00045   init();
00046 }

rarBifurGauss::rarBifurGauss ( 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 rarBifurGauss.cc.

References init().

00066   : rarBasePdf(configFile, configSec, configStr,
00067                theDatasets, theData, name, title),
00068     _x(0), _parSymLevel(0), _peak(0), _sigL(0), _sigR(0)
00069 {
00070   init();
00071 }

rarBifurGauss::~rarBifurGauss (  )  [virtual]

Definition at line 73 of file rarBifurGauss.cc.

00074 {
00075 }

rarBifurGauss::rarBifurGauss ( const rarBifurGauss  )  [private]


Member Function Documentation

rarBifurGauss::ClassDef ( rarBifurGauss  ,
 
) [private]

void rarBifurGauss::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 the RooBifurGauss PDF.

Reimplemented from rarBasePdf.

Definition at line 82 of file rarBifurGauss.cc.

References rarBasePdf::_obsSet, rarBasePdf::_params, _parSymLevel, rarBasePdf::_pdfType, _peak, _sigL, _sigR, rarBasePdf::_thePdf, _x, rarConfig::createAbsReal(), rarConfig::createAbsVar(), rarBasePdf::getVarSec(), and rarConfig::readConfStr().

Referenced by rarBifurGauss().

00083 {
00084   cout<<"init of rarBifurGauss for "<<GetName()<<":"<<endl;
00085   
00086   // first get its dependent/observable
00087   _x=createAbsReal("x", "observable"); assert(_x);
00088   RooRealVar *x=(RooRealVar *)RooArgList(_obsSet).at(0); assert(x);
00089   // default _parSymLevel for BGGauss pdfType
00090   if ("BGGauss"==_pdfType) _parSymLevel=1;
00091   // read in _parSymLevel from config section
00092   _parSymLevel=atoi(readConfStr("parSymLevel", Form("%d", _parSymLevel),
00093                                 getVarSec()));
00094   if (_parSymLevel<0) _parSymLevel=0;
00095   if (_parSymLevel>3) _parSymLevel=3;
00096   // Config pdf params
00097   if (0==_parSymLevel) {
00098     _peak=createAbsReal("peak", "#mu", (x->getMin()+x->getMax())/2,
00099                         x->getMin(), x->getMax(), _x->getUnit());
00100     _sigL=createAbsReal("sigL", "#sigma_{L}", .1, 0.,
00101                         (x->getMax()-x->getMin())/2,_x->getUnit());
00102     _sigR=createAbsReal("sigR", "#sigma_{R}", .1, 0.,
00103                         (x->getMax()-x->getMin())/2,_x->getUnit());
00104   } else {
00105     createAbsReal("mean", "#mu", (x->getMin()+x->getMax())/2,
00106                   x->getMin(), x->getMax(), _x->getUnit());
00107     createAbsReal("rms", "#sigma", .1, 0.,(x->getMax()-x->getMin())/2,
00108                   _x->getUnit());
00109     createAbsReal("asym", "A", 0., -1., 1.);
00110   }
00111   if (1==_parSymLevel) {
00112     createAbsReal("Cmean", "sqrt(8/pi)", sqrt(8./3.14159265), "RooConstVar");
00113     _peak=(RooAbsReal*)
00114       createAbsVar("peak RooFormulaVar @0-@3*@1*@2 mean rms asym Cmean");
00115     _sigL=(RooAbsReal*)createAbsVar("sigL RooFormulaVar @0*(1-@1) rms asym");
00116     _sigR=(RooAbsReal*)createAbsVar("sigR RooFormulaVar @0*(1+@1) rms asym");
00117   } else if (2==_parSymLevel) {
00118     createAbsReal("Cmean", "sqrt(8/pi)", sqrt(8./3.14159265), "RooConstVar");
00119     createAbsReal("CA2", "3/2 - 4/pi", .5*(3. - 8./3.14159265), "RooConstVar");
00120     _peak=(RooAbsReal*)
00121       createAbsVar(Form("%s %s", "peak RooFormulaVar",
00122                         "@0-@3*@1*@2*(1-@4*@2*@2) mean rms asym Cmean CA2"));
00123     _sigL=(RooAbsReal*)
00124       createAbsVar("sigL RooFormulaVar @0*(1-@2*@1*@1)*(1-@1) rms asym CA2");
00125     _sigR=(RooAbsReal*)
00126       createAbsVar("sigR RooFormulaVar @0*(1-@2*@1*@1)*(1+@1) rms asym CA2");
00127   } else if (3==_parSymLevel) {
00128     createAbsReal("CA2x3", "(3*pi-8)/8", (3.*3.14159265-8.)/8., "RooConstVar");
00129     createAbsReal("CAx3", "sqrt(pi/8)", sqrt(3.14159265/8.), "RooConstVar");
00130     _peak=(RooAbsReal*)
00131       createAbsVar(Form("%s %s %s", "peak RooFormulaVar",
00132                         "@0-@2/@1/@1/sqrt(1+@3*(@2/@1/@1/@1)*(@2/@1/@1/@1))",
00133                         "mean rms asym CA2x3"));
00134     _sigL=(RooAbsReal*)
00135       createAbsVar(Form("%s %s%s %s", "sigL RooFormulaVar",
00136                         "@0*(1-@2*@1/@0/@0/@0)/sqrt(1+@3*(@1/@0/@0/@0)",
00137                         "*(@1/@0/@0/@0))", "rms asym CAx3 CA2x3"));
00138     _sigR=(RooAbsReal*)
00139       createAbsVar(Form("%s %s%s %s", "sigR RooFormulaVar",
00140                         "@0*(1+@2*@1/@0/@0/@0)/sqrt(1+@3*(@1/@0/@0/@0)",
00141                         "*(@1/@0/@0/@0))", "rms asym CAx3 CA2x3"));
00142   }
00143   _params.Print("v");
00144   
00145   // create pdf
00146   _thePdf=new RooBifurGauss(Form("the_%s", GetName()), _pdfType+" "+GetTitle(),
00147                             *_x, *_peak, *_sigL, *_sigR);
00148 }


Member Data Documentation

Int_t rarBifurGauss::_parSymLevel [protected]

parSymLevel

Definition at line 64 of file rarBifurGauss.hh.

Referenced by init().

RooAbsReal* rarBifurGauss::_peak [protected]

Pdf mean.

Definition at line 65 of file rarBifurGauss.hh.

Referenced by init().

RooAbsReal* rarBifurGauss::_sigL [protected]

Left side sigma.

Definition at line 66 of file rarBifurGauss.hh.

Referenced by init().

RooAbsReal* rarBifurGauss::_sigR [protected]

Right side sigma.

Definition at line 67 of file rarBifurGauss.hh.

Referenced by init().

RooAbsReal* rarBifurGauss::_x [protected]

Default obs.

Definition at line 63 of file rarBifurGauss.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