rarSimPdf Class Reference

RooSimultaneous PDF builder. More...

#include <rarSimPdf.hh>

Inheritance diagram for rarSimPdf:

rarCompBase rarBasePdf rarConfig List of all members.

Public Member Functions

 rarSimPdf ()
 Trivial ctor.
 rarSimPdf (const char *configFile, const char *configSec, const char *configStr, rarDatasets *theDatasets, RooDataSet *theData, const char *name, const char *title)
 Default ctor.
virtual ~rarSimPdf ()
virtual RooAbsPdf * getPdfWOvar (RooArgList ignoredObs)
 Get a PDF not depending on specified observables for sPlot.
virtual RooAbsPdf * getProtGen ()
 Return prototype var generator for toy study.

Protected Member Functions

void init ()
 Initial function called by ctor.

Protected Attributes

RooSimPdfBuilder * _simBuilder
 SimPdf builder.
RooArgSet * _simConfig
 SimPdf config ArgSet.

Private Member Functions

 rarSimPdf (const rarSimPdf &)
 ClassDef (rarSimPdf, 0)

Detailed Description

RooSimultaneous PDF builder.

Build RooSimultaneous Pdf.

Config Directives:
See doc for SimPdf configs.

Definition at line 29 of file rarSimPdf.hh.


Constructor & Destructor Documentation

rarSimPdf::rarSimPdf (  ) 

Trivial ctor.

Usually the objects should be created using other ctors.

Definition at line 43 of file rarSimPdf.cc.

References init().

00044   : rarCompBase(),
00045     _simBuilder(0), _simConfig(0)
00046 {
00047   init();
00048 }

rarSimPdf::rarSimPdf ( 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, _configFile, _configSec, _configStr, name, title, and then calls init.

Definition at line 63 of file rarSimPdf.cc.

References init().

00067   : rarCompBase(configFile, configSec, configStr,
00068                 theDatasets, theData, name, title, kFALSE),
00069     _simBuilder(0), _simConfig(0)
00070 {
00071   init();
00072 }

rarSimPdf::~rarSimPdf (  )  [virtual]

Definition at line 74 of file rarSimPdf.cc.

00075 {
00076 }

rarSimPdf::rarSimPdf ( const rarSimPdf  )  [private]


Member Function Documentation

rarSimPdf::ClassDef ( rarSimPdf  ,
 
) [private]

RooAbsPdf * rarSimPdf::getPdfWOvar ( RooArgList  ignoredObs  )  [virtual]

Get a PDF not depending on specified observables for sPlot.

Parameters:
ignoredObs The observables to check
Returns:
The Pdf required
It checks of the pdf depends on the observables. if no, it returns the default pdf; if yes, it builds the non-dependent pdf.

Reimplemented from rarBasePdf.

Definition at line 125 of file rarSimPdf.cc.

References rarBasePdf::_thePdf.

00126 {
00127   RooAbsPdf *thePdf=_thePdf;
00128   cout<<"This pdf can not be used in model"<<endl;
00129   exit(-1);
00130   ignoredObs.getHashTableSize() ; // avoid "unused" warning
00131   return thePdf;
00132 }

RooAbsPdf * rarSimPdf::getProtGen (  )  [virtual]

Return prototype var generator for toy study.

Returns:
The generator
It constrcuts prototype var generator for toy study

Reimplemented from rarCompBase.

Definition at line 138 of file rarSimPdf.cc.

References rarBasePdf::_theProtGen.

00139 {
00140   cout<<"This pdf can not be used in model"<<endl;
00141   exit(-1);
00142   return _theProtGen;
00143 }

void rarSimPdf::init (  )  [protected, virtual]

Initial function called by ctor.

init is called by the ctor. The initialization work to read in component config info is done with rarCompBase::init. init here then reads in category info for SimPdf, then it builds datasets for each category type so that each SimPdf component built has its own default fit dataset, and finally it builds RooSimultaneous PDF with configured components.

Reimplemented from rarCompBase.

Definition at line 87 of file rarSimPdf.cc.

References rarConfig::_configFile, _simBuilder, _simConfig, rarBasePdf::_subPdfs, rarBasePdf::_theData, rarBasePdf::_thePdf, rarBasePdf::getFitter(), rarMLFitter::getSimBuilder(), rarBasePdf::getVarSec(), and rarBasePdf::setControlBits().

Referenced by rarSimPdf().

00088 {
00089   // it should always have fitData
00090   if (!_theData) {
00091     cout<<" No dataset for Sim Pdf"<<endl;
00092     exit(-1);
00093   }
00094   // create SimPdfBuilder
00095   _simBuilder=new RooSimPdfBuilder(_subPdfs);
00096   _simConfig=_simBuilder->createProtoBuildConfig();
00097   _simConfig->readFromFile(_configFile, 0, getVarSec());
00098   cout<<"simPdfBuilder configs in the config file:"<<endl;
00099   _simConfig->Print("v");
00100   // do we need to use _simBuilder->addSpecializations?
00101   // Yes, let's do it
00102   if (getFitter()->getSimBuilder()) {
00103     RooSimPdfBuilder *theFitterBuilder=getFitter()->getSimBuilder();
00104     _simBuilder->addSpecializations(theFitterBuilder->splitLeafList());
00105   }
00106   // build SimPdf
00107   _thePdf=(RooAbsPdf*)_simBuilder->buildPdf(*_simConfig, _theData, 0, kTRUE);
00108   _thePdf->SetName(Form("the_%s", GetName()));
00109   // fit the total pdf for pdfFit as well
00110   setControlBits("UseAlsoBasePdfFit");
00111   
00112   //_thePdf->Print();
00113   //_thePdf->Print("v");
00114   //_thePdf->getComponents()->Print("v");
00115   cout<<"done init of rarSimPdf for "<<GetName()<<endl<<endl;
00116 }


Member Data Documentation

RooSimPdfBuilder* rarSimPdf::_simBuilder [protected]

SimPdf builder.

Definition at line 44 of file rarSimPdf.hh.

Referenced by init().

RooArgSet* rarSimPdf::_simConfig [protected]

SimPdf config ArgSet.

Definition at line 45 of file rarSimPdf.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