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