CMS 3D CMS Logo

SiPixelROCsStatusAndMappingWrapperESProducer.cc
Go to the documentation of this file.
1 #include <memory>
2 
13 #include "RecoTracker/Record/interface/CkfComponentsRecord.h" // TODO: eventually use something more limited
14 
16 public:
18  std::unique_ptr<SiPixelROCsStatusAndMappingWrapper> produce(const CkfComponentsRecord& iRecord);
19 
20  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
21 
22 private:
27 };
28 
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 
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 
67 
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