rarGaussModel Class Reference

RooGaussModel PDF builder. More...

#include <rarGaussModel.hh>

Inheritance diagram for rarGaussModel:

rarBasePdf rarConfig List of all members.

Public Member Functions

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

Protected Member Functions

void init ()
 Initial function called by ctor.

Protected Attributes

RooRealVar * _x
 Default obs (deltaT).
RooAbsReal * _mean
 Mean of PDF.
RooAbsReal * _sigma
 Sigma of PDF.
RooAbsReal * _msSF
 Scale factor for mean and sigma.
RooAbsReal * _meanSF
 Scale factor of the mean.
RooAbsReal * _sigmaSF
 Scale factor of the sigma.

Private Member Functions

 rarGaussModel (const rarGaussModel &)
 ClassDef (rarGaussModel, 0)

Detailed Description

RooGaussModel PDF builder.

Build RooGaussModel Pdf.

Config Directives:
/// configStr = GaussModel ["<Optional Title>"]
/// x = RealVar Def
/// mean = AbsReal Def
/// sigma = AbsReal Def
/// msSF = AbsReal Def
/// meanSF = AbsReal Def
/// sigmaSF = AbsReal Def
/// FlatScaleFactorIntegral = <yes|no>
x is the default observable (deltaT) and should be RooRealVar. mean is the mean of the PDF. sigma is the sigma of the PDF. msSF is the scale factor for both mean and sigma. meanSF is the mean scale factor of the PDF. sigmaSF is the sigma scale factor of the PDF. One can choose to specify msSF for both mean and sigma, or choose meanSF for mean, and/or sigmaSF for sigma, or if none is chosen, the default values are 1. All the AbsReal parameters can be RooRealVar or RooFormulaVar. If optional FlatScaleFactorIntegral is set to no (default yes), RooGaussModel::advertiseFlatScaleFactorIntegral will be called with kFALSE, otherwise with kTRUE.

Definition at line 48 of file rarGaussModel.hh.

Constructor & Destructor Documentation

rarGaussModel::rarGaussModel (  ) 

Trivial ctor.

Usually the objects should be created using other ctors.

Definition at line 40 of file rarGaussModel.cc.

References init().

00041   : rarBasePdf(),
00042     _x(0), _mean(0), _sigma(0), _msSF(0), _meanSF(0), _sigmaSF(0)
00043 {
00044   init();
00045 }

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

Definition at line 59 of file rarGaussModel.cc.

References init().

00063   : rarBasePdf(configFile, configSec, configStr,
00064                theDatasets, theData, name, title),
00065     _x(0), _mean(0), _sigma(0), _msSF(0), _meanSF(0), _sigmaSF(0)
00066 {
00067   init();
00068 }

rarGaussModel::~rarGaussModel (  )  [virtual]

Definition at line 70 of file rarGaussModel.cc.

00071 {
00072 }

rarGaussModel::rarGaussModel ( const rarGaussModel  )  [private]

Member Function Documentation

rarGaussModel::ClassDef ( rarGaussModel  ,
) [private]

void rarGaussModel::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 RooGaussModel PDF.

Reimplemented from rarBasePdf.

Definition at line 79 of file rarGaussModel.cc.

References _mean, _meanSF, _msSF, rarBasePdf::_obsSet, rarBasePdf::_params, rarBasePdf::_pdfType, _sigma, _sigmaSF, rarBasePdf::_thePdf, _x, rarConfig::createAbsReal(), rarBasePdf::getVarSec(), and rarConfig::readConfStr().

Referenced by rarGaussModel().

00080 {
00081   cout<<"init of rarGaussModel for "<<GetName()<<":"<<endl;
00083   // first get its dependent/observable
00084   _x=(RooRealVar*)createAbsReal("x", "observable"); assert(_x);
00085   RooRealVar *x=(RooRealVar *)RooArgList(_obsSet).at(0); assert(x);
00086   // make sure theDep is not derived
00087   if (_x!=x) {
00088     cout <<"No derived dependent allowed in rarGaussModel"<<endl;
00089     exit(-1);
00090   }
00091   // Config pdf params
00092   _mean=createAbsReal("mean", "#mu", (x->getMin()+x->getMax())/2,
00093                       x->getMin(), x->getMax(), _x->getUnit());
00094   _sigma=createAbsReal("sigma", "#sigma", .1, 0., 1., _x->getUnit());
00095   // param Level
00096   Int_t paramLevel(0);
00097   TString msSFStr=readConfStr("msSF", "notSet", getVarSec());
00098   TString meanSFStr=readConfStr("meanSF", "notSet", getVarSec());
00099   TString sigmaSFStr=readConfStr("sigmaSF", "notSet", getVarSec());
00100   if("notSet"!=msSFStr) { // level 1
00101     paramLevel=1;
00102     _msSF=createAbsReal("msSF", "SF_{#mu#sigma}", 1.);
00103   } else if (("notSet"!=meanSFStr) && ("notSet"!=sigmaSFStr)) { // level 2
00104     paramLevel=2;
00105     _meanSF=createAbsReal("meanSF", "SF_{#mu}", 1.);
00106     _sigmaSF=createAbsReal("sigmaSF", "SF_{#sigma}", 1.);
00107   }
00108   _params.Print("v");
00110   // create pdf
00111   if (1==paramLevel) {
00112     _thePdf=new RooGaussModel(Form("the_%s",GetName()),_pdfType+" "+GetTitle(),
00113                               *_x, *_mean, *_sigma, *_msSF);
00114   } else if (2==paramLevel) {
00115     _thePdf=new RooGaussModel(Form("the_%s",GetName()),_pdfType+" "+GetTitle(),
00116                               *_x, *_mean, *_sigma, *_meanSF, *_sigmaSF);
00117   } else { //default level 0
00118     _thePdf=new RooGaussModel(Form("the_%s",GetName()),_pdfType+" "+GetTitle(),
00119                               *_x, *_mean, *_sigma);
00120   }
00121   // FlatScaleFactorIntegral?
00122   Bool_t FSFIntegral(kTRUE);
00123   if ("no"==readConfStr("FlatScaleFactorIntegral", "yes", getVarSec()))
00124     FSFIntegral=kFALSE;
00125   ((RooGaussModel*)_thePdf)->advertiseFlatScaleFactorIntegral(FSFIntegral);
00127 }

Member Data Documentation

RooAbsReal* rarGaussModel::_mean [protected]

Mean of PDF.

Definition at line 62 of file rarGaussModel.hh.

Referenced by init().

RooAbsReal* rarGaussModel::_meanSF [protected]

Scale factor of the mean.

Definition at line 65 of file rarGaussModel.hh.

Referenced by init().

RooAbsReal* rarGaussModel::_msSF [protected]

Scale factor for mean and sigma.

Definition at line 64 of file rarGaussModel.hh.

Referenced by init().

RooAbsReal* rarGaussModel::_sigma [protected]

Sigma of PDF.

Definition at line 63 of file rarGaussModel.hh.

Referenced by init().

RooAbsReal* rarGaussModel::_sigmaSF [protected]

Scale factor of the sigma.

Definition at line 66 of file rarGaussModel.hh.

Referenced by init().

RooRealVar* rarGaussModel::_x [protected]

Default obs (deltaT).

Definition at line 61 of file rarGaussModel.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