ATLAS Offline Software
Writer.h
Go to the documentation of this file.
1 // this is -*- C++ -*-
2 /*
3  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
4 */
5 #ifndef HDF_TUPLE_HH
6 #define HDF_TUPLE_HH
7 
16 #include "WriterConfiguration.h"
17 #include "H5Traits.h"
18 #include "CompressedTypes.h"
19 #include "common.h"
20 #include "defaults.h"
21 
22 #include "H5Cpp.h"
23 
24 #include <functional>
25 #include <vector>
26 #include <memory>
27 #include <cassert>
28 #include <set>
29 
30 namespace H5Utils {
31 
34 
35  namespace internal {
36 
45  template <typename I>
47  {
48  public:
49  virtual ~IDataConsumer() {}
50  virtual data_buffer_t getBuffer(I) const = 0;
51  virtual data_buffer_t getDefault() const = 0;
52  virtual H5::DataType getType() const = 0;
53  virtual H5::DataType getWriteType() const = 0;
54  virtual std::string name() const = 0;
55  typedef I input_type;
56  };
57 
59  template <typename T, typename I>
60  class DataConsumer: public IDataConsumer<I>
61  {
62  public:
63  DataConsumer(const std::string&,
64  const std::function<T(I)>&,
65  const T default_value = T(),
67  data_buffer_t getBuffer(I) const override;
68  data_buffer_t getDefault() const override;
69  H5::DataType getType() const override;
70  H5::DataType getWriteType() const override;
71  std::string name() const override;
72  private:
73  std::function<T(I)> m_getter;
74  std::string m_name;
77  };
78  template <typename T, typename I>
80  const std::function<T(I)>& func,
81  const T default_value,
83  m_getter(func),
84  m_name(name),
85  m_default_value(default_value),
86  m_write_type(getCompressedType<T>(comp))
87  {
88  }
89  template <typename T, typename I>
92  H5Traits<T>::ref(buffer) = m_getter(args);
93  return buffer;
94  }
95  template <typename T, typename I>
97  data_buffer_t default_value;
98  H5Traits<T>::ref(default_value) = m_default_value;
99  return default_value;
100  }
101  template <typename T, typename I>
103  return H5Traits<T>::type;
104  }
105  template <typename T, typename I>
107  return m_write_type;
108  }
109  template <typename T, typename I>
110  std::string DataConsumer<T, I>::name() const {
111  return m_name;
112  }
113 
114  }
116 
124  template <typename I>
126  using SharedConsumer = std::shared_ptr<internal::IDataConsumer<I> >;
127  template <typename I>
128  class Consumers
129  {
130  public:
131 
133  template <typename T>
134  void add(const std::string& name, const std::function<T(I)>&,
135  const T& default_value = T(),
137 
139  template <
140  typename T,
141  typename F,
142  typename R=decltype(std::declval<F>()(std::declval<I>()))
143  >
144  void add(const std::string& name, const F func, const T& def = T(),
146  add<R>(name, std::function<R(I)>(func), R(def), comp);
147  }
148 
149 
150  const std::vector<SharedConsumer<I> > & getConsumers() const;
151 
152  using input_type = I;
153  template <typename T>
154  using function_type = std::function<T(I)>;
155 
156  private:
157  std::vector<SharedConsumer<I> > m_consumers;
158  std::set<std::string> m_used;
159  };
161 
162  template <typename I>
163  template <typename T>
164  void Consumers<I>::add(const std::string& name,
165  const std::function<T(I)>& fun,
166  const T& def_val,
168  {
169  if (m_used.count(name)) {
170  throw std::logic_error("tried to insert '" + name + "' twice");
171  }
172  m_consumers.push_back(
173  std::make_shared<internal::DataConsumer<T,I>>(name, fun, def_val, comp));
174  m_used.insert(name);
175  }
176 
177  template <typename I>
178  const std::vector<SharedConsumer<I>> & Consumers<I>::getConsumers() const {
179  return m_consumers;
180  }
181 
182 
185  namespace internal {
186 
187  // This class exists to inspect the way the fill(...) function is
188  // called, so that errors can be caught with a static assert and
189  // give a much less cryptic error message.
190  //
191  // We check to make sure the depth of the input matches the rank
192  // of the output, and that the types match.
193  using std::begin;
194  template <size_t N, typename T, typename I, typename = void>
195  struct CheckType {
197  static const bool any_type = ok_type;
198  static const int depth = 0;
199  };
200  template <size_t N, typename T, typename I>
201  struct CheckType <N,T,I,decltype(*begin(std::declval<T&>()), void())> {
202  typedef CheckType<N-1,decltype(*begin(std::declval<T&>())),I> subtype;
203  static const bool ok_type = subtype::ok_type;
204  static const bool any_type = (
205  subtype::any_type || std::is_convertible<T,I>::value);
206  static const int depth = subtype::depth + 1;
207  };
208  template <typename T, typename I>
209  struct CheckType <0,T,I,decltype(*begin(std::declval<T&>()), void())> {
211  static const bool ok_type = std::is_convertible<T,I>::value;
212  static const bool any_type = subtype::any_type || ok_type;
213  static const int depth = subtype::depth + 1;
214  };
215 
223  template <size_t N, typename F, typename T, size_t M = N>
224  struct DataFlattener {
225 
226  std::vector<data_buffer_t> buffer;
227  std::vector<std::array<hsize_t, N> > element_offsets;
228  DataFlattener(const F& filler, T args,
229  const std::array<hsize_t,M>& extent):
230  buffer() {
231  hsize_t offset = 0;
232  for (const auto& arg: args) {
233  const size_t this_dim_max = extent.at(extent.size() - N);
234  if (offset >= this_dim_max) return;
235  DataFlattener<N-1, F, decltype(arg), M> in(filler, arg, extent);
236  buffer.insert(buffer.end(), in.buffer.begin(), in.buffer.end());
237  for (const auto& in_ele: in.element_offsets){
238  std::array<hsize_t, N> element_pos;
239  element_pos.at(0) = offset;
240  std::copy(in_ele.begin(), in_ele.end(), element_pos.begin() + 1);
241  element_offsets.push_back(element_pos);
242  }
243  offset++;
244  }
245  }
246  };
247  template <typename F, typename T, size_t M>
248  struct DataFlattener<0, F, T, M> {
249  std::vector<data_buffer_t> buffer;
250  std::vector<std::array<hsize_t, 0> > element_offsets;
251  DataFlattener(const F& f, T args,
252  const std::array<hsize_t,M>& /*extent*/):
253  buffer(),
254  element_offsets(1) {
255  for (const auto& filler: f) {
256  buffer.push_back(filler->getBuffer(args));
257  }
258  }
259  };
260 
263  template<typename I>
264  H5::CompType buildType(const std::vector<SharedConsumer<I> >& consumers) {
265  if (consumers.size() < 1) {
266  throw std::logic_error(
267  "you must specify at least one consumer when initializing the HDF5"
268  "writer");
269  }
270 
271  H5::CompType type(consumers.size() * sizeof(data_buffer_t));
272  size_t dt_offset = 0;
273  for (const SharedConsumer<I>& filler: consumers) {
274  type.insertMember(filler->name(), dt_offset, filler->getType());
275  dt_offset += sizeof(data_buffer_t);
276  }
277  return type;
278  }
279  template<typename I>
280  H5::CompType buildWriteType(const std::vector<SharedConsumer<I> >& con) {
281  H5::CompType type(con.size() * sizeof(data_buffer_t));
282  size_t dt_offset = 0;
283  for (const SharedConsumer<I>& filler: con) {
284  type.insertMember(filler->name(), dt_offset, filler->getWriteType());
285  dt_offset += sizeof(data_buffer_t);
286  }
287  type.pack();
288  return type;
289  }
290 
292  template <typename I, size_t N>
293  struct DSParameters {
294  DSParameters(const std::vector<SharedConsumer<I> >& fillers,
295  const std::array<hsize_t,N>& extent,
296  hsize_t batch_size);
297  H5::CompType type{};
298  std::array<hsize_t,N> extent{};
299  hsize_t batch_size{};
300  };
301 
302  // DS parameters
303  template <typename I, size_t N>
305  const std::array<hsize_t,N>& extent_,
306  hsize_t batch_size_):
307  type(buildType(cons)),
308  extent(extent_),
309  batch_size(batch_size_)
310  {
311  }
312 
313 
314  template<typename I>
315  std::vector<data_buffer_t> buildDefault(const std::vector<SharedConsumer<I> >& f) {
316  std::vector<data_buffer_t> def;
317  for (const SharedConsumer<I>& filler: f) {
318  def.push_back(filler->getDefault());
319  }
320  return def;
321  }
322 
323  // some internal functions take a vector, others take arrays
324  template <size_t N>
325  std::vector<hsize_t> vec(std::array<hsize_t,N> a) {
326  return std::vector<hsize_t>(a.begin(),a.end());
327  }
328 
329  // default initalizer for writers where the extent isn't specified
330  template <hsize_t N>
331  std::array<hsize_t, N> uniform(size_t val) {
332  std::array<hsize_t, N> ar;
333  ar.fill(val);
334  return ar;
335  }
336 
337 
338  }
340 
348  template <size_t N, typename I>
349  class Writer {
350  public:
351  Writer(H5::Group& group, const std::string& name,
352  const Consumers<I>& consumers,
353  const std::array<hsize_t, N>& extent = internal::uniform<N>(5),
354  hsize_t batch_size = defaults::batch_size);
356  const Consumers<I>& consumers,
358  Writer(const Writer&) = delete;
359  Writer(Writer&&) = default;
360  Writer& operator=(Writer&) = delete;
361  ~Writer();
362  template <typename T>
363  void fill(T);
364  void flush();
365  size_t index() const;
367  using input_type = I;
368  template <typename T>
371  private:
373  hsize_t m_offset;
374  hsize_t m_buffer_rows;
375  std::vector<internal::data_buffer_t> m_buffer;
376  std::vector<SharedConsumer<I> > m_consumers;
377  H5::DataSet m_ds;
378  H5::DataSpace m_file_space;
379  };
380 
381  template <size_t N, typename I>
382  Writer<N, I>::Writer(H5::Group& group, const std::string& name,
383  const Consumers<I>& consumers,
384  const std::array<hsize_t,N>& extent,
385  hsize_t batch_size):
386  Writer<N,I>(
387  group, consumers, WriterConfiguration<N>{
388  name, // name
389  extent, // extent
390  batch_size, // batch_size
391  extent, // chunks
392  defaults::deflate // deflate
393  })
394  {}
395 
396  template <size_t N, typename I>
398  const Consumers<I>& consumers,
399  const WriterConfiguration<N>& cfg):
400  m_par(consumers.getConsumers(), cfg.extent,
402  m_offset(0),
403  m_buffer_rows(0),
404  m_consumers(consumers.getConsumers()),
405  m_file_space(H5S_SIMPLE)
406  {
408  if (m_par.batch_size < 1) {
409  throw std::logic_error("batch size must be > 0");
410  }
411  // create space
412  H5::DataSpace space = internal::getUnlimitedSpace(
413  internal::vec(cfg.extent));
414 
415  // create params
416  H5::DSetCreatPropList params = internal::getChunckedDatasetParams(cfg);
417  std::vector<data_buffer_t> default_value = internal::buildDefault(
418  consumers.getConsumers());
419  params.setFillValue(m_par.type, default_value.data());
420 
421  // create ds
423  H5::CompType packed_type = buildWriteType(consumers.getConsumers());
424  m_ds = group.createDataSet(cfg.name, packed_type, space, params);
425  m_file_space = m_ds.getSpace();
426  m_file_space.selectNone();
427  }
428 
429  template <size_t N, typename I>
431  using namespace H5Utils;
432  try {
433  flush();
434  } catch (H5::Exception& err) {
435  internal::printDestructorError(err.getDetailMsg());
436  } catch (std::exception& err) {
438  }
439  }
440 
441  template <size_t N, typename I>
442  template <typename T>
444  if (m_buffer_rows == m_par.batch_size) {
445  flush();
446  }
447 
448  // make some assertions to simplify debugging, the errors can be
449  // pretty nasty wtih all these templates.
450  typedef internal::CheckType<N, T, I> checkType;
451  static_assert(
452  checkType::depth >= N,
453  "\n\n"
454  " ** H5 Writer rank is greater than the depth of fill(...) input! **"
455  " \n");
456  static_assert(
457  // Suppress cppcheck warning here. It reports that the condition
458  // below is always true if `N = 0`. In N > 0 cases this
459  // condition might be false though, so I consider this a
460  // spurious warning.
461  //
462  // <3 Dan Guest, 2024-07-16 <3
463  //
464  // cppcheck-suppress incorrectLogicOperator
465  !(checkType::any_type && !checkType::ok_type),
466  "\n\n"
467  " ** H5 Writer input type matches fill(...), but rank is incorrect! **"
468  " \n");
469  static_assert(
470  checkType::any_type,
471  "\n\n"
472  " ** H5 Writer input type doesn't match input for fill(...)! **"
473  " \n");
474 
475  internal::DataFlattener<N, decltype(m_consumers), T> buf(
476  m_consumers, arg, m_par.extent);
477  hsize_t n_el = buf.element_offsets.size();
478  std::vector<hsize_t> elements;
479  for (const auto& el_local: buf.element_offsets) {
480  std::array<hsize_t, N+1> el_global;
481  el_global[0] = m_offset + m_buffer_rows;
482  std::copy(el_local.begin(), el_local.end(), el_global.begin() + 1);
483  elements.insert(elements.end(), el_global.begin(), el_global.end());
484  }
485  if (n_el > 0) {
486  m_file_space.selectElements(H5S_SELECT_APPEND, n_el, elements.data());
487  }
488  m_buffer.insert(m_buffer.end(), buf.buffer.begin(), buf.buffer.end());
489  m_buffer_rows++;
490  }
491 
492  template <size_t N, typename I>
494  const hsize_t buffer_size = m_buffer_rows;
495  if (buffer_size == 0) return;
496 
497  // extend the ds
498  std::vector<hsize_t> total_dims{buffer_size + m_offset};
499  total_dims.insert(total_dims.end(),
500  m_par.extent.begin(),
501  m_par.extent.end());
502  m_ds.extend(total_dims.data());
503  m_file_space.setExtentSimple(total_dims.size(), total_dims.data());
504 
505  // write out
506  hsize_t n_buffer_pts = m_buffer.size() / m_consumers.size();
507  assert(m_file_space.getSelectNpoints() >= 0);
508  assert(static_cast<hsize_t>(m_file_space.getSelectNpoints())
509  == n_buffer_pts);
510  H5::DataSpace mem_space(1, &n_buffer_pts);
511  m_ds.write(m_buffer.data(), m_par.type, mem_space, m_file_space);
512  m_offset += buffer_size;
513  m_buffer.clear();
514  m_buffer_rows = 0;
515  m_file_space.selectNone();
516  }
517 
518  template <size_t N, typename I>
519  size_t Writer<N, I>::index() const {
520  return m_buffer_rows + m_offset;
521  }
522 
533  template <size_t N, class I>
535  H5::Group& group, const std::string& name,
536  const Consumers<I>& consumers,
537  const std::array<hsize_t, N>& extent = internal::uniform<N>(5),
538  hsize_t batch_size = defaults::batch_size) {
539  return Writer<N,I>(group, name, consumers, extent, batch_size);
540  }
541 
548  template <typename T>
550 
551 
558  template <size_t N, typename T>
560 
561 
568  template <typename T>
570 
571 }
572 
573 #endif
H5Utils::Writer::~Writer
~Writer()
Definition: Writer.h:430
H5Utils::Consumers::add
void add(const std::string &name, const std::function< T(I)> &, const T &default_value=T(), Compression=Compression::STANDARD)
This should be the only method you need in this class.
Definition: Writer.h:164
H5Utils::internal::IDataConsumer::getDefault
virtual data_buffer_t getDefault() const =0
plotting.yearwise_luminosity_vs_mu.comp
comp
Definition: yearwise_luminosity_vs_mu.py:23
H5Utils::SharedConsumer
std::shared_ptr< internal::IDataConsumer< I > > SharedConsumer
Consumer Class.
Definition: Writer.h:126
generateReferenceFile.fun
fun
Definition: generateReferenceFile.py:18
H5Utils::internal::DataFlattener::buffer
std::vector< data_buffer_t > buffer
Definition: Writer.h:226
H5Utils::internal::H5Traits
We have lots of code to get around HDF5's rather weak typing.
Definition: H5Traits.h:54
H5Utils::internal::getChunckedDatasetParams
H5::DSetCreatPropList getChunckedDatasetParams(const WriterConfiguration< N > &)
egammaParameters::depth
@ depth
pointing depth of the shower as calculated in egammaqgcld
Definition: egammaParamDefs.h:276
TrigDefs::Group
Group
Properties of a chain group.
Definition: GroupProperties.h:13
H5Utils::internal::DSParameters::type
H5::CompType type
Definition: Writer.h:297
H5Utils::internal::IDataConsumer::getWriteType
virtual H5::DataType getWriteType() const =0
FullCPAlgorithmsTest_eljob.flush
flush
Definition: FullCPAlgorithmsTest_eljob.py:182
H5Utils::internal::DSParameters::batch_size
hsize_t batch_size
Definition: Writer.h:299
defaults.h
H5Utils::internal::DataConsumer
implementation for variable filler
Definition: Writer.h:61
H5Utils::internal::getUnlimitedSpace
H5::DataSpace getUnlimitedSpace(const std::vector< hsize_t > &max_length)
Definition: common.cxx:31
H5Utils::Compression::STANDARD
@ STANDARD
H5Utils::Consumers::m_consumers
std::vector< SharedConsumer< I > > m_consumers
Definition: Writer.h:157
H5Utils::internal::CheckType::ok_type
static const bool ok_type
Definition: Writer.h:196
H5Utils::internal::DataFlattener< 0, F, T, M >::DataFlattener
DataFlattener(const F &f, T args, const std::array< hsize_t, M > &)
Definition: Writer.h:251
H5Utils::internal::DataFlattener
Data flattener class: this is used by the writer to read in the elements one by one and put them in a...
Definition: Writer.h:224
H5Utils::internal::DataConsumer::m_name
std::string m_name
Definition: Writer.h:74
H5Utils::internal::DSParameters
Constant parameters for the writer.
Definition: Writer.h:293
DataType
OFFLINE_FRAGMENTS_NAMESPACE::PointerType DataType
Definition: RoIBResultByteStreamTool.cxx:25
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
H5Utils::Writer::operator=
Writer & operator=(Writer &)=delete
taskman.template
dictionary template
Definition: taskman.py:317
H5Utils::internal::DataConsumer::getBuffer
data_buffer_t getBuffer(I) const override
Definition: Writer.h:90
H5Utils::WriterConfiguration
Definition: WriterConfiguration.h:16
H5Utils::internal::CheckType< N, T, I, decltype(*begin(std::declval< T & >()), void())>::subtype
CheckType< N-1, decltype(*begin(std::declval< T & >))), I > subtype
Definition: Writer.h:202
getConsumers
consumer_t getConsumers()
Definition: test-hdf5-writer.cxx:27
athena.value
value
Definition: athena.py:124
H5Utils::internal::buildType
H5::CompType buildType(const std::vector< SharedConsumer< I > > &consumers)
Adapter to translate configuration info into the objects needed by the writer.
Definition: Writer.h:264
H5Traits.h
JetTiledMap::N
@ N
Definition: TiledEtaPhiMap.h:44
H5Utils::Writer::function_type
typename consumer_type::template function_type< T > function_type
Definition: Writer.h:369
H5Utils::internal::DSParameters::DSParameters
DSParameters(const std::vector< SharedConsumer< I > > &fillers, const std::array< hsize_t, N > &extent, hsize_t batch_size)
Definition: Writer.h:304
H5Utils::internal::IDataConsumer::input_type
I input_type
Definition: Writer.h:55
H5Utils::defaults::batch_size
const hsize_t batch_size
Definition: defaults.h:9
H5Utils::internal::IDataConsumer::getType
virtual H5::DataType getType() const =0
H5Utils::internal::getCompressedType
H5::DataType getCompressedType(Compression comp)
Definition: CompressedTypes.h:23
H5Utils::internal::DataConsumer::getWriteType
H5::DataType getWriteType() const override
Definition: Writer.h:106
H5Utils::internal::IDataConsumer::~IDataConsumer
virtual ~IDataConsumer()
Definition: Writer.h:49
H5Utils::internal::printDestructorError
void printDestructorError(const std::string &msg)
Definition: common.cxx:24
H5Utils::Compression
Compression
Definition: CompressionEnums.h:11
H5Utils::internal::DataConsumer::DataConsumer
DataConsumer(const std::string &, const std::function< T(I)> &, const T default_value=T(), Compression=Compression::STANDARD)
Definition: Writer.h:79
m_buffer
T m_buffer
Definition: copyRootTree.cxx:62
H5Utils::Writer::m_buffer_rows
hsize_t m_buffer_rows
Definition: Writer.h:374
H5Utils::internal::IDataConsumer::getBuffer
virtual data_buffer_t getBuffer(I) const =0
H5Utils::internal::DataFlattener< 0, F, T, M >::element_offsets
std::vector< std::array< hsize_t, 0 > > element_offsets
Definition: Writer.h:250
H5Utils::internal::CheckType::depth
static const int depth
Definition: Writer.h:198
H5Utils::internal::DSParameters::extent
std::array< hsize_t, N > extent
Definition: Writer.h:298
createCoolChannelIdFile.buffer
buffer
Definition: createCoolChannelIdFile.py:12
H5Utils::Consumers::getConsumers
const std::vector< SharedConsumer< I > > & getConsumers() const
Definition: Writer.h:178
H5Utils::Writer
Writer.
Definition: Writer.h:349
H5Utils::Writer::m_ds
H5::DataSet m_ds
Definition: Writer.h:377
dqt_zlumi_pandas.err
err
Definition: dqt_zlumi_pandas.py:182
H5Utils::internal::DataConsumer::name
std::string name() const override
Definition: Writer.h:110
H5Utils::internal::IDataConsumer::name
virtual std::string name() const =0
H5Utils::Writer::Writer
Writer(const Writer &)=delete
H5Utils::internal::vec
std::vector< hsize_t > vec(std::array< hsize_t, N > a)
Definition: Writer.h:325
H5Utils::Writer::flush
void flush()
Definition: Writer.h:493
H5Utils::Writer::Writer
Writer(H5::Group &group, const std::string &name, const Consumers< I > &consumers, const std::array< hsize_t, N > &extent=internal::uniform< N >(5), hsize_t batch_size=defaults::batch_size)
Definition: Writer.h:382
H5Utils::internal::data_buffer_t
data_buffer_t
Definition: H5Traits.h:34
calibdata.exception
exception
Definition: calibdata.py:496
H5Utils::Writer::m_consumers
std::vector< SharedConsumer< I > > m_consumers
Definition: Writer.h:376
H5Utils::Writer::m_buffer
std::vector< internal::data_buffer_t > m_buffer
Definition: Writer.h:375
hist_file_dump.f
f
Definition: hist_file_dump.py:135
H5Utils::Writer::index
size_t index() const
Definition: Writer.h:519
H5Utils::internal::DataConsumer::m_default_value
T m_default_value
Definition: Writer.h:75
H5Utils::internal::DataConsumer::getType
H5::DataType getType() const override
Definition: Writer.h:102
H5Utils
HDF5 Tuple Writer.
Definition: common.h:20
H5Utils::internal::throwIfExists
void throwIfExists(const std::string &name, const H5::Group &in_group)
Definition: common.cxx:46
create_dcsc_inputs_sqlite.arg
list arg
Definition: create_dcsc_inputs_sqlite.py:48
H5Utils::Consumers::input_type
I input_type
Definition: Writer.h:152
H5Utils::Writer::m_offset
hsize_t m_offset
Definition: Writer.h:373
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
WriterConfiguration.h
H5Utils::internal::DataFlattener::element_offsets
std::vector< std::array< hsize_t, N > > element_offsets
Definition: Writer.h:227
H5Utils::internal::buildWriteType
H5::CompType buildWriteType(const std::vector< SharedConsumer< I > > &con)
Definition: Writer.h:280
H5Utils::Writer::fill
void fill(T)
Definition: Writer.h:443
WriteCaloSwCorrections.cfg
cfg
Definition: WriteCaloSwCorrections.py:23
Base_Fragment.defaults
dictionary defaults
This includes now the top quark, the leptons and the bosons.
Definition: GeneratorFilters/share/common/Base_Fragment.py:79
H5Utils::internal::DataFlattener::DataFlattener
DataFlattener(const F &filler, T args, const std::array< hsize_t, M > &extent)
Definition: Writer.h:228
common.h
H5Utils::makeWriter
Writer< N, I > makeWriter(H5::Group &group, const std::string &name, const Consumers< I > &consumers, const std::array< hsize_t, N > &extent=internal::uniform< N >(5), hsize_t batch_size=defaults::batch_size)
makeWriter
Definition: Writer.h:534
H5Utils::Consumers
Definition: Writer.h:129
H5Utils::internal::uniform
std::array< hsize_t, N > uniform(size_t val)
Definition: Writer.h:331
a
TList * a
Definition: liststreamerinfos.cxx:10
CaloLCW_tf.group
group
Definition: CaloLCW_tf.py:28
H5Utils::Consumers::add
void add(const std::string &name, const F func, const T &def=T(), Compression comp=Compression::STANDARD)
overload to cast lambdas into functions
Definition: Writer.h:144
ref
const boost::regex ref(r_ef)
Pythia8_RapidityOrderMPI.val
val
Definition: Pythia8_RapidityOrderMPI.py:14
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
F
#define F(x, y, z)
Definition: MD5.cxx:112
H5Utils::internal::IDataConsumer
DataConsumer classes.
Definition: Writer.h:47
H5Utils::Writer::m_par
const internal::DSParameters< I, N > m_par
Definition: Writer.h:372
convertTimingResiduals.offset
offset
Definition: convertTimingResiduals.py:71
H5Utils::Writer::m_file_space
H5::DataSpace m_file_space
Definition: Writer.h:378
H5Utils::internal::buildDefault
std::vector< data_buffer_t > buildDefault(const std::vector< SharedConsumer< I > > &f)
Definition: Writer.h:315
H5Utils::Consumers::m_used
std::set< std::string > m_used
Definition: Writer.h:158
H5Utils::internal::DataConsumer::getDefault
data_buffer_t getDefault() const override
Definition: Writer.h:96
calibdata.copy
bool copy
Definition: calibdata.py:27
H5Utils::internal::DataFlattener< 0, F, T, M >::buffer
std::vector< data_buffer_t > buffer
Definition: Writer.h:249
H5Utils::Consumers::function_type
std::function< T(I)> function_type
Definition: Writer.h:154
I
#define I(x, y, z)
Definition: MD5.cxx:116
PowhegControl_ttFCNC_NLO.params
params
Definition: PowhegControl_ttFCNC_NLO.py:226
H5Utils::internal::CheckType< 0, T, I, decltype(*begin(std::declval< T & >()), void())>::subtype
CheckType< 0, decltype(*begin(std::declval< T & >))), I > subtype
Definition: Writer.h:210
H5Utils::Writer::Writer
Writer(Writer &&)=default
H5Utils::Writer::input_type
I input_type
Definition: Writer.h:367
H5Utils::internal::DataConsumer::m_getter
std::function< T(I)> m_getter
Definition: Writer.h:73
H5Utils::internal::DataConsumer::m_write_type
H5::DataType m_write_type
Definition: Writer.h:76
H5Utils::internal::CheckType::any_type
static const bool any_type
Definition: Writer.h:197
H5Utils::defaults::deflate
const int deflate
Definition: defaults.h:10
python.CaloScaleNoiseConfig.args
args
Definition: CaloScaleNoiseConfig.py:80
CompressedTypes.h
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35
H5Utils::internal::CheckType
Definition: Writer.h:195