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/RooFormulaVar.hh"
00027 #include "RooFitCore/RooRealVar.hh"
00028 #include "RooFitCore/RooStringVar.hh"
00029
00030 #include "RooFitModels/RooChebychev.hh"
00031 #include "RooFitModels/RooPolynomial.hh"
00032
00033 #include "RooRarFit/rarPoly.hh"
00034
00035 ClassImp(rarPoly)
00036 ;
00037
00041 rarPoly::rarPoly()
00042 : rarBasePdf(),
00043 _x(0), _nOrder(1)
00044 {
00045 init();
00046 }
00047
00060 rarPoly::rarPoly(const char *configFile, const char *configSec,
00061 const char *configStr, rarDatasets *theDatasets,
00062 RooDataSet *theData, const char *name, const char *title)
00063 : rarBasePdf(configFile, configSec, configStr,
00064 theDatasets, theData, name, title),
00065 _x(0), _nOrder(1)
00066 {
00067 init();
00068 }
00069
00070 rarPoly::~rarPoly()
00071 {
00072 }
00073
00080 void rarPoly::init()
00081 {
00082 cout<<"init of rarPoly for "<<GetName()<<":"<<endl;
00083
00084
00085 _x=createAbsReal("x", "observable"); assert(_x);
00086
00087 _nOrder=atoi(readConfStr("nOrder", "1", getVarSec()));
00088 if (_nOrder<=0) _nOrder=1;
00089 _nOrder++;
00090 for (Int_t i=1; i<_nOrder; i++) {
00091 RooAbsReal *P=createAbsReal(Form("P%02d",i),Form("p_{%d}", i),
00092 0, -10000, +10000);
00093 _coeffs.add(*P);
00094 }
00095 _params.Print("v");
00096
00097
00098 if ("Chebychev"==_pdfType) {
00099 _thePdf=new RooChebychev(Form("the_%s", GetName()),_pdfType+" "+GetTitle(),
00100 *_x, _coeffs);
00101 } else {
00102 _thePdf=new RooPolynomial(Form("the_%s",GetName()),_pdfType+" "+GetTitle(),
00103 *_x, _coeffs);
00104 }
00105 }