Project
Loading...
Searching...
No Matches
ModuleConfig.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
12#ifndef ALICEO2_ZDC_MODULECONFIG_H
13#define ALICEO2_ZDC_MODULECONFIG_H
14
15#include "ZDCBase/Constants.h"
16#include <Rtypes.h>
17#include <array>
18#include <string>
19
20namespace o2
21{
22namespace zdc
23{
24
26 int8_t id = -1;
27 int8_t first = 0;
28 int8_t last = 0;
29 uint8_t shift = 0;
30 int16_t threshold = 0;
31 void print() const;
33};
34
35struct Module {
36 static constexpr int MaxChannels = 4, MaxTriggChannels = 2;
37 int id = -1; // not active
38 std::array<int8_t, MaxChannels> channelID = {IdDummy, IdDummy, IdDummy, IdDummy};
39 std::array<int16_t, MaxChannels> feeID = {-1, -1, -1, -1};
40 std::array<bool, MaxChannels> readChannel = {false};
41 std::array<bool, MaxChannels> trigChannel = {false};
42 std::array<TriggerChannelConfig, MaxChannels> trigChannelConf;
43
44 void setChannel(int slot, int8_t chID, int16_t fID, bool read, bool trig = false, int tF = 0, int tL = 0, int tS = 0, int tT = 0);
45 void print() const;
46 void printCh() const;
47 void printTrig() const;
48 void check() const;
50};
51
53 static constexpr int MaxNModules = 8, NWMap = 56;
54
55 std::array<Module, MaxNModules> modules;
56
57 float nBunchAverage = 0; // Number of bunches used in average
58 float baselineFactor = 1; // Baseline conversion factor
59 std::array<uint64_t, NWMap> emptyMap = {0}; // Map of bunches used in the average (empty for simulations)
60
61 void print() const;
62 void check() const;
63 void resetMap();
64 void addBunch(int ibunch);
65 uint32_t getTriggerMask() const;
66 std::string getPrintTriggerMask() const;
67
69};
70
71} // namespace zdc
72} // namespace o2
73
74#endif
struct o2::upgrades_utils::@463 zdc
structure to keep FT0 information
constexpr int IdDummy
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
ClassDefNV(ModuleConfig, 3)
std::array< uint64_t, NWMap > emptyMap
uint32_t getTriggerMask() const
static constexpr int MaxNModules
std::string getPrintTriggerMask() const
void addBunch(int ibunch)
static constexpr int NWMap
std::array< Module, MaxNModules > modules
void check() const
std::array< bool, MaxChannels > trigChannel
void setChannel(int slot, int8_t chID, int16_t fID, bool read, bool trig=false, int tF=0, int tL=0, int tS=0, int tT=0)
void printCh() const
std::array< TriggerChannelConfig, MaxChannels > trigChannelConf
std::array< bool, MaxChannels > readChannel
ClassDefNV(Module, 1)
void print() const
static constexpr int MaxChannels
std::array< int8_t, MaxChannels > channelID
static constexpr int MaxTriggChannels
std::array< int16_t, MaxChannels > feeID
void printTrig() const
ClassDefNV(TriggerChannelConfig, 1)