RooAdaptiveGaussKronrodIntegrator1D.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * Project: RooFit                                                           *
00003  * Package: RooFitCore                                                       *
00004  *    File: $Id: RooAdaptiveGaussKronrodIntegrator1D.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_ADAPTIVE_GAUSS_KRONROD_INTEGRATOR_1D
00017 #define ROO_ADAPTIVE_GAUSS_KRONROD_INTEGRATOR_1D
00018 
00019 #include "RooAbsIntegrator.h"
00020 #include "RooNumIntConfig.h"
00021 
00022 double RooAdaptiveGaussKronrodIntegrator1D_GSL_GlueFunction(double x, void *data) ;
00023 
00024 class RooAdaptiveGaussKronrodIntegrator1D : public RooAbsIntegrator {
00025 public:
00026 
00027   // Constructors, assignment etc
00028   RooAdaptiveGaussKronrodIntegrator1D() ;
00029   RooAdaptiveGaussKronrodIntegrator1D(const RooAbsFunc& function, const RooNumIntConfig& config) ;
00030   RooAdaptiveGaussKronrodIntegrator1D(const RooAbsFunc& function, Double_t xmin, Double_t xmax, 
00031                                       const RooNumIntConfig& config) ;
00032   virtual RooAbsIntegrator* clone(const RooAbsFunc& function, const RooNumIntConfig& config) const ;
00033   virtual ~RooAdaptiveGaussKronrodIntegrator1D();
00034 
00035   virtual Bool_t checkLimits() const;
00036   virtual Double_t integral(const Double_t *yvec=0) ;
00037 
00038   using RooAbsIntegrator::setLimits ;
00039   Bool_t setLimits(Double_t* xmin, Double_t* xmax);
00040   virtual Bool_t setUseIntegrandLimits(Bool_t flag) {
00041     // If flag is true, intergration limits are taken from definition in input function binding
00042     _useIntegrandLimits = flag ; return kTRUE ; 
00043   }
00044 
00045   virtual Bool_t canIntegrate1D() const { 
00046     // We can integrate 1-dimensional functions
00047     return kTRUE ; 
00048   }
00049   virtual Bool_t canIntegrate2D() const { 
00050     // We can not integrate 2-dimensional functions
00051     return kFALSE ; 
00052   }
00053   virtual Bool_t canIntegrateND() const { 
00054     // We can not integrate >2-dimensional functions
00055     return kFALSE ; 
00056   }
00057   virtual Bool_t canIntegrateOpenEnded() const { 
00058     // We can integrate over open-ended domains
00059     return kTRUE ; 
00060   }
00061 
00062 protected:
00063 
00064   friend class RooNumIntFactory ;
00065   static void registerIntegrator(RooNumIntFactory& fact) ;      
00066 
00067   enum DomainType { Closed, OpenLo, OpenHi, Open } ;
00068   mutable DomainType _domainType ;
00069 
00070   friend double RooAdaptiveGaussKronrodIntegrator1D_GSL_GlueFunction(double x, void *data) ;
00071 
00072   Bool_t initialize();
00073 
00074   Bool_t _useIntegrandLimits;  
00075 
00076   Double_t* xvec(Double_t& xx) {
00077     // Return contents of xx in internal array pointer
00078     _x[0] = xx ; return _x ; 
00079   }
00080   Double_t *_x ;                        //! Current coordinate
00081 
00082   Double_t _epsAbs ;                   // Absolute precision
00083   Double_t _epsRel ;                   // Relative precision
00084   Int_t    _methodKey ;                // GSL method key
00085   Int_t    _maxSeg ;                   // Maximum number of segments
00086   void*    _workspace ;                // GSL workspace 
00087 
00088   mutable Double_t _xmin;              //! Lower integration bound
00089   mutable Double_t _xmax;              //! Upper integration bound
00090 
00091   ClassDef(RooAdaptiveGaussKronrodIntegrator1D,0) // 1-dimensional adaptive Gauss-Kronrod numerical integration engine
00092 };
00093 
00094 #endif

Generated on Tue Jul 5 14:26:04 2011 for ROOT_528-00b_version by  doxygen 1.5.1