RooIntegrator2D.cxx

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * Project: RooFit                                                           *
00003  * Package: RooFitCore                                                       *
00004  * @(#)root/roofitcore:$Id: RooIntegrator2D.cxx 24278 2008-06-15 15:21:16Z wouter $
00005  * Authors:                                                                  *
00006  *   WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu       *
00007  *   DK, David Kirkby,    UC Irvine,         dkirkby@uci.edu                 *
00008  *                                                                           *
00009  * Copyright (c) 2000-2005, Regents of the University of California          *
00010  *                          and Stanford University. All rights reserved.    *
00011  *                                                                           *
00012  * Redistribution and use in source and binary forms,                        *
00013  * with or without modification, are permitted according to the terms        *
00014  * listed in LICENSE (http://roofit.sourceforge.net/license.txt)             *
00015  *****************************************************************************/
00016 
00017 //////////////////////////////////////////////////////////////////////////////
00018 //
00019 // BEGIN_HTML
00020 // RooIntegrator2D implements a numeric two-dimensiona integrator
00021 // in terms of a recursive application of RooIntegrator1D
00022 // END_HTML
00023 //
00024 
00025 
00026 #include "RooFit.h"
00027 
00028 #include "TClass.h"
00029 #include "RooIntegrator2D.h"
00030 #include "RooArgSet.h"
00031 #include "RooIntegratorBinding.h"
00032 #include "RooRealVar.h"
00033 #include "RooNumber.h"
00034 #include "RooNumIntFactory.h"
00035 
00036 #include <assert.h>
00037 
00038 ClassImp(RooIntegrator2D)
00039 ;
00040 
00041 
00042 //_____________________________________________________________________________
00043 void RooIntegrator2D::registerIntegrator(RooNumIntFactory& fact)
00044 {
00045   // Register RooIntegrator2D, is parameters and capabilities with RooNumIntFactory
00046 
00047   RooIntegrator2D* proto = new RooIntegrator2D() ;
00048   fact.storeProtoIntegrator(proto,RooArgSet(),RooIntegrator1D::Class()->GetName()) ;
00049   RooNumIntConfig::defaultConfig().method2D().setLabel(proto->IsA()->GetName()) ;
00050 }
00051 
00052 
00053 //_____________________________________________________________________________
00054 RooIntegrator2D::RooIntegrator2D() :
00055   _xIntegrator(0), _xint(0)
00056 {
00057   // Default constructor
00058 
00059 }
00060 
00061 
00062 //_____________________________________________________________________________
00063 RooIntegrator2D::RooIntegrator2D(const RooAbsFunc& function, RooIntegrator1D::SummationRule rule,
00064                                  Int_t maxSteps, Double_t eps) : 
00065   RooIntegrator1D(*(_xint=new RooIntegratorBinding(*(_xIntegrator=new RooIntegrator1D(function,rule,maxSteps,eps)))),rule,maxSteps,eps)
00066 {
00067   // Constructor with a given function binding, summation rule,
00068   // maximum number of steps and conversion tolerance. The integration
00069   // limits are taken from the definition in the function binding.
00070 } 
00071 
00072 
00073 //_____________________________________________________________________________
00074 RooIntegrator2D::RooIntegrator2D(const RooAbsFunc& function, Double_t xmin, Double_t xmax,
00075                                  Double_t ymin, Double_t ymax,
00076                                  SummationRule rule, Int_t maxSteps, Double_t eps) : 
00077   RooIntegrator1D(*(_xint=new RooIntegratorBinding(*(_xIntegrator=new RooIntegrator1D(function,ymin,ymax,rule,maxSteps,eps)))),xmin,xmax,rule,maxSteps,eps)
00078 {
00079   // Constructor with a given function binding, summation rule,
00080   // maximum number of steps, conversion tolerance and an explicit
00081   // choice of integration limits on both dimensions.
00082 } 
00083 
00084 
00085 //_____________________________________________________________________________
00086 RooIntegrator2D::RooIntegrator2D(const RooAbsFunc& function, const RooNumIntConfig& config) :
00087   RooIntegrator1D(*(_xint=new RooIntegratorBinding(*(_xIntegrator=new RooIntegrator1D(function,config)))),config)
00088 {
00089   // Constructor with a function binding and a configuration object.
00090   // The integration limits are taken from the definition in the function
00091   // binding
00092 } 
00093 
00094 
00095 
00096 //_____________________________________________________________________________
00097 RooIntegrator2D::RooIntegrator2D(const RooAbsFunc& function, Double_t xmin, Double_t xmax,
00098                                  Double_t ymin, Double_t ymax,
00099                                  const RooNumIntConfig& config) :
00100   RooIntegrator1D(*(_xint=new RooIntegratorBinding(*(_xIntegrator=new RooIntegrator1D(function,ymin,ymax,config)))),xmin,xmax,config)
00101 {
00102   // Constructor with a function binding, a configuration object and
00103   // an explicit definition of the integration limits.
00104 } 
00105 
00106 
00107 //_____________________________________________________________________________
00108 RooAbsIntegrator* RooIntegrator2D::clone(const RooAbsFunc& function, const RooNumIntConfig& config) const
00109 {
00110   // Clone integrator with new function and configuration. Needed to support RooNumIntFactory
00111   return new RooIntegrator2D(function,config) ;
00112 }
00113 
00114 
00115 
00116 //_____________________________________________________________________________
00117 RooIntegrator2D::~RooIntegrator2D() 
00118 {
00119   // Destructor
00120 
00121   delete _xint ;
00122   delete _xIntegrator ;
00123 }
00124 
00125 
00126 //_____________________________________________________________________________
00127 Bool_t RooIntegrator2D::checkLimits() const 
00128 {
00129   // Verify that the limits are OK for this integrator (i.e. no open-ended ranges)
00130 
00131   Bool_t ret = RooIntegrator1D::checkLimits() ;
00132   ret &= _xIntegrator->checkLimits() ;
00133   return ret ;
00134 }

Generated on Tue Jul 5 15:06:42 2011 for ROOT_528-00b_version by  doxygen 1.5.1