R3BROOT
R3B analysis software
Loading...
Searching...
No Matches
R3BNeulandCalData2.h
Go to the documentation of this file.
1#pragma once
2
3/******************************************************************************
4 * Copyright (C) 2019 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
5 * Copyright (C) 2019-2023 Members of R3B Collaboration *
6 * *
7 * This software is distributed under the terms of the *
8 * GNU General Public Licence (GPL) version 3, *
9 * copied verbatim in the file "LICENSE". *
10 * *
11 * In applying this license GSI does not waive the privileges and immunities *
12 * granted to it by virtue of its status as an Intergovernmental Organization *
13 * or submit itself to any jurisdiction. *
14 ******************************************************************************/
15
16#include "R3BValueError.h"
17#include <R3BFormatters.h> // NOLINT
18#include <Rtypes.h>
19#include <fmt/core.h>
20#include <fmt/format.h>
21#include <vector>
22
23namespace R3B::Neuland
24{
32
34 {
35 public:
36 BarCalData() = default;
37 explicit BarCalData(unsigned int mod_num)
38 : module_num{ mod_num }
39 {
40 }
41 unsigned int module_num = 0; // 1 based bar num
42 std::vector<CalDataSignal> left;
43 std::vector<CalDataSignal> right;
44 ClassDefNV(BarCalData, 1)
45 };
46} // namespace R3B::Neuland
47 //
48using R3BNeulandCalDataContainer = std::vector<R3B::Neuland::BarCalData>;
49
50template <>
51class fmt::formatter<R3B::Neuland::CalDataSignal>
52{
53 public:
54 static constexpr auto parse(format_parse_context& ctx) { return ctx.end(); }
55 template <typename FmtContent>
56 constexpr auto format(const R3B::Neuland::CalDataSignal& signal, FmtContent& ctn) const
57 {
58 return format_to(ctn.out(),
59 "{{leadT: {}, tot: {}, trigT: {} }}",
60 signal.leading_time,
62 signal.trigger_time);
63 }
64};
65
66template <>
67class fmt::formatter<R3B::Neuland::BarCalData>
68{
69 public:
70 static constexpr auto parse(format_parse_context& ctx) { return ctx.end(); }
71 template <typename FmtContent>
72 constexpr auto format(const R3B::Neuland::BarCalData& signal, FmtContent& ctn) const
73 {
74 return format_to(ctn.out(),
75 "ModuleNum: {}, left bar: [{}], right bar: [{}]",
76 signal.module_num,
77 fmt::join(signal.left, ", "),
78 fmt::join(signal.right, ", "));
79 }
80};
std::vector< R3B::Neuland::BarCalData > R3BNeulandCalDataContainer
static constexpr auto parse(format_parse_context &ctx)
constexpr auto format(const R3B::Neuland::BarCalData &signal, FmtContent &ctn) const
static constexpr auto parse(format_parse_context &ctx)
constexpr auto format(const R3B::Neuland::CalDataSignal &signal, FmtContent &ctn) const
Simulation of NeuLAND Bar/Paddle.
BarCalData(unsigned int mod_num)
std::vector< CalDataSignal > left
std::vector< CalDataSignal > right
ValueError< double > trigger_time
ValueError< double > leading_time
ValueError< double > time_over_threshold