rarProd Class Reference

ProdPdf builder. More...

#include <rarProd.hh>

Inheritance diagram for rarProd:

rarCompBase rarBasePdf rarConfig List of all members.

Public Member Functions

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

Protected Member Functions

void init ()
 Initial function called by ctor.

Protected Attributes

TList _condPdfList
 RooRarFit Pdf list.
RooArgList _condPdfs
 condPdf ArgList

Private Member Functions

 rarProd (const rarProd &)
 ClassDef (rarProd, 0)

Detailed Description

ProdPdf builder.

Build composite pdfs through RooProdPdf.

Config Directives:
See doc for ProdPdf configs.

Definition at line 26 of file rarProd.hh.


Constructor & Destructor Documentation

rarProd::rarProd (  ) 

Trivial ctor.

Usually the objects should be created using other ctors.

Definition at line 40 of file rarProd.cc.

References init().

00041   : rarCompBase()
00042 {
00043   init();
00044 }

rarProd::rarProd ( 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 58 of file rarProd.cc.

References init().

00062   : rarCompBase(configFile, configSec, configStr,
00063                 theDatasets, theData, name, title, kFALSE)
00064 {
00065   init();
00066 }

rarProd::~rarProd (  )  [virtual]

Definition at line 68 of file rarProd.cc.

00069 {
00070 }

rarProd::rarProd ( const rarProd  )  [private]


Member Function Documentation

rarProd::ClassDef ( rarProd  ,
 
) [private]

RooAbsPdf * rarProd::getDPdfWvar ( RooRealVar *  theVar  )  [virtual]

Return the pdf if it depends on the var.

Parameters:
theVar The var to check
Returns:
This (sim)Pdf if it depends on the var
It checks if the pdf depends on the obs; if yes, it returns this (sim)Pdf

Reimplemented from rarBasePdf.

Definition at line 175 of file rarProd.cc.

References rarCompBase::_nComp, and rarCompBase::_pdfList.

00176 {
00177   RooAbsPdf *retVal(0);
00178   for (Int_t i=0; i<_nComp; i++) {
00179     rarBasePdf *thePdf=(rarBasePdf*)_pdfList.At(i);
00180     retVal=thePdf->getDPdfWvar(theVar);
00181     if (retVal) return retVal;
00182   }
00183   return retVal;
00184 }

RooAbsPdf * rarProd::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 147 of file rarProd.cc.

References rarConfig::_fullObs, rarBasePdf::_thePdf, and rarCompBase::getPdfsWOvar().

00148 {
00149   RooAbsPdf *thePdf=_thePdf;
00150   // check if thePdf depends on theVar
00151   if (!(thePdf->dependsOn(ignoredObs))) return thePdf;
00152   // create individual Pdf
00153   TString theName=Form("the_%s_%s", ignoredObs[0].GetName(), GetName());
00154   TString theTitle=Form("%s w/o %s", GetTitle(), ignoredObs[0].GetName());
00155   RooArgList myPdfList=getPdfsWOvar(ignoredObs);
00156   thePdf=new RooProdPdf(theName, theTitle, myPdfList);
00157   //thePdf->Print("v");
00158   //thePdf->Print();
00159   if (!(thePdf->dependsOn(ignoredObs))) return thePdf;
00160   delete thePdf;
00161   // create a dummy for it
00162   thePdf=new RooGenericPdf(theName, theTitle, "1",
00163                            *_thePdf->getParameters(_fullObs));
00164   //thePdf->Print("v");
00165   //thePdf->Print();
00166   return thePdf;
00167 }

RooAbsPdf * rarProd::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 190 of file rarProd.cc.

References rarBasePdf::_myDummyPdf, rarBasePdf::_protGenPdfs, rarCompBase::_subProtGenPdfs, rarBasePdf::_theProtGen, rarBasePdf::getControlBit(), and rarCompBase::getProtGen().

00191 {
00192   if (_theProtGen) return _theProtGen;
00193   // call super class' getProtGen
00194   rarCompBase::getProtGen();
00195   _theProtGen=_myDummyPdf;
00196   RooArgList pdfList(_protGenPdfs);
00197   if (!getControlBit("dummySubGenPdfs")) pdfList.add(_subProtGenPdfs);
00198   else pdfList.add(*_theProtGen);
00199   if ((pdfList.getSize()>1)||(!getControlBit("dummySubGenPdfs")))
00200     _theProtGen = new RooProdPdf (Form("protGen_%s",GetName()),
00201                                   Form("Prot Gen for %s", GetName()), pdfList);
00202   
00203   return _theProtGen;
00204 }

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

Initial function called by ctor.

init is called by the ctor. The initialization work to read in config info is done with rarCompBase::init(), and init here just builds the RooProdPdf with configured components.

Reimplemented from rarCompBase.

Definition at line 78 of file rarProd.cc.

References _condPdfList, _condPdfs, rarCompBase::_pdfList, rarBasePdf::_pdfType, rarBasePdf::_subPdfs, rarBasePdf::_thePdf, rarCompBase::getArgSet(), rarStrParser::nArgs(), rarConfig::readConfStr(), and rarBasePdf::setControlBit().

Referenced by rarProd().

00079 {
00080   // Config pdfs done by parent Pdf
00081   // list configed pdfs done by parent pdf
00082   
00083   // set control bits
00084   setControlBit("noUseBasePdfFit", "ndFit");
00085   
00086   // list of cmd
00087   RooLinkedList cmdList;
00088 
00089   // do we have conditional obseervables?
00090   RooArgSet condObsSet(getArgSet(readConfStr("CondObss",""),kFALSE));
00091   // do we have conditional Pdf ?
00092   rarStrParser condPdfsStr=readConfStr("CondPdfs","");
00093   while (condPdfsStr.nArgs()>0) {
00094     rarBasePdf *condPdf=(rarBasePdf*)_pdfList.FindObject(condPdfsStr[0]);
00095     condPdfsStr.Remove();
00096     if (condPdf) {
00097       _condPdfList.Add(condPdf);
00098       _condPdfs.add(*condPdf->getPdf());
00099       // now set CondObss to this pdf
00100       //RooArgSet *thisPdfSet=new RooArgSet;
00101       //thisPdfSet->add(*condPdf->getPdf());
00102       RooArgSet *thisPdfSet=new RooArgSet(*condPdf->getPdf());
00103       RooArgSet *thisCondObsSet=new RooArgSet(condObsSet);
00104       thisCondObsSet->
00105         add(getArgSet(readConfStr
00106                       (Form("CondObss_%s",condPdf->GetName()),""),kFALSE));
00107       condPdf->setCondObss(*thisCondObsSet);
00108       cmdList.Add(Conditional(*thisPdfSet,*thisCondObsSet).Clone());
00109       cout<<" "<<condPdf->GetName()<<" is conditional PDF"<<endl;
00110       cout<<" The normalization of this PDF is on "<<endl;
00111       thisCondObsSet->Print();
00112     }
00113   }
00114   // Pdfs without conditional
00115   RooArgList subPdfs(_subPdfs);
00116   subPdfs.remove(_condPdfs);
00117   if (_condPdfs.getSize()>0) {
00118     // do not use ndFit by default
00119     //setControlBit("UseBasePdfFit", "ndFit");
00120     // cout...
00121     cout<<"The following PDFs are conditional PDFs:"<<endl;
00122     _condPdfs.Print();
00123     cout<<endl;
00124     //cout<<"The normalization of those PDFs are on observables:"<<endl;
00125     //condObsSet.Print();
00126     //cout<<endl;
00127     cout<<"The remaining PDFs in the production are:"<<endl;
00128     subPdfs.Print();
00129     cout<<endl;
00130   }
00131   
00132   // build ProdPdf
00133   //cmdList.Print("v");
00134   _thePdf=new RooProdPdf(Form("the_%s", GetName()), _pdfType+" "+GetTitle(),
00135                          subPdfs, cmdList);
00136   
00137   cout<<"done init of rarProd for "<<GetName()<<endl<<endl;
00138 }


Member Data Documentation

TList rarProd::_condPdfList [protected]

RooRarFit Pdf list.

Definition at line 42 of file rarProd.hh.

Referenced by init().

RooArgList rarProd::_condPdfs [protected]

condPdf ArgList

Definition at line 43 of file rarProd.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