5#ifndef ALGO_DETECTORS_MUCH_READOUTCONFIG_H
6#define ALGO_DETECTORS_MUCH_READOUTCONFIG_H
28 "Equipment ID of component. Written to the data stream (MicrosliceDescriptor).", YAML::Hex),
29 yaml::Property(&
Component::active,
"active",
"Active/Inactive flag per component (Unused for now)"));
66 "FEBs mapping per detector", {}, YAML::Flow),
68 "Mapping of channel to PAD for GEM A", {}, YAML::Flow),
70 "Mapping of channel to PAD for GEM B", {}, YAML::Flow),
72 "Mapping of channel to PAD for RPC", {}, YAML::Flow));
108 std::vector<uint32_t>
Map(uint16_t equipId, uint16_t elink);
115 std::vector<bool>
MaskMap(uint16_t equipId, uint16_t elink);
128 std::map<uint16_t, std::vector<std::vector<uint32_t>>>
fReadoutMap = {};
132 std::map<uint16_t, std::map<size_t, std::vector<bool>>>
fMaskMap = {};
156 static constexpr int16_t
elink2Feb[
numElinksPerCrob] = {0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2,
157 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5,
158 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8};
181 int8_t
GetPadXA(uint8_t febid, uint8_t channelid);
182 int8_t
GetPadYA(uint8_t febid, uint8_t channelid);
183 int8_t
GetPadXB(uint8_t febid, uint8_t channelid);
184 int8_t
GetPadYB(uint8_t febid, uint8_t channelid);
187 int8_t
GetPadXRpc(uint8_t febid, uint8_t channelid);
188 int8_t
GetPadYRpc(uint8_t febid, uint8_t channelid);
std::vector< bool > MaskMap(uint16_t equipId, uint16_t elink)
API: Mapping from component and elink to channel mask flags.
void InitChannelToPadMaps()
Init arrays which store positions of PADs.
static const uint16_t numAsicsPerFeb
Number of ASICs connected in each FEB for MUCH.
int32_t GetFebId(uint16_t)
void InitHardcoded()
Initialisation of readout map from hardcoded valus, backup if YAML missing.
int8_t GetPadYA(uint8_t febid, uint8_t channelid)
std::vector< int16_t > fChannelsToPadXA
Array which stores the corresponding x position of PAD of entire module A.
ReadoutConfig()
Default Constructor if no valid YAMl file available.
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.
std::vector< uint16_t > GetEquipmentIds()
Equipment in the configuration.
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
virtual ~ReadoutConfig()
Destructor.
std::vector< uint32_t > Map(uint16_t equipId, uint16_t elink)
API: Mapping from component and elink to addresses per channel.
void Init()
Initialisation of readout map with hardcoded values.
int32_t GetSystemTimeOffset() const
System time offset for MUCH.
size_t GetNumElinks(uint16_t equipmentId)
Number of elinks of a component.
std::vector< int16_t > fnFebsIdsArrayRpc
Array to hold FEB IDs connected to RPC Module.
std::vector< int16_t > fChannelsToPadYRpc
Array which stores the corresponding y position of PAD of RPC module.
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.
int8_t GetPadXB(uint8_t febid, uint8_t channelid)
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.
static constexpr int16_t elink2Feb[numElinksPerCrob]
static const uint16_t numElinksPerCrob
Number of elinks in each CROB ?
int8_t GetPadYB(uint8_t febid, uint8_t channelid)
const uint16_t numChanPerAsic
Number of channels in each ASIC.
uint16_t numFebsInGemA
Variables.
std::map< uint16_t, std::vector< std::vector< uint32_t > > > GetFullMap()
API: Get fullMapping from component and elink to addresses per channel.
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 GetPadYRpc(uint8_t febid, uint8_t channelid)
int8_t GetPadXA(uint8_t febid, uint8_t channelid)
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::map< uint16_t, std::map< size_t, std::vector< bool > > > fMaskMap
CBM_YAML_PROPERTIES(yaml::Property(&Component::equipmentId, "equipmentId", "Equipment ID of component. Written to the data stream (MicrosliceDescriptor).", YAML::Hex), yaml::Property(&Component::active, "active", "Active/Inactive flag per component (Unused for now)"))
std::vector< int16_t > febsGemA
std::vector< int16_t > febsRpc
CBM_YAML_PROPERTIES(yaml::Property(&FebsIds::febsGemA, "febsGemA", "Mapping of FEBs IDs for GEM A"), yaml::Property(&FebsIds::febsGemB, "febsGemB", "Mapping of FEBs IDs for GEM B"), yaml::Property(&FebsIds::febsRpc, "febsRpc", "Mapping of FEBs IDs forRPC"))
std::vector< int16_t > febsGemB
CBM_YAML_PROPERTIES(yaml::Property(&PadsConfig::channelToPadX, "channelToPadX", "X means CHANNEL for CbmMuchAddressA"), yaml::Property(&PadsConfig::channelToPadY, "channelToPadY", "Y means SECTOR for CbmMuchAddress"))
std::vector< int16_t > channelToPadY
std::vector< int16_t > channelToPadX
Readout setup / Hardware cabling for MUCH Used to create the hardware mapping for the MUCH unpacker.
std::vector< Component > components
PadsConfig padsConfigGemA
CBM_YAML_PROPERTIES(yaml::Property(&ReadoutSetup::timeOffset, "timeOffset", "Time offset in ns of the MVD data relative to the reference/trigger"), yaml::Property(&ReadoutSetup::numAsicsPerFeb, "numAsicsPerFeb", "Number of ASICs per FEB"), yaml::Property(&ReadoutSetup::components, "components", "Components", {}, YAML::Flow), yaml::Property(&ReadoutSetup::febsMapping, "febsMapping", "FEBs mapping per detector", {}, YAML::Flow), yaml::Property(&ReadoutSetup::padsConfigGemA, "padsConfigGemA", "Mapping of channel to PAD for GEM A", {}, YAML::Flow), yaml::Property(&ReadoutSetup::padsConfigGemB, "padsConfigGemB", "Mapping of channel to PAD for GEM B", {}, YAML::Flow), yaml::Property(&ReadoutSetup::padsConfigRpc, "padsConfigRpc", "Mapping of channel to PAD for RPC", {}, YAML::Flow))
PadsConfig padsConfigGemB