R3BROOT
R3B analysis software
Loading...
Searching...
No Matches
MilleEntry.h
Go to the documentation of this file.
1/******************************************************************************
2 * Copyright (C) 2019 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
3 * Copyright (C) 2019-2023 Members of R3B Collaboration *
4 * *
5 * This software is distributed under the terms of the *
6 * GNU General Public Licence (GPL) version 3, *
7 * copied verbatim in the file "LICENSE". *
8 * *
9 * In applying this license GSI does not waive the privileges and immunities *
10 * granted to it by virtue of its status as an Intergovernmental Organization *
11 * or submit itself to any jurisdiction. *
12 ******************************************************************************/
13
14#pragma once
15
16#include <Rtypes.h>
17#include <fmt/base.h>
18#include <fmt/core.h>
19#include <utility>
20#include <vector>
21
22namespace R3B
23{
25 {
26 std::vector<float> locals; // local derivatives
27 std::vector<std::pair<int, float>> globals; // global label and derivatives pair
28 float measurement = 0.; // measurement corresponding to the error value
29 float sigma = 1.; // error value
30 void clear()
31 {
32 locals.clear();
33 globals.clear();
34 measurement = 0.;
35 sigma = 1.;
36 }
38 };
39} // namespace R3B
40
41#ifndef __CLING__
42template <>
43class fmt::formatter<R3B::MilleDataPoint>
44{
45 public:
46 static constexpr auto parse(format_parse_context& ctx) { return ctx.end(); }
47 template <typename FmtContent>
48 constexpr auto format(const R3B::MilleDataPoint& point, FmtContent& ctn) const
49 {
50 return fmt::format_to(ctn.out(),
51 "measurement: {}, sigma: {}\nlocals: {}\nglobals: {}",
52 point.measurement,
53 point.sigma,
54 point.locals,
55 point.globals);
56 }
57};
58#endif
static constexpr auto parse(format_parse_context &ctx)
Definition MilleEntry.h:46
constexpr auto format(const R3B::MilleDataPoint &point, FmtContent &ctn) const
Definition MilleEntry.h:48
std::vector< std::pair< int, float > > globals
Definition MilleEntry.h:27
ClassDefNV(MilleDataPoint, 1)
std::vector< float > locals
Definition MilleEntry.h:26