CalibTracker
SiPixelESProducers
plugins
SiPixelROCsStatusAndMappingWrapperESProducer.cc
Go to the documentation of this file.
1
#include <memory>
2
3
#include "
CalibTracker/SiPixelESProducers/interface/SiPixelROCsStatusAndMappingWrapper.h
"
4
#include "
CondFormats/DataRecord/interface/SiPixelFedCablingMapRcd.h
"
5
#include "
CondFormats/DataRecord/interface/SiPixelQualityRcd.h
"
6
#include "
FWCore/Framework/interface/ESProducer.h
"
7
#include "
FWCore/Framework/interface/ESTransientHandle.h
"
8
#include "
FWCore/Framework/interface/EventSetup.h
"
9
#include "
FWCore/Framework/interface/ModuleFactory.h
"
10
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
11
#include "
Geometry/Records/interface/TrackerDigiGeometryRecord.h
"
12
#include "
Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h
"
13
#include "
RecoTracker/Record/interface/CkfComponentsRecord.h
"
// TODO: eventually use something more limited
14
15
class
SiPixelROCsStatusAndMappingWrapperESProducer
:
public
edm::ESProducer
{
16
public
:
17
explicit
SiPixelROCsStatusAndMappingWrapperESProducer
(
const
edm::ParameterSet
& iConfig);
18
std::unique_ptr<SiPixelROCsStatusAndMappingWrapper>
produce
(
const
CkfComponentsRecord
& iRecord);
19
20
static
void
fillDescriptions
(
edm::ConfigurationDescriptions
& descriptions);
21
22
private
:
23
edm::ESGetToken<SiPixelFedCablingMap, SiPixelFedCablingMapRcd>
cablingMapToken_
;
24
edm::ESGetToken<SiPixelQuality, SiPixelQualityRcd>
qualityToken_
;
25
edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord>
geometryToken_
;
26
bool
useQuality_
;
27
};
28
29
SiPixelROCsStatusAndMappingWrapperESProducer::SiPixelROCsStatusAndMappingWrapperESProducer
(
30
const
edm::ParameterSet
& iConfig)
31
: useQuality_(iConfig.getParameter<
bool
>(
"UseQualityInfo"
)) {
32
auto
const
& component = iConfig.
getParameter
<
std::string
>(
"ComponentName"
);
33
auto
cc
=
setWhatProduced
(
this
, component);
34
cablingMapToken_
=
cc
.consumes(
edm::ESInputTag
{
""
, iConfig.
getParameter
<
std::string
>(
"CablingMapLabel"
)});
35
if
(
useQuality_
) {
36
qualityToken_
=
cc
.consumes();
37
}
38
geometryToken_
=
cc
.consumes();
39
}
40
41
void
SiPixelROCsStatusAndMappingWrapperESProducer::fillDescriptions
(
edm::ConfigurationDescriptions
& descriptions) {
42
edm::ParameterSetDescription
desc
;
43
desc
.add<
std::string
>(
"ComponentName"
,
""
);
44
desc
.add<
std::string
>(
"CablingMapLabel"
,
""
)->setComment(
"CablingMap label"
);
45
desc
.add<
bool
>(
"UseQualityInfo"
,
false
);
46
descriptions.
addWithDefaultLabel
(
desc
);
47
}
48
49
std::unique_ptr<SiPixelROCsStatusAndMappingWrapper>
SiPixelROCsStatusAndMappingWrapperESProducer::produce
(
50
const
CkfComponentsRecord
& iRecord) {
51
auto
cablingMap = iRecord.
getTransientHandle
(
cablingMapToken_
);
52
53
const
SiPixelQuality
*
quality
=
nullptr
;
54
if
(
useQuality_
) {
55
auto
qualityInfo = iRecord.
getTransientHandle
(
qualityToken_
);
56
quality
= qualityInfo.product();
57
}
58
59
auto
geom
= iRecord.
getTransientHandle
(
geometryToken_
);
60
61
return
std::make_unique<SiPixelROCsStatusAndMappingWrapper>(*cablingMap, *
geom
,
quality
);
62
}
63
64
#include "
FWCore/Framework/interface/MakerMacros.h
"
65
#include "
FWCore/Utilities/interface/typelookup.h
"
66
#include "
FWCore/Framework/interface/eventsetuprecord_registration_macro.h
"
67
68
DEFINE_FWK_EVENTSETUP_MODULE
(
SiPixelROCsStatusAndMappingWrapperESProducer
);
SiPixelROCsStatusAndMappingWrapperESProducer::useQuality_
bool useQuality_
Definition:
SiPixelROCsStatusAndMappingWrapperESProducer.cc:26
electrons_cff.bool
bool
Definition:
electrons_cff.py:366
edm::ESInputTag
Definition:
ESInputTag.h:87
ESTransientHandle.h
TrackerGeometry.h
eventsetuprecord_registration_macro.h
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition:
ESProducer.h:163
edm::ParameterSetDescription
Definition:
ParameterSetDescription.h:52
ESProducer.h
typelookup.h
SiPixelROCsStatusAndMappingWrapperESProducer::qualityToken_
edm::ESGetToken< SiPixelQuality, SiPixelQualityRcd > qualityToken_
Definition:
SiPixelROCsStatusAndMappingWrapperESProducer.cc:24
CkfComponentsRecord.h
SiPixelROCsStatusAndMappingWrapperESProducer::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition:
SiPixelROCsStatusAndMappingWrapperESProducer.cc:41
quality
const uint32_t *__restrict__ Quality * quality
Definition:
CAHitNtupletGeneratorKernelsImpl.h:109
MakerMacros.h
CkfComponentsRecord
Definition:
CkfComponentsRecord.h:22
SiPixelQualityRcd.h
edm::eventsetup::DependentRecordImplementation::getTransientHandle
ESTransientHandle< ProductT > getTransientHandle(ESGetToken< ProductT, DepRecordT > const &iToken) const
Definition:
DependentRecordImplementation.h:98
SiPixelROCsStatusAndMappingWrapper.h
relativeConstraints.geom
geom
Definition:
relativeConstraints.py:72
edm::ConfigurationDescriptions
Definition:
ConfigurationDescriptions.h:28
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
TrackerDigiGeometryRecord.h
edm::ParameterSet
Definition:
ParameterSet.h:47
SiPixelQuality
Definition:
SiPixelQuality.h:27
SiPixelROCsStatusAndMappingWrapperESProducer::produce
std::unique_ptr< SiPixelROCsStatusAndMappingWrapper > produce(const CkfComponentsRecord &iRecord)
Definition:
SiPixelROCsStatusAndMappingWrapperESProducer.cc:49
SiPixelFedCablingMapRcd.h
cc
edm::ESGetToken< SiPixelFedCablingMap, SiPixelFedCablingMapRcd >
ModuleFactory.h
submitPVResolutionJobs.desc
string desc
Definition:
submitPVResolutionJobs.py:251
SiPixelROCsStatusAndMappingWrapperESProducer::SiPixelROCsStatusAndMappingWrapperESProducer
SiPixelROCsStatusAndMappingWrapperESProducer(const edm::ParameterSet &iConfig)
Definition:
SiPixelROCsStatusAndMappingWrapperESProducer.cc:29
DEFINE_FWK_EVENTSETUP_MODULE
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition:
ModuleFactory.h:60
EventSetup.h
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition:
ParameterSet.h:303
SiPixelROCsStatusAndMappingWrapperESProducer::geometryToken_
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > geometryToken_
Definition:
SiPixelROCsStatusAndMappingWrapperESProducer.cc:25
edm::ESProducer
Definition:
ESProducer.h:104
ParameterSet.h
SiPixelROCsStatusAndMappingWrapperESProducer
Definition:
SiPixelROCsStatusAndMappingWrapperESProducer.cc:15
SiPixelROCsStatusAndMappingWrapperESProducer::cablingMapToken_
edm::ESGetToken< SiPixelFedCablingMap, SiPixelFedCablingMapRcd > cablingMapToken_
Definition:
SiPixelROCsStatusAndMappingWrapperESProducer.cc:23
edm::ConfigurationDescriptions::addWithDefaultLabel
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
Definition:
ConfigurationDescriptions.cc:87
Generated for CMSSW Reference Manual by
1.8.16