rarTwoGauss Class Reference

Double-Gaussian PDF builder. More...

#include <rarTwoGauss.hh>

Inheritance diagram for rarTwoGauss:

rarBasePdf rarConfig List of all members.

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)

Detailed Description

Double-Gaussian PDF builder.

Build Double-Gaussian PDF.

Config Directives:
See doc for TwoGauss configs.

Definition at line 24 of file rarTwoGauss.hh.


Constructor & Destructor Documentation

rarTwoGauss::rarTwoGauss (  ) 

Trivial ctor.

Usually the objects should be created using other ctors.

Definition at line 40 of file rarTwoGauss.cc.

References init().

00041   : rarBasePdf(),
00042     _x(0), _meanC(0), _sigmaC(0), _meanT(0), _sigmaT(0), _fracC(0),
00043     _scale(0), _shift(0)
00044 {
00045   init();
00046 }

rarTwoGauss::rarTwoGauss ( 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 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]

Definition at line 71 of file rarTwoGauss.cc.

00072 {
00073 }

rarTwoGauss::rarTwoGauss ( const rarTwoGauss  )  [private]


Member Function Documentation

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


Member Data Documentation

RooAbsReal* rarTwoGauss::_fracC [protected]

Fraction of core Gaussian.

Definition at line 41 of file rarTwoGauss.hh.

Referenced by init().

RooAbsReal* rarTwoGauss::_meanC [protected]

Mean of core Gaussian.

Definition at line 37 of file rarTwoGauss.hh.

Referenced by init().

RooAbsReal* rarTwoGauss::_meanT [protected]

Mean of tail Gaussian.

Definition at line 39 of file rarTwoGauss.hh.

Referenced by init().

RooAbsReal* rarTwoGauss::_scale [protected]

Scale of the core sigma.

Definition at line 42 of file rarTwoGauss.hh.

Referenced by init().

RooAbsReal* rarTwoGauss::_shift [protected]

Shift of the two means.

Definition at line 43 of file rarTwoGauss.hh.

Referenced by init().

RooAbsReal* rarTwoGauss::_sigmaC [protected]

Sigma of core Gaussian.

Definition at line 38 of file rarTwoGauss.hh.

Referenced by init().

RooAbsReal* rarTwoGauss::_sigmaT [protected]

Sigma of tail Gaussian.

Definition at line 40 of file rarTwoGauss.hh.

Referenced by init().

RooAbsReal* rarTwoGauss::_x [protected]

Default obs.

Definition at line 36 of file rarTwoGauss.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