Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:54:34

0001 // -*- C++ -*-
0002 // $Id: FixedConstant.hh,v 1.2 2003/09/06 14:04:13 boudreau Exp $
0003 //----------------------FixedConstant --------------------------------------//
0004 //                                                                          //
0005 //  Class FixedConstant                                                     //
0006 //  Joe Boudreau, Petar Maksimovic, Nov. 1999                               //
0007 //                                                                          //
0008 //  FixedConstant allows use to treat "promote" fixed contants to constant  //
0009 //  functions so that they automatically will inherit all the algebraic     //
0010 //  operations we have so painstakingly defined for functions.              //
0011 //                                                                          //
0012 //--------------------------------------------------------------------------//
0013 #ifndef FixedConstant_h
0014 #define FixedConstant_h 1
0015 #include "CLHEP/GenericFunctions/AbsFunction.hh"
0016 
0017 namespace Genfun {
0018 
0019   /**
0020    * @author
0021    * @ingroup genfun
0022    */
0023   class FixedConstant : public AbsFunction  {
0024   
0025     FUNCTION_OBJECT_DEF(FixedConstant)
0026 
0027       public:
0028 
0029     // Constructor
0030     FixedConstant(double value);
0031   
0032     // Copy constructor
0033     FixedConstant(const FixedConstant &right);
0034   
0035     // Destructor
0036     virtual ~FixedConstant();
0037   
0038     // Retrieve function value
0039     virtual double operator ()(double argument) const override;
0040     virtual double operator ()(const Argument & a) const override {return operator() (a[0]);}
0041   
0042     // Derivative.  
0043     Derivative partial (unsigned int) const override;
0044 
0045     // Does this function have an analytic derivative?
0046     virtual bool hasAnalyticDerivative() const override {return true;}
0047   
0048   private:
0049 
0050     // It is illegal to assign a fixed constant
0051     const FixedConstant & operator=(const FixedConstant &right);
0052 
0053     // The value of the constant:
0054     double _value;
0055   };
0056 } // namespace Genfun
0057 #endif