CMS 3D CMS Logo

EcalElectronicsMappingBuilder.cc
Go to the documentation of this file.
5 
9 
11 {
12  //the following line is needed to tell the framework what
13  // data is being produced
14  setWhatProduced(this);
15 }
16 
17 // ------------ method called to produce the data ------------
20 {
21  auto prod = std::make_unique<EcalElectronicsMapping>();
22 
25  fRecord.get(item);
26 
27  const std::vector<EcalMappingElement>& ee = item->endcapItems();
29  return prod;
30 }
31 
32 void EcalElectronicsMappingBuilder::FillFromDatabase(const std::vector<EcalMappingElement>& ee,
33  EcalElectronicsMapping& theMap)
34 {
35  for (unsigned int i=0; i < ee.size(); i++)
36  {
37  if (ee[i].electronicsid == 0)
38  continue;
39  if (ee[i].triggerid == 0)
40  continue;
41  theMap.assign(EEDetId::unhashIndex(i).rawId(),ee[i].electronicsid,ee[i].triggerid);
42  }
43  return;
44 }
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:116
ReturnType produce(const EcalMappingRcd &)
EcalElectronicsMappingBuilder(const edm::ParameterSet &)
static EEDetId unhashIndex(int hi)
Definition: EEDetId.cc:99
void assign(const DetId &cell, const EcalElectronicsId &, const EcalTriggerElectronicsId &tower)
set the association between a DetId and a tower
void FillFromDatabase(const std::vector< EcalMappingElement > &ee, EcalElectronicsMapping &theMap)
std::unique_ptr< EcalElectronicsMapping > ReturnType