11#include <framework/logging/Logger.h>
25 template<
size_t Ndims = 9>
34 std::array<double, Ndims>
hits{};
41 template<
size_t Ndims>
44 size_t nSamplesBefore = samples.size();
48 if (line.empty())
continue;
49 std::stringstream ss(line);
50 std::array<double, 9> coords;
51 for (
double& c : coords) ss >> c;
57 B2INFO(
"Read in " << (samples.size() - nSamplesBefore) <<
" samples.");
61 template<
size_t Ndims>
64 for (
const auto& event : samples) {
65 for (
const auto& val : event.hits) {
68 os <<
event.signal << std::endl;
70 B2INFO(
"Wrote out " << samples.size() <<
" samples.");
static void writeSamplesToStream(std::ostream &os, const std::vector< FBDTTrainSample< Ndims > > &samples)
write all samples to stream
static void readSamplesFromStream(std::istream &is, std::vector< FBDTTrainSample< Ndims > > &samples)
read samples from stream and append them to samples
Abstract base class for different kinds of events.
bundle together the classifier input and the target value into one struct for easier passing around.
FBDTTrainSample(const std::array< double, Ndims > &values, bool sig)
constructor from array of inputs and a target value
std::array< double, Ndims > hits
inputs
FBDTTrainSample()
default constructor