Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 10:03:26

0001 // -*- C++ -*-
0002 // $Id: PeriodicRectangular.hh,v 1.2 2003/09/06 14:04:13 boudreau Exp $
0003 //---------------------Rectangular------------------------------------------//
0004 //                                                                          //
0005 // Class Exponential                                                        //
0006 // Joe Boudreau, Petar Maksimovic, November 1999                            //
0007 //                                                                          //
0008 //--------------------------------------------------------------------------//
0009 #ifndef PeriodicRectangular_h_
0010 #define PeriodicRectangular_h_ 1
0011 #include "CLHEP/GenericFunctions/AbsFunction.hh"
0012 #include "CLHEP/GenericFunctions/Parameter.hh"
0013 namespace Genfun {
0014 
0015   /**
0016    * @author
0017    * @ingroup genfun
0018    */
0019   class PeriodicRectangular : public AbsFunction  {
0020 
0021     FUNCTION_OBJECT_DEF(PeriodicRectangular)
0022 
0023 
0024     public:
0025 
0026     // Constructor
0027     PeriodicRectangular();
0028 
0029     // Copy constructor
0030     PeriodicRectangular(const PeriodicRectangular &right);
0031   
0032     // Destructor
0033     virtual ~PeriodicRectangular();
0034   
0035     // Retreive function value
0036     virtual double operator ()(double argument) const override;
0037     virtual double operator ()(const Argument & arg) const override {return operator() (arg[0]);}
0038   
0039     // Get the position of the first discontinuity
0040     Parameter & a(); 
0041 
0042     // Get the position of the second discontinuity
0043     Parameter & b(); 
0044 
0045     // Get the value of the function at its top
0046     Parameter & height(); 
0047   
0048     // Derivative.  
0049     Derivative partial (unsigned int) const override;
0050 
0051     // Does this function have an analytic derivative?
0052     virtual bool hasAnalyticDerivative() const override {return true;}
0053 
0054   private:
0055 
0056     // It is illegal to assign an adjustable constant
0057     const PeriodicRectangular & operator=(const PeriodicRectangular &right);
0058 
0059     // Here is the decay constant
0060     Parameter _a;
0061     Parameter _b;
0062     Parameter _height;
0063 
0064   };
0065 } // namespace Genfun
0066 #endif