CbmRoot
Loading...
Searching...
No Matches
much/ReadoutConfig.h
Go to the documentation of this file.
1/* Copyright (C) 2021 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Dominik Smith [committer] */
4
5#ifndef ALGO_DETECTORS_MUCH_READOUTCONFIG_H
6#define ALGO_DETECTORS_MUCH_READOUTCONFIG_H
7
8#include <cstddef>
9#include <cstdint>
10#include <map>
11#include <vector>
12
13namespace cbm::algo::much
14{
16
17 public:
20
22 virtual ~ReadoutConfig();
23
27 std::vector<uint16_t> GetEquipmentIds();
28
33 size_t GetNumElinks(uint16_t equipmentId);
34
40 std::vector<uint32_t> Map(uint16_t equipId, uint16_t elink);
41
47 std::vector<bool> MaskMap(uint16_t equipId, uint16_t elink);
48
49 private:
50 // --- MUCH readout map
51 // --- Map index: (equipment, elink, channel), map value: (MUCH address)
52 std::map<uint16_t, std::vector<std::vector<uint32_t>>> fReadoutMap = {};
53
54 // --- MUCH channel mask map
55 // --- Map index: (equipment, elink), map value: (vector of mask flags for channels per asic)
56 std::map<uint16_t, std::map<size_t, std::vector<bool>>> fMaskMap = {};
57
59 void Init();
60
62 uint32_t CreateMuchAddress(uint32_t dpbidx, int32_t iFebId, uint32_t usChan);
63
65 static const uint16_t numCrobPerComp = 1;
66 static const uint16_t numElinksPerCrob = 42;
67 static const uint16_t numFebsPerCrob = 9;
68 static const uint16_t numAsicsPerFeb = 1;
69 const uint16_t numChanPerAsic = 128;
70 static const uint16_t numComp = 7;
71
73 uint16_t numFebsInGemA = 27;
74 uint16_t numFebsInGemB = 27;
75 uint16_t numFebsInRpc = 9;
76 std::vector<int16_t> fnFebsIdsArrayGemA;
77 std::vector<int16_t> fnFebsIdsArrayGemB;
78 std::vector<int16_t> fnFebsIdsArrayRpc;
79 std::vector<int16_t>
81 std::vector<int16_t>
83 std::vector<int16_t>
85 std::vector<int16_t>
87 std::vector<int16_t> fChannelsToPadXRpc;
88 std::vector<int16_t> fChannelsToPadYRpc;
89
91
92 int32_t GetFebId(uint16_t);
93 int8_t GetPadXA(uint8_t febid, uint8_t channelid);
94 int8_t GetPadYA(uint8_t febid, uint8_t channelid);
95 int8_t GetPadXB(uint8_t febid, uint8_t channelid);
96 int8_t GetPadYB(uint8_t febid, uint8_t channelid);
97
98 //RPC Module Related Functions
99 int8_t GetPadXRpc(uint8_t febid, uint8_t channelid);
100 int8_t GetPadYRpc(uint8_t febid, uint8_t channelid);
101 };
102
103} // namespace cbm::algo::much
104
105#endif // ALGO_DETECTORS_MUCH_READOUTCONFIG_H
uint32_t CreateMuchAddress(uint32_t dpbidx, int32_t iFebId, uint32_t usChan)
Maps component index, Fed Id and channel number to Much Address.
int8_t GetPadXB(uint8_t febid, uint8_t channelid)
static const uint16_t numAsicsPerFeb
Number of ASICs connected in each FEB for MUCH.
std::vector< int16_t > fChannelsToPadXA
Array which stores the corresponding x position of PAD of entire module A.
std::vector< int16_t > fChannelsToPadXB
Array which stores the corresponding x position of PAD of entire module B.
uint16_t numFebsInGemB
Number of FEBs connected in GEM Module B.
static const uint16_t numCrobPerComp
Constants.
void InitChannelToPadMaps()
Init arrays which store positions of PADs.
int8_t GetPadYB(uint8_t febid, uint8_t channelid)
static const uint16_t numFebsPerCrob
Number of FEBs connected to each CROB for mMuch 2019.
std::map< uint16_t, std::vector< std::vector< uint32_t > > > fReadoutMap
void Init()
Initialisation of readout map.
std::vector< int16_t > fnFebsIdsArrayRpc
Array to hold FEB IDs connected to RPC Module.
std::vector< uint16_t > GetEquipmentIds()
Equipment in the configuration.
int8_t GetPadYA(uint8_t febid, uint8_t channelid)
std::vector< int16_t > fChannelsToPadYRpc
Array which stores the corresponding y position of PAD of RPC module.
int8_t GetPadYRpc(uint8_t febid, uint8_t channelid)
std::vector< int16_t > fnFebsIdsArrayGemA
Array to hold FEB IDs connected to GEM Module A.
std::vector< int16_t > fChannelsToPadYB
Array which stores the corresponding y position of PAD of entire module B.
size_t GetNumElinks(uint16_t equipmentId)
Number of elinks of a component.
int8_t GetPadXRpc(uint8_t febid, uint8_t channelid)
std::vector< int16_t > fChannelsToPadYA
Array which stores the corresponding y position of PAD of entire module A.
std::vector< int16_t > fChannelsToPadXRpc
Array which stores the corresponding x position of PAD of RPC module.
std::vector< bool > MaskMap(uint16_t equipId, uint16_t elink)
API: Mapping from component and elink to channel mask flags.
static const uint16_t numComp
Total number of MUCH DPBs in system.
static const uint16_t numElinksPerCrob
Number of elinks in each CROB ?
const uint16_t numChanPerAsic
Number of channels in each ASIC.
uint16_t numFebsInRpc
Number of FEBs connected in RPC Module.
std::vector< int16_t > fnFebsIdsArrayGemB
Array to hold FEB IDs connected to GEM Module B.
std::vector< uint32_t > Map(uint16_t equipId, uint16_t elink)
API: Mapping from component and elink to addresses per channel.
int8_t GetPadXA(uint8_t febid, uint8_t channelid)
std::map< uint16_t, std::map< size_t, std::vector< bool > > > fMaskMap