26 for (
auto v : {
"modules",
"si",
"sipm"}) {
36 findingRecord<HGCalElectronicsMappingRcd>();
53 desc.add<
edm::FileInPath>(
"si")->setComment(
"file containing the mapping of the readout cells in Si modules");
55 "file containing the mapping of the readout cells in SiPM-on-tile modules");
69 std::map<std::string, hgcal::mappingtools::HGCalEntityList>
parsedMaps_;
76 for (
auto v : {
"si",
"sipm"}) {
78 const auto& entities = pmap.getEntries();
79 for (
auto row : entities) {
80 std::string typecode = pmap.getAttr(
"Typecode", row);
81 int chip = pmap.getIntAttr(
"ROC", row);
82 int half = pmap.getIntAttr(
"HalfROC", row);
96 auto typecodeidx = defaultTypeCodeIdx;
98 auto nerx = defaultNerx;
100 auto nwords = defaultTypeNWords;
103 auto& entities = pmap.getEntries();
104 for (
auto row : entities) {
105 std::string typecode = pmap.getAttr(
"typecode", row);
107 if (typecode.find(
'M') == 0 && typecode.size() > 4)
108 typecode = typecode.substr(0, 4);
115 int plane = pmap.getIntAttr(
"plane", row);
116 int u = pmap.getIntAttr(
"u", row);
117 int v = pmap.getIntAttr(
"v", row);
118 edm::LogWarning(
"HGCalMappingESProducer") <<
"Exception caught decoding index for typecode=" << typecode
119 <<
" @ plane=" << plane <<
" u=" << u <<
" v=" <<
v <<
"\n" 121 <<
"===> will assign default (MH-F) which may be inefficient";
122 typecodeidx = defaultTypeCodeIdx;
123 nwords = defaultTypeNWords;
127 int fedid = pmap.getIntAttr(
"fedid", row);
128 int captureblockidx = pmap.getIntAttr(
"captureblockidx", row);
129 int econdidx = pmap.getIntAttr(
"econdidx", row);
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
T getParameter(std::string const &) const
std::map< std::string, hgcal::mappingtools::HGCalEntityList > parsedMaps_
utility class to assign dense readout module indexing the class holds the information on the expected...
void processNewCell(std::string typecode, uint16_t chip, uint16_t half)
static const IOVSyncValue & endOfTime()
std::pair< Time_t, Time_t > ValidityInterval
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
std::shared_ptr< HGCalMappingModuleIndexer > produceModuleMapIndexer(const HGCalElectronicsMappingRcd &)
size_t getEnumFromTypecode(std::string typecode) const
gets index given typecode string
HGCalMappingCellIndexer cellIndexer_
static const IOVSyncValue & beginOfTime()
void prepareCellMapperIndexer()
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 ...
void setIntervalFor(const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &oValidity) override
std::shared_ptr< HGCalMappingCellIndexer > produceCellMapIndexer(const HGCalElectronicsMappingRcd &)
#define DEFINE_FWK_EVENTSETUP_SOURCE(type)
void update()
process the current list of type codes handled and updates the dense indexers
utility class to assign dense readout cell indexing
plugin parses the module/cell locator files to produce the indexer records
void prepareModuleMapperIndexer()
HGCalMappingESProducer(const edm::ParameterSet &iConfig)
HGCalMappingModuleIndexer modIndexer_
size_t getNWordsExpectedFor(std::string typecode) const
gets the number of words for a given typecode
const std::string & fullPath() const
Log< level::Warning, false > LogWarning
size_t getNErxExpectedFor(std::string typecode) const
gets the number of e-Rx for a given typecode