npstat is hosted by Hepforge, IPPP Durham
NPStat  5.10.0
LognormalTransform1D.hh
Go to the documentation of this file.
1 #ifndef NPSTAT_LOGNORMALTRANSFORM1D_HH_
2 #define NPSTAT_LOGNORMALTRANSFORM1D_HH_
3 
4 /*!
5 // \file LognormalTransform1D.hh
6 //
7 // \brief Transform used to generate the lognormal distribution
8 //
9 // Author: I. Volobouev
10 //
11 // November 2022
12 */
13 
15 
16 namespace npstat {
18  {
19  public:
20  LognormalTransform1D(double delta, double gamma,
21  double xi, bool positiveSkewness);
22  inline virtual ~LognormalTransform1D() {}
23 
24  inline virtual LognormalTransform1D* clone() const
25  {return new LognormalTransform1D(*this);}
26 
27  double transformForward(double x, double* dydx) const;
28  double transformBack(double y) const;
29  bool isIncreasing() const;
30 
31  //@{
32  /** Prototype needed for I/O */
33  inline virtual gs::ClassId classId() const {return gs::ClassId(*this);}
34  virtual bool write(std::ostream&) const;
35  //@}
36 
37  static inline const char* classname()
38  {return "npstat::LognormalTransform1D";}
39  static inline unsigned version() {return 1;}
40  static LognormalTransform1D* read(const gs::ClassId& id, std::istream& is);
41 
42  protected:
43  virtual bool isEqual(const AbsDistributionTransform1D&) const;
44 
45  private:
46  inline void setParameterChecked(const unsigned which, const double value)
47  {params_[which] = value;}
48  inline void setAllParametersChecked(const double* p)
49  {for (unsigned i=0; i<4U; ++i) {params_[i] = p[i];}}
50  inline double getParameterChecked(const unsigned which) const
51  {return params_[which];}
52 
53  double params_[4];
54  };
55 }
56 
57 #endif // NPSTAT_LOGNORMALTRANSFORM1D_HH_
Interface definition for 1-d coordinate transformations used to build statistical distributions.
Definition: AbsDistributionTransform1D.hh:29
Definition: LognormalTransform1D.hh:18
virtual bool isEqual(const AbsDistributionTransform1D &) const
virtual gs::ClassId classId() const
Definition: LognormalTransform1D.hh:33
virtual LognormalTransform1D * clone() const
Definition: LognormalTransform1D.hh:24
double transformForward(double x, double *dydx) const
Definition: AbsArrayProjector.hh:14