rarGeneric.cc

Go to the documentation of this file.
00001 /*****************************************************************************
00002 * Project: BaBar detector at the SLAC PEP-II B-factory
00003 * Package: RooRarFit
00004  *    File: $Id: rarGeneric.cc,v 1.6 2011/06/16 13:18:49 fwilson Exp $
00005  * Authors: Lei Zhang
00006  * History:
00007  * 
00008  * Copyright (C) 2005-2012, University of California, Riverside
00009  *****************************************************************************/
00010 
00011 // -- CLASS DESCRIPTION [RooRarFit] --
00012 // This class provides Generic Pdf class for RooRarFit
00014 //
00015 // BEGIN_HTML
00016 // This class provides Generic Pdf class for RooRarFit
00017 // END_HTML
00018 //
00019 
00020 #include "RooRarFit/rarVersion.hh"
00021 
00022 #include "Riostream.h"
00023 
00024 #include "RooFitCore/RooArgList.hh"
00025 #include "RooFitCore/RooDataSet.hh"
00026 #include "RooFitCore/RooProdPdf.hh"
00027 #include "RooFitCore/RooRealVar.hh"
00028 #include "RooFitCore/RooStringVar.hh"
00029 
00030 #include "RooRarFit/rarGeneric.hh"
00031 
00032 ClassImp(rarGeneric)
00033   ;
00034 
00038 rarGeneric::rarGeneric()
00039   : rarBasePdf()
00040 {
00041   init();
00042 }
00043 
00056 rarGeneric::rarGeneric(const char *configFile, const char *configSec,
00057                        const char *configStr,
00058                        rarDatasets *theDatasets, RooDataSet *theData,
00059                        const char *name, const char *title)
00060   : rarBasePdf(configFile, configSec, configStr,
00061                theDatasets, theData, name, title)
00062 {
00063   init();
00064 }
00065 
00066 rarGeneric::~rarGeneric()
00067 {
00068 }
00069 
00077 void rarGeneric::init()
00078 {
00079   cout<<"init of rarGeneric for "<<GetName()<<":"<<endl;
00080   
00081   // read the formula string
00082   TString formulaStr=readConfStr("formula", "1", getVarSec());
00083   rarStrParser formulaStrParser=formulaStr;
00084   // get formula
00085   TString formula=formulaStrParser[0];
00086   formulaStrParser.Remove();
00087   // get formula dep list
00088   RooArgList *depVarList=getFormulaArgs(formulaStrParser);
00089   _params.Print("v");
00090   cout<<"formula string:\t"<<formulaStr<<endl;
00091   
00092   // create the generic pdf
00093   _thePdf=new RooGenericPdf(Form("the_%s", GetName()), _pdfType+" "+GetTitle(),
00094                             formula, *depVarList);
00095 }

Generated on 30 Oct 2013 for RooRarFit by  doxygen 1.4.7