R3BROOT
R3B analysis software
Loading...
Searching...
No Matches
R3BNeulandMapToCalPar.h
Go to the documentation of this file.
1#pragma once
2
4#include <FairParSet.h>
5#include <R3BNeulandParSet.h>
6#include <R3BShared.h>
7#include <cmath>
8#include <unordered_map>
9
10namespace R3B
11{
13 {
14 double hist_overflow{};
15 std::vector<ValueError<double>> value_error;
17 };
18
27
29 {
30 public:
31 using ValueErrors = std::vector<ValueError<double>>;
32 TCalVFTXModulePar() = default;
33 explicit TCalVFTXModulePar(unsigned int module_num)
34 : module_num_{ module_num }
35 {
36 }
37
38 // Setters:
39 void Set_correlation(std::map<FTType, FTChannel2TimeRelation> correlation)
40 {
41 finetime_correlation_ = std::move(correlation);
42 }
43
44 // Getters:
45 [[nodiscard]] auto GetFineTime(FTType ftType, uint channel_Num) const -> ValueError<double>;
46 [[nodiscard]] auto GetModuleNum() const { return module_num_; }
47
48 private:
49 unsigned int module_num_ = 0;
50 std::map<FTType, FTChannel2TimeRelation> finetime_correlation_;
51
52 public:
54 };
55
57 {
58 public:
59 using TrigIDMap = Neuland::TrigIDMappingFinder::TrigIDMap;
60 explicit Map2CalPar(std::string_view name = "NeulandMap2CalPar",
61 std::string_view title = "Neuland Map2Cal calibration",
62 std::string_view context = "TestDefaultContext",
63 bool own = true);
64 // ~R3BTCalPar2() { LOG(debug) << " R3BTCalPar2 deleted!"; }
65 void AddModuleParam(unsigned int module_num, TCalVFTXModulePar modulePar);
66
67 // Setters:
68 void SetTrigEnabled(bool is_enabled) { is_trig_enabled_ = is_enabled; }
69 void SetSlowClockFrequency(float frq) { slow_clock_frequency_ = frq; }
70 void SetDetParName(std::string_view detParName) { fairDetParName_ = detParName; }
71 void SetModuleParam(unsigned int module_num, TCalVFTXModulePar par)
72 {
73 moduleParams_.insert_or_assign(module_num, std::move(par));
74 }
75
76 void SetParam(std::unordered_map<unsigned int, TCalVFTXModulePar> moduleParams)
77 {
78 moduleParams_ = std::move(moduleParams);
79 }
80
81 // Getters:
82 [[nodiscard]] auto GetSlowClockFrequency() const -> const auto& { return slow_clock_frequency_; }
83 [[nodiscard]] auto GetParams() const -> const auto& { return moduleParams_; }
84 [[nodiscard]] auto GetParamAt(unsigned int module_num) const -> const auto&
85 {
86 return moduleParams_.at(module_num);
87 }
88 auto HasTrigEnabled() const -> bool { return is_trig_enabled_; }
89
90 private:
91 float slow_clock_frequency_ = 0; // GHz
92 bool is_trig_enabled_ = true;
93 std::unordered_map<unsigned int, TCalVFTXModulePar> moduleParams_;
94 std::string fairDetParName_ = "FairGenericParIo";
95
96 void clear() override { moduleParams_.clear(); }
97
98 public:
100 };
101} // namespace R3B
102
R3B::Map2CalPar R3BTCalPar2
void SetDetParName(std::string_view detParName)
ClassDefOverride(Map2CalPar, 1)
auto GetSlowClockFrequency() const -> const auto &
Map2CalPar(std::string_view name="NeulandMap2CalPar", std::string_view title="Neuland Map2Cal calibration", std::string_view context="TestDefaultContext", bool own=true)
void AddModuleParam(unsigned int module_num, TCalVFTXModulePar modulePar)
void SetParam(std::unordered_map< unsigned int, TCalVFTXModulePar > moduleParams)
auto HasTrigEnabled() const -> bool
void SetModuleParam(unsigned int module_num, TCalVFTXModulePar par)
auto GetParams() const -> const auto &
void SetTrigEnabled(bool is_enabled)
auto GetParamAt(unsigned int module_num) const -> const auto &
void SetSlowClockFrequency(float frq)
Neuland::TrigIDMappingFinder::TrigIDMap TrigIDMap
void clear() override
TCalVFTXModulePar(unsigned int module_num)
auto GetFineTime(FTType ftType, uint channel_Num) const -> ValueError< double >
std::vector< ValueError< double > > ValueErrors
ClassDefNV(TCalVFTXModulePar, 1)
void Set_correlation(std::map< FTType, FTChannel2TimeRelation > correlation)
std::vector< ValueError< double > > value_error
ClassDefNV(FTChannel2TimeRelation, 1)