00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00014
00015
00016
00017
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/RooDataHist.hh"
00027 #include "RooFitCore/RooProdPdf.hh"
00028 #include "RooFitCore/RooRealVar.hh"
00029 #include "RooFitCore/RooStringVar.hh"
00030
00031 #include "RooFitCore/RooHistPdf.hh"
00032 #include "RooRarFit/rarHistPdf.hh"
00033
00034 ClassImp(rarHistPdf)
00035 ;
00036
00040 rarHistPdf::rarHistPdf()
00041 : rarBasePdf(),
00042 _theHist(0)
00043 {
00044 init();
00045 }
00046
00059 rarHistPdf::rarHistPdf(const char *configFile, const char *configSec,
00060 const char *configStr,
00061 rarDatasets *theDatasets, RooDataSet *theData,
00062 const char *name, const char *title)
00063 : rarBasePdf(configFile, configSec, configStr,
00064 theDatasets, theData, name, title),
00065 _theHist(0)
00066 {
00067 init();
00068 }
00069
00070 rarHistPdf::~rarHistPdf()
00071 {
00072 }
00073
00080 void rarHistPdf::init()
00081 {
00082 cout<<"init of rarHistPdf for "<<GetName()<<":"<<endl;
00083
00084
00085 setControlBits("noPdfFit");
00086
00087
00088 rarStrParser obsStrParser=readConfStr("obs", "", getVarSec());
00089
00090 getFormulaArgs(obsStrParser);
00091
00092 cout<<" Obs in pdf:"<<endl;
00093 _obsSet.Print("v");
00094
00095
00096 if (!_theData) {
00097 cout<<" No dataset for HistPdf"<<endl;
00098 exit(-1);
00099 }
00100
00101 _theHist=new RooDataHist(Form("the_%s_Hist", GetName()),
00102 "pdf histogram", _obsSet, *_theData);
00103
00104 _thePdf=new RooHistPdf(Form("the_%s", GetName()), _pdfType+" "+GetTitle(),
00105 _obsSet, *_theHist);
00106 }