forked from AmbaPant/mantid
-
Notifications
You must be signed in to change notification settings - Fork 1
/
EventLoaderHelpers.cpp
31 lines (27 loc) · 1.11 KB
/
EventLoaderHelpers.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Mantid Repository : https://github.com/mantidproject/mantid
//
// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
// NScD Oak Ridge National Laboratory, European Spallation Source,
// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
// SPDX - License - Identifier: GPL - 3.0 +
#include "MantidParallel/IO/EventLoaderHelpers.h"
namespace Mantid {
namespace Parallel {
namespace IO {
namespace EventLoader {
std::vector<size_t> readBankSizes(const H5::Group &group, const std::vector<std::string> &bankNames) {
std::vector<size_t> bankSizes;
for (const auto &bankName : bankNames) {
const H5::DataSet dataset = group.openDataSet(bankName + "/event_id");
const H5::DataSpace dataSpace = dataset.getSpace();
bankSizes.emplace_back(dataSpace.getSelectNpoints());
}
return bankSizes;
}
H5::DataType readDataType(const H5::Group &group, const std::vector<std::string> &bankNames, const std::string &name) {
return group.openDataSet(bankNames.front() + "/" + name).getDataType();
}
} // namespace EventLoader
} // namespace IO
} // namespace Parallel
} // namespace Mantid