00001 /***************************************************************************** 00002 * Project: RooFit * 00003 * Package: RooFitCore * 00004 * File: $Id: RooGaussKronrodIntegrator1D.h,v 1.5 2007/05/11 09:11:30 verkerke Exp $ 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 #ifndef ROO_GAUSS_KRONROD_INTEGRATOR_1D 00017 #define ROO_GAUSS_KRONROD_INTEGRATOR_1D 00018 00019 #include "RooAbsIntegrator.h" 00020 #include "RooNumIntConfig.h" 00021 00022 double RooGaussKronrodIntegrator1D_GSL_GlueFunction(double x, void *data) ; 00023 00024 class RooGaussKronrodIntegrator1D : public RooAbsIntegrator { 00025 public: 00026 00027 // Constructors, assignment etc 00028 RooGaussKronrodIntegrator1D() ; 00029 RooGaussKronrodIntegrator1D(const RooAbsFunc& function, const RooNumIntConfig& config) ; 00030 RooGaussKronrodIntegrator1D(const RooAbsFunc& function, Double_t xmin, Double_t xmax, const RooNumIntConfig& config) ; 00031 virtual RooAbsIntegrator* clone(const RooAbsFunc& function, const RooNumIntConfig& config) const ; 00032 virtual ~RooGaussKronrodIntegrator1D(); 00033 00034 virtual Bool_t checkLimits() const; 00035 virtual Double_t integral(const Double_t *yvec=0) ; 00036 00037 using RooAbsIntegrator::setLimits ; 00038 Bool_t setLimits(Double_t* xmin, Double_t* xmax); 00039 virtual Bool_t setUseIntegrandLimits(Bool_t flag) {_useIntegrandLimits = flag ; return kTRUE ; } 00040 00041 virtual Bool_t canIntegrate1D() const { return kTRUE ; } 00042 virtual Bool_t canIntegrate2D() const { return kFALSE ; } 00043 virtual Bool_t canIntegrateND() const { return kFALSE ; } 00044 virtual Bool_t canIntegrateOpenEnded() const { return kTRUE ; } 00045 00046 protected: 00047 00048 friend class RooNumIntFactory ; 00049 static void registerIntegrator(RooNumIntFactory& fact) ; 00050 00051 friend double RooGaussKronrodIntegrator1D_GSL_GlueFunction(double x, void *data) ; 00052 00053 Bool_t initialize(); 00054 00055 Bool_t _useIntegrandLimits; // Use limits in function binding? 00056 00057 Double_t* xvec(Double_t& xx) { _x[0] = xx ; return _x ; } 00058 Double_t *_x ; //! do not persist 00059 00060 Double_t _epsAbs ; // Absolute precision 00061 Double_t _epsRel ; // Relative precision 00062 00063 mutable Double_t _xmin; //! Lower integration bound 00064 mutable Double_t _xmax; //! Upper integration bound 00065 00066 ClassDef(RooGaussKronrodIntegrator1D,0) // 1-dimensional Gauss-Kronrod numerical integration engine 00067 }; 00068 00069 #endif