npstat is hosted by Hepforge, IPPP Durham
NPStat  5.10.0
productResponseMatrix.hh
Go to the documentation of this file.
1 #ifndef NPSTAT_PRODUCTRESPONSEMATRIX_HH_
2 #define NPSTAT_PRODUCTRESPONSEMATRIX_HH_
3 
4 /*!
5 // \file productResponseMatrix.hh
6 //
7 // \brief Function for building sparse response matrices for multivariate
8 // unfolding problems using product distributions
9 //
10 // Author: I. Volobouev
11 //
12 // June 2014
13 */
14 
15 #include "geners/CPP11_auto_ptr.hh"
16 
17 #include "npstat/nm/BoxND.hh"
19 
21 
22 namespace npstat {
23  /**
24  // Function arguments are as follows:
25  //
26  // unfoldedBox -- boundaries for the "unfolded" (that is,
27  // physical) space.
28  //
29  // unfoldedShape -- number of subdivisions for each dimension of
30  // the unfolded space. Uniform binning is used.
31  //
32  // observedBox -- boundaries for the "observed" space.
33  //
34  // observedShape -- number of subdivisions for each dimension of
35  // the observed space. Uniform binning is used.
36  //
37  // distro -- distribution to use in order to build the
38  // response matrix. The method "isScalable"
39  // of this distribution must return "true".
40  // Locations and scales of "distro" components
41  // will be modified while this function runs
42  // but will be restored to their initial values
43  // upon exit.
44  //
45  // shifts -- these functors should calculate shifts in the
46  // physical space, as a function of point location
47  // in that space. If the function pointer is NULL,
48  // the shift is set to 0. In order to calculate
49  // the response in the obseved space, locations
50  // of the marginals will be set to the coordinate
51  // of the physical space point plus this shift.
52  //
53  // widthFactors -- these functors should calculate width factors
54  // used to mutiply the original scales, as
55  // a function of point location in the physical
56  // space. If the function pointer is NULL, the
57  // factor is set to 1.
58  //
59  // It is expected that some or all of the "distro" marginals will
60  // have finite support, otherwise the returned collection of triplets
61  // will not be sparse. The first index of each triplet will correspond
62  // to the cell number in the observed space, and the second index
63  // will correspond to the cell number in the physical space.
64  */
65  template<class Triplet>
66  CPP11_auto_ptr<std::vector<Triplet> > productResponseMatrix(
67  const npstat::BoxND<double>& unfoldedBox,
68  const std::vector<unsigned>& unfoldedShape,
69  const npstat::BoxND<double>& observedBox,
70  const std::vector<unsigned>& observedShape,
72  const std::vector<npstat::AbsMultivariateFunctor*>& shifts,
73  const std::vector<npstat::AbsMultivariateFunctor*>& widthFactors);
74 }
75 
76 #include "npstat/stat/productResponseMatrix.icc"
77 
78 #endif // NPSTAT_PRODUCTRESPONSEMATRIX_HH_
Interface definition for multidimensional functors.
Template to represent rectangles, boxes, and hyperboxes.
A number of useful multivariate continuous statistical distributions.
Definition: DistributionsND.hh:30
Definition: AbsArrayProjector.hh:14
CPP11_auto_ptr< std::vector< Triplet > > productResponseMatrix(const npstat::BoxND< double > &unfoldedBox, const std::vector< unsigned > &unfoldedShape, const npstat::BoxND< double > &observedBox, const std::vector< unsigned > &observedShape, npstat::ProductDistributionND &distro, const std::vector< npstat::AbsMultivariateFunctor * > &shifts, const std::vector< npstat::AbsMultivariateFunctor * > &widthFactors)