CbmRoot
Loading...
Searching...
No Matches
WalkMap.h
Go to the documentation of this file.
1/* Copyright (C) 2024-2025 FIAS Frankfurt Institute for Advanced Studies, Frankfurt / Main
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Felix Weiglhofer [committer], Dominik Smith */
4
5#pragma once
6
7#include "CbmYaml.h"
9
10#include <map>
11#include <vector>
12
13namespace cbm::algo::sts
14{
15
16 class WalkMap {
17
18 public:
22 WalkMap() = default;
23 ~WalkMap() = default;
24
30 std::vector<double> Get(int32_t modAddress, uint16_t asic);
31
34
35 private:
36 // Move ADC into seperate class for easier YAML formatting
37 struct AdcMap {
38 // Map index: (ADC value), map value: (walk coefficient)
39 std::vector<double> walkCoefficients;
40
41 AdcMap() = default;
42 AdcMap(std::initializer_list<double> coeffs) : walkCoefficients(coeffs) {}
43
44 CBM_YAML_FORMAT(YAML::Flow);
46 CBM_YAML_PROPERTIES(yaml::Property(&AdcMap::walkCoefficients, "walkCoefficients", "Walk coefficients"));
47 };
48
49 // --- STS system time offset
51
52 // --- STS walk correction map
53 // --- Map index: (module address, ASIC number in module, ADC value), map value: (walk coefficient)
54 std::map<i32, std::vector<AdcMap>> fWalkMap;
55
57 CBM_YAML_PROPERTIES( yaml::Property(&WalkMap::timeOffset, "timeOffset", "Time offset for STS", YAML::Hex),
58 yaml::Property(&WalkMap::fWalkMap, "WalkMap", "Walk correction map", YAML::Hex, YAML::Flow));
59 };
60
61} // namespace cbm::algo::sts
62
#define CBM_YAML_EXTERN_DECL(type)
Declare the external instantiation of the Read and Dump functions for a type.
Definition CbmYaml.h:342
std::vector< double > Get(int32_t modAddress, uint16_t asic)
API: Mapping from module address and ASIC number to walk coefficients.
Definition WalkMap.cxx:11
WalkMap()=default
Construct emtpy mapping.
CBM_YAML_PROPERTIES(yaml::Property(&WalkMap::timeOffset, "timeOffset", "Time offset for STS", YAML::Hex), yaml::Property(&WalkMap::fWalkMap, "WalkMap", "Walk correction map", YAML::Hex, YAML::Flow))
std::map< i32, std::vector< AdcMap > > fWalkMap
Definition WalkMap.h:54
i32 GetSystemTimeOffset()
Get system time offset.
Definition WalkMap.h:33
int32_t i32
Definition Definitions.h:20
std::vector< double > walkCoefficients
Definition WalkMap.h:39
AdcMap(std::initializer_list< double > coeffs)
Definition WalkMap.h:42
CBM_YAML_PROPERTIES(yaml::Property(&AdcMap::walkCoefficients, "walkCoefficients", "Walk coefficients"))