R3BROOT
R3B analysis software
Loading...
Searching...
No Matches
R3BFormatters.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 "
R3BShared.h
"
17
#include <TVector3.h>
18
#include <fmt/format.h>
19
20
template
<>
21
class
fmt::formatter<TVector3>
22
{
23
public
:
24
static
constexpr
auto
parse
(format_parse_context& ctx) {
return
ctx.end(); }
25
template
<
typename
FmtContent>
26
constexpr
auto
format
(
const
TVector3& vec, FmtContent& ctn)
const
27
{
28
return
format_to(ctn.out(),
"[x: {}, y: {}, z: {}]"
, vec.X(), vec.Y(), vec.Z());
29
}
30
};
31
32
template
<
typename
DataType>
33
class
fmt::formatter<
R3B
::ValueError<DataType>>
34
{
35
public
:
36
// TODO: add more options
37
static
constexpr
auto
parse
(format_parse_context& ctx) {
return
ctx.end(); }
38
template
<
typename
FmtContent>
39
constexpr
auto
format
(
const
R3B::ValueError<DataType>
& value_error, FmtContent& ctn)
const
40
{
41
return
format_to(ctn.out(),
"{}+/-{}"
, value_error.
value
, value_error.
error
);
42
}
43
};
R3BShared.h
fmt::formatter< R3B::ValueError< DataType > >::format
constexpr auto format(const R3B::ValueError< DataType > &value_error, FmtContent &ctn) const
Definition
R3BFormatters.h:39
fmt::formatter< R3B::ValueError< DataType > >::parse
static constexpr auto parse(format_parse_context &ctx)
Definition
R3BFormatters.h:37
fmt::formatter< TVector3 >::format
constexpr auto format(const TVector3 &vec, FmtContent &ctn) const
Definition
R3BFormatters.h:26
fmt::formatter< TVector3 >::parse
static constexpr auto parse(format_parse_context &ctx)
Definition
R3BFormatters.h:24
R3B
Definition
R3BNeulandAnalysisApp.cxx:80
R3B::ValueError
Definition
R3BValueError.h:23
R3B::ValueError::value
DataType value
Definition
R3BValueError.h:25
R3B::ValueError::error
DataType error
Definition
R3BValueError.h:26
r3bbase
R3BFormatters.h
Generated by
1.13.2