Project
Loading...
Searching...
No Matches
FEEConfig.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
15
16#ifndef AliceO2_TPC_FEEConfig_H_
17#define AliceO2_TPC_FEEConfig_H_
18
19#include <string>
20#include <string_view>
21#include <unordered_map>
22#include <vector>
23#include <cstdint>
24
25#include "Rtypes.h"
26
27#include "TPCBase/CalDet.h"
28#include "TPCBase/CRU.h"
29
30namespace o2::tpc
31{
32struct CRUConfig {
33 static constexpr int NConfigValues = 7;
34
35 uint32_t linkOn{0};
36 uint32_t cmcEnabled{0};
37 uint32_t zsOffset{0};
38 float itCorr0{1.f};
39 bool itfEnabled{false};
40 bool zsEnabled{false};
41 bool resyncEnabled{false};
42
43 bool setValues(std::string_view cruData);
44
46};
47
48struct FEEConfig {
50 enum class Tags : uint8_t {
51 Unspecified = 0,
52 TestWithZS = 1,
53 Pedestals = 2,
54 Pulser = 3,
55 Laser = 4,
56 Cosmics = 5,
57 Physics35sigma = 6,
58 Physics30sigma = 7,
59 Physics25sigma = 8,
60 Laser10ADCoff = 9,
61 TestNoFilters = 10,
62 Physics2025sigma = 11,
64 };
65
66 enum class PadConfig {
67 ITfraction = 0,
68 ITexpLambda = 1,
69 CMkValues = 2,
70 ThresholdMap = 3,
71 Pedestals = 4,
72 };
73
74 static constexpr size_t MaxLinks = 91 * 36;
75 static const std::unordered_map<Tags, const std::string> TagNames;
76 static const std::unordered_map<PadConfig, const std::string> PadConfigNames;
77
78 using CalPadMapType = std::unordered_map<std::string, CalPad>;
80 // FEEConfig& operator=(const FEEConfig& config)
81 //{
82 // padMaps = config.pad
83 // return *this;
84 //}
85
87 std::vector<CRUConfig> cruConfig;
89
90 void clear()
91 {
92 for ([[maybe_unused]] auto& [key, val] : padMaps) {
93 val *= 0;
94 }
95
96 for (auto& val : cruConfig) {
97 val = CRUConfig();
98 }
99 }
100
101 size_t getNumberActiveLinks() const;
102 bool isCMCEnabled() const;
103 bool isITFEnabled() const;
104 bool isZSEnabled() const;
105 bool isResyncEnabled() const;
106
107 void setAllLinksOn();
108
109 void print() const;
110 void printShort() const;
111
114
115 const CalPad& getPadMap(PadConfig config) const { return padMaps.at(PadConfigNames.at(config)); }
116
118};
119
120} // namespace o2::tpc
121#endif
StringRef key
CCDB container for the full set of CPV calibration coefficients.
@ MaxCRU
Definition CRU.h:31
GLuint GLfloat * val
Definition glcorearb.h:1582
Global TPC definitions and constants.
Definition SimTraits.h:167
bool resyncEnabled
if resync feature is enabled
Definition FEEConfig.h:41
bool setValues(std::string_view cruData)
Definition FEEConfig.cxx:30
bool itfEnabled
if ion tail filter correction is enabled
Definition FEEConfig.h:39
bool zsEnabled
if zero suppression is enabled
Definition FEEConfig.h:40
ClassDefNV(CRUConfig, 2)
uint32_t zsOffset
zero suppression offset value used in ITF
Definition FEEConfig.h:37
float itCorr0
ion tail scaling parameter
Definition FEEConfig.h:38
uint32_t linkOn
bitmask of active links
Definition FEEConfig.h:35
static constexpr int NConfigValues
number of configuration values
Definition FEEConfig.h:33
uint32_t cmcEnabled
if common mode correction is enabled
Definition FEEConfig.h:36
CalPadMapType padMaps
pad-wise configuration data
Definition FEEConfig.h:86
std::vector< CRUConfig > cruConfig
CRU configuration values.
Definition FEEConfig.h:87
Tags
Tag definitions for TPC/Config/FEE.
Definition FEEConfig.h:50
@ Cosmics
Configuration for Cosmics data taking.
@ Physics30sigmaPbPb
Physics configuration with 3.0 sigma thresholds for PbPb (using differnet CMC settings wrt....
@ Unspecified
Unspecified.
@ Pulser
Configuration for Pulser data taking.
@ TestNoFilters
Test configuration without filters.
@ Physics2025sigma
Physics configuration with 2.0/2.5 sigma thresholds (IROC/OROC)
@ Laser10ADCoff
Configuration for Laser data taking with 10ADC offset for special studies.
@ Physics30sigma
Physics configuration with 3.0 sigma thresholds.
@ Laser
Configuration for Laser data taking.
@ Physics25sigma
Physics configuration with 2.5 sigma thresholds.
@ Physics35sigma
Physics configuration with 3.5 sigma thresholds.
@ TestWithZS
Test configuration with ZS.
bool isITFEnabled() const
Definition FEEConfig.cxx:91
void printShort() const
static const std::unordered_map< Tags, const std::string > TagNames
Definition FEEConfig.h:75
const CalPad & getPadMap(PadConfig config) const
Definition FEEConfig.h:115
CalDet< bool > getDeadChannelMap() const
Dead channel map including deactivated links and single channels.
size_t getNumberActiveLinks() const
Definition FEEConfig.cxx:73
bool isResyncEnabled() const
std::unordered_map< std::string, CalPad > CalPadMapType
Definition FEEConfig.h:78
static const std::unordered_map< PadConfig, const std::string > PadConfigNames
Definition FEEConfig.h:76
ClassDefNV(FEEConfig, 2)
bool isZSEnabled() const
Tags tag
tag number
Definition FEEConfig.h:88
static constexpr size_t MaxLinks
Definition FEEConfig.h:74
void print() const
bool isCMCEnabled() const
Definition FEEConfig.cxx:81