MarlinMT  0.1.0
HistEntryData.h
Go to the documentation of this file.
1 #pragma once
2 
3 // -- std includes
4 #include <array>
5 #include <functional>
6 
7 // -- MarlinBook includes
8 #include "marlinmt/book/Entry.h"
10 #include "marlinmt/book/Types.h"
11 
12 // -- Hist includes
14 
15 namespace marlinmt {
16  namespace book {
17 
21  template < typename Config>
22  class EntryData< types::HistT<Config>, 0 >
23  : public EntryDataBase< types::HistT<Config> > {
25  static constexpr int D = Type::Dimension;
26  public:
31  explicit EntryData( const typename Type::AxisConfig_t &axis ) ;
32 
38  EntryData( const std::string_view& title,
39  const typename Type::AxisConfig_t &axis ) ;
40 
46  EntryData( const typename Type::AxisConfig_t &x_axis,
47  const typename Type::AxisConfig_t &y_axis ) ;
48 
55  EntryData( const std::string_view & title,
56  const typename Type::AxisConfig_t &x_axis,
57  const typename Type::AxisConfig_t &y_axis ) ;
58 
65  EntryData( const typename Type::AxisConfig_t &x_axis,
66  const typename Type::AxisConfig_t &y_axis,
67  const typename Type::AxisConfig_t &z_axis ) ;
68 
76  EntryData( const std::string_view & title,
77  const typename Type::AxisConfig_t &x_axis,
78  const typename Type::AxisConfig_t &y_axis,
79  const typename Type::AxisConfig_t &z_axis ) ;
80 
86  EntryData( const std::string_view& title,
87  const std::array<const types::AxisConfig<
88  typename Config::Precision_t>*
89  , Config::Dimension>& axes) ;
90 
91  } ;
92 
93 
94 
98  template < typename Config >
99  class EntryData< types::HistT<Config>, Flags::value( Flags::Book::Single ) > {
102  friend BookStore ;
103  static constexpr int D = Object_t::Dimension;
104 
105  explicit EntryData(
106  const EntryDataBase< Object_t > &data )
107  : _data{data} {}
108 
113  template < typename... Args_t, int d = D >
114  std::enable_if_t< d == 1, std::shared_ptr< details::Entry > >
115  book( BookStore &store, const Args_t &... args ) const ;
116 
121  template < typename... Args_t, int d = D >
122  std::enable_if_t< d == 2, std::shared_ptr< details::Entry > >
123  book( BookStore &store, const Args_t &... args ) const ;
124 
129  template < typename... Args_t, int d = D >
130  std::enable_if_t< d == 3, std::shared_ptr< details::Entry > >
131  book( BookStore &store, const Args_t &... args ) const ;
132 
134  } ;
135 
139  template < typename Config>
140  class EntryData< types::HistT<Config>, Flags::value( Flags::Book::MultiCopy ) > {
143  friend BookStore ;
144  static constexpr int D = Object_t::Dimension;
145 
147  std::size_t n )
148  : _data{data}, _n{n} {}
149 
154  template < typename... Args_t, int d = D >
155  std::enable_if_t< d == 1, std::shared_ptr< details::Entry > >
156  book( BookStore &store, const Args_t &... args ) const ;
157 
162  template < typename... Args_t, int d = D >
163  std::enable_if_t< d == 2, std::shared_ptr< details::Entry > >
164  book( BookStore &store, const Args_t &... args ) const ;
165 
170  template < typename... Args_t, int d = D >
171  std::enable_if_t< d == 3, std::shared_ptr< details::Entry > >
172  book( BookStore &store, const Args_t &... args ) const ;
173 
175  const std::size_t _n ;
176  } ;
177 
181  template < typename Config>
182  class EntryData< types::HistT<Config>, Flags::value( Flags::Book::MultiShared ) > {
185  friend BookStore ;
186  static constexpr int D = Object_t::Dimension;
187 
188  explicit EntryData(
189  const EntryDataBase< Object_t > &data,
190  std::size_t n)
191  : _data{data}, _n{n} {}
192 
197  template < typename... Args_t, int d = D >
198  std::enable_if_t< d == 1, std::shared_ptr< details::Entry > >
199  book( BookStore &store, const Args_t &... args ) const ;
200 
205  template < typename... Args_t, int d = D >
206  std::enable_if_t< d == 2, std::shared_ptr< details::Entry > >
207  book( BookStore &store, const Args_t &... args ) const ;
208 
213  template < typename... Args_t, int d = D >
214  std::enable_if_t< d == 3, std::shared_ptr< details::Entry > >
215  book( BookStore &store, const Args_t &... args ) const ;
216 
218  const std::size_t _n;
219  } ;
220 
221  } // end namespace book
222 } // end namespace marlinmt
Managed Access and creation of Objects.
Definition: BookStore.h:96
Container for data to construct and setup booked object.
Definition: EntryData.h:66
constexpr unsigned long long value(const Flag_t &flag)
Definition: Flags.h:106
Generalized histogram class.
Definition: Base.h:151
Base Class for Entry Data, for similar behavior.
Definition: EntryData.h:45
collection for Axis Description
Definition: Base.h:23