rarThreshold.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: rarThreshold.cc,v 1.1 2012/04/02 14:47:57 fwilson Exp $
00005  * Authors: Fergus Wilson
00006  * History:
00007  * 
00008  * Copyright (C) 2005-2012, RAL
00009  *****************************************************************************/
00010 
00011 // -- CLASS DESCRIPTION [RooRarFit] --
00012 // This class provides Threshold Pdf class for RooRarFit
00014 //
00015 // BEGIN_HTML
00016 // This class provides Threshold 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 //#include "RooNumber.h"
00030 
00031 #include "RooRarFit/RooThreshold.hh"
00032 #include "RooRarFit/rarThreshold.hh"
00033 
00034 using namespace RooFit;
00035 
00036 ClassImp(rarThreshold);
00037 
00041 rarThreshold::rarThreshold()
00042   : rarBasePdf(),
00043     _x(0), _m0(0), _power(0), _nOrder(1)
00044 {
00045   init();
00046 }
00047 
00060 rarThreshold::rarThreshold(const char *configFile, 
00061                                      const char *configSec,
00062                                      const char *configStr,
00063                                      rarDatasets *theDatasets, 
00064                                      RooDataSet *theData,
00065                                      const char *name, const char *title)
00066   : rarBasePdf(configFile, configSec, configStr,
00067                theDatasets, theData, name, title),
00068     _x(0), _m0(0), _power(0), _nOrder(1)
00069 {
00070   init();
00071 }
00072 
00073 rarThreshold::~rarThreshold()
00074 {
00075 }
00076 
00082 void rarThreshold::init()
00083 {
00084 
00085   cout <<"init of rarThreshold for " << GetName() << ":"<<endl;
00086   
00087   // first get its observable
00088   _x = createAbsReal("x", "observable"); assert(_x);
00089 
00090   // Config pdf params
00091   _m0 = createAbsReal("m0", "threshold", 0, -100000, 100000);
00092   _power = createAbsReal("power", "power", 1, -1000, 1000);
00093 
00094   // read in pdf params
00095   _nOrder=atoi(readConfStr("nOrder", "1", getVarSec()));
00096   if (_nOrder<=0) {_nOrder=1;}
00097   _nOrder++;
00098   for (Int_t i=1; i<_nOrder; i++) {
00099     RooAbsReal *P=createAbsReal(Form("P%02d",i),Form("p_{%d}", i),
00100                                 0, -10000, +10000);
00101     _coeffs.add(*P);
00102   }
00103 
00104   _params.Print("v");
00105   
00106   // create pdf
00107   _thePdf=new RooThreshold(Form("the_%s", GetName()),_pdfType+" "+GetTitle(),
00108                            *_x, *_m0, *_power, _coeffs);
00109 }

Generated on 30 Oct 2013 for RooRarFit by  doxygen 1.4.7