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