TimeDistribution_ROOT.cc
Go to the documentation of this file.
1 #include <utl/TimeDistribution.h>
2 #include <io/TimeDistribution_ROOT.h>
3 
4 
6 
8 
9 namespace io {
10 
11  template<typename T>
13  fSlotSize(d.GetBinning())
14  {
15  for (auto it = d.SparseBegin(), end = d.SparseEnd(); it != end; ++it)
16  fTimeDistribution.emplace(it->template get<0>(), it->template get<1>());
17  }
18 
19 
20  template<typename T>
21  void
23  const
24  {
25  for (const auto& tv : fTimeDistribution)
26  d.AddTime(tv.first, tv.second);
27  }
28 
29 
30  template class TimeDistribution_ROOT<int>;
31  template class TimeDistribution_ROOT<double>;
32 
33 }
Histogram class for time distributions with suppressed empty bins.
std::map< int, T > fTimeDistribution
void operator>>(utl::TimeDistribution< T > &distribution) const
SparseIterator SparseEnd() const
SparseIterator SparseBegin() const
Iterator over time slots with data in them (skips empty slots).
void AddTime(const double time, const T weight=T(1))
Add an entry (optionally weighted) for the given time. Slot will be computed.

, generated on Tue Sep 26 2023.