10 #include <type_traits> 22 template<
typename Precision_t>
60 template<
typename Itr>
65 _bins{(end - begin) - 1},
79 template<
typename Itr>
89 template<
typename Container>
91 const std::string_view&
title,
92 const Container& container)
93 :
AxisConfig(title, container.begin(), container.end()) {}
135 template<
typename P,
typename W, std::
size_t D>
147 static constexpr std::size_t Dimension =
static_cast<std::size_t
>(D);
154 template<
typename Config>
158 template<
typename Config>
172 template<
typename Config>
174 typename Config::Impl_t&
impl() {
return _impl; }
176 const typename Config::Impl_t&
impl()
const {
return _impl; }
178 friend void add<Config>(
const std::shared_ptr<HistT<Config>>&,
const std::shared_ptr<HistT<Config>>&);
187 static constexpr std::size_t Dimension = Config::Dimension;
189 using Point_t = std::array<Precision_t, Dimension>;
220 const std::string_view& title,
227 HistT(
const std::string_view& title,
262 const typename Config::Impl_t&
get()
const {
return _impl; }
268 return !std::is_same_v<Config::Impl_t, void*>;
272 typename Config::Impl_t _impl{};
278 template<
typename Config>
281 typename Config::ConcurrentManager_t&
impl() {
return _impl; }
285 typename Config::ConcurrentManager_t
_impl;
291 template<
typename Config>
317 typename Config::ConcurrentFiller_t
_impl;
325 template<
typename Config>
338 template<
typename I,
typename O>
340 static_assert((
true == std::is_integral_v<I>) == std::is_integral_v<O>
341 ,
"safe_cast only available for integral types!");
343 static_cast<O>(input) >= std::numeric_limits<O>::min()
344 && static_cast<O>(input) <= std::numeric_limits<O>::max()) {
345 return static_cast<O
>(input);
347 throw std::domain_error(
"Input number is outside of target type domain!");
354 template <
typename T >
356 template <
typename T >
HistT(const AxisConfig_t &axis)
non-title 1D-histogram constructor.
void * Impl_t
math type used to handle histogram
Managed Access and creation of Objects.
book::types::HistT< HistConfig< P, W, D > > HistT
W Weight_t
type used for bin weight
HistT(const AxisConfig_t &axisA, const AxisConfig_t &axisB)
non-title 2D-histogram constructor.
const Config::Impl_t & impl() const
AxisConfig(const std::string_view &title, Itr begin, Itr end)
Axis with irregular borders.
void * ConcurrentManager_t
class to create ConcurrentFiller for one Histogram.
AxisConfig(const std::string_view &title, const Container &container)
Axis with irregular borders.
constexpr bool hasImpl()
check if histogram type implemented.
type trait for Histograms.
HistT(const AxisConfig_t &axisA, const AxisConfig_t &axisB, const AxisConfig_t &axisC)
non-title 3D-histogram constructor.
Config::ConcurrentManager_t _impl
Config::ConcurrentFiller_t _impl
bool isRegular() const
check if bins are equal sized.
const std::vector< Precision_t > & iregularBorder() const
get borders, when borders are irregular.
Generalized histogram class.
typename Config::Precision_t Precision_t
type used for bin borders
AxisConfig(std::size_t bins, Precision_t min, Precision_t max)
Axis with equal sized bins.
P Precision_t
type used for bin borders
AxisConfig(const std::string_view &title, std::size_t bins, Precision_t min, Precision_t max)
Axis with equal sized bins.
collection for Axis Description
std::optional< std::vector< Precision_t > > _iregularBorder
std::size_t bins() const
Get amount of bins.
constexpr O safe_cast(const I &input)
caste integral types with domain check.
Config::ConcurrentManager_t & impl()
auto toRoot6(const HistT< Config > &hist, const std::string_view &name)
convert histogram to Root-6 Object for serialization
AxisConfig(Itr begin, Itr end)
Axis with irregular borders.
HistT< Config > & add(HistT< Config > &to, const HistT< Config > &from)
add weights from one Histogram to an other.
class which basic functionality for every handle.
std::string_view title() const
Get Axis Title.
Precision_t max() const
Get upper bound.
std::array< Precision_t, Dimension > Point_t
type used for Entry Points
class managing parallel filling to one histogram.
class managing HistConcurrentFiller creation for one histogram.
typename Type::Weight_t Weight_t
Type used for bin weight.
void * ConcurrentFiller_t
class to access single instance across multiple threads.
typename Config::Weight_t Weight_t
type used for bin weight
Precision_t min() const
Get lower bound.
typename Type::Point_t Point_t
Type used for points.