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 <Rtypes.h>
18#include <vector>
19
20#ifndef __CLING__
21#include "R3BFormatters.h" // IWYU pragma: keep
22#include <fmt/base.h>
23#include <fmt/core.h>
24#include <fmt/format.h>
25#include <fmt/ranges.h>
26#endif
27
28namespace R3B::Neuland
29{
37
39 {
40 public:
41 BarCalData() = default;
42 explicit BarCalData(int mod_num)
43 : module_num{ mod_num }
44 {
45 }
46 int module_num = 0; // 1 based bar num
47 std::vector<CalDataSignal> left;
48 std::vector<CalDataSignal> right;
49 ClassDefNV(BarCalData, 1)
50 };
51} // namespace R3B::Neuland
52 //
53using R3BNeulandCalDataContainer = std::vector<R3B::Neuland::BarCalData>;
54
55#ifndef __CLING__
56template <>
57class fmt::formatter<R3B::Neuland::CalDataSignal>
58{
59 public:
60 static constexpr auto parse(format_parse_context& ctx) { return ctx.end(); }
61 template <typename FmtContent>
62 constexpr auto format(const R3B::Neuland::CalDataSignal& signal, FmtContent& ctn) const
63 {
64 return fmt::format_to(ctn.out(),
65 "{{leadT: {}, tot: {}, trigT: {} }}",
66 signal.leading_time,
68 signal.trigger_time);
69 }
70};
71
72template <>
73class fmt::formatter<R3B::Neuland::BarCalData>
74{
75 public:
76 static constexpr auto parse(format_parse_context& ctx) { return ctx.end(); }
77 template <typename FmtContent>
78 constexpr auto format(const R3B::Neuland::BarCalData& signal, FmtContent& ctn) const
79 {
80 return fmt::format_to(ctn.out(),
81 "ModuleNum: {}, left bar: [{}], right bar: [{}]",
82 signal.module_num,
83 fmt::join(signal.left, ", "),
84 fmt::join(signal.right, ", "));
85 }
86};
87#endif
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