Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // -*- C++ -*-
0002 // $Id: Rectangular.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 Rectangular_h
0010 #define Rectangular_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 Rectangular : public AbsFunction  {
0020 
0021     FUNCTION_OBJECT_DEF(Rectangular)
0022 
0023       public:
0024 
0025     // Constructor
0026     Rectangular();
0027 
0028     // Copy constructor
0029     Rectangular(const Rectangular &right);
0030   
0031     // Destructor
0032     virtual ~Rectangular();
0033   
0034     // Retreive function value
0035     virtual double operator ()(double argument) const override;
0036     virtual double operator ()(const Argument & a) const override {return operator() (a[0]);}
0037   
0038     // Get the position of the first discontinuity
0039     const Parameter & x0() const; 
0040     Parameter & x0(); 
0041 
0042     // Get the position of the second discontinuity
0043     const Parameter & x1() const; 
0044     Parameter & x1(); 
0045 
0046     // Get the value of the function at its baseline
0047     const Parameter & baseline() const; 
0048     Parameter & baseline(); 
0049 
0050     // Get the value of the function at its top
0051     const Parameter & height() const; 
0052     Parameter & height(); 
0053   
0054     // Derivative.  
0055     Derivative partial (unsigned int) const override;
0056 
0057     // Does this function have an analytic derivative?
0058     virtual bool hasAnalyticDerivative() const override {return true;}
0059 
0060   private:
0061 
0062     // It is illegal to assign an adjustable constant
0063     const Rectangular & operator=(const Rectangular &right);
0064 
0065     // Here is the decay constant
0066     Parameter _x0;
0067     Parameter _x1;
0068     Parameter _baseline;
0069     Parameter _height;
0070 
0071   };
0072 } // namespace Genfun
0073 #endif