Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-03-13 09:06:09

0001 // -*- C++ -*-
0002 // $Id: Bessel.hh,v 1.2 2003/09/06 14:04:13 boudreau Exp $
0003 //---------------------Bessel-------------------------------------------------//
0004 //                                                                            //
0005 // Class Bessel, providing Bessel Functions  The Namespace "FractionalORder"  //
0006 // and "Integral order" are nested here, so that you fully specify the class  //
0007 // like this:                                                                 //
0008 //                                                                            //
0009 //                 Genfun::FractionalOrder::Bessel                            //
0010 //                                                                            //
0011 //                              or                                            //
0012 //                                                                            //
0013 //                 Genfun::IntegralOrder::Bessel                              //
0014 //                                                                            //
0015 //                                                                            //
0016 // Joe Boudreau, April 2001                                                   //
0017 //                                                                            //
0018 //--------------------------------------------------------------------------  //
0019 #ifndef Bessel_h
0020 #define Bessel_h 1
0021 #include "CLHEP/GenericFunctions/AbsFunction.hh"
0022 #include "CLHEP/GenericFunctions/Parameter.hh"
0023 namespace Genfun {
0024 
0025 namespace FractionalOrder { 
0026   /**
0027    * @author
0028    * @ingroup genfun
0029    */
0030   class Bessel : public AbsFunction  {
0031 
0032     FUNCTION_OBJECT_DEF(Bessel)
0033 
0034       public:
0035 
0036     // Enumerated type:
0037     enum Type {J, Y};
0038 
0039     // Constructor:  Use this one and you will get a Bessel function of
0040     // integer order
0041     Bessel (Type type);
0042 
0043     // Copy constructor
0044     Bessel(const Bessel &right);
0045   
0046     // Destructor
0047     virtual ~Bessel();
0048   
0049     // Retreive function value
0050     virtual double operator ()(double argument) const override;
0051     virtual double operator ()(const Argument & a) const override {return operator() (a[0]);}
0052   
0053     // Get the order of the Bessel Function.  Default value, 0.0.  If modified the
0054     // Bessel function 
0055     Parameter & order(); 
0056     const Parameter & order() const; 
0057 
0058   private:
0059 
0060     // It is illegal to assign an adjustable constant
0061     const Bessel & operator=(const Bessel &right);
0062 
0063     // The type and order of the Bessel function
0064     Type      _type;
0065     Parameter _order; // the fractional order:
0066   
0067   };
0068 } // namespace FractionalOrder
0069 
0070 namespace IntegralOrder { 
0071   /**
0072    * @author
0073    * @ingroup genfun
0074    */
0075   class Bessel : public AbsFunction  {
0076 
0077     FUNCTION_OBJECT_DEF(Bessel)
0078 
0079       public:
0080 
0081     // Enumerated type:
0082     enum Type {J, Y};
0083 
0084     // Constructor:  Use this one and you will get a Bessel function of
0085     // integer order
0086     Bessel (Type type, unsigned int order);
0087 
0088     // Copy constructor
0089     Bessel(const Bessel &right);
0090   
0091     // Destructor
0092     virtual ~Bessel();
0093   
0094     // Retreive function value
0095     virtual double operator ()(double argument) const override;
0096     virtual double operator ()(const Argument & a) const override {return operator() (a[0]);}
0097   
0098   private:
0099 
0100     // It is illegal to assign an adjustable constant
0101     const Bessel & operator=(const Bessel &right);
0102 
0103     // The type and order of the Bessel function
0104     Type                _type;
0105     unsigned  int       _order; 
0106 
0107     double              _bessel_IJ_taylor(double nu, 
0108                       double x,
0109                       int sign,
0110                       int kmax,
0111                       double threshhold) const;
0112   
0113   };
0114 } // namespace IntegralOrder
0115 
0116 } // namespace Genfun
0117 
0118 
0119 #include "CLHEP/GenericFunctions/Bessel.icc"
0120 #endif