CMS 3D CMS Logo

PixelFEDChannelCollectionProducer.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: CalibTracker/PixelFEDChannelCollectionProducer
4 // Class: PixelFEDChannelCollectionProducer
5 //
13 //
14 // Original Author: Marco Musich
15 // Created: Thu, 13 Dec 2018 08:48:22 GMT
16 //
17 //
18 
19 // system include files
20 #include <memory>
21 
22 // user include files
26 
30 
31 // Need to add #include statements for definitions of
32 // the data type and record type here
33 
34 //
35 // class declaration
36 //
37 
39 public:
42 
43  typedef std::unordered_map<std::string, PixelFEDChannelCollection> PixelFEDChannelCollectionMap;
44  using ReturnType = std::unique_ptr<PixelFEDChannelCollectionMap>;
45 
47 
48 private:
49  // ----------member data ---------------------------
51 };
52 
54  : qualityToken_(setWhatProduced(this).consumes()) {}
55 
57  // do anything here that needs to be done at destruction time
58  // (e.g. close files, deallocate resources etc.)
59 }
60 
61 //
62 // member functions
63 //
64 
65 // ------------ method called to produce the data ------------
68  const auto& qualityCollection = iRecord.get(qualityToken_);
69 
70  auto out = std::make_unique<PixelFEDChannelCollectionMap>();
71 
72  for (const auto& it : qualityCollection.getScenarioMap()) {
73  const std::string& scenario = it.first;
74  // getScenarioMap() is an unordered_map<string, ...>, so each scenario appears exactly once
75  PixelFEDChannelCollection& disabled_channelcollection = (*out)[scenario];
76 
77  const auto& SiPixelBadFedChannels = it.second;
78  for (const auto& entry : SiPixelBadFedChannels) {
79  disabled_channelcollection.insert(entry.first, entry.second.data(), entry.second.size());
80  }
81  }
82 
83  return out;
84 }
85 
86 //define this as a plug-in
PixelFEDChannelCollectionProducer::qualityToken_
const edm::ESGetToken< SiPixelFEDChannelContainer, SiPixelStatusScenariosRcd > qualityToken_
Definition: PixelFEDChannelCollectionProducer.cc:50
mps_splice.entry
entry
Definition: mps_splice.py:68
edmNew::DetSetVector::insert
DetSet insert(id_type iid, data_type const *idata, size_type isize)
Definition: DetSetVectorNew.h:451
PixelFEDChannelCollectionProducer::PixelFEDChannelCollectionMap
std::unordered_map< std::string, PixelFEDChannelCollection > PixelFEDChannelCollectionMap
Definition: PixelFEDChannelCollectionProducer.cc:43
SiPixelFEDChannelContainerESProducerRcd
Definition: SiPixelFEDChannelContainerESProducerRcd.h:9
SiPixelFEDChannelContainer.h
ESProducer.h
PixelFEDChannelCollectionProducer::~PixelFEDChannelCollectionProducer
~PixelFEDChannelCollectionProducer() override
Definition: PixelFEDChannelCollectionProducer.cc:56
PixelFEDChannelCollectionProducer::produce
ReturnType produce(const SiPixelFEDChannelContainerESProducerRcd &)
Definition: PixelFEDChannelCollectionProducer.cc:66
cmsdt::scenario
scenario
Definition: constants.h:167
edm::eventsetup::DependentRecordImplementation::get
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
Definition: DependentRecordImplementation.h:109
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
PixelFEDChannelCollectionProducer::ReturnType
std::unique_ptr< PixelFEDChannelCollectionMap > ReturnType
Definition: PixelFEDChannelCollectionProducer.cc:44
edm::ParameterSet
Definition: ParameterSet.h:47
edm::ESGetToken< SiPixelFEDChannelContainer, SiPixelStatusScenariosRcd >
PixelFEDChannelCollectionProducer::PixelFEDChannelCollectionProducer
PixelFEDChannelCollectionProducer(const edm::ParameterSet &)
Definition: PixelFEDChannelCollectionProducer.cc:53
edmNew::DetSetVector
Definition: DetSetNew.h:13
ModuleFactory.h
DEFINE_FWK_EVENTSETUP_MODULE
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
SiPixelStatusScenariosRcd.h
PixelFEDChannelCollectionProducer
Definition: PixelFEDChannelCollectionProducer.cc:38
EventSetup.h
edm::ESProducer
Definition: ESProducer.h:104
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
SiPixelFEDChannelContainerESProducerRcd.h