R3BROOT
R3B analysis software
Loading...
Searching...
No Matches
ParResultReader.h
Go to the documentation of this file.
1#pragma once
2
3#include <fmt/format.h>
4#include <string>
5#include <unordered_map>
6
7namespace R3B::Millepede
8{
10 {
11 int par_num = 0;
12 float value = 0.F;
13 float sigma = 0.F;
14 float value_diff = 0.F;
15 float error = 0.F;
16 };
17
19 {
20 public:
21 ResultReader() = default;
22 void set_filename(std::string_view filename) { filename_ = filename; }
23
24 void read();
25 void print();
26 [[nodiscard]] auto get_pars() const -> const auto& { return par_results_; }
27
28 private:
29 std::string filename_;
30 std::unordered_map<int, ParResultEntry> par_results_;
31 };
32
33} // namespace R3B::Millepede
34
35template <>
36class fmt::formatter<R3B::Millepede::ParResultEntry>
37{
38 public:
39 static constexpr auto parse(format_parse_context& ctx) { return ctx.end(); }
40 template <typename FmtContent>
41 constexpr auto format(const R3B::Millepede::ParResultEntry& entry, FmtContent& ctn) const
42 {
43 return format_to(ctn.out(),
44 "par id: {}, value: {}, sigma: {}, value_diff: {}, error: {}",
45 entry.par_num,
46 entry.value,
47 entry.sigma,
48 entry.value_diff,
49 entry.error);
50 }
51};
auto get_pars() const -> const auto &
void set_filename(std::string_view filename)
constexpr auto format(const R3B::Millepede::ParResultEntry &entry, FmtContent &ctn) const
static constexpr auto parse(format_parse_context &ctx)
float error
float value
float sigma
float value_diff
int par_num