npstat is hosted by Hepforge, IPPP Durham
NPStat  5.10.0
UGaussConvolution1D.hh
Go to the documentation of this file.
1 #ifndef NPSTAT_UGAUSSCONVOLUTION1D_HH_
2 #define NPSTAT_UGAUSSCONVOLUTION1D_HH_
3 
4 /*!
5 // \file UGaussConvolution1D.hh
6 //
7 // \brief Convolution of 1-d uniform and Gaussian distributions
8 //
9 // Author: I. Volobouev
10 //
11 // June 2014
12 */
13 
15 
16 namespace npstat {
18  {
19  public:
20  /**
21  // Parameters "leftEdge" and "uniformWidth" specify the
22  // location of the left edge and the width of the uniform
23  // distribution in the coordinate system for which the
24  // Gaussian has mean 0 and width 1.
25  */
27  double leftEdge, double uniformWidth);
28 
29  inline virtual UGaussConvolution1D* clone() const
30  {return new UGaussConvolution1D(*this);}
31 
32  inline virtual ~UGaussConvolution1D() {}
33 
34  inline double leftEdge() const {return leftEdge_;}
35  inline double uniformWidth() const {return width_;}
36 
37  // Methods needed for I/O
38  virtual gs::ClassId classId() const {return gs::ClassId(*this);}
39  virtual bool write(std::ostream& os) const;
40 
41  static inline const char* classname()
42  {return "npstat::UGaussConvolution1D";}
43  static inline unsigned version() {return 1;}
44  static UGaussConvolution1D* read(const gs::ClassId& id, std::istream&);
45 
46  protected:
47  virtual bool isEqual(const AbsDistribution1D&) const;
48 
49  private:
51 
52  UGaussConvolution1D(double location, double scale,
53  const std::vector<double>& params);
54  inline static int nParameters() {return 2;}
55 
56  double unscaledDensity(double x) const;
57  double unscaledCdf(double x) const;
58  double unscaledQuantile(double x) const;
59  double unscaledExceedance(double x) const;
60 
61  double leftEdge_;
62  double width_;
63  double rightEdge_;
64  };
65 }
66 
67 #endif // NPSTAT_UGAUSSCONVOLUTION1D_HH_
Factories for 1-d distributions for use in interpretive language environments.
Definition: AbsDistribution1D.hh:165
double scale() const
Definition: AbsDistribution1D.hh:183
double location() const
Definition: AbsDistribution1D.hh:180
Definition: Distribution1DFactory.hh:35
Definition: UGaussConvolution1D.hh:18
virtual UGaussConvolution1D * clone() const
Definition: UGaussConvolution1D.hh:29
virtual gs::ClassId classId() const
Definition: UGaussConvolution1D.hh:38
virtual bool isEqual(const AbsDistribution1D &) const
UGaussConvolution1D(double location, double scale, double leftEdge, double uniformWidth)
Definition: AbsArrayProjector.hh:14
Definition: AbsDistribution1D.hh:31