#include <rarGaussian.hh>
Inheritance diagram for rarGaussian:
Public Member Functions | |
rarGaussian () | |
Trivial ctor. | |
rarGaussian (const char *configFile, const char *configSec, const char *configStr, rarDatasets *theDatasets, RooDataSet *theData, const char *name, const char *title) | |
Default ctor. | |
virtual | ~rarGaussian () |
Protected Member Functions | |
void | init () |
Initial function called by ctor. | |
Protected Attributes | |
RooAbsReal * | _x |
Default obs. | |
RooAbsReal * | _mean |
Mean of PDF. | |
RooAbsReal * | _sigma |
Sigma of PDF. | |
RooAbsReal * | _scale |
Scale of the sigma. | |
RooAbsReal * | _shift |
Shift of the mean. | |
Private Member Functions | |
rarGaussian (const rarGaussian &) | |
ClassDef (rarGaussian, 0) |
Build RooGaussian / RooBreitWigner Pdf.
/// configStr = Gaussian ["<Optional Title>"] /// configStr = BreitWigner ["<Optional Title>"] /// x = AbsReal Def /// mean = AbsReal Def /// sigma = AbsReal Def
x
is the default observable. mean
is the mean of the PDF. sigma
is the sigma of the PDF. All the variables can be RooRealVar
or RooFormulaVar
.
Definition at line 38 of file rarGaussian.hh.
rarGaussian::rarGaussian | ( | ) |
Trivial ctor.
Usually the objects should be created using other ctors.
Definition at line 42 of file rarGaussian.cc.
References init().
00043 : rarBasePdf(), 00044 _x(0), _mean(0), _sigma(0), 00045 _scale(0), _shift(0) 00046 { 00047 init(); 00048 }
rarGaussian::rarGaussian | ( | 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 62 of file rarGaussian.cc.
References init().
00066 : rarBasePdf(configFile, configSec, configStr, 00067 theDatasets, theData, name, title), 00068 _x(0), _mean(0), _sigma(0), 00069 _scale(0), _shift(0) 00070 { 00071 init(); 00072 }
rarGaussian::~rarGaussian | ( | ) | [virtual] |
rarGaussian::rarGaussian | ( | const rarGaussian & | ) | [private] |
rarGaussian::ClassDef | ( | rarGaussian | , | |
0 | ||||
) | [private] |
void rarGaussian::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 RooGaussian/RooBreitWigner PDF with _pdfType being Gaussian/BreitWigner, respectively.
Reimplemented from rarBasePdf.
Definition at line 84 of file rarGaussian.cc.
References _mean, rarBasePdf::_obsSet, rarBasePdf::_params, rarBasePdf::_pdfType, _scale, _shift, _sigma, rarBasePdf::_thePdf, _x, rarConfig::createAbsReal(), rarConfig::createAbsVar(), rarBasePdf::getVarSec(), and rarConfig::readConfStr().
Referenced by rarGaussian().
00085 { 00086 cout<<"init of rarGaussian for "<<GetName()<<":"<<endl; 00087 00088 // first get its dependent/observable 00089 _x=createAbsReal("x", "observable"); assert(_x); 00090 RooRealVar *x=(RooRealVar *)RooArgList(_obsSet).at(0); assert(x); 00091 // Config pdf params 00092 _mean=createAbsReal("mean", "#mu", (x->getMin()+x->getMax())/2, 00093 x->getMin(), x->getMax(), _x->getUnit()); 00094 if ("notSet"!=readConfStr("shift", "notSet", getVarSec())) { // use shift 00095 _shift=createAbsReal("shift", "d#mu", 0.); 00096 _mean=(RooAbsReal*) 00097 createAbsVar(Form("%s %s", "meanS RooFormulaVar","@0+@1 mean shift")); 00098 } 00099 _sigma=createAbsReal("sigma", "#sigma", .1, 0., 1., _x->getUnit()); 00100 if ("notSet"!=readConfStr("scale", "notSet", getVarSec())) { // use scale 00101 _scale=createAbsReal("scale", "S#sigma_{C}", 1.); 00102 _sigma=(RooAbsReal*) 00103 createAbsVar(Form("%s %s","sigmaS RooFormulaVar","@0*@1 sigma scale")); 00104 } 00105 _params.Print("v"); 00106 00107 // create pdf 00108 if("BreitWigner"==_pdfType) { 00109 _thePdf=new RooBreitWigner(Form("the_%s", GetName()), 00110 _pdfType+" "+GetTitle(), *_x, *_mean, *_sigma); 00111 } else if ("Landau"==_pdfType) { 00112 _thePdf=new RooLandau(Form("the_%s", GetName()), 00113 _pdfType+" "+GetTitle(), *_x, *_mean, *_sigma); 00114 } else { // default 00115 _thePdf=new RooGaussian(Form("the_%s", GetName()), _pdfType+" "+GetTitle(), 00116 *_x, *_mean, *_sigma); 00117 } 00118 }
RooAbsReal* rarGaussian::_mean [protected] |
RooAbsReal* rarGaussian::_scale [protected] |
RooAbsReal* rarGaussian::_shift [protected] |
RooAbsReal* rarGaussian::_sigma [protected] |
RooAbsReal* rarGaussian::_x [protected] |