00001 /***************************************************************************** 00002 * Project: BaBar detector at the SLAC PEP-II B-factory 00003 * Package: RooRarFit 00004 * File: $Id: rarUsrPdf.cc,v 1.5 2011/06/16 13:18:51 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 User-defined Pdf class for RooRarFit 00013 // 00014 // Please change this cc file to make use of your PDF. 00015 // In many cases, you just need to change the code inside marks: 00016 //====================================================================> 00017 // v 00018 // v 00019 // and 00020 // ^ 00021 // ^ 00022 //====================================================================> 00024 // 00025 // BEGIN_HTML 00026 // This class provides User-defined Pdf class for RooRarFit 00027 // 00028 // Please change this cc file to make use of your PDF. 00029 // In many cases, you just need to change the code inside marks: 00030 //====================================================================> 00031 // v 00032 // v 00033 // and 00034 // ^ 00035 // ^ 00036 //====================================================================> 00037 // END_HTML 00038 // 00039 00040 #include "RooRarFit/rarVersion.hh" 00041 00042 #include "Riostream.h" 00043 //using namespace std; 00044 00045 #include "RooFitCore/RooArgList.hh" 00046 #include "RooFitCore/RooDataSet.hh" 00047 #include "RooFitCore/RooProdPdf.hh" 00048 #include "RooFitCore/RooRealVar.hh" 00049 #include "RooFitCore/RooStringVar.hh" 00050 00051 //==================================================================> 00052 // Please include your RooFit Pdf header here v 00053 // #include "mydir/myPdf.hh" v 00054 00055 // ^ 00056 // ^ 00057 //==================================================================> 00058 00059 00060 #include "RooRarFit/rarUsrPdf.hh" 00061 00062 ClassImp(rarUsrPdf) 00063 ; 00064 00068 rarUsrPdf::rarUsrPdf() 00069 : rarBasePdf(), 00070 _x(0), _a(0), _b(0), _c(0), _d(0), _e(0) 00071 { 00072 init(); 00073 } 00074 00087 rarUsrPdf::rarUsrPdf(const char *configFile, const char *configSec, 00088 const char *configStr, 00089 rarDatasets *theDatasets, RooDataSet *theData, 00090 const char *name, const char *title) 00091 : rarBasePdf(configFile, configSec, configStr, 00092 theDatasets, theData, name, title), 00093 _x(0), _a(0), _b(0), _c(0), _d(0), _e(0) 00094 { 00095 init(); 00096 } 00097 00098 rarUsrPdf::~rarUsrPdf() 00099 { 00100 } 00101 00107 void rarUsrPdf::init() 00108 { 00109 cout<<"init of rarUsrPdf for "<<GetName()<<":"<<endl; 00110 00111 //==================================================================> 00112 // change the lines in between the marks as you want v 00113 // v 00114 // first get its obs 00115 _x=createAbsReal("x", "observable"); assert(_x); 00116 // Config pdf params 00117 // instead of a b c etc, you can give them more meaningful names and titles 00118 // for example 00119 // _a=createAbsReal("mean", "#mu", 0, -10, 10); 00120 // _b=createAbsReal("sigma", "#sigma", 0, -10, 10); 00121 // if you give them different names, please use those names 00122 // in the PDF config sections, 00123 // for example, a is now mean, b sigma, etc. 00124 // [myPdf Config] 00125 // configStr = UsrPdf 00126 // x = AbsReal Def 00127 // mean = AbsReal Def 00128 // sigma = AbsReal Def 00129 00130 // Default param creation 00131 _a=createAbsReal("a", "a", 0, -10, 10); 00132 _b=createAbsReal("b", "b", 0, -10, 10); 00133 _c=createAbsReal("c", "c", 0, -10, 10); 00134 _d=createAbsReal("d", "d", 0, -10, 10); 00135 _e=createAbsReal("e", "e", 0, -10, 10); 00136 _params.Print("v"); 00137 00138 // YOU MUST CREATE YOUR PDF AND SET IT TO _thePdf 00139 // create pdf 00140 //_thePdf=new myPdf(Form("the_%s", GetName()),_pdfType+" "+GetTitle(), 00141 // *_x, *_a, *_b, *_c, *_d, *_e); 00142 // ^ 00143 // change the lines in between the marks as you want ^ 00144 //==================================================================> 00145 00146 }