1 #ifndef CondFormats_HGCalObjects_interface_HGCalMappingParameterIndex_h 2 #define CondFormats_HGCalObjects_interface_HGCalMappingParameterIndex_h 47 uint16_t captureblockIdx,
108 fedit.moduleLUT_.resize(fedit.readoutTypes_.size(), -1);
109 for (
size_t i = 0;
i < fedit.readoutTypes_.size();
i++) {
110 if (fedit.readoutTypes_[
i] == -1)
112 fedit.moduleLUT_[
i] = nconn;
118 fedit.readoutTypes_.begin(), fedit.readoutTypes_.end(), [&](
int val) ->
bool {
return val == -1; });
121 size_t nmods = fedit.readoutTypes_.size();
122 fedit.modOffsets_.resize(nmods, 0);
123 fedit.erxOffsets_.resize(nmods, 0);
124 fedit.chDataOffsets_.resize(nmods, 0);
125 for (
size_t i = 0;
i < nmods;
i++) {
126 uint32_t type_val = fedit.readoutTypes_[
i];
129 uint32_t baseMod_offset =
moduleOffsets_[type_val] + typeCounters[type_val];
130 fedit.modOffsets_[
i] = baseMod_offset;
134 uint32_t internalErx_offset =
globalTypesNErx_[type_val] * typeCounters[type_val];
135 fedit.erxOffsets_[
i] = baseErx_offset + internalErx_offset;
140 fedit.chDataOffsets_[
i] = baseData_offset + internalData_offset;
142 typeCounters[type_val]++;
152 if (typecode.size() < 5)
153 throw cms::Exception(
"InvalidHGCALTypeCode") << typecode <<
" is invalid for decoding readout cell type";
155 bool isSiPM = {typecode.find(
"TM") != std::string::npos ?
true :
false};
160 celltype = {typecode[4] ==
'1' ? 0 : typecode[4] ==
'2' ? 1 : 2};
162 return std::pair<bool, bool>(
isSiPM, celltype);
188 uint32_t
fedid, uint16_t captureblockIdx, uint16_t econdIdx, uint32_t erxidx, uint32_t chidx)
const {
221 throw cms::Exception(
"ValueError") <<
"FED ID=" <<
fedid <<
" is unknown to current mapping";
225 throw cms::Exception(
"ValueError") <<
"FED ID=" <<
fedid <<
" capture block=" << captureblockIdx
226 <<
" econ=" << econdIdx <<
"has not been assigned a dense indexing" 228 return uint32_t(dense_idx);
static constexpr uint16_t maxChPerErx_
std::vector< uint32_t > moduleOffsets_
std::vector< uint32_t > erxOffsets_
~HGCalMappingModuleIndexer()=default
std::vector< int > moduleLUT_
>look-up table (capture block, econd idx) -> internal dense index
std::vector< uint32_t > erxOffsets_
utility class to assign dense readout module indexing the class holds the information on the expected...
int getTypeForModule(uint32_t fedid, uint16_t captureblockIdx, uint16_t econdIdx) const
internal indexer
uint32_t getIndexForModule(uint32_t fedid, uint16_t captureblockIdx, uint16_t econdIdx) const
static constexpr uint32_t maxCBperFED_
max number of ECON-Ds processed by a main buffer/capture block
uint32_t getIndexForModuleData(uint32_t fedid, uint32_t nmod, uint32_t erxidx, uint32_t chidx) const
std::vector< uint32_t > modOffsets_
>dense sequence of offsets for modules, e-Rx and channel data
static std::pair< bool, int > convertTypeCode(std::string_view typecode)
decodes silicon or sipm type and cell type for the detector id from the typecode string ...
std::vector< int > readoutTypes_
>dense sequence of modules in the readout: the type is the one in use in the cell mapping ...
uint32_t maxModulesIdx_
max number of main buffers/capture blocks per FED
std::vector< HGCalFEDReadoutSequence_t > fedReadoutSequences_
global counters for types of modules, number of e-Rx and words
static constexpr uint32_t maxECONDperCB_
std::vector< uint32_t > chDataOffsets_
bool isSiPM(int ieta, int iphi, int depth)
std::vector< uint32_t > dataOffsets_
global counters (sizes of vectors)
this structure holds the indices and types in the readout sequence as the 12 capture blocks may not a...
void processNewModule(uint32_t fedid, uint16_t captureblockIdx, uint16_t econdIdx, uint32_t typecodeIdx, uint32_t nerx, uint32_t nwords)
for a new module it adds it's type to the readaout sequence vector if the fed id is not yet existing ...
std::vector< uint32_t > globalTypesNWords_
base offsets to apply per module type with different granularity : module, e-Rx, channel data ...
uint32_t getIndexForModuleErx(uint32_t fedid, uint16_t captureblockIdx, uint16_t econdIdx, uint32_t erxidx) const
std::vector< uint32_t > globalTypesNErx_
HGCalDenseIndexerBase modFedIndexer_
the sequence of FED readout sequence descriptors
uint32_t getIndexForModule(uint32_t fedid, uint32_t nmod) const
returns the index for the n-th module in the readout sequence of a FED if the index in the readout se...
this is a simple class that takes care of building a dense index for a set of categories the maximum ...
uint32_t getIndexForModuleData(uint32_t fedid, uint16_t captureblockIdx, uint16_t econdIdx, uint32_t erxidx, uint32_t chidx) const
int getTypeForModule(uint32_t fedid, uint32_t nmod) const
uint32_t getIndexForModuleErx(uint32_t fedid, uint32_t nmod, uint32_t erxidx) const
uint32_t denseIndex(std::vector< uint32_t > v) const
HGCalMappingModuleIndexer()
#define COND_SERIALIZABLE
uint32_t denseIndexingFor(uint32_t fedid, uint16_t captureblockIdx, uint16_t econdIdx) const
given capture block and econd indices returns the dense indexer
std::vector< uint32_t > globalTypesCounter_