00001 /***************************************************************************** 00002 * Project: RooFit * 00003 * Package: RooFitCore * 00004 * File: $Id: RooIntegratorBinding.h,v 1.4 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_INTEGRATOR_BINDING 00017 #define ROO_INTEGRATOR_BINDING 00018 00019 #include "RooAbsFunc.h" 00020 #include "RooAbsIntegrator.h" 00021 00022 class RooIntegratorBinding : public RooAbsFunc { 00023 public: 00024 RooIntegratorBinding(RooAbsIntegrator& integrator) : 00025 RooAbsFunc(integrator.integrand()->getDimension()-1), _integrator(&integrator) {} ; 00026 virtual ~RooIntegratorBinding() {} ; 00027 00028 inline virtual Double_t operator()(const Double_t xvector[]) const { _ncall++ ; return _integrator->integral(xvector) ; } 00029 inline virtual Double_t getMinLimit(UInt_t index) const { return _integrator->integrand()->getMinLimit(index+1); } 00030 inline virtual Double_t getMaxLimit(UInt_t index) const { return _integrator->integrand()->getMaxLimit(index+1); } 00031 00032 protected: 00033 RooAbsIntegrator* _integrator ; // Numeric integrator 00034 00035 00036 ClassDef(RooIntegratorBinding,0) // Function binding representing output of numeric integrator 00037 }; 00038 00039 #endif 00040