npstat is hosted by Hepforge, IPPP Durham
NPStat  5.10.0
make_UnbinnedGOFTest1D.hh
Go to the documentation of this file.
1 #ifndef NPSTAT_MAKE_UNBINNEDGOFTEST1D_HH_
2 #define NPSTAT_MAKE_UNBINNEDGOFTEST1D_HH_
3 
4 /*!
5 // \file make_UnbinnedGOFTest1D.hh
6 //
7 // \brief A factory function for creating 1-d GOF test objects
8 //
9 // Author: I. Volobouev
10 //
11 // October 2022
12 */
13 
14 #include "geners/CPP11_auto_ptr.hh"
15 
17 
18 namespace npstat {
19  CPP11_auto_ptr<AbsUnbinnedGOFTest1D> make_UnbinnedGOFTest1D(
20  const std::string& classname, const AbsDistribution1D& nullD,
21  unsigned maxDegree, const std::vector<unsigned char>& degreeMask);
22 
23 #ifdef SWIG
24  inline AbsUnbinnedGOFTest1D* make_UnbinnedGOFTest1D_2(
25  const std::string& classname, const AbsDistribution1D& nullD,
26  const unsigned maxDegree, const std::vector<int>& degreeMask)
27  {
28  const unsigned sz = degreeMask.size();
29  std::vector<unsigned char> m(sz);
30  for (unsigned i=0; i<sz; ++i)
31  {
32  if (degreeMask[i])
33  m[i] = 1;
34  else
35  m[i] = 0;
36  }
37  CPP11_auto_ptr<AbsUnbinnedGOFTest1D> ptr =
38  make_UnbinnedGOFTest1D(classname, nullD, maxDegree, m);
39  return ptr.release();
40  }
41 #endif
42 }
43 
44 #endif // NPSTAT_MAKE_UNBINNEDGOFTEST1D_HH_
Interface definition for goodness-of-fit tests for 1-d distributions.
Definition: AbsArrayProjector.hh:14