npstat is hosted by Hepforge, IPPP Durham
NPStat  5.10.0
mergeTwoHistos.hh
Go to the documentation of this file.
1 #ifndef NPSTAT_MERGETWOHISTOS_HH_
2 #define NPSTAT_MERGETWOHISTOS_HH_
3 
4 /*!
5 // \file mergeTwoHistos.hh
6 //
7 // \brief Smooth interpolation between two histograms
8 //
9 // Author: I. Volobouev
10 //
11 // July 2012
12 */
13 
15 
16 namespace npstat {
17  /**
18  // This function merges two histograms using a variable
19  // weight which usually changes smoothly from 0 to 1
20  // (or from 1 to 0) along a certain direction in the
21  // space spanned by histogram axes. Here, the histograms
22  // are basically treated as uniform data grids.
23  //
24  // The function arguments are as follows:
25  //
26  // h1, h2 -- The histograms to merge. Their axes do not have to
27  // be the same.
28  //
29  // w1 -- Functor which calculates the weight for histogram 1
30  // (histogram 2 will be assigned weight equal to 1.0 - w1).
31  //
32  // result -- Points to the result histogram (its bin contents will
33  // be modified). Dimensionalities of h1, h2, and the result
34  // histogram must be the same.
35  //
36  // truncateWeight -- If true, weights calculated by w1 will be
37  // truncated so that they are between 0 and 1.
38  //
39  // interpolationDegree -- This argument will be passed to the
40  // "interpolateHistoND" functions which will
41  // be employed to determine bin contents of
42  // h1 and h2 at the bin locations of the
43  // result histo.
44  */
45  template <class H1, class H2, class H3>
46  void mergeTwoHistos(const H1& h1, const H2& h2,
47  const AbsMultivariateFunctor& w1,
48  H3* result, bool truncateWeight=true,
49  unsigned interpolationDegree=1);
50 }
51 
52 #include "npstat/stat/mergeTwoHistos.icc"
53 
54 #endif // NPSTAT_MERGETWOHISTOS_HH_
Interface definition for multidimensional functors.
Definition: AbsArrayProjector.hh:14
void mergeTwoHistos(const H1 &h1, const H2 &h2, const AbsMultivariateFunctor &w1, H3 *result, bool truncateWeight=true, unsigned interpolationDegree=1)
Definition: AbsMultivariateFunctor.hh:19