Geometry
EcalMapping
plugins
EcalElectronicsMappingBuilder.cc
Go to the documentation of this file.
1
#include "
EcalElectronicsMappingBuilder.h
"
2
#include "
DataFormats/EcalDetId/interface/EEDetId.h
"
3
#include "
DataFormats/EcalDetId/interface/EcalElectronicsId.h
"
4
#include "
DataFormats/EcalDetId/interface/EcalTriggerElectronicsId.h
"
5
6
#include "
FWCore/Framework/interface/EventSetup.h
"
7
#include "
CondFormats/DataRecord/interface/EcalMappingElectronicsRcd.h
"
8
9
EcalElectronicsMappingBuilder::EcalElectronicsMappingBuilder
(
const
edm::ParameterSet
&)
10
: eeToken_{
11
setWhatProduced
(
this
).consumesFrom<
EcalMappingElectronics
,
EcalMappingElectronicsRcd
>(
edm::ESInputTag
{})} {}
12
13
// ------------ method called to produce the data ------------
14
EcalElectronicsMappingBuilder::ReturnType
EcalElectronicsMappingBuilder::produce
(
const
EcalMappingRcd
& iRecord) {
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
}
EcalElectronicsMapping
Definition:
EcalElectronicsMapping.h:28
EcalElectronicsId.h
mps_fire.i
i
Definition:
mps_fire.py:428
edm::ESInputTag
Definition:
ESInputTag.h:87
EEDetId::unhashIndex
static EEDetId unhashIndex(int hi)
Definition:
EEDetId.cc:65
EEDetId.h
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition:
ESProducer.h:163
EcalElectronicsMappingBuilder::EcalElectronicsMappingBuilder
EcalElectronicsMappingBuilder(const edm::ParameterSet &)
Definition:
EcalElectronicsMappingBuilder.cc:9
EcalMappingElectronics
EcalMappingElectronicsMap EcalMappingElectronics
Definition:
EcalMappingElectronics.h:22
dumpMFGeometry_cfg.prod
prod
Definition:
dumpMFGeometry_cfg.py:24
edm::eventsetup::DependentRecordImplementation::get
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
Definition:
DependentRecordImplementation.h:103
edm::ParameterSet
Definition:
ParameterSet.h:47
EcalElectronicsMappingBuilder.h
EcalTriggerElectronicsId.h
EcalMappingElectronicsRcd.h
EcalElectronicsMappingBuilder::FillFromDatabase
void FillFromDatabase(const std::vector< EcalMappingElement > &ee, EcalElectronicsMapping &theMap)
Definition:
EcalElectronicsMappingBuilder.cc:24
B2GTnPMonitor_cfi.item
item
Definition:
B2GTnPMonitor_cfi.py:147
EcalElectronicsMappingBuilder::ReturnType
std::unique_ptr< EcalElectronicsMapping > ReturnType
Definition:
EcalElectronicsMappingBuilder.h:23
EcalMappingRcd
Definition:
EcalMappingRcd.h:15
EcalElectronicsMappingBuilder::eeToken_
edm::ESGetToken< EcalMappingElectronics, EcalMappingElectronicsRcd > eeToken_
Definition:
EcalElectronicsMappingBuilder.h:30
EcalElectronicsMapping::assign
void assign(const DetId &cell, const EcalElectronicsId &, const EcalTriggerElectronicsId &tower)
set the association between a DetId and a tower
Definition:
EcalElectronicsMapping.cc:755
EventSetup.h
EcalElectronicsMappingBuilder::produce
ReturnType produce(const EcalMappingRcd &)
Definition:
EcalElectronicsMappingBuilder.cc:14
EcalMappingElectronicsRcd
Definition:
EcalMappingElectronicsRcd.h:5
Generated for CMSSW Reference Manual by
1.8.16