MarlinMT  0.1.0
HistEntryDataBase.h
Go to the documentation of this file.
1 #pragma once
2 
3 // -- std includes
4 #include <array>
5 
6 // -- MarlinBook includes
8 #include "marlinmt/book/Types.h"
9 
10 namespace marlinmt {
11  namespace book {
12 
16  template < class Config >
17  class EntryDataBase< types::HistT<Config>>
18  : public EntryDataBase< void > {
19  template < typename, unsigned long long >
20  friend class EntryData ;
21  static constexpr std::string_view empty{""} ;
22  protected:
23 
25  static constexpr int D = Type::Dimension;
26  public:
27 
28  explicit EntryDataBase( const std::string_view &title = empty ) ;
29 
34  single() const ;
35 
41  multiCopy( std::size_t n ) const ;
42 
47  multiShared( std::size_t n = 0) const ;
48 
49  protected:
50 
54  [[nodiscard]] const std::string_view &title() const { return _title; }
55 
60  [[nodiscard]] std::unique_ptr< typename Type::AxisConfig_t > &
61  axis( const std::size_t id ) {
62  return _axis.at( id ) ;
63  }
64 
69  [[nodiscard]] const std::unique_ptr< typename Type::AxisConfig_t > &
70  axis( const std::size_t id ) const {
71  return _axis.at( id ) ;
72  }
73 
74  private:
76  const std::string_view &_title ;
78  std::array< std::unique_ptr< typename Type::AxisConfig_t >, D > _axis{} ;
79  } ;
80  } // end namespace book
81 } // end namespace marlinmt
Container for data to construct and setup booked object.
Definition: EntryData.h:66
Generalized histogram class.
Definition: Base.h:151
Base Class for Entry Data, for similar behavior.
Definition: EntryData.h:45
const std::string_view & title() const
read access for passed title.
const std::string_view & _title
Histogram custom title, length = 0 when nothing setted.
std::unique_ptr< typename Type::AxisConfig_t > & axis(const std::size_t id)
access Histogram axis configuration.
const std::unique_ptr< typename Type::AxisConfig_t > & axis(const std::size_t id) const
access Histogram axis configuration.