#include <rarTwoGauss.hh>
Inheritance diagram for rarTwoGauss:
Public Member Functions | |
rarTwoGauss () | |
Trivial ctor. | |
rarTwoGauss (const char *configFile, const char *configSec, const char *configStr, rarDatasets *theDatasets, RooDataSet *theData, const char *name, const char *title) | |
Default ctor. | |
virtual | ~rarTwoGauss () |
Protected Member Functions | |
void | init () |
Initial function called by ctor. | |
Protected Attributes | |
RooAbsReal * | _x |
Default obs. | |
RooAbsReal * | _meanC |
Mean of core Gaussian. | |
RooAbsReal * | _sigmaC |
Sigma of core Gaussian. | |
RooAbsReal * | _meanT |
Mean of tail Gaussian. | |
RooAbsReal * | _sigmaT |
Sigma of tail Gaussian. | |
RooAbsReal * | _fracC |
Fraction of core Gaussian. | |
RooAbsReal * | _scale |
Scale of the core sigma. | |
RooAbsReal * | _shift |
Shift of the two means. | |
Private Member Functions | |
rarTwoGauss (const rarTwoGauss &) | |
ClassDef (rarTwoGauss, 0) |
Build Double-Gaussian PDF.
Definition at line 24 of file rarTwoGauss.hh.
rarTwoGauss::rarTwoGauss | ( | ) |
rarTwoGauss::rarTwoGauss | ( | 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 60 of file rarTwoGauss.cc.
References init().
00063 : rarBasePdf(configFile, configSec, configStr, 00064 theDatasets, theData, name, title), 00065 _x(0), _meanC(0), _sigmaC(0), _meanT(0), _sigmaT(0), _fracC(0), 00066 _scale(0), _shift(0) 00067 { 00068 init(); 00069 }
rarTwoGauss::~rarTwoGauss | ( | ) | [virtual] |
rarTwoGauss::rarTwoGauss | ( | const rarTwoGauss & | ) | [private] |
rarTwoGauss::ClassDef | ( | rarTwoGauss | , | |
0 | ||||
) | [private] |
void rarTwoGauss::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 Double-Gaussian PDF by creating two RooGaussian PDFs and combining them using RooAddPdf.
Reimplemented from rarBasePdf.
Definition at line 82 of file rarTwoGauss.cc.
References _fracC, _meanC, _meanT, rarBasePdf::_obsSet, rarBasePdf::_params, rarBasePdf::_pdfType, _scale, _shift, _sigmaC, _sigmaT, rarBasePdf::_subPdfs, rarBasePdf::_thePdf, _x, rarConfig::createAbsReal(), rarConfig::createAbsVar(), rarBasePdf::getVarSec(), rarConfig::readConfStr(), and rarBasePdf::setControlBit().
Referenced by rarTwoGauss().
00083 { 00084 cout<<"init of rarTwoGauss 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 // Config pdf params 00090 _meanC=createAbsReal("meanC", "#mu_{C}", 00091 (x->getMin()+x->getMax())/2, 00092 x->getMin(), x->getMax(), _x->getUnit()); 00093 _meanT=createAbsReal("meanT", "#mu_{T}", 00094 (x->getMin()+x->getMax())/2, 00095 x->getMin(), x->getMax(), _x->getUnit()); 00096 if ("notSet"!=readConfStr("shift", "notSet", getVarSec())) { // use shift 00097 _shift=createAbsReal("shift", "d#mu", 0.); 00098 _meanC=(RooAbsReal*) 00099 createAbsVar(Form("%s %s", "meanCS RooFormulaVar","@0+@1 meanC shift")); 00100 _meanT=(RooAbsReal*) 00101 createAbsVar(Form("%s %s", "meanTS RooFormulaVar","@0+@1 meanT shift")); 00102 } 00103 _sigmaC=createAbsReal("sigmaC", "#sigma_{C}", .1, 0., 1., _x->getUnit()); 00104 if ("notSet"!=readConfStr("scale", "notSet", getVarSec())) { // use scale 00105 _scale=createAbsReal("scale", "S#sigma_{C}", 1.); 00106 _sigmaC=(RooAbsReal*) 00107 createAbsVar(Form("%s %s","sigmaCS RooFormulaVar","@0*@1 sigmaC scale")); 00108 } 00109 _sigmaT=createAbsReal("sigmaT", "#sigma_{T}", .1, 0., 1., _x->getUnit()); 00110 _fracC=createAbsReal("fracC", "f_{C}", .6, 0., 1.); 00111 _params.Print("v"); 00112 00113 // create pdf 00114 RooAbsPdf *corePdf= 00115 new RooGaussian(Form("core_%s",GetName()), 00116 Form("Core Gaussian %s", GetTitle()), 00117 *_x, *_meanC, *_sigmaC); 00118 _subPdfs.add(*corePdf); 00119 RooAbsPdf *tailPdf= 00120 new RooGaussian(Form("tail_%s",GetName()), 00121 Form("Tail Gaussian %s", GetTitle()), 00122 *_x, *_meanT, *_sigmaT); 00123 _subPdfs.add(*tailPdf); 00124 _thePdf=new RooAddPdf(Form("the_%s", GetName()), _pdfType+" "+GetTitle(), 00125 *corePdf, *tailPdf, *_fracC); 00126 // by default do comp plot 00127 setControlBit("CompsOnPlot", "compsOnPlot"); 00128 }
RooAbsReal* rarTwoGauss::_fracC [protected] |
RooAbsReal* rarTwoGauss::_meanC [protected] |
RooAbsReal* rarTwoGauss::_meanT [protected] |
RooAbsReal* rarTwoGauss::_scale [protected] |
RooAbsReal* rarTwoGauss::_shift [protected] |
RooAbsReal* rarTwoGauss::_sigmaC [protected] |
RooAbsReal* rarTwoGauss::_sigmaT [protected] |
RooAbsReal* rarTwoGauss::_x [protected] |