CMS 3D CMS Logo

EcalElectronicsMappingBuilder.cc
Go to the documentation of this file.
5 
8 
10  : eeToken_{
12 
13 // ------------ method called to produce the data ------------
15  auto prod = std::make_unique<EcalElectronicsMapping>();
16 
17  const auto& item = iRecord.get(eeToken_);
18 
19  const std::vector<EcalMappingElement>& ee = item.endcapItems();
20  FillFromDatabase(ee, *prod);
21  return prod;
22 }
23 
24 void EcalElectronicsMappingBuilder::FillFromDatabase(const std::vector<EcalMappingElement>& ee,
25  EcalElectronicsMapping& theMap) {
26  for (unsigned int i = 0; i < ee.size(); i++) {
27  if (ee[i].electronicsid == 0)
28  continue;
29  if (ee[i].triggerid == 0)
30  continue;
31  theMap.assign(EEDetId::unhashIndex(i).rawId(), ee[i].electronicsid, ee[i].triggerid);
32  }
33  return;
34 }
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:166
ReturnType produce(const EcalMappingRcd &)
EcalElectronicsMappingBuilder(const edm::ParameterSet &)
static EEDetId unhashIndex(int hi)
Definition: EEDetId.cc:65
void assign(const DetId &cell, const EcalElectronicsId &, const EcalTriggerElectronicsId &tower)
set the association between a DetId and a tower
EcalMappingElectronicsMap EcalMappingElectronics
void FillFromDatabase(const std::vector< EcalMappingElement > &ee, EcalElectronicsMapping &theMap)
std::unique_ptr< EcalElectronicsMapping > ReturnType
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
edm::ESGetToken< EcalMappingElectronics, EcalMappingElectronicsRcd > eeToken_