npstat is hosted by Hepforge, IPPP Durham
NPStat  5.10.0
UnbinnedGOFTest1DFactory.hh
Go to the documentation of this file.
1 #ifndef NPSTAT_UNBINNEDGOFTEST1DFACTORY_HH_
2 #define NPSTAT_UNBINNEDGOFTEST1DFACTORY_HH_
3 
4 /*!
5 // \file UnbinnedGOFTest1DFactory.hh
6 //
7 // \brief Factories for 1-d GoF tests for use in interpretive language
8 // environments
9 //
10 // Author: I. Volobouev
11 //
12 // April 2022
13 */
14 
15 #include <map>
16 #include <string>
17 
20 
21 namespace npstat {
23  {
24  public:
25  inline virtual ~AbsUnbinnedGOFTest1DFactory() {}
26 
27  virtual AbsUnbinnedGOFTest1D* create(
28  const AbsDistribution1D& null) const = 0;
29  };
30 
31  template <typename T>
33  {
34  public:
35  inline virtual ~UnbinnedGOFTest1DFactory() {}
36 
37  T* create(const AbsDistribution1D& null) const
38  {
39  return new T(null);
40  }
41  };
42 
43  /**
44  // Use this factory to construct a 1-d GoF test from its null
45  // distrubution.
46  //
47  // Not all GoF tests support this construction method. Iterate
48  // over the keys in this map for the list of supported tests.
49  */
51  public std::map<std::string, AbsUnbinnedGOFTest1DFactory *>
52  {
53  public:
56 
57  inline bool contains(const std::string& name) const
58  {return this->find(name) != this->end();}
59 
60  private:
65  };
66 }
67 
68 #endif // NPSTAT_UNBINNEDGOFTEST1DFACTORY_HH_
Interface definition for 1-d continuous statistical distributions.
Interface definition for goodness-of-fit tests for 1-d distributions.
Definition: UnbinnedGOFTest1DFactory.hh:23
Definition: AbsUnbinnedGOFTest1D.hh:24
Definition: UnbinnedGOFTest1DFactory.hh:52
Definition: UnbinnedGOFTest1DFactory.hh:33
Definition: AbsArrayProjector.hh:14
Definition: AbsDistribution1D.hh:31