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 <fmt/ranges.h>
22#include <vector>
23
24namespace R3B::Neuland
25{
33
35 {
36 public:
37 BarCalData() = default;
38 explicit BarCalData(int mod_num)
39 : module_num{ mod_num }
40 {
41 }
42 int module_num = 0; // 1 based bar num
43 std::vector<CalDataSignal> left;
44 std::vector<CalDataSignal> right;
45 ClassDefNV(BarCalData, 1)
46 };
47} // namespace R3B::Neuland
48 //
49using R3BNeulandCalDataContainer = std::vector<R3B::Neuland::BarCalData>;
50
51template <>
52class fmt::formatter<R3B::Neuland::CalDataSignal>
53{
54 public:
55 static constexpr auto parse(format_parse_context& ctx) { return ctx.end(); }
56 template <typename FmtContent>
57 constexpr auto format(const R3B::Neuland::CalDataSignal& signal, FmtContent& ctn) const
58 {
59 return fmt::format_to(ctn.out(),
60 "{{leadT: {}, tot: {}, trigT: {} }}",
61 signal.leading_time,
63 signal.trigger_time);
64 }
65};
66
67template <>
68class fmt::formatter<R3B::Neuland::BarCalData>
69{
70 public:
71 static constexpr auto parse(format_parse_context& ctx) { return ctx.end(); }
72 template <typename FmtContent>
73 constexpr auto format(const R3B::Neuland::BarCalData& signal, FmtContent& ctn) const
74 {
75 return fmt::format_to(ctn.out(),
76 "ModuleNum: {}, left bar: [{}], right bar: [{}]",
77 signal.module_num,
78 fmt::join(signal.left, ", "),
79 fmt::join(signal.right, ", "));
80 }
81};
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.
std::vector< CalDataSignal > left
std::vector< CalDataSignal > right
ValueError< double > trigger_time
ValueError< double > leading_time
ValueError< double > time_over_threshold