Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // -*- C++ -*-
0002 // $Id: PuncturedSmearedExp.hh,v 1.3 2010/06/16 18:22:01 garren Exp $
0003 // ------------------------------------------------------------------------------//
0004 // This function-object makes an exponential with acceptance holes ("punctures") //
0005 // smeared by a resolution function.                                             //
0006 //                                                                               //
0007 //                                                                               //
0008 // Joe Boudreau.                                                                 //
0009 //                                                                               //
0010 // ------------------------------------------------------------------------------//
0011 #ifndef _PuncturedSmearedExp_h_
0012 #define _PuncturedSmearedExp_h_ 
0013 #include "CLHEP/GenericFunctions/AbsFunction.hh"
0014 #include "CLHEP/GenericFunctions/Parameter.hh"
0015  
0016 namespace Genfun {
0017 
0018   /**
0019    * @author
0020    * @ingroup genfun
0021    */
0022   class PuncturedSmearedExp: public AbsFunction {
0023 
0024     FUNCTION_OBJECT_DEF(PuncturedSmearedExp)
0025 
0026       public:
0027 
0028     // Constructor
0029     PuncturedSmearedExp();
0030 
0031     // Copy constructor
0032     PuncturedSmearedExp(const PuncturedSmearedExp &right);
0033   
0034     // Destructor:
0035     virtual ~PuncturedSmearedExp();
0036 
0037     // Retreive function value
0038     virtual double operator ()(double argument) const override;
0039     virtual double operator ()(const Argument & a) const override {return operator() (a[0]);}
0040   
0041     // Lifetime of exponential:
0042     Parameter & lifetime();
0043     const Parameter & lifetime() const;
0044 
0045     // Width of the gaussian:
0046     Parameter & sigma();
0047     const Parameter & sigma() const;
0048 
0049     // Puncture this thing:
0050     void puncture(double min, double max);
0051 
0052     // Get the puncture parameters:
0053     Parameter & min(unsigned int i);
0054     Parameter & max(unsigned int i);
0055     const Parameter & min(unsigned int i) const;
0056     const Parameter & max(unsigned int i) const;
0057     
0058 
0059   private:
0060   
0061     // These are for calculating mixing terms.
0062     double pow(double x, int n) const ;
0063     double erfc(double x) const ;
0064 
0065     // It is illegal to assign an adjustable constant
0066     const PuncturedSmearedExp & operator=(const PuncturedSmearedExp &right);
0067 
0068     Parameter              _lifetime;
0069     Parameter              _sigma;
0070     std::vector<Parameter> _punctures;
0071 
0072   };
0073 } // namespace Genfun
0074 #endif