Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/RooAbsIntegrator.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /*****************************************************************************
0002  * Project: RooFit                                                           *
0003  * Package: RooFitCore                                                       *
0004  *    File: $Id: RooAbsIntegrator.h,v 1.18 2007/05/11 09:11:30 verkerke Exp $
0005  * Authors:                                                                  *
0006  *   WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu       *
0007  *   DK, David Kirkby,    UC Irvine,         dkirkby@uci.edu                 *
0008  *                                                                           *
0009  * Copyright (c) 2000-2005, Regents of the University of California          *
0010  *                          and Stanford University. All rights reserved.    *
0011  *                                                                           *
0012  * Redistribution and use in source and binary forms,                        *
0013  * with or without modification, are permitted according to the terms        *
0014  * listed in LICENSE (http://roofit.sourceforge.net/license.txt)             *
0015  *****************************************************************************/
0016 #ifndef ROO_ABS_INTEGRATOR
0017 #define ROO_ABS_INTEGRATOR
0018 
0019 #include "RooAbsFunc.h"
0020 #include "RooNumIntConfig.h"
0021 
0022 class RooAbsIntegrator {
0023 public:
0024   RooAbsIntegrator() ;
0025   RooAbsIntegrator(const RooAbsFunc& function, bool printEvalCounter=false);
0026   virtual ~RooAbsIntegrator() = default;
0027 
0028   /// Is integrator in valid state
0029   inline bool isValid() const {
0030     return _valid;
0031   }
0032 
0033   /// Return value of integrand at given observable values
0034   inline double integrand(const double x[]) const {
0035     return (*_function)(x);
0036   }
0037 
0038   /// Return integrand function binding
0039   inline const RooAbsFunc *integrand() const {
0040     return _function;
0041   }
0042 
0043   /// If true, finite limits are required on the observable range
0044   inline virtual bool checkLimits() const {
0045     return true;
0046   }
0047 
0048   double calculate(const double *yvec=nullptr) ;
0049   virtual double integral(const double *yvec=nullptr)=0 ;
0050 
0051   bool printEvalCounter() const { return _printEvalCounter ; }
0052   void setPrintEvalCounter(bool value) { _printEvalCounter = value ; }
0053 
0054   virtual bool setLimits(double*, double*) { return false ; }
0055   virtual bool setLimits(double xmin, double xmax) ;
0056   virtual bool setUseIntegrandLimits(bool flag) ;
0057 
0058 protected:
0059 
0060   const RooAbsFunc *_function = nullptr; ///< Pointer to function binding of integrand
0061   bool _valid = false;                   ///< Is integrator in valid state?
0062   bool _printEvalCounter = false;        ///< If true print number of function evaluation required for integration
0063 };
0064 
0065 #endif