 |
Belle II Software
release-05-02-19
|
12 #ifndef _SVD_RECONSTRUCTION_NNWAVEFITTOOL_H
13 #define _SVD_RECONSTRUCTION_NNWAVEFITTOOL_H
21 #include <svd/simulation/SVDSimulationTools.h>
52 auto ibin =
m_bins.begin();
55 *ipt++ = std::make_pair(*ibin++, cp);
58 *ipt++ = std::make_pair(*ibin++, cp);
69 if (t >
m_pTable.back().first)
return 1.0;
70 if (t <
m_pTable[0].first)
return 0.0;
71 auto it = lower_bound(
m_pTable.begin(),
m_pTable.end(), std::make_pair(t, 0.0));
72 if (it ==
m_pTable.begin())
return it->second;
75 double result = it2->second + (it->second - it2->second) * (t - it2->first) / (it->first - it2->first);
81 std::vector<std::pair<double, double> >
m_pTable;
133 std::transform(p.begin(), p.end(),
134 p1.begin(), p.begin(), std::multiplies<double>());
144 std::shared_ptr<nnFitterBinData>
pFromInterval(
double left,
double right);
162 std::tuple<double, double, double>
182 double pnorm = std::accumulate(p.begin(), p.end(), 0.0);
184 if (pnorm < 1.0e-10) {
185 double uniformP = 1.0 / std::distance(p.begin(), p.end());
186 std::fill(p.begin(), p.end(), uniformP);
189 std::transform(p.begin(), p.end(), p.begin(),
190 std::bind2nd(std::divides<double>(), pnorm));
std::vector< std::pair< double, double > > m_pTable
(bin, prob) pairs
Empirical distribution function object is basic for mainpulation of probabilities.
Waveform generator This is a functor to calculate signal values.
double operator()(double t)
EmpiricalDistributionFunction(t) gives edf value at time t, linearly interpolated from cummulative bi...
const nnFitterBins & m_bins
array of bin boundaries.
std::vector< double > nnFitterBins
Vector of bin edges, nnFitterBinData.size() + 1.
Abstract base class for different kinds of events.
std::array< apvSampleBaseType, nAPVSamples > apvSamples
vector od apvSample BaseType objects
EmpiricalDistributionFunction(const nnFitterBinData &p, const nnFitterBins &bins)
Constructor constructs edf object from a probability distribution.
std::vector< double > nnFitterBinData
Vector of values defined for bins, such as bin times or bin probabilities.