Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-08-06 09:20:06

0001 
0002 /***********************************************************************
0003 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
0004 *                                                                      *
0005 * This file is part of EvtGen.                                         *
0006 *                                                                      *
0007 * EvtGen is free software: you can redistribute it and/or modify       *
0008 * it under the terms of the GNU General Public License as published by *
0009 * the Free Software Foundation, either version 3 of the License, or    *
0010 * (at your option) any later version.                                  *
0011 *                                                                      *
0012 * EvtGen is distributed in the hope that it will be useful,            *
0013 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
0014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
0015 * GNU General Public License for more details.                         *
0016 *                                                                      *
0017 * You should have received a copy of the GNU General Public License    *
0018 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
0019 ***********************************************************************/
0020 
0021 #ifndef EVTITGABSFUNCTION_HH
0022 #define EVTITGABSFUNCTION_HH
0023 
0024 //-------------
0025 // C Headers --
0026 //-------------
0027 extern "C" {
0028 }
0029 
0030 // Description:
0031 //      Abstraction of a generic function for use in integration methods elsewhere
0032 //      in this package. (Stolen and modified from the BaBar IntegrationUtils package
0033 //      - author: Phil Strother).
0034 
0035 class EvtItgAbsFunction {
0036   public:
0037     // Constructors
0038 
0039     EvtItgAbsFunction( double lowerRange, double upperRange );
0040 
0041     // Destructor
0042     virtual ~EvtItgAbsFunction() = default;
0043 
0044     virtual double value( double x ) const;
0045 
0046     virtual double operator()( double x ) const;
0047 
0048     // Selectors (const)
0049 
0050     inline double upperRange() const { return _upperRange; }
0051     inline double lowerRange() const { return _lowerRange; }
0052     inline void getRange( double& lower, double& upper ) const
0053     {
0054         lower = _lowerRange;
0055         upper = _upperRange;
0056     }
0057     virtual void setCoeff( int, int, double ) = 0;
0058     virtual double getCoeff( int, int ) = 0;
0059 
0060   protected:
0061     virtual double myFunction( double x ) const = 0;
0062     void setRange( double x1, double x2 )
0063     {
0064         _lowerRange = x1;
0065         _upperRange = x2;
0066     };
0067 
0068   private:
0069     double _upperRange;
0070     double _lowerRange;
0071 };
0072 
0073 #endif    // EVTITGABSFUNCTION_HH